/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V4
 * Rimi waitlist — Editorial Minimalism.
 * Tokens are brand-locked to flutter_app/lib/theme/colors.dart. */

:root {
  --paper: #F7F3EC;
  --paper-2: #F2EBDD;
  --ink: #1F1A15;
  --rouge: #A0522D;
  --rouge-dark: #6B3419;
  --rouge-light: #E8DCC5;
  --text-2: #5C5245;
  --muted: #8A7E6E;
  --hairline: #D8CFC2;
  --hairline-2: #EAE3D6;
  --safe: #3D9A6C;
  --caution: #C98A3A;
  --avoid: #C44D3E;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Instrument Sans', -apple-system, 'Segoe UI', sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { overflow-x: clip; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--rouge-light); color: var(--rouge-dark); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---- Paper grain — barely-there texture (E7, dialled down for a paper theme) ---- */
.grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  filter: url(#grain);
  opacity: 0.045;
  mix-blend-mode: multiply;
}

/* ---- Masthead — newspaper style, double rule ---- */
.masthead {
  border-bottom: 1px solid var(--ink);
  position: relative;
}
.masthead::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
  border-bottom: 1px solid var(--hairline);
}
.masthead__inner {
  max-width: 72rem; margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex; justify-content: space-between; align-items: baseline;
}
.masthead__wordmark {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.55rem; letter-spacing: 0.01em;
}
.masthead__dot { color: var(--rouge); }
.masthead__note {
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
}

/* ---- Hero — left-biased, height of its content ---- */
.hero {
  max-width: 72rem; margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 6.5rem) var(--gutter) clamp(3rem, 7vh, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: start;
  position: relative;
  isolation: isolate;
}
.hero::before {
  content: ''; position: absolute; z-index: -1;
  inset: 0 calc(50% - 50vw); /* full-bleed past the container */
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--paper) 96%, var(--rouge) 4%) 0%,
    var(--paper) 62%);
}

.kicker {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--rouge);
  margin-bottom: 1.4rem;
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 15ch;
}
.display .accent {
  font-style: normal;
  color: var(--rouge);
  border-bottom: 3px solid var(--rouge-light);
}

.hero__sub {
  margin-top: 1.6rem;
  max-width: var(--measure);
  color: var(--text-2);
  font-size: 1.06rem;
}

/* ---- C2 · inline form-as-CTA ---- */
.cta-form {
  margin-top: 2.4rem;
  max-width: var(--measure);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--ink);
  transition: border-color 0.25s ease;
}
.cta-form:focus-within { border-color: var(--rouge); }
.cta-form input[type="email"] {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: none; border: 0; outline: none;
  padding: 0.8rem 0; min-height: 44px;
  min-width: 0;
}
.cta-form input[type="email"]::placeholder { color: var(--muted); }
.cta-form button {
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink);
  background: none; border: 0;
  padding: 0.8rem 0 0.8rem 1.2rem; min-height: 44px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.5rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.cta-form button .btn-arrow {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: var(--rouge);
}
.cta-form button:hover, .cta-form button:active { color: var(--rouge-dark); }
.cta-form button:hover .btn-arrow { transform: translateX(4px); }
.cta-form button:focus-visible {
  outline: 2px solid var(--rouge);
  outline-offset: 3px;
}
.cta-form button:disabled { color: var(--muted); cursor: default; }
.cta-form.is-loading .btn-arrow { animation: nudge 0.9s ease-in-out infinite; }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

.form-note {
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.form-error {
  margin-top: 0.8rem;
  font-size: 0.86rem;
  color: var(--avoid);
}
.success {
  margin-top: 2.4rem;
  max-width: var(--measure);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  border-bottom: 1px solid var(--rouge);
  padding-bottom: 0.8rem;
}
.success__mark { color: var(--rouge); }

/* ---- Specimen — a typographic label, not fake chrome ---- */
.hero__specimen {
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  padding: 1.6rem 1.5rem 1.3rem;
  margin-top: 0.4rem;
}
.specimen__caption {
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--hairline);
}
.specimen__list { list-style: none; }
.specimen__list li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--hairline-2);
}
.inci {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.verdict {
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  white-space: nowrap;
}
.verdict--safe { color: var(--safe); }
.verdict--caution { color: var(--caution); }
.verdict--avoid { color: var(--avoid); }
.specimen__foot {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-2);
}

/* ---- Ingredient marquee ---- */
.marquee {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
  padding: 0.85rem 0;
}
.marquee__track {
  display: inline-flex; align-items: center; gap: 2.2rem;
  white-space: nowrap;
  animation: scroll 48s linear infinite;
  will-change: transform;
}
.marquee__track span {
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--text-2);
}
.marquee__track i { font-style: normal; font-size: 0.6rem; color: var(--rouge); }
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- Index — numbered editorial rows, not icon cards ---- */
.index {
  max-width: 72rem; margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) var(--gutter);
}
.index__row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 2fr);
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.7rem 0;
  border-top: 1px solid var(--hairline);
}
.index__row:last-child { border-bottom: 1px solid var(--hairline); }
.index__num {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 600;
  color: var(--rouge);
}
.index__term {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 500;
  line-height: 1.1;
}
.index__desc {
  color: var(--text-2);
  max-width: 36rem;
}

/* ---- Demo — the film plays on the paper itself ---- */
.demo {
  max-width: 72rem; margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 5rem) var(--gutter) 0;
  text-align: center;
}
.demo__kicker { margin-bottom: 1rem; }
.demo__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
}
.demo__figure {
  position: relative;
  max-width: 400px;
  margin: 2.2rem auto 0;
}
.demo__figure video {
  display: block;
  width: 100%;
  height: auto;
  /* the film's paper matches the page paper — no chrome, no box */
  background: var(--paper);
}
.demo__play {
  position: absolute;
  left: 50%; bottom: 9%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.6rem;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}
.demo__play:hover { background: var(--rouge-dark); transform: translateX(-50%) translateY(-2px); }
.demo__play:focus-visible { outline: 2px solid var(--rouge); outline-offset: 3px; }
.demo__play-mark { font-size: 0.6rem; color: var(--rouge-light); }
.demo__foot {
  margin-top: 1.1rem;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
}

/* ---- Statement ---- */
.statement {
  max-width: 72rem; margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 5rem) var(--gutter) clamp(3.5rem, 9vh, 6rem);
  text-align: center;
}
.statement__text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  line-height: 1.25;
}

/* ---- Footer — Ft2 inline single line ---- */
.footer { border-top: 1px solid var(--hairline); }
.footer__inner {
  max-width: 72rem; margin: 0 auto;
  padding: 1.3rem var(--gutter);
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer__right { font-style: italic; }

/* ---- Motion layer (Aceternity-inspired, editorial restraint) ---- */

/* Scroll progress hairline (Tracing Beam, adapted) */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 2px;
  background: var(--rouge);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* Headline word-by-word blur-fade (Text Generate Effect, adapted) */
body.js .display .w {
  display: inline-block;
  opacity: 0;
  filter: blur(7px);
  transform: translateY(0.18em);
  transition: opacity 0.65s ease, filter 0.65s ease, transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.js.loaded .display .w {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

/* Accent underline draws itself in (Hero Highlight, adapted) */
.display .accent { position: relative; border-bottom: 0; }
.display .accent::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0.04em;
  height: 3px;
  background: var(--rouge-light);
  z-index: -1;
}
body.js .display .accent::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 1s;
}
body.js.loaded .display .accent::after { transform: scaleX(1); }

/* Warm cursor light over the hero (Card Spotlight, adapted) */
.hero__light {
  position: absolute; top: 0; left: 0; z-index: -1;
  width: 560px; height: 560px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(160, 82, 45, 0.07), transparent 72%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  will-change: transform;
}

/* Specimen tilt + label cycling (3D Card + Card Stack, adapted) */
.hero__specimen {
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
  transform-style: preserve-3d;
}
.hero__specimen:hover { box-shadow: 0 18px 40px rgba(31, 26, 21, 0.07); }
.specimen__product {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--rouge-dark);
  padding-top: 0.8rem;
}
.specimen__body {
  transition: opacity 0.38s ease, transform 0.38s ease;
}
.specimen__body.is-switching {
  opacity: 0;
  transform: translateY(5px);
}

/* Marquee pauses under the cursor */
.marquee:hover .marquee__track { animation-play-state: paused; }

/* Scroll-triggered reveals */
.reveal-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal-scroll.is-visible { opacity: 1; transform: none; }

/* ---- Reveal on load ---- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-scroll { opacity: 1; transform: none; transition: none; }
  body.js .display .w { opacity: 1; filter: none; transform: none; transition: none; }
  body.js .display .accent::after { transform: scaleX(1); transition: none; }
  .marquee__track { animation: none; }
  .cta-form.is-loading .btn-arrow { animation: none; }
  .hero__light { display: none; }
  .hero__specimen { transition: none; }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero__specimen { max-width: 26rem; }
  .index__row {
    grid-template-columns: 3rem minmax(0, 1fr);
    grid-template-areas: "num term" "num desc";
  }
  .index__num { grid-area: num; }
  .index__term { grid-area: term; }
  .index__desc { grid-area: desc; }
}

@media (max-width: 480px) {
  .cta-form { grid-template-columns: minmax(0, 1fr); border-bottom: 0; }
  .cta-form input[type="email"] { border-bottom: 1px solid var(--ink); }
  .cta-form:focus-within input[type="email"] { border-color: var(--rouge); }
  .cta-form button {
    justify-content: flex-start;
    padding-left: 0; padding-top: 1rem;
  }
  .masthead__note { display: none; }
}
