/* Freeflo site. One idea: the page is a day. Dawn at the top, night at the
   bottom, where the security story lives. No scripts, no third-party assets. */

@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f6fb;
  --ink: #1b1b1f;
  --muted: #55576a;
  --line: #dcdcea;
  --indigo: #5b5bd6;
  --indigo-ink: #4343b4;
  --on-indigo: #ffffff;
  --dawn: #fff0e2;
  --dawn-2: #ffe2cf;
  --dusk: #ece8fb;
  --shot-shadow: 0 22px 44px -22px rgba(36, 34, 92, 0.38), 0 2px 6px rgba(36, 34, 92, 0.06);

  /* night is the same in both themes */
  --night: #17173a;
  --night-2: #0f0f27;
  --night-ink: #ececf6;
  --night-muted: #b3b3d4;
  --night-line: #2d2d5a;
  --moonlight: #a9a9ff;

  --measure: 64ch;
  --rail: 10.5rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121228;
    --ink: #ececf3;
    --muted: #a9aac2;
    --line: #2a2a4a;
    --indigo: #8f8ff2;
    --indigo-ink: #b4b4ff;
    --on-indigo: #121228;
    --dawn: #2a1f33;
    --dawn-2: #352339;
    --dusk: #19183a;
    --shot-shadow: 0 22px 44px -20px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
    --night: #0d0d22;
    --night-2: #08081a;
    --night-line: #26264a;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
}

::selection { background: #ffc98a; color: #1b1b1f; }

a { color: var(--indigo-ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #ffa257; outline-offset: 3px; border-radius: 4px; }

img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0 0 1em; text-wrap: pretty; }

code, kbd {
  font: 500 0.88em/1 ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  background: color-mix(in srgb, var(--indigo) 10%, transparent);
  border-radius: 6px;
  padding: 0.15em 0.4em;
}
kbd { border: 1px solid color-mix(in srgb, var(--indigo) 30%, transparent); border-bottom-width: 2px; }

.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--indigo); color: var(--on-indigo); padding: 0.6rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--dawn) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.bar nav { display: flex; gap: 0.25rem 1.4rem; flex-wrap: wrap; font-size: 0.95rem; }
.bar nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.bar nav a:hover { color: var(--indigo-ink); }

/* ---------- buttons ---------- */
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 2rem 0 1rem; }
.btn {
  display: inline-flex; align-items: center; min-height: 3.25rem;
  padding: 0 1.5rem; border-radius: 14px;
  font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; text-decoration: none;
  background: var(--indigo); color: var(--on-indigo);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--indigo) 80%, transparent);
  transition: transform 160ms cubic-bezier(.16, 1, .3, 1), box-shadow 160ms;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--indigo) 90%, transparent); }
.btn.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.quiet:hover { box-shadow: inset 0 0 0 1.5px var(--indigo); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

.fine { font-size: 0.9rem; color: var(--muted); max-width: 56ch; }

/* ---------- hero: sunrise ---------- */
.hero {
  background: linear-gradient(to bottom, var(--dawn-2) 0%, var(--dawn) 45%, var(--paper) 100%);
  padding-top: clamp(2.5rem, 6vw, 5.5rem);
}
.hero-in {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  gap: 2rem;
}
.hero h1 {
  font-size: clamp(2.9rem, 6.6vw, 5.6rem);
  line-height: 0.98;
  font-weight: 780;
  letter-spacing: -0.04em;
}
.lead { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.5; max-width: 40ch; margin-top: 1.5rem; color: var(--ink); }
.hero-copy { padding-bottom: clamp(1.5rem, 4vw, 3.5rem); }

.sun { width: 100%; max-width: 520px; justify-self: end; }
.sun path { animation: rise 1800ms cubic-bezier(.16, 1, .3, 1) 120ms both; }
@keyframes rise { from { transform: translateY(26px); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .sun path { animation: none; } }

.horizon { height: 2px; background: linear-gradient(to right, transparent, #ffa257 18%, #ff7a7a 82%, transparent); opacity: 0.8; }

.hero-shot { margin-top: clamp(1.5rem, 4vw, 3rem); margin-bottom: 0; }
.hero-shot img { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shot-shadow); }

/* ---------- the day ---------- */
.day {
  background: linear-gradient(to bottom, var(--paper) 0%, var(--paper) 62%, var(--dusk) 86%, var(--dusk) 100%);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}
.note { color: var(--muted); font-size: 0.95rem; padding-top: clamp(3rem, 6vw, 5rem); margin-block: 0; }

.hour { padding-block: clamp(3rem, 7vw, 6rem) 0; }
.hour-in { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 2rem; align-items: start; }

.clock {
  position: sticky; top: 5.5rem;
  margin: 0.4rem 0 0; color: var(--muted); font-size: 0.95rem; font-weight: 500;
  display: grid; gap: 0.1rem;
}
.clock time {
  font-size: 2.1rem; font-weight: 300; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--indigo);
}

.hour h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05; font-weight: 740; letter-spacing: -0.035em;
  margin-bottom: 1rem;
}
.lede { max-width: var(--measure); margin-bottom: 2.25rem; }
.lede p { color: var(--muted); font-size: 1.12rem; }
.lede strong, .lede em { color: var(--ink); }

.shot { margin: 0; }
.shot img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shot-shadow); background: var(--paper); }
.shot figcaption { margin-top: 0.85rem; font-size: 0.95rem; color: var(--muted); max-width: 52ch; }
.shot figcaption strong { color: var(--ink); font-weight: 650; }
.shot.wide { margin-bottom: 2.75rem; }
.shot.wide img { width: 100%; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 2.5rem; align-items: start; }
.split .lede { margin-bottom: 0; }

.mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.25rem 1.5rem; }
.mosaic .big { grid-column: span 2; grid-row: span 2; }
.mosaic .half { grid-column: span 2; }

/* ---------- night: security, cloud, questions ---------- */
.night {
  background: linear-gradient(to bottom, var(--night) 0%, var(--night-2) 100%);
  color: var(--night-ink);
  --ink: var(--night-ink);
  --muted: var(--night-muted);
  --line: var(--night-line);
  --indigo: var(--moonlight);
  --indigo-ink: #c9c9ff;
  --on-indigo: #121228;
  --paper: var(--night);
  --shot-shadow: 0 24px 48px -22px rgba(0, 0, 0, 0.8);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.night .clock time { color: #ffd36b; }

.claims {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.5rem; margin: 0 0 3rem;
}
.claims div { border-top: 1px solid var(--line); padding: 1.15rem 0 1.25rem; }
.claims dt { font-weight: 680; font-size: 1.1rem; letter-spacing: -0.01em; margin-bottom: 0.3rem; }
.claims dd { margin: 0; color: var(--muted); }

.review { max-width: var(--measure); }
.review h3 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin: 2rem 0 0.75rem; }
.review h3:first-child { margin-top: 0; }
.review p, .review li { color: var(--muted); }
.review ul { padding-left: 1.2rem; margin: 0 0 1.5rem; }
.review li { margin-bottom: 0.5rem; }
.review li::marker { color: #ffa257; }
.links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; font-weight: 550; }

.levels {
  list-style: none; padding: 0; margin: 0 0 2rem;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem;
  counter-reset: level;
}
.levels li { counter-increment: level; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.levels svg { width: 120px; margin-bottom: 1rem; }
.levels .dev { fill: none; stroke: var(--night-ink); stroke-width: 2; }
.levels .relay { fill: #ffa257; }
.levels .friend { fill: none; stroke: var(--moonlight); stroke-width: 2; }
.levels .link { stroke: var(--night-muted); stroke-width: 1.5; stroke-dasharray: 3 3; fill: none; }
.levels h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.levels h3::before { content: "Level " counter(level) ". "; color: var(--muted); font-weight: 500; }
.levels p { color: var(--muted); }
.levels .who { color: var(--ink); font-weight: 550; font-size: 0.95rem; }
.tip { font-size: 1.15rem; max-width: 52ch; margin-bottom: 3rem; color: var(--ink); }

.faq { max-width: var(--measure); border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2rem 1.1rem 0; position: relative;
  font-weight: 620; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform 200ms;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--muted); padding-bottom: 0.6rem; }
.faq h2 { margin-bottom: 1.5rem; }
.more { margin-top: 1.25rem; font-weight: 550; }

.last { padding-top: clamp(4rem, 8vw, 7rem); }
.last-in { text-align: center; display: grid; justify-items: center; }
.last h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 760; letter-spacing: -0.04em; line-height: 1.05; }
.last .cta { justify-content: center; }

.foot { background: var(--night-2); color: var(--night-muted); border-top: 1px solid #22224a; padding: 2.25rem 0 2.75rem; font-size: 0.95rem; }
.foot a { color: #c9c9ff; }
.foot-in { display: grid; gap: 0.6rem; }
.foot ul { list-style: none; padding: 0; margin: 0 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.foot p { margin: 0; }
.foot .fine { color: var(--night-muted); }

/* ---------- smaller screens ---------- */
@media (max-width: 960px) {
  :root { --rail: 1fr; }
  .hour-in { grid-template-columns: 1fr; gap: 1rem; }
  .clock { position: static; display: flex; align-items: baseline; gap: 0.6rem; }
  .clock time { font-size: 1.6rem; }
  .split { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mosaic .big { grid-row: auto; }
  .mosaic .half { grid-column: span 1; }
  .levels { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero-in { grid-template-columns: 1fr; gap: 0; }
  .sun { max-width: 200px; justify-self: center; order: 2; margin-top: 0.5rem; }
  .hero-copy { padding-bottom: 1.5rem; }
  .bar nav a:not(:last-child):not([href="#security"]) { display: none; }
  .pair, .claims { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: 1fr; }
  .mosaic .big { grid-column: auto; }
  .btn { width: 100%; justify-content: center; }
}

/* Same frame for every picture in a group, so captions line up. */
.pair .shot img, .mosaic .shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }
.mosaic .big img { aspect-ratio: auto; height: auto; }
html { background: var(--night-2); }
