/* Layout: one masthead, then a two-column instruction sheet. Left column is the fix, right column is a drawn
   picture of the app's switch (the one thing people have to touch). First-time setup runs underneath as a row. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-next-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("/fonts/atkinson-mono-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand: the logo's asterisk mark is #249CD8 and its wordmark is #485662. */
  --paper: #f2f6f9;
  --panel: #ffffff;
  --ink: #1f2c36;
  --ink-soft: #485662;
  --rule: #d5dee5;
  --mark: #249cd8;
  --link: #14699c;
  --track-off: #b9c4cd;
  --stop: #b42318;
  --font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1820;
    --panel: #15222c;
    --ink: #e3ebf1;
    --ink-soft: #a3b3c0;
    --rule: #283743;
    --mark: #3aaee6;
    --link: #74c6f0;
    --track-off: #3d4c58;
    --stop: #f97066;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.6;
}
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) max(20px, env(safe-area-inset-right)) 56px max(20px, env(safe-area-inset-left));
}
.logo { display: inline-block; line-height: 0; }
/* The logo PNG has an opaque white background. Light: multiply drops the white.
   Dark: flip its lightness while keeping its hues, then screen drops the (now black) background. */
.logo img { height: 24px; width: auto; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) {
  .logo img { filter: invert(1) hue-rotate(180deg) saturate(1.3); mix-blend-mode: screen; }
}

.sheet {
  margin-top: clamp(28px, 6vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.fix { min-width: 0; max-width: 34rem; }

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 1.35rem + 2.1vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.lede { margin: 14px 0 0; color: var(--ink-soft); font-size: 1.0625em; max-width: 32rem; }
h2 { margin: 0 0 12px; font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.01em; }
.fix h2 { margin-top: 36px; }

/* Numbered markers only on true sequences. */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 12px; align-items: baseline; }
.steps > li::before {
  content: counter(step);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mark);
  font-size: 1.375rem;
  line-height: 1;
  justify-self: end;
}
.steps p { margin: 0; }
.steps .sub { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.steps .sub a { font-weight: 700; }

.action { margin: 22px 0 0 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--link); color: var(--panel);
  font-weight: 700; text-decoration: none;
  padding: 12px 20px; border-radius: 10px;
  transition: transform 120ms var(--ease), filter 120ms;
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }
.hint { color: var(--ink-soft); font-size: 0.9375em; }

.team {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.0625em;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* The picture: the Cloudflare One switch, plus where its icon lives on each system. */
.picture { margin: 0; min-width: 0; }
.app {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 22px 24px 26px;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(20, 60, 90, 0.45);
}
.app-head { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-weight: 700; font-size: 0.9375em; }
.app-head svg { width: 26px; height: 18px; color: var(--ink-soft); }
.switch-row { margin-top: 26px; display: flex; align-items: center; gap: 22px; }
.switch {
  position: relative; flex: none;
  width: 116px; height: 64px; border-radius: 999px;
  background: var(--track-off);
  animation: track-on 420ms var(--ease) 1100ms forwards;
}
.switch::after {
  content: ""; position: absolute; top: 6px; left: 6px;
  width: 52px; height: 52px; border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 30, 45, 0.28);
  animation: knob-on 420ms var(--ease) 1100ms forwards;
}
.state { position: relative; display: grid; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.state span { grid-area: 1 / 1; }
.state .off { color: var(--ink-soft); animation: fade-out 200ms linear 1150ms forwards; }
.state .on { color: var(--mark); opacity: 0; animation: fade-in 260ms linear 1350ms forwards; }
@keyframes track-on { to { background: var(--mark); } }
@keyframes knob-on { to { transform: translateX(52px); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { to { opacity: 1; } }

.where { margin-top: 18px; display: grid; gap: 10px; }
.bar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 55%, var(--paper));
  border: 1px solid var(--rule);
  font-size: 0.875em; color: var(--ink-soft);
}
.bar .os, .bar .tray { white-space: nowrap; flex: none; }
.bar > span:nth-child(2) { min-width: 0; }
.bar .os { font-weight: 700; color: var(--ink); min-width: 4.25rem; }
.bar .tray { margin-left: auto; display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.bar svg { width: 20px; height: 14px; }
.bar .ring { display: inline-flex; padding: 4px 5px; border-radius: 7px; box-shadow: 0 0 0 2px var(--mark); color: var(--ink); }
.picture figcaption { margin-top: 12px; color: var(--ink-soft); font-size: 0.875em; }

/* First-time setup runs as a row of four. */
.first {
  margin-top: clamp(40px, 7vw, 72px);
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.first .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.first .steps > li { grid-template-columns: 1fr; gap: 6px; align-items: start; align-content: start; }
.first .steps > li::before { justify-self: start; }

.footer {
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule);
  color: var(--ink-soft); font-size: 0.9375em; display: grid; gap: 6px;
}
.footer p { margin: 0; }
.url { font-family: var(--mono); font-size: 0.875em; overflow-wrap: anywhere; color: var(--ink-soft); }

/* No-access page: a two-line status readout instead of the switch. */
.status { list-style: none; margin: 0; padding: 22px 24px; display: grid; gap: 14px; }
.status li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.status svg { width: 24px; height: 24px; margin-top: 1px; }
.status .yes { color: var(--mark); }
.status .no { color: var(--stop); }
.status b { display: block; color: var(--ink); }
.status span { color: var(--ink-soft); font-size: 0.9375em; }
.options { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.options b { display: block; }
.options p { margin: 2px 0 0; }
.denied .action { margin-left: 0; }

@media (max-width: 860px) {
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .fix { max-width: none; }
  .picture { max-width: 30rem; }
  .first .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .first .steps { grid-template-columns: minmax(0, 1fr); }
  .action { margin-left: 0; }
  .bar .clock { display: none; }
  .switch { width: 96px; height: 54px; }
  .switch::after { width: 42px; height: 42px; }
  @keyframes knob-on { to { transform: translateX(42px); } }
}
@media (max-width: 400px) {
  .app { padding: 18px 16px 20px; }
  .bar { gap: 8px; padding: 8px 10px; }
  .bar .os { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .switch, .switch::after, .state .off, .state .on { animation-duration: 1ms; animation-delay: 0ms; }
  .button { transition: none; }
}
