/* ------------------------------------------------------------------
     Tokens — lifted verbatim from Herbario/Design/Theme.swift. This page
     does not invent a palette, and like the app it has no dark variant:
     papel is the ground, always.
     ------------------------------------------------------------------ */
  :root {
    --ground:     #F3F0E7;   /* papel  */
    --surface:    #FBF9F4;
    --ink:        #1E241B;   /* tinta  */
    --ink-muted:  rgba(30, 36, 27, 0.60);
    --ink-faint:  rgba(30, 36, 27, 0.36);
    --hairline:   rgba(30, 36, 27, 0.14);
    --accent:     #B4531F;   /* ocre   */
    --accent-ink: #F3F0E7;
    --sage:       #7D8C5C;   /* salvia */
    --leaf-dark:  #334522;
    --leaf-light: #5C733E;
    --scrim:      rgba(20, 24, 15, 0.78);
    --on-dark:    #F6F3EA;

    --rotulo: "Arial Black", "Segoe UI Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: Georgia, "Times New Roman", serif;

    --t-xs: 0.72rem;
    --t-sm: 0.875rem;
    --t-base: 1.0625rem;
    --t-md: 1.25rem;
    --t-lg: 1.625rem;
    --t-display: clamp(2.6rem, 9vw, 5.25rem);

    --gutter: clamp(1.25rem, 4vw, 3rem);
    --radius: 14px;
  }

  /* Light-locked, deliberately — matching the app, which pins
     .preferredColorScheme(.light) because the palette has no dark tokens.
     The papel ground IS the brand, and the dark variant was the one place it
     inverted. color-scheme "only light" also stops the browser painting its
     own dark form controls and scrollbars onto the cream page. */
  :root { color-scheme: only light; }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--body);
    font-size: var(--t-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  .sheet { max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter); }

  /* Rótulo: heavy, squared, uppercase, tightly tracked — the exact fallback
     the app itself renders when the licensed Goodwheel face is absent. */
  .rotulo {
    font-family: var(--rotulo);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 0.96;
    text-wrap: balance;
  }
  .rail-label {
    font-size: var(--t-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sage);
  }
  .binomial { font-family: var(--serif); font-style: italic; }

  a { color: var(--accent); text-decoration: none; }
  a:hover { text-decoration: underline; }

  /* ---------------- nav ---------------- */
  .nav {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--ground) 86%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline);
  }
  .nav-in {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 0.8rem var(--gutter);
    max-width: 1140px; margin: 0 auto;
  }
  .nav-mark { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); }
  .nav-mark:hover { text-decoration: none; }
  .nav-mark svg { width: 26px; height: 26px; }
  .nav-word { font-family: var(--rotulo); font-weight: 900; font-size: 1rem; letter-spacing: 0.02em; }
  .nav-links { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
  .nav-links a { color: var(--ink-muted); font-size: var(--t-sm); font-weight: 600; }
  .nav-links a:hover { color: var(--ink); text-decoration: none; }
  .nav-cta {
    background: var(--accent); color: var(--accent-ink) !important;
    padding: 0.5rem 1rem; border-radius: 999px; font-weight: 700;
  }
  .nav-cta:hover { text-decoration: none; filter: brightness(1.06); }
  @media (max-width: 720px) { .nav-links a:not(.nav-cta) { display: none; } }

  /* ---------------- hero ---------------- */
  .hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 5rem); overflow: hidden; }
  .hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(2rem, 5vw, 4rem); align-items: center;
  }
  @media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

  .hero-eyebrow { margin-bottom: 1.2rem; }
  .hero h1 { font-size: var(--t-display); margin-bottom: 1.4rem; }
  .hero h1 .knows { color: var(--accent); }
  .hero-sub {
    font-size: var(--t-md); color: var(--ink-muted); max-width: 34rem;
    margin-bottom: 2rem; text-wrap: pretty;
  }
  .hero-ctas { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
  .btn {
    display: inline-block; font-weight: 700; border-radius: var(--radius);
    padding: 0.95rem 1.6rem; font-size: var(--t-base);
  }
  .btn-primary { background: var(--accent); color: var(--accent-ink); }
  .btn-primary:hover { text-decoration: none; filter: brightness(1.06); }
  .btn-ghost { border: 1.5px solid var(--hairline); color: var(--ink); }
  .btn-ghost:hover { text-decoration: none; border-color: var(--ink-faint); }
  .hero-note { font-size: var(--t-sm); color: var(--ink-faint); margin-top: 1rem; }

  /* ---------------- the phone ----------------
     An illustrative render of the real Identify screen, drawn in CSS from
     the same design decisions as the SwiftUI. Not a screenshot, and not
     pretending to be one — the pin chip, reticle, organ chips and shutter
     are the app's actual components. */
  .phone-wrap { display: flex; justify-content: center; }
  .phone {
    width: min(310px, 78vw); aspect-ratio: 9 / 19;
    background: #101408; border-radius: 44px;
    border: 6px solid #2A2A28;
    box-shadow: 0 30px 70px -30px rgba(30, 36, 27, 0.55);
    position: relative; overflow: hidden;
    transform: rotate(2.5deg);
  }
  .cam {
    position: absolute; inset: 0;
    background:
      radial-gradient(130% 90% at 18% 12%, #6d7f4a 0%, transparent 55%),
      radial-gradient(120% 100% at 85% 25%, #3f5228 0%, transparent 60%),
      radial-gradient(150% 110% at 60% 95%, #22301a 0%, transparent 70%),
      linear-gradient(170deg, #55683a 0%, #2c3c1e 55%, #16200f 100%);
  }
  .cam::after {
    content: ""; position: absolute; inset: 0;
    background:
      radial-gradient(3.5px 14px at 30% 40%, rgba(240,235,220,0.10), transparent 70%),
      radial-gradient(4px 16px at 68% 55%, rgba(240,235,220,0.08), transparent 70%),
      radial-gradient(3px 12px at 48% 72%, rgba(240,235,220,0.07), transparent 70%);
  }
  .notch {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    width: 34%; height: 22px; background: #101010; border-radius: 12px; z-index: 6;
  }
  .quota-chip {
    position: absolute; top: 48px; right: 14px; z-index: 5;
    background: var(--scrim); color: var(--on-dark);
    font-size: 0.62rem; font-weight: 600; font-variant-numeric: tabular-nums;
    padding: 0.28rem 0.6rem; border-radius: 999px;
  }
  .reticle {
    position: absolute; top: 26%; left: 14%; right: 14%; aspect-ratio: 1; z-index: 3;
  }
  .reticle svg { width: 100%; height: 100%;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4)); }
  .reticle-caption {
    position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%);
    background: var(--scrim); color: var(--on-dark); white-space: nowrap;
    font-size: 0.66rem; font-weight: 700;
    padding: 0.3rem 0.7rem; border-radius: 999px;
  }
  .pin { position: absolute; top: 20%; left: 56%; z-index: 4; }
  .pin-chip {
    background: var(--scrim); border: 0.5px solid rgba(246,243,234,0.16);
    border-radius: 10px; padding: 0.42rem 0.6rem;
    box-shadow: 0 6px 14px rgba(0,0,0,0.3);
    transform: translateX(-50%);
    animation: pinfloat 5s ease-in-out infinite;
  }
  @keyframes pinfloat {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -4px); }
  }
  .pin-name { color: #F6F3EA; font-size: 0.72rem; font-weight: 700; line-height: 1.25; }
  .pin-name .dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: #8FC47E; margin-right: 4px;
  }
  .pin-latin { color: rgba(246,243,234,0.62); font-size: 0.6rem; font-family: var(--serif); font-style: italic; }
  .pin-stem { width: 1.5px; height: 30px; background: rgba(246,243,234,0.7); margin: 0 auto; }
  .pin-dot {
    width: 9px; height: 9px; border-radius: 50%; margin: 0 auto;
    background: #8FC47E; border: 1.5px solid rgba(246,243,234,0.9);
  }
  .organ-row {
    position: absolute; left: 0; right: 0; bottom: 106px; z-index: 5;
    display: flex; gap: 6px; justify-content: center;
  }
  .organ {
    background: var(--scrim); color: var(--on-dark);
    font-size: 0.6rem; font-weight: 700;
    padding: 0.32rem 0.62rem; border-radius: 999px;
    border: 0.5px solid rgba(246,243,234,0.18);
  }
  .organ.sel { background: #A8BA80; color: #1E241B; border-color: transparent; }
  .hint-pill {
    position: absolute; left: 50%; bottom: 142px; transform: translateX(-50%); z-index: 5;
    background: var(--scrim); color: var(--on-dark); white-space: nowrap;
    font-size: 0.62rem; font-weight: 700; padding: 0.3rem 0.75rem; border-radius: 999px;
  }
  .shutter {
    position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 5;
    width: 62px; height: 62px; border-radius: 50%;
    border: 3px solid rgba(246,243,234,0.9);
    display: grid; place-items: center;
  }
  .shutter::after {
    content: ""; width: 48px; height: 48px; border-radius: 50%; background: #B4531F;
  }

  /* ---------------- stat strip ---------------- */
  .stats { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
  .stats-in {
    display: grid; grid-template-columns: repeat(3, 1fr);
    max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter);
  }
  .stat { padding: 1.6rem 1rem; text-align: center; }
  .stat + .stat { border-left: 1px solid var(--hairline); }
  .stat b { display: block; font-family: var(--rotulo); font-weight: 900; font-size: var(--t-lg); }
  .stat span { font-size: var(--t-sm); color: var(--ink-muted); }
  @media (max-width: 640px) { .stat b { font-size: var(--t-md); } .stat span { font-size: var(--t-xs); } }

  /* ---------------- bands ---------------- */
  .band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
  .band + .band { border-top: 1px solid var(--hairline); }
  .band-grid {
    display: grid; grid-template-columns: 150px minmax(0, 1fr);
    gap: 1.5rem; max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter);
  }
  @media (max-width: 860px) { .band-grid { grid-template-columns: 1fr; } }
  .band-head { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 1.1rem; }
  .band-sub { color: var(--ink-muted); max-width: 40rem; margin-bottom: 2rem; text-wrap: pretty; }

  .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  @media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
  .step {
    background: var(--surface); border: 1px solid var(--hairline);
    border-radius: var(--radius); padding: 1.4rem;
  }
  .step em {
    display: block; font-family: var(--rotulo); font-style: normal; font-weight: 900;
    color: var(--accent); font-size: var(--t-lg); margin-bottom: 0.5rem;
  }
  .step h3 { font-size: var(--t-base); margin-bottom: 0.4rem; }
  .step p { font-size: var(--t-sm); color: var(--ink-muted); }

  .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  @media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
  .card {
    background: var(--surface); border: 1px solid var(--hairline);
    border-radius: var(--radius); padding: 1.3rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -18px rgba(30, 36, 27, 0.4);
  }
  .card h3 { font-size: var(--t-base); margin-bottom: 0.4rem; }
  .card p { font-size: var(--t-sm); color: var(--ink-muted); }
  .card .glyph { color: var(--sage); font-size: 1.3rem; margin-bottom: 0.6rem; display: block; }

  /* herbarium mock */
  .shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-top: 2rem; }
  @media (max-width: 700px) { .shelf { grid-template-columns: repeat(2, 1fr); } }
  .spec { border-radius: 10px; overflow: hidden; border: 1px solid var(--hairline); background: var(--surface); }
  .spec-img { aspect-ratio: 1; position: relative; }
  .spec-img i {
    position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.9);
  }
  .spec-meta { padding: 0.5rem 0.65rem 0.65rem; }
  .spec-meta b { display: block; font-size: 0.78rem; }
  .spec-meta span { font-size: 0.68rem; color: var(--ink-muted); font-family: var(--serif); font-style: italic; }

  /* pro table */
  .tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 46rem; }
  @media (max-width: 640px) { .tiers { grid-template-columns: 1fr; } }
  .tier {
    background: var(--surface); border: 1px solid var(--hairline);
    border-radius: var(--radius); padding: 1.5rem;
  }
  .tier.pro { border-color: var(--accent); border-width: 1.5px; }
  .tier h3 { font-family: var(--rotulo); font-weight: 900; text-transform: uppercase; font-size: var(--t-base); margin-bottom: 0.9rem; }
  .tier ul { list-style: none; }
  .tier li { font-size: var(--t-sm); color: var(--ink-muted); padding: 0.32rem 0 0.32rem 1.4rem; position: relative; }
  .tier li::before { content: "—"; position: absolute; left: 0; color: var(--sage); }
  .tier.pro li::before { content: "✓"; color: var(--accent); font-weight: 700; }
  .tier-note { font-size: var(--t-sm); color: var(--ink-muted); margin-top: 1.2rem; max-width: 40rem; }

  /* faq */
  details {
    border-bottom: 1px solid var(--hairline); padding: 1rem 0;
  }
  summary {
    font-weight: 700; cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: "+"; color: var(--sage); font-weight: 900; font-size: 1.2rem; }
  details[open] summary::after { content: "–"; }
  details p { padding-top: 0.7rem; color: var(--ink-muted); font-size: var(--t-sm); max-width: 44rem; }

  /* closing + footer */
  .close-band { text-align: center; }
  .close-band .band-head { margin-left: auto; margin-right: auto; }
  .foot { border-top: 1px solid var(--hairline); padding: 2.2rem 0 3rem; }
  .foot-in {
    display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center;
    max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter);
    font-size: var(--t-sm); color: var(--ink-muted);
  }
  .foot-in .spacer { margin-left: auto; }
  .foot a { color: var(--ink-muted); }
  .foot a:hover { color: var(--ink); }

  /* scroll reveal — additive; without JS everything is simply visible */
  @media (prefers-reduced-motion: no-preference) {
    .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
    .js .reveal.in { opacity: 1; transform: none; }
  }
