/* ismywifiworking.com — "The Flood": the whole page is the answer. One look; dark mode only dims the flood.
   Colors also live in site.js (theme-color), site.webmanifest, Copy.swift, and PreviewImage.swift. */

@font-face {
  font-family: "Anton";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/anton-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/dm-mono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/dm-mono-500-latin.woff2") format("woff2");
}

html {
  --yep: #63F67B;
  --yep-ink: #08210F;
  --nope: #FF4B4B;
  --nope-ink: #2B0606;
  --flood: var(--yep);
  --ink: var(--yep-ink);
  background: var(--flood);
  color: var(--ink);
  transition: background-color 300ms ease, color 300ms ease;
}
/* Dark: same hues with a 20% black shade baked in; the ink stays put. Follows the OS under Auto
   (no data-theme); an explicit choice from theme.js / the toggle overrides it. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --yep: #4FC562;
    --nope: #CC3C3C;
  }
}
html[data-theme="dark"] {
  --yep: #4FC562;
  --nope: #CC3C3C;
}
/* Black: the flood inverts. Pure black ground, the status color moves to the ink. */
html[data-theme="black"] {
  --flood: #000000;
  --ink: var(--yep);
}
html[data-theme="black"]:has(.status.is-offline) {
  --flood: #000000;
  --ink: var(--nope);
}
html:has(.status.is-offline) {
  --flood: var(--nope);
  --ink: var(--nope-ink);
}

body {
  margin: 0;
  font: 500 0.8rem/1.45 "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.5rem;
  padding: clamp(1rem, 3vw, 2.25rem);
}

.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 2rem;
}
.brand { margin: 0; }
.byline { display: block; margin-top: 0.15rem; opacity: 0.72; }
.byline a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
.byline a:hover { text-decoration-thickness: 2px; }
.byline a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.theme {
  display: flex;
  gap: 0.9rem;
  margin-top: 0.5rem;
  opacity: 0.72;
}
.theme[hidden] { display: none; }
.theme button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-underline-offset: 0.3em;
}
.theme button:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.theme button[aria-pressed="true"] { text-decoration: underline; text-decoration-thickness: 2px; }
.theme button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  text-align: right;
}

.status {
  align-self: center;
  margin: 0;
  font: 400 min(30vw, 58vh)/0.82 "Anton", Impact, "Arial Narrow", sans-serif;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.counter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
  transition: opacity 300ms ease;
}
.counter.is-dimmed { opacity: 0.5; }

.counter-number {
  font: 400 2.25rem/1 "Anton", Impact, sans-serif;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.windows {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.windows[hidden] { display: none; }
.windows button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid currentColor;
  border-radius: 0.25rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.windows button:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.windows button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--flood);
}
.windows button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.here-now { margin-left: auto; }

@media (max-width: 600px) {
  .meta { align-items: flex-start; text-align: left; }
  .here-now { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html, .counter { transition: none; }
}
