/* ===========================================================
   PENUMBRA — dark luxury product showcase
   =========================================================== */

:root {
  --bg-black: #0a0908;
  --bg-charcoal: #131210;
  --ink: #f2ede3;
  --ink-dim: #b8b0a2;
  --ink-faint: #6e675c;
  --brass: #c9a24b;
  --brass-bright: #e8c877;
  --line: rgba(242, 237, 227, 0.12);

  /* Garamond / Bahnschrift ship with Windows only; the rest of each stack is what
     iPhone, Mac and Android pick up (Baskerville + Palatino on Apple, SF / Roboto via system-ui). */
  --font-display: Garamond, 'EB Garamond', Baskerville, 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-body: Bahnschrift, 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--bg-black);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-black);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  cursor: default;
}

::selection { background: var(--brass); color: var(--bg-black); }

a { color: inherit; text-decoration: none; }

.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 400;
}

/* ===== Loader ===== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s var(--ease), visibility 1s var(--ease);
}
#loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-inner { width: min(360px, 70vw); text-align: center; }

.loader-brand {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.42em;
  color: var(--ink);
  margin-bottom: 2rem;
}

.loader-track {
  width: 100%;
  height: 1px;
  background: var(--line);
  position: relative;
}

#loader-bar {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 0%;
  background: var(--brass);
  transition: width 0.25s linear;
}

.loader-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.9rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ===== Header ===== */
/* A soft dark fade behind the header (instead of a colour-blend): the logo and links stay
   readable over any frame, and a title scrolling underneath never collides with them. */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.6rem 5vw 2.2rem;
  background: linear-gradient(to bottom, rgba(10, 9, 8, 0.86) 0%, rgba(10, 9, 8, 0.5) 55%, transparent 100%);
  pointer-events: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header a,
.site-header button { pointer-events: auto; }

.logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.34em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 2.4rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding-bottom: 3px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 1px;
  background: var(--ink);
  transition: width 0.4s var(--ease);
}

.nav-links a:hover::after { width: 100%; }

/* ===== Mobile menu ===== */
.menu-toggle {
  display: none; /* shown on phones only, where the top links are hidden */
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
}

.menu-toggle-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1px;
  background: currentColor;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.menu-toggle-bar:nth-child(1) { top: 18px; }
.menu-toggle-bar:nth-child(2) { top: 26px; }

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { top: 22px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { top: 22px; transform: rotate(-45deg); }

.menu-toggle:focus-visible { outline: 2px solid var(--brass-bright); outline-offset: 2px; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90; /* under the header, so the toggle stays on top to close it */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5.5rem 1rem 2rem; /* clear of the header */
  overflow-y: auto; /* a short screen (landscape, zoomed-in browser) scrolls instead of cutting entries */
  overscroll-behavior: contain;
  background: var(--bg-black);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }

/* auto margins centre the list when it fits, and let it start at the top (scrollable) when it doesn't */
.mobile-menu ul { list-style: none; text-align: center; margin: auto; }
.mobile-menu li + li { margin-top: clamp(0.5rem, 3.2vh, 1.6rem); }

.mobile-menu a {
  display: inline-block;
  padding: 0.3rem 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, min(9vw, 7vh), 2.6rem);
  letter-spacing: 0.02em;
  color: var(--ink);
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease), color 0.3s var(--ease);
}
.mobile-menu.is-open a { transform: none; opacity: 1; }
.mobile-menu.is-open li:nth-child(2) a { transition-delay: 0.07s; }
.mobile-menu.is-open li:nth-child(3) a { transition-delay: 0.14s; }
.mobile-menu a:active { color: var(--brass); }
.mobile-menu .menu-cta { color: var(--brass); }

.menu-index {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
}

html.menu-open { overflow: hidden; }

/* ===== Hero ===== */
.hero-standalone {
  position: relative;
  height: 100vh;
  height: 100svh; /* phones: don't jump when the URL bar slides away */
  width: 100%;
  background: var(--bg-black);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-standalone::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(201, 162, 75, 0.10), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
  pointer-events: none;
}

.hero-label {
  position: relative;
  margin-bottom: 1.6rem;
}

.hero-heading {
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(4.5rem, 14vw, 12.5rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.hero-word { display: inline-block; overflow: hidden; }
.hero-word:last-child { color: var(--brass); }

.hero-tagline {
  position: relative;
  margin-top: 1.6rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

.scroll-indicator {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-faint);
}

.scroll-indicator span {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.scroll-indicator svg { animation: bob 2.2s ease-in-out infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ===== Canvas ===== */
.canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
  clip-path: circle(0% at 50% 50%);
  background: var(--bg-black);
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== Marquee ===== */
.marquee-wrap {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 5; /* above the sections' mobile scrims, which would grey it out */
  width: 100%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
  text-align: center;
}

.marquee-text {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 3.8vw; /* the full line is ~23em wide, so this keeps it inside the viewport */
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 0 2px 18px rgba(10, 9, 8, 0.85), 0 1px 3px rgba(10, 9, 8, 0.9);
}

/* ===== Scroll container & sections ===== */
#scroll-container {
  position: relative;
  height: 900vh;
  width: 100%;
  z-index: 4;
  /* Sections slide in from off-screen; without this they widen the mobile
     layout viewport and push fixed elements (marquee, canvas) off-center. */
  overflow: hidden;
  overflow: clip; /* both axes: the last block may extend below the container, which would add dead scroll */
}

.scroll-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  pointer-events: none;
  transform: translateY(-50%);
}

.scroll-section .section-inner { pointer-events: auto; }

/* positionSections() sets --fit (<1) when a block would be taller than the screen */
.scroll-section .section-inner,
.scroll-section .stats-grid {
  transform: scale(var(--fit, 1));
  transform-origin: center center;
}

.align-left { padding-left: 6vw; padding-right: 55vw; justify-content: flex-start; }
.align-right { padding-left: 55vw; padding-right: 6vw; justify-content: flex-end; }

.align-left .section-inner,
.align-right .section-inner { max-width: 40vw; position: relative; }

/* Soft scrim behind the text block so it stays legible regardless of what
   the canvas frame behind it looks like at that scroll position. */
.align-left .section-inner::before,
.align-right .section-inner::before {
  content: "";
  position: absolute;
  inset: -4vh -3vw;
  background: radial-gradient(ellipse at center, rgba(10, 9, 8, 0.78) 0%, rgba(10, 9, 8, 0.5) 60%, transparent 85%);
  z-index: -1;
  pointer-events: none;
}

.section-content .section-label { margin-bottom: 1.4rem; }

.section-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 4.2vw, 4.4rem);
  line-height: 1.04;
  color: var(--ink);
  margin-bottom: 1.6rem;
}

.section-body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-dim);
  max-width: 34ch;
}

/* ===== Stats ===== */
.section-stats {
  justify-content: center;
}

.stats-grid {
  pointer-events: auto;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 0 8vw;
}

.stat {
  position: relative;
  text-align: center;
  border-left: 1px solid var(--line);
  padding-left: 1.6rem;
}

/* Same soft scrim as the text sections, so the white figures stay legible
   directly over the pen frame. */
.stat::before {
  content: "";
  position: absolute;
  inset: -3vh -1.5vw;
  background: radial-gradient(ellipse at center, rgba(10, 9, 8, 0.7) 0%, rgba(10, 9, 8, 0.4) 60%, transparent 85%);
  z-index: -1;
  pointer-events: none;
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  color: var(--ink);
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
  margin-left: 0.2rem;
}

.stat-label {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ===== CTA ===== */
.section-cta {
  justify-content: center;
  text-align: center;
}

.section-cta .section-inner { max-width: 44vw; margin: 0 auto; position: relative; }

/* Same soft scrim as the left/right text blocks, so the copy stays legible over the pen. */
.section-cta .section-inner::before {
  content: "";
  position: absolute;
  inset: -6vh -4vw;
  background: radial-gradient(ellipse closest-side at center, rgba(10, 9, 8, 0.78) 0%, rgba(10, 9, 8, 0.55) 60%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}
.section-cta .section-label { display: flex; justify-content: center; margin-bottom: 1.4rem; }
.section-cta .section-heading { }
.section-cta .section-body { margin: 0 auto 2.4rem; }

.cta-button {
  pointer-events: auto;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bg-black);
  background: var(--brass);
  border: 1px solid var(--brass);
  padding: 1.1rem 2.6rem;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), letter-spacing 0.4s var(--ease);
}

/* hover only where there is a real pointer: on touch it would stay "stuck" after a tap */
@media (hover: hover) {
  .cta-button:hover {
    background: transparent;
    color: var(--brass);
    letter-spacing: 0.28em;
  }
}

.cta-button:active {
  background: transparent;
  color: var(--brass);
}

.cta-button:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-indicator svg { animation: none; }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  /* Header: a soft dark fade instead of the blend mode, so the logo stays readable
     when a title scrolls underneath it. */
  .site-header {
    padding: calc(0.7rem + env(safe-area-inset-top)) max(6vw, env(safe-area-inset-right)) 1.6rem max(6vw, env(safe-area-inset-left));
  }
  .logo { font-size: 1rem; }
  .nav-links { display: none; }
  .menu-toggle { display: block; }

  #scroll-container { height: 560vh; }

  /* Hero: the wordmark stays on a single line */
  .hero-label { font-size: 0.75rem; letter-spacing: 0.3em; margin-bottom: 1.4rem; }
  .hero-heading { font-size: clamp(3rem, 14.5vw, 6.5rem); white-space: nowrap; }
  .hero-tagline { font-size: 1.15rem; padding: 0 8vw; text-wrap: balance; }
  .scroll-indicator { bottom: calc(2rem + env(safe-area-inset-bottom)); }
  .scroll-indicator span { font-size: 0.7rem; }

  .align-left, .align-right {
    padding: 0 7vw;
    justify-content: center;
    text-align: center;
  }

  .align-left .section-inner,
  .align-right .section-inner,
  .section-cta .section-inner {
    max-width: 100%;
    position: relative;
  }

  /* Soft scrim that hugs the text block (the previous full-height box showed its hard edges
     as dark rectangles sliding over the pen). */
  .align-left .section-inner::before,
  .align-right .section-inner::before,
  .section-cta .section-inner::before {
    content: "";
    position: absolute;
    inset: -9vh -9vw;
    z-index: -1;
    pointer-events: none;
    /* closest-side: the gradient reaches zero exactly at the box edge, so no visible border */
    background: radial-gradient(ellipse closest-side at center, rgba(10, 9, 8, 0.8) 0%, rgba(10, 9, 8, 0.66) 60%, transparent 100%);
  }

  .section-content .section-label,
  .section-cta .section-label { margin-bottom: 1.1rem; }
  .section-label { font-size: 0.75rem; }
  /* sizes follow the width and, on short screens, the height as well */
  .section-heading { font-size: clamp(1.5rem, min(9vw, 6.2vh), 2.6rem); margin-bottom: clamp(0.7rem, 2vh, 1.3rem); text-wrap: balance; }
  .section-body { margin: 0 auto; font-size: clamp(0.88rem, 2.3vh, 1.05rem); line-height: 1.6; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.2rem 1rem;
    padding: 0 7vw;
  }
  .stat { padding-left: 0.9rem; }
  .stat-number { font-size: clamp(2.6rem, 11.5vw, 3.4rem); }
  .stat-suffix { font-size: 1.25rem; }
  .stat-label { font-size: 0.75rem; letter-spacing: 0.12em; line-height: 1.45; }

  .section-cta .section-body { margin-bottom: clamp(1.1rem, 3.4vh, 2rem); }
  .cta-button { font-size: 0.8rem; padding: 1.15rem 2.2rem; min-height: 3.25rem; }

  /* Too narrow for one line: split the marquee over two, larger */
  .marquee-text { font-size: 7.5vw; line-height: 1.2; }
  .marquee-line { display: block; }
}

/* Tall screens: the product sits in the upper part of the screen and the text below it,
   so the closing marquee follows the text. */
@media (max-aspect-ratio: 4/5) {
  .marquee-wrap { top: 62%; }
}

/* Very small phones (iPhone SE, compact Androids) */
@media (max-width: 360px) {
  .section-body { font-size: 1rem; }
  .stats-grid { gap: 1.8rem 0.6rem; }
  .stat { padding-left: 0.6rem; }
  .stat-label { letter-spacing: 0.08em; }
  .cta-button { padding-left: 1.6rem; padding-right: 1.6rem; letter-spacing: 0.16em; }
}

/* Phones held sideways: very little height, so everything gets tighter */
@media (max-height: 520px) and (orientation: landscape) {
  .hero-heading { font-size: clamp(2.6rem, 9vw, 4.5rem); white-space: nowrap; }
  .hero-label { margin-bottom: 0.8rem; }
  .hero-tagline { margin-top: 0.8rem; font-size: 1rem; }
  .scroll-indicator { display: none; }
  .section-content .section-label { margin-bottom: 0.7rem; }
  .section-heading { font-size: clamp(1.5rem, 4.4vw, 2rem); margin-bottom: 0.8rem; }
  .section-body { font-size: 0.9rem; line-height: 1.5; max-width: 40ch; }
  .stat-number { font-size: clamp(1.8rem, 5vw, 2.6rem); }
  .stat-label { font-size: 0.68rem; }
  .section-cta .section-body { margin-bottom: 1.2rem; }
  .cta-button { padding: 0.8rem 1.8rem; min-height: 0; }
  .marquee-text { font-size: 3.6vw; }
  .marquee-line { display: inline; }
}
