/* Random Sensei web pages: the app's look, "Calm sensei, playful picks"
   (ai.local/plans/rework/04-ux-ui.md §1–2). The colours mirror
   lib/core/theme/app_theme.dart: pastel sky and blush as containers, an ink
   for text and brush strokes. Soft, rounded shapes; tonal surfaces, not
   shadows; light and dark follow the system. Fonts are bundled, as in the app:
   nothing is fetched from another site. */
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito-Variable.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --canvas: #fbfdff;
  --surface: #eef7fc;
  --surface-alt: #ddebf4;
  --hairline: #bfd0dc;
  --outline: #6a7d90; /* field borders: 3:1 against the surfaces */
  --text: #1b2430;
  --muted: #4f6072;
  --accent: #1670ab;
  --on-accent: #ffffff;
  --accent-soft: #d9f3ff;
  --blush: #b5387a;
  --blush-soft: #ffdff8;
  --r-row: 12px;
  --r-card: 20px;
  --r-sheet: 28px;
  --fast: 150ms;
  --base: 250ms;
  --reveal: 600ms;
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1); /* the app's easeOutQuart */
  --ui: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", sans-serif;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f1419;
    --surface: #1a2129;
    --surface-alt: #242d37;
    --hairline: #33404d;
    --outline: #7c8b9a;
    --text: #e8eef4;
    --muted: #9daab8;
    --accent: #8fd3ff;
    --on-accent: #06263a;
    --accent-soft: #123a52;
    --blush: #ffb0d9;
    --blush-soft: #4a1735;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(44rem 30rem at 100% -6rem, color-mix(in srgb, var(--blush-soft) 80%, transparent), transparent 70%),
    radial-gradient(48rem 34rem at -10% -8rem, var(--accent-soft), transparent 70%),
    var(--canvas);
  background-repeat: no-repeat;
  font: 500 17px/1.6 var(--ui);
}
h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 0;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.shell { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Top bar -------------------------------------------------------------- */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 0; font-size: 1.3rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { flex: none; width: 34px; height: 34px; }
.nav-links { display: flex; align-items: center; gap: 4px 22px; font-size: 0.97rem; font-weight: 700; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.nav-links .pill { padding: 0 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.nav-links .pill:hover { color: var(--on-accent); filter: brightness(1.08); }
@media (max-width: 720px) { .nav-links .wide { display: none; } }
@media (max-width: 400px) { .nav-links .mid { display: none; } }

/* Hero ----------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; padding: 40px 0 72px; }
.eyebrow { display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px; background: var(--blush-soft); font-size: 0.88rem; font-weight: 800; letter-spacing: 0.01em; }
.hero h1 { font-size: clamp(2.9rem, 7.4vw, 4.9rem); line-height: 1; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { max-width: 33rem; margin-top: 22px; color: var(--muted); font-size: clamp(1.08rem, 1.7vw, 1.24rem); }
@media (max-width: 880px) {
  /* One column: the demo keeps a phone's width rather than stretching. */
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 20px 0 56px; }
  .hero .decide { width: 100%; max-width: 520px; }
}

/* Store badges: each store's own artwork, unaltered, at one height and with
   at least a quarter of that height clear around it. */
.store-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }
.store-badge { display: inline-flex; border-radius: 9px; }
.store-badge img { display: block; width: auto; height: 52px; }
.store-badge:focus-visible { border-radius: 9px; }
.store-note { margin-top: 14px; color: var(--muted); font-size: 0.95rem; }

/* Quick Decide: the app's first screen, small enough to try here. ------- */
.decide { padding: 26px; border: 1px solid var(--hairline); border-radius: var(--r-sheet); background: var(--surface); }
.kicker { color: var(--muted); font: 800 0.8rem/1.4 var(--ui); font-variation-settings: normal; letter-spacing: 0.09em; text-transform: uppercase; }
.stage { position: relative; display: grid; place-items: center; width: min(100%, 236px); aspect-ratio: 1; margin: 8px auto 18px; }
.enso { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--text); }
/* The seal a calligrapher stamps beside the stroke: clear of the ring. */
.seal { position: absolute; right: 2%; bottom: 3%; width: 10%; aspect-ratio: 1; border-radius: 30%; background: var(--blush); }
.result { position: relative; max-width: 60%; text-align: center; }
.result-label { display: block; color: var(--muted); font-size: 0.86rem; font-weight: 800; }
.result-value { display: block; margin-top: 2px; font-family: var(--display); font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 0; font-size: 2.1rem; line-height: 1.1; overflow-wrap: anywhere; }
.result-value[data-size="m"] { font-size: 1.45rem; }
.result-value[data-size="s"] { font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 37px; margin: 0; padding: 0; list-style: none; }
.chips li { max-width: 100%; padding: 5px 14px; border: 2px solid transparent; border-radius: 999px; background: var(--accent-soft); font-size: 0.95rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips li:nth-child(even) { background: var(--blush-soft); }
.chips li.is-chosen { border-color: var(--text); } /* an outline as well as the colour */
.decide form { margin-top: 18px; }
.decide label { display: block; margin-bottom: 6px; font-size: 0.95rem; font-weight: 800; }
.decide input { width: 100%; min-height: 52px; padding: 12px 16px; border: 1.5px solid var(--outline); border-radius: var(--r-row); background: var(--canvas); color: var(--text); font: inherit; }
.decide input:focus-visible { outline-offset: 1px; border-radius: var(--r-row); }
.button { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-top: 14px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 800 1.06rem/1 var(--ui); cursor: pointer; }
.button:hover { filter: brightness(1.08); }
.button:focus-visible { border-radius: 999px; }
.button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.hint { min-height: 1.5em; margin-top: 8px; color: var(--muted); font-size: 0.9rem; text-align: center; }
.no-js .decide form { display: none; }

/* Sections ------------------------------------------------------------- */
.section { padding: 56px 0; }
.section-head { max-width: 40rem; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 1.1rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 340px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card { padding: clamp(16px, 4vw, 22px); border: 1px solid var(--hairline); border-radius: var(--r-card); background: var(--surface); }
.card h3 { margin-top: 16px; font-size: 1.35rem; }
.card p { margin-top: 6px; color: var(--muted); }
.icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 16px; background: var(--accent-soft); color: var(--text); }
.icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon .dot { fill: currentColor; stroke: none; }
.cards > :nth-child(even) .icon, .tools > :nth-child(even) .icon { background: var(--blush-soft); }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.tools li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: var(--r-row); background: var(--surface); }
.tools strong { display: block; font-weight: 800; line-height: 1.3; }
.tools span span { display: block; color: var(--muted); font-size: 0.95rem; line-height: 1.4; }
.promises { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px 32px; padding-top: 28px; border-top: 1px solid var(--hairline); }
.promises h3 { font-size: 1.25rem; }
.promises p { margin-top: 6px; color: var(--muted); }

/* The closing call. */
.cta { margin: 16px auto 72px; padding: clamp(32px, 6vw, 56px) 24px; border-radius: var(--r-sheet); background: var(--blush-soft); text-align: center; }
.cta h2 { font-size: clamp(2rem, 5vw, 3rem); }
.cta p { margin-top: 10px; color: var(--muted); font-size: 1.1rem; }
.cta .store-badges { justify-content: center; }

/* Privacy and other reading pages. */
.doc { max-width: 44rem; padding: 24px 0 72px; }
.doc h1 { margin-bottom: 20px; font-size: clamp(2.2rem, 6vw, 3.2rem); }
.doc h2 { margin: 1.9em 0 0.4em; font-size: 1.4rem; }
.doc p { margin: 0.8em 0; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }

/* Short pages: /get and not-found. */
.center { max-width: 34rem; padding: 56px 0 80px; text-align: center; }
.center .stage { margin-bottom: 24px; }
.center h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); }
.center > p { margin-top: 12px; color: var(--muted); font-size: 1.1rem; }
.center .store-badges { justify-content: center; }

/* Footer --------------------------------------------------------------- */
.site-footer { padding: 24px 0 max(32px, env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); color: var(--muted); font-size: 0.95rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 2px 22px; }
.footer-links a { display: inline-block; padding: 8px 0; color: var(--muted); }
.legal { display: block; margin-top: 10px; font-size: 0.8rem; line-height: 1.5; }

/* Motion: the reveal draws the brush circle, then the answer arrives. With
   reduced motion the answer just fades in. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .store-badge, .button { transition: transform var(--fast) ease-out, filter var(--fast) ease-out; }
  .store-badge:hover { transform: translateY(-2px); }
  .store-badge:active, .button:active { transform: scale(0.985); }
  .is-revealing .enso-sweep { animation: enso-draw var(--reveal) var(--ease-out) both; }
  .is-revealing .seal { animation: arrive var(--base) ease-out 470ms both; }
  .is-revealing .result { animation: arrive var(--base) ease-out 380ms both; }
}
@media (prefers-reduced-motion: reduce) {
  .is-revealing .result { animation: fade var(--fast) linear both; }
}
@keyframes enso-draw { from { stroke-dashoffset: 98.89; } to { stroke-dashoffset: 0; } }
@keyframes arrive { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-contrast: more) {
  :root { --hairline: var(--outline); }
}
