/* ==========================================================================
   Oana Regeneraceuticals - landing page
   Plain CSS, no build step (managed shared hosting).

   One theme: the logo's own colours (dark green ground, light green type),
   used in both light and dark system modes.
   Shape rule: buttons and inputs are full pill; the checkbox is 4px. No other radii.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2");
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --oana-green: #174102;
  --oana-sage: #E1EBDF;
  --sister-ink: #0a0918;                  /* Backdoor Botanics ground: matches its preloader */

  --bg: var(--oana-green);
  --ink: var(--oana-sage);
  --ink-soft: #C2D3BD;                    /* secondary copy, AA+ on --bg */
  --line: rgb(225 235 223 / 0.22);
  --error: #F6D5C7;                       /* warm blush, AA on --bg */

  --font-display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --font-body: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.4vw + 0.98rem, 1.1875rem); /* 17-19px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* ---------- Type ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* ---------- Hero ---------- */
/* The image fades out at the bottom into the green ground, and the logo
   tucks into that fade. Heights are kept modest so the philosophy buttons
   land on the first screen. */
.hero { text-align: center; }
.hero__media {
  height: clamp(220px, 50svh, 560px);
  overflow: hidden;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 53% 55%; /* keeps the centre bottle in frame on narrow screens */
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent);
  mask-image: linear-gradient(to bottom, #000 58%, transparent);
}
.hero__logo {
  position: relative;
  width: min(54%, 250px);
  margin: clamp(-36px, -3vw, -16px) auto 0;
}

@media (max-width: 599px) {
  .hero__media { height: clamp(200px, 34svh, 320px); }
  .hero__logo { width: 172px; }
}

/* ---------- Newsletter ---------- */
.newsletter {
  width: min(100% - 2 * var(--gutter), 560px);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 128px) 0 clamp(88px, 11vw, 140px);
}
.newsletter__intro { text-align: center; }
.newsletter__intro p {
  margin: 18px auto 0;
  max-width: 38ch;
  color: var(--ink-soft);
}
.newsletter__form-wrap { margin-top: 48px; }

.signup { display: grid; gap: 22px; }

.field { display: grid; gap: 8px; }
.field label { font-size: 0.9375rem; letter-spacing: 0.02em; }
.field__optional { color: var(--ink-soft); }

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  border: 1px solid rgb(225 235 223 / 0.55);
  border-radius: 999px;
  background: rgb(225 235 223 / 0.06);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.3s var(--ease);
}
.field input:hover { border-color: var(--ink); }
.field input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-color: var(--ink);
}
.field input[aria-invalid="true"] { border-color: var(--error); }

.field__error { font-size: 0.9375rem; color: var(--error); }
.field__error:empty { display: none; }

.field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 14px;
}
.field--check input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 3px 0 0;
  border: 1px solid rgb(225 235 223 / 0.7);
  border-radius: 4px;
  background: rgb(225 235 223 / 0.06) center / 14px no-repeat;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.field--check input:hover { border-color: var(--ink); }
.field--check input:checked {
  border-color: var(--ink);
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%23174102' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.field--check input[aria-invalid="true"] { border-color: var(--error); }
.field--check label { color: var(--ink-soft); line-height: 1.55; cursor: pointer; }
.field--check .field__error { grid-column: 2; }

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 32px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--oana-green);
  font: 500 0.9375rem/1 var(--font-body);
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--oana-green); }
.btn:active { transform: translateY(1px) scale(0.985); }

.signup__submit { width: 100%; margin-top: 6px; }
.signup__submit[disabled] { opacity: 0.75; cursor: progress; }
.signup__status { font-size: 0.9375rem; color: var(--error); text-align: center; }
.signup__status:empty { display: none; }

.signup-success { text-align: center; }
.signup-success h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.875rem, 3vw, 2.375rem);
  line-height: 1.15;
}
.signup-success p { margin-top: 12px; color: var(--ink-soft); }
.signup-success:focus { outline: none; }

/* ---------- Philosophy ---------- */
.philosophy {
  width: min(100% - 2 * var(--gutter), 1200px);
  margin: 0 auto;
  padding: clamp(24px, 3vw, 36px) 0 clamp(80px, 10vw, 128px);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.philosophy__text {
  max-width: 34em; /* breaks 3 + 2 phrases on wide screens */
  margin: 14px auto 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.25rem, 1.7vw, 1.75rem);
  line-height: 1.35;
}
/* the markup puts a space after each dot, so the left margin is wider to balance it */
.philosophy__text .sep {
  margin: 0 0.2em 0 0.45em;
  color: var(--ink-soft);
}
/* keep each phrase whole so lines only break at the separators */
.philosophy__text span:not(.sep) { white-space: nowrap; }

.philosophy__actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 16px;
}
.philosophy__email {
  margin-top: 18px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.philosophy__email a {
  color: var(--ink);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.philosophy__email a:hover { text-decoration: none; }

@media (max-width: 479px) {
  .philosophy__actions .btn { width: 100%; }
}

/* ---------- Sign-up hint ---------- */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgb(225 235 223 / 0.45);
  border-radius: 999px;
  background: rgb(23 65 2 / 0.92);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgb(6 22 0 / 0.45);
  transition: opacity 0.4s var(--ease), visibility 0.4s, border-color 0.3s var(--ease);
}
.scroll-hint:hover { border-color: var(--ink); }
.scroll-hint.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.scroll-hint__arrow { display: inline-block; }

/* ---------- Brand switch ---------- */
/* A two-way pill at the top: Oana | Backdoor Botanics. The thumb sits under
   the current brand. Choosing the sister slides the thumb across, then the
   page is wiped in the sister's ink before navigating. */
.brand-switch {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 20;
  width: max-content;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid rgb(225 235 223 / 0.3);
  border-radius: 999px;
  background: rgb(23 65 2 / 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgb(6 22 0 / 0.35);
}
.brand-switch__thumb {
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.55s var(--ease), background-color 0.55s var(--ease);
}
.brand-switch__option {
  position: relative; /* above the thumb */
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.45s var(--ease);
}
.brand-switch__option:hover { color: var(--ink); }
.brand-switch__option[aria-current="page"] { color: var(--oana-green); }
.brand-switch__option:focus-visible { outline-offset: 2px; }

/* Thumb on the sister's side: while leaving, or just arrived from there */
.brand-switch.is-leaving .brand-switch__thumb,
.from-sister .brand-switch__thumb {
  transform: translateX(100%);
  background: var(--sister-ink);
}
.brand-switch.is-leaving [aria-current="page"],
.from-sister [aria-current="page"] { color: var(--ink-soft); }
.brand-switch.is-leaving [data-sister],
.from-sister [data-sister] { color: var(--ink); }

@media (max-width: 379px) {
  .brand-switch__option { padding: 0 12px; letter-spacing: 0.12em; }
}

/* The wipe: a circle of sister ink grows from the switch to fill the screen */
.brand-wipe {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--sister-ink);
  clip-path: circle(0 at var(--wipe-x, 50%) var(--wipe-y, 0));
  visibility: hidden;
  pointer-events: none;
}
.brand-wipe.is-on {
  clip-path: circle(var(--wipe-r, 150vmax) at var(--wipe-x, 50%) var(--wipe-y, 0));
  visibility: visible;
  pointer-events: auto;
  transition: clip-path 0.9s cubic-bezier(0.7, 0, 0.2, 1) 0.25s;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.site-footer__links a { text-decoration: none; }
.site-footer__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 599px) {
  .site-footer { flex-direction: column-reverse; align-items: center; text-align: center; }
  .site-footer__links { justify-content: center; }
}

/* ---------- Motion ---------- */
/* The logo settles in on load; the form and philosophy rise once as they
   enter. Everything is static under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Opening: the image unveils from the top while easing out of a slow zoom,
     then the logo and the philosophy rise into place one after another */
  .hero__media { animation: unveil 1.5s cubic-bezier(0.7, 0, 0.2, 1) both; }
  .hero__media img { animation: zoom-out 2.6s var(--ease) both; }
  .hero__logo { animation: settle 1.4s var(--ease) 0.7s both; }
  .philosophy > * { animation: settle 1.2s var(--ease) both; }
  .philosophy > :nth-child(1) { animation-delay: 0.9s; }
  .philosophy > :nth-child(2) { animation-delay: 1s; }
  .philosophy > :nth-child(3) { animation-delay: 1.1s; }
  .philosophy > :nth-child(4) { animation-delay: 1.2s; }

  /* On scroll the image drifts a little slower than the page */
  @supports (animation-timeline: scroll()) {
    .hero__media img {
      animation: zoom-out 2.6s var(--ease) both, drift linear both;
      animation-timeline: auto, scroll();
      animation-range: normal, 0 100vh;
    }
  }

  /* the hint arrives after the logo, then its arrow nudges downward */
  .scroll-hint:not(.is-hidden) { animation: hint-in 0.9s var(--ease) 1.2s both; }
  .scroll-hint__arrow { animation: nudge 2.2s var(--ease) 2s infinite; }

  .js .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }

  .brand-switch { animation: switch-in 0.9s var(--ease) 0.4s both; }
}

/* Reduced motion: no sliding or growing circle; the switch and wipe simply fade */
@media (prefers-reduced-motion: reduce) {
  .brand-switch__thumb { transition: none; }
  .brand-wipe { clip-path: none; opacity: 0; }
  .brand-wipe.is-on { clip-path: none; opacity: 1; transition: opacity 0.3s linear; }
}

@keyframes switch-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

@keyframes hint-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes nudge {
  0%, 60%, 100% { transform: none; }
  30% { transform: translateY(4px); }
}
@keyframes unveil {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}
@keyframes zoom-out {
  from { scale: 1.14; }
  to { scale: 1; }
}
@keyframes drift {
  to { translate: 0 22%; }
}
@keyframes settle {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
