/* ==========================================================================
   Wardo landing page
   Tokens first (derived from the app's design system + the mascot's wood tones),
   then base, layout, components. Mobile-first.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/newsreader-latin.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  /* Color: light */
  --c-bg:          #FAF8F5;               /* app canvas */
  --c-bg-alt:      #F5F2EB;               /* oat */
  --c-surface:     #FFFFFF;
  --c-text:        #1A1918;               /* espresso */
  --c-text-muted:  #5F5953;               /* AA on bg and surface */
  --c-accent:      #94452C;               /* app primary, text-safe */
  --c-accent-tint: rgb(200 109 81 / .12);
  --c-accent-line: rgb(200 109 81 / .28);
  --c-terracotta:  #C86D51;               /* decorative only */
  --c-sage:        #7A8B7B;               /* decorative only */
  --c-border:      #D9D2C9;
  --c-focus:       #94452C;
  --glow-warm:     rgb(200 109 81 / .22);
  --glow-sage:     rgb(122 139 123 / .16);
  --shadow-mascot: rgb(44 42 41 / .20);
  --shadow-lift:   0 10px 24px -6px rgb(44 42 41 / .22);
  --c-btn:         #94452C;               /* filled button; white text is 7:1 */
  --c-btn-hover:   #7C3822;
  --c-on-btn:      #FFFFFF;
  --c-field:       #857D74;               /* input / option borders, 3:1 against the surface */

  /* Type */
  --font-display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-sm:      0.875rem;
  --text-base:    clamp(1rem, .96rem + .2vw, 1.0625rem);
  --text-lg:      clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  --text-xl:      clamp(1.5rem, 1.25rem + 1.1vw, 2.25rem);
  --text-display: clamp(3.25rem, 1.9rem + 6.2vw, 7.25rem);
  --leading-tight: 1.02;
  --leading-snug: 1.2;
  --leading-body: 1.55;
  --tracking-display: -0.025em;

  /* Spacing (4px base) */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* Radii (app scale) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: 160ms;
  --float-dur: 6s;

  /* Store badges: both rendered at this height, with 1/4-height clear space around */
  --badge-h: 48px;
  --badge-gap: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg:          #141312;
    --c-bg-alt:      #1F1E1C;
    --c-surface:     #1F1E1C;
    --c-text:        #F2EEE9;
    --c-text-muted:  #A39D96;
    --c-accent:      #E8967A;
    --c-accent-tint: rgb(232 150 122 / .12);
    --c-accent-line: rgb(232 150 122 / .30);
    --c-border:      #3A3733;
    --c-focus:       #E8967A;
    --glow-warm:     rgb(232 150 122 / .18);
    --glow-sage:     rgb(122 139 123 / .12);
    --shadow-mascot: rgb(0 0 0 / .50);
    --shadow-lift:   0 10px 24px -6px rgb(0 0 0 / .6);
    --c-btn:         #B85A3C;               /* the app's dark-mode fill; white text is 4.6:1 */
    --c-btn-hover:   #A34D31;
    --c-field:       #7A746D;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: var(--c-bg);
  /* Soft ambient light that scales with the viewport, so ultra-wide screens never show bare edges */
  background-image:
    radial-gradient(60vmax 50vmax at 78% 42%, var(--glow-warm), transparent 70%),
    radial-gradient(45vmax 40vmax at 6% 100%, var(--glow-sage), transparent 70%);
  background-repeat: no-repeat;
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, svg { display: block; max-width: 100%; }
p, h1, ul { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection { background: var(--c-accent-tint); }

/* ---------- Layout shell ---------- */

main {
  display: grid;
  align-content: center;      /* vertically centers the hero between header and footer */
}

/* ---------- Header ---------- */

.site-header {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding: var(--space-4) var(--gutter) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand img { border-radius: 9px; }

/* ---------- Hero ---------- */

.hero {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding: var(--space-5) var(--gutter) var(--space-7);
  display: grid;
  gap: var(--space-5);
  justify-items: center;
  text-align: center;
}

.hero__art  { order: -1; width: 100%; }
.hero__copy { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 40rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--c-accent-line);
  border-radius: var(--radius-pill);
  background: var(--c-accent-tint);
  color: var(--c-accent);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .01em;
}

.hero__title {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.hero__tagline {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  color: var(--c-accent);
  text-wrap: balance;
}

.hero__lead {
  margin-top: var(--space-4);
  max-width: 34rem;
  font-size: var(--text-lg);
  color: var(--c-text-muted);
  text-wrap: pretty;
}

/* ---------- Store buttons ---------- */

.stores {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--badge-gap);
}

.store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--badge-h);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.store img { height: var(--badge-h); width: auto; }

a.store:hover  { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
a.store:active { transform: translateY(0) scale(.98); box-shadow: none; }
a.store:focus-visible { border-radius: 10px; }

/* ---------- Launch flags: <html data-ios="soon|live" data-android="soon|live"> ---------- */

/* Store badges appear only for a platform that is live; the sign-up form hides when both are live. */
.store--apple, .store--play { display: none; }
html[data-ios="live"] .store--apple     { display: inline-flex; }
html[data-android="live"] .store--play  { display: inline-flex; }
html[data-ios="soon"][data-android="soon"] .stores { display: none; }
html[data-ios="live"][data-android="live"] .signup,
html[data-ios="live"][data-android="live"] .hero__soon { display: none; }

/* ---------- Coming soon + early-access form ---------- */

.hero__soon {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--c-text);
}

.signup {
  width: 100%;
  max-width: 30rem;
  margin-top: var(--space-4);
}

/* The form needs JS (it posts JSON); without it, the <noscript> email line is shown instead. */
html:not(.js) .signup__form { display: none; }

.signup__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text-muted);
}

.signup__row { display: grid; gap: var(--space-3); }

.signup__input {
  width: 100%;
  min-width: 0;
  height: var(--badge-h);
  padding-inline: var(--space-4);
  border: 1px solid var(--c-field);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 1rem;              /* 16px+ stops iOS Safari zooming the page on focus */
}

.signup__input::placeholder { color: var(--c-text-muted); opacity: 1; }
.signup__input[aria-invalid="true"] { border-color: var(--c-accent); border-width: 2px; }

.signup__button {
  height: var(--badge-h);
  padding-inline: var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--c-btn);
  color: var(--c-on-btn);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.signup__button:hover:not(:disabled)  { background: var(--c-btn-hover); }
.signup__button:active:not(:disabled) { transform: scale(.98); }
.signup__button:disabled { opacity: .7; cursor: progress; }

.signup__input:focus-visible,
.signup__button:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; border-radius: var(--radius-pill); }

.signup__platform {
  margin: var(--space-4) 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.signup__platform legend {
  margin: 0 auto var(--space-2);
  padding: 0;
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.signup__platform legend span { opacity: .85; }

.signup__options { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-3); }

.option { position: relative; display: inline-flex; }

.option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.option span {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-inline: var(--space-4);
  border: 1px solid var(--c-field);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.option input:checked + span { border-color: var(--c-accent); background: var(--c-accent-tint); color: var(--c-accent); }
.option input:focus-visible + span { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.option:hover input:not(:checked) + span { border-color: var(--c-text-muted); }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields) */
.signup__hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.signup__note {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.signup__note a, .signup__done a { color: var(--c-accent); text-underline-offset: 3px; }

.signup__status { min-height: 1.5em; margin-top: var(--space-2); font-size: var(--text-sm); }
.signup__status.is-error { color: var(--c-accent); font-weight: 600; }

.signup__done {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--c-accent-line);
  border-radius: var(--radius-lg);
  background: var(--c-accent-tint);
  color: var(--c-text);
  text-align: left;
}

.signup__done:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.signup__done-title { font-family: var(--font-display); font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--c-accent); }
.signup__done p + p { margin-top: var(--space-1); color: var(--c-text-muted); }

@media (min-width: 480px) {
  .signup__row { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (min-width: 960px) {
  .signup__platform legend { margin-inline: 0; }
  .signup__options { justify-content: flex-start; }
}

/* ---------- Mascot ---------- */

.mascot {
  position: relative;
  width: min(86vw, 420px);
  margin-inline: auto;
  padding-bottom: var(--space-5);
}

.mascot__img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 825;
  transform-origin: 50% 80%;
  animation: float var(--float-dur) ease-in-out infinite;
}

.mascot__shadow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 70%;
  height: 22px;
  margin-left: -35%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--shadow-mascot), transparent);
  animation: shadow var(--float-dur) ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-12px) rotate(1deg); }
}

@keyframes shadow {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(.82); opacity: .6; }
}

/* ---------- Text page (privacy) ---------- */

.doc {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  padding: var(--space-7) var(--gutter) var(--space-8);
  display: block;
}

.doc__title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

.doc__meta {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.doc__lead {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  color: var(--c-text-muted);
  text-wrap: pretty;
}

.doc h2 {
  margin-top: var(--space-7);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
  font-weight: 500;
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  scroll-margin-top: var(--space-6);
}

.doc h2 + p,
.doc h2 + ul { margin-top: var(--space-3); }

.doc p + p,
.doc ul + p,
.doc p + ul { margin-top: var(--space-4); }

.doc ul {
  padding-left: 1.25rem;
  list-style: disc;
}

.doc li { padding-left: var(--space-1); }
.doc li + li { margin-top: var(--space-3); }
.doc li::marker { color: var(--c-accent); }

.doc strong { font-weight: 600; }

.doc a {
  color: var(--c-accent);
  text-underline-offset: 3px;
}

.doc a:hover { text-decoration-thickness: 2px; }

.doc__back { margin-top: var(--space-7); }

/* ---------- Footer ---------- */

.site-footer {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding: var(--space-5) var(--gutter) calc(var(--space-5) + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.site-footer__links { display: flex; gap: var(--space-5); }

.site-footer a {
  display: inline-block;
  padding-block: var(--space-2);          /* comfortable tap target */
  text-decoration: underline;
  text-decoration-color: var(--c-accent-line);
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out), text-decoration-color var(--dur-fast) var(--ease-out);
}

.site-footer a:hover { color: var(--c-accent); text-decoration-color: currentColor; }

/* ---------- Tablet ---------- */

@media (min-width: 768px) {
  .mascot { width: min(60vw, 460px); }
  .hero { padding-top: var(--space-6); gap: var(--space-6); }
  .hero__lead { max-width: 36rem; }
}

/* ---------- Desktop: two columns, mascot on the right ---------- */

@media (min-width: 960px) {
  .site-header { padding-top: var(--space-5); }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: var(--space-7);
    justify-items: stretch;
    text-align: left;
    padding-block: var(--space-6);
  }

  .hero__art  { order: 0; }
  .hero__copy { align-items: flex-start; max-width: none; }
  .hero__lead { max-width: 30rem; }
  .stores { justify-content: flex-start; }
  .signup__done { max-width: 30rem; }

  .mascot { width: min(100%, 720px); margin-inline: auto 0; }
  .mascot__shadow { height: 30px; }

  .site-footer { justify-content: space-between; }
}

@media (min-width: 960px) and (min-height: 760px) {
  /* Let the hero breathe so it comfortably fills tall viewports */
  .hero { padding-block: var(--space-7); }
}

/* ---------- Narrow phones ---------- */

@media (max-width: 359px) {
  :root { --badge-h: 44px; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .mascot__img, .mascot__shadow { animation: none; }
  .store, .site-footer a, .signup__button, .option span { transition: none; }
  a.store:hover, a.store:active, .signup__button:active:not(:disabled) { transform: none; }
}
