/* =========================================================================
   OneMay — editorial product showcase
   Palette is driven by CSS custom properties (--bg / --fg / --accent),
   which app.js tweens with GSAP whenever the active product changes.
   ========================================================================= */

/* Registered so the vars interpolate smoothly even without GSAP (fallback). */
@property --bg     { syntax: '<color>'; inherits: true; initial-value: #C7B9A6; }
@property --fg     { syntax: '<color>'; inherits: true; initial-value: #26304A; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #8A2A34; }

:root {
  --bg: #C7B9A6;
  --fg: #26304A;
  --accent: #8A2A34;

  --edge-pad: clamp(20px, 3.2vw, 54px);
  --img-w: min(50vw, 620px);           /* portrait box width */
  --img-half: calc(var(--img-w) / 2);
  /* how far each name half tucks behind the image — a fraction of the IMAGE
     width, so it stays consistent on any screen size (never over-covers). */
  --name-tuck: calc(var(--img-w) * 0.2);
  --hair: color-mix(in srgb, var(--fg) 22%, transparent);
  --muted: color-mix(in srgb, var(--fg) 55%, transparent);
  --ease: cubic-bezier(0.7, 0, 0.2, 1);

  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
}

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

/* the [hidden] attr must win over our display utilities */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  /* palette vars are interpolated by GSAP (js/app.js), not CSS. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* anti-FOUC: hidden until JS reveals (JS also clears this as a failsafe) */
body.is-loading { opacity: 0; }

/* lock background scroll while a modal / detail view is open (mobile) */
body.modal-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ------------------------------------------------------------------ TOP BAR */
.topbar {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: clamp(16px, 2.2vw, 30px) var(--edge-pad);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(19px, 1.6vw, 26px);
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo-dot { color: var(--accent); }

.topbar-center { justify-self: center; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  letter-spacing: 0.14em;
  font-size: 13px;
  text-transform: uppercase;
}
.back-x { font-size: 19px; line-height: 1; opacity: 0.8; }
.back-label { border-bottom: 1px solid var(--fg); padding-bottom: 3px; }

.topbar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
}
.verify-btn,
.about-btn {
  letter-spacing: 0.14em;
  font-size: 13px;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease);
}
.verify-btn:hover,
.about-btn:hover { border-bottom-color: var(--fg); }

/* -------------------------------------------------------------------- STAGE */
.stage {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
}

/* --------------------------------------------------------------------- HERO */
.hero {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* big name — split down the middle: left half sits to the LEFT of the
   portrait (right-aligned to its edge), right half to the RIGHT. */
.hero-name {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.name-side { position: absolute; top: 0; bottom: 0; width: 0; }
/* tuck behind the image edge (relative to image width) so the two halves
   read as one word around it, consistently at any screen size */
.name-left  { right: calc(50% + var(--img-half) - var(--name-tuck)); }
.name-right { left:  calc(50% + var(--img-half) - var(--name-tuck)); }
.name-layer {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 10vw, 11rem);
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
  color: var(--fg);
  opacity: 0;
  text-transform: uppercase;
}
.name-left  .name-layer { right: 0; text-align: right; }
.name-right .name-layer { left: 0;  text-align: left; }

/* compact name for phones — sits above the portrait (see mobile rules) */
.name-mobile {
  display: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 7vw, 2.6rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.92;
  white-space: nowrap;
}

/* portrait — a fixed box; images are contained (transparent letterbox lets
   the name breathe on either side). */
.portrait {
  position: relative;
  z-index: 2;
  height: min(78vh, 880px);
  width: var(--img-w);
}
.p-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 30px 60px color-mix(in srgb, #000 30%, transparent));
}
.portrait-tag {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  z-index: 3;
}

/* neighbour previews */
.edge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(80px, 10vw, 160px);
  height: min(56vh, 520px);
  z-index: 2;
  overflow: hidden;
  opacity: 0.34;
  transition: opacity 0.5s var(--ease);
  border-radius: 4px;
}
.edge--prev { left: 0; }
.edge--next { right: 0; }
.edge:hover { opacity: 0.62; }
.edge-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.edge-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

/* see more — pill keeps it legible over any image; soft rounded corners */
.see-more {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 2.4vh, 30px);
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  border-radius: 999px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--fg) 22%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), gap 0.4s var(--ease);
}
.see-more:hover { transform: translateX(-50%) translateY(-2px); gap: 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); }
.see-more-plus { font-size: 15px; line-height: 1; opacity: 0.85; }

/* swipe hint — phones only; sits low INSIDE the portrait as a soft pill */
.swipe-hint {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  align-items: center;
  gap: 9px;
  z-index: 5;
  padding: 7px 15px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg);
}
.swipe-arrow { font-size: 20px; line-height: 1; display: inline-block; }
.swipe-arrow:first-child { animation: swipeL 1.7s var(--ease) infinite; }
.swipe-arrow:last-child  { animation: swipeR 1.7s var(--ease) infinite; }
@keyframes swipeL { 0%,100% { transform: translateX(0); opacity: 0.45; } 50% { transform: translateX(-5px); opacity: 1; } }
@keyframes swipeR { 0%,100% { transform: translateX(0); opacity: 0.45; } 50% { transform: translateX(5px);  opacity: 1; } }

/* ------------------------------------------------------------------- DETAIL */
.detail {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
  visibility: hidden;          /* hard-hidden unless open (no peeking) */
  pointer-events: none;
  padding: 0 var(--edge-pad);
}
.detail.open { visibility: visible; pointer-events: auto; }

.detail-meta {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 22px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
  max-width: 82vw;
  overflow: hidden;
}

.detail-frame {
  position: relative;
  /* no white card — the image sits directly on the themed background.
     Cap height so the picture is never cropped, and leave room for caption. */
  height: min(78vh, calc(100% - 86px));
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-img {
  height: 100%;
  max-height: 100%;
  width: auto;
  max-width: min(56vw, 720px);
  object-fit: contain;
  display: block;
  border-radius: 4px;
  box-shadow: 0 26px 64px color-mix(in srgb, #000 30%, transparent);
}
.detail-caption {
  position: absolute;
  bottom: -32px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--fg) 80%, transparent);
}

/* right-hand thumbnail rail */
.detail-rail {
  position: absolute;
  right: var(--edge-pad);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 4px;
}
.detail-rail::-webkit-scrollbar { width: 0; }
.thumb {
  width: 70px;
  height: 96px;
  overflow: hidden;
  opacity: 0.5;
  outline: 1px solid transparent;
  outline-offset: 3px;
  transition: opacity 0.35s var(--ease), outline-color 0.35s var(--ease);
  flex: none;
  border-radius: 3px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { opacity: 0.82; }
.thumb.active { opacity: 1; outline-color: var(--fg); }

/* ------------------------------------------------------------------- FOOTER */
.footer {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: clamp(18px, 3vw, 56px);
  padding: clamp(12px, 1.6vw, 22px) var(--edge-pad) clamp(16px, 2.2vw, 30px);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.footer-brand { flex: none; }
.footer-strong { font-weight: 600; letter-spacing: 0.14em; }
.footer-muted { color: var(--muted); letter-spacing: 0.14em; margin-top: 2px; }

.specs {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 2px clamp(16px, 2vw, 36px);
  align-items: end;
}
.specs .spec-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.specs .spec-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(15px, 1.15vw, 19px);
  letter-spacing: 0;
}
.footer-desc { color: var(--muted); max-width: 26ch; line-height: 1.45; align-self: flex-end; }

/* bottom-right cluster: pagination beside the links */
.footer-side {
  display: flex;
  align-items: flex-end;
  gap: clamp(18px, 2vw, 34px);
  flex: none;
}
.ticker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}
.ticker-marks { display: inline-flex; gap: 5px; align-items: center; }
.ticker-marks i {
  display: block;
  width: 1px;
  height: 12px;
  background: var(--fg);
  opacity: 0.3;
  transition: opacity 0.4s var(--ease), height 0.4s var(--ease);
}
.ticker-marks i.active { opacity: 1; height: 20px; }

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.footer-links a { position: relative; }
.footer-links a::after {
  content: "";
  position: absolute;
  left: auto; right: 0; bottom: -2px;
  width: 0; height: 1px;
  background: var(--fg);
  transition: width 0.35s var(--ease);
}
.footer-links a:hover::after { width: 100%; left: 0; right: auto; }

/* ------------------------------------------------------------------- ABOUT */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 92%, var(--fg));
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--edge-pad);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.about-overlay.open { opacity: 1; visibility: visible; }
/* shared close control for About + Verify modals — compact "CLOSE ×" */
.about-close,
.verify-close {
  position: absolute;
  top: clamp(16px, 2.2vw, 30px);
  right: var(--edge-pad);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.close-label { font-size: 11px; line-height: 1; }
/* the × glyph sits optically low next to uppercase text — nudge it up to center */
.close-x { font-size: 19px; line-height: 1; transform: translateY(-1.5px); }

.about-inner { max-width: 720px; }
.about-kicker { letter-spacing: 0.24em; text-transform: uppercase; font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.about-head { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 4vw, 52px); line-height: 1.08; letter-spacing: -0.01em; }
.about-body { margin-top: 24px; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.6; max-width: 54ch; color: var(--muted); }
.about-lead { margin-top: 20px; font-size: clamp(15px, 1.3vw, 19px); line-height: 1.5; }
.about-contact { margin-top: 34px; }
.about-contact-note { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.about-contact a { font-size: clamp(15px, 1.3vw, 19px); border-bottom: 1px solid var(--fg); }

/* ------------------------------------------------------------ VERIFY MODAL */
.verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 93%, var(--fg));
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--edge-pad);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.verify-overlay.open { opacity: 1; visibility: visible; }
/* .verify-close is styled by the shared `.about-close, .verify-close` rule */
.verify-inner { width: min(560px, 100%); text-align: left; }
.verify-kicker { letter-spacing: 0.24em; text-transform: uppercase; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.verify-head { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 4vw, 46px); line-height: 1.05; letter-spacing: -0.01em; }
.verify-sub { margin-top: 16px; font-size: clamp(14px, 1.1vw, 16px); line-height: 1.55; color: var(--muted); max-width: 46ch; }

.verify-form {
  margin-top: 30px;
  display: flex;
  gap: 14px;
  align-items: stretch;
  flex-wrap: wrap;
}
.verify-input {
  flex: 1 1 220px;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid color-mix(in srgb, var(--fg) 45%, transparent);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 8px 4px;
  outline: none;
  transition: border-color 0.35s var(--ease);
}
.verify-input::placeholder { color: color-mix(in srgb, var(--fg) 28%, transparent); letter-spacing: 0.28em; }
.verify-input:focus { border-bottom-color: var(--fg); }
.verify-submit {
  flex: 0 0 auto;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.verify-submit:hover { transform: translateY(-2px); }
.verify-submit[disabled] { opacity: 0.5; pointer-events: none; }

.verify-result {
  margin-top: 26px;
  padding: 18px 20px;
  border-radius: 10px;
  border-left: 3px solid currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
  font-size: 15px;
  line-height: 1.5;
}
.verify-result .vr-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.01em; margin-bottom: 4px; }
.verify-result .vr-sub { opacity: 0.85; font-size: 13px; }
.verify-result.is-first   { color: #2f7d52; }   /* genuine · first  — green  */
.verify-result.is-again   { color: #c9741f; }   /* genuine · repeat — orange */
.verify-result.is-invalid { color: #b23b3b; }   /* not found        — red    */

.verify-note { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* --------------------------------------------------------------- RESPONSIVE */
@media (max-width: 900px) {
  /* the page SCROLLS on phones so the footer specs are always reachable */
  html, body { height: auto; }
  body { overflow-x: hidden; overflow-y: auto; min-height: 100dvh; }

  .stage {
    flex: none;                 /* height driven by content, not forced full-screen */
    overflow: visible;
    touch-action: pan-y;        /* vertical = native scroll, horizontal = product swipe */
  }

  /* hero flows in the document (was absolute) and stacks vertically */
  .hero {
    position: relative;
    inset: auto;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 14px 0 22px;
  }
  .portrait { width: min(82vw, 460px); height: min(56vh, 520px); flex: none; }
  .name-side { display: none; }                       /* no room to flank on phones */
  .name-mobile { display: block; width: min(82vw, 460px); text-align: center; }
  .see-more { position: static; transform: none; left: auto; bottom: auto; }
  .see-more:hover { transform: translateY(-2px); }
  .swipe-hint { display: flex; }                       /* shown low inside the image */
  .edge { display: none; }

  /* detail covers the viewport when open, independent of page scroll */
  .detail { position: fixed; }

  .footer {
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px 20px;
    font-size: 11px;
  }
  .footer-desc { display: none; }        /* drop the tagline when space is tight */
  .detail-rail { right: 6px; }
  .thumb { width: 52px; height: 72px; }
  .detail-img { max-width: 68vw; }
  .detail-frame { height: min(66vh, 560px); }
}

/* phone portrait — compact info bar */
@media (max-width: 560px) {
  .footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 16px;
  }
  .footer-strong { font-size: 11px; }
  .footer-muted { font-size: 10px; }
  .specs {
    grid-template-columns: repeat(5, 1fr);
    gap: 2px 8px;
    margin-top: 10px;
  }
  .specs .spec-label { font-size: 8px; letter-spacing: 0.08em; }
  .specs .spec-value { font-size: 13px; }
  .footer-desc { display: none; }          /* keep the phone bar minimal */
  .footer-side {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .footer-links { flex-direction: row; gap: 12px; font-size: 10px; }
  .ticker { font-size: 11px; gap: 8px; }
  .ticker-marks { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
