/* websitegenie — paper-light editorial canvas
   Primary reference: Garden Eight (sculptural serif, monochrome restraint)
   Borrowed: Not Real (sharp media frame), Lusion (solid pill CTA) */

:root {
  --canvas: #ffffff;
  --header-h: 88px;       /* sticky header height — drives anchor offsets */
  /* Greek paper palette, sampled from the statue */
  --ink: #4d4537;          /* deep umber — small text, buttons */
  --paper: #8d7d62;        /* statue midtone — display headline */
  --ink-soft: rgba(77, 69, 55, 0.78);
  --hairline: rgba(77, 69, 55, 0.2);
  --ls-kicker: 0.18em;     /* kickers, counters, indices, stats */
  --ls-meta: 0.12em;       /* scope lines, caption metadata */
  --accent: #dc5648; /* reserved: live/status signals only */
  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
}

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

html, body { height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
section[id] { scroll-margin-top: var(--header-h); }

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

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.6s ease;
}

/* crushed state — the whole page flips with the statue; tokens swap once
   so every section shifts coherently */
body.crushed {
  background: #ddd3bf;
  --ink-soft: rgba(60, 52, 40, 0.85);
  --hairline: rgba(60, 52, 40, 0.28);
  /* darkened from #80715a — that pair sat below the 3:1 large-text
     threshold on the crushed background (#ddd3bf); #6f6149 clears it */
  --paper: #6f6149;
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(24px, 5vw, 72px);
  z-index: 10;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.6s ease;
}
body.crushed .site-header { background: rgba(221, 211, 191, 0.82); }

.brand {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.wordmark {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark sup { font-size: 9px; font-weight: 400; margin-left: 2px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.85;
}
.site-nav a:hover { opacity: 1; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 10px 18px; /* taller hit area — keeps the pill near 44px touch target */
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.25s ease, color 0.25s ease;
}
.pill:hover { background: var(--ink); color: var(--canvas); }

.pill.solid { background: var(--ink); color: var(--canvas); }
.pill.solid:hover { background: transparent; color: var(--ink); }

/* short label only swaps in on very narrow viewports (see 400px block) */
.pill .label-short { display: none; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  padding: 120px clamp(24px, 5vw, 72px) 48px;
  max-width: 1640px;
  margin: 0 auto;
}

.kicker {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.headline {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(38px, 4.8vw, 84px);
  line-height: 0.92;
  letter-spacing: -0.015em;
  text-wrap: balance;
  /* tracking compresses with grip via --squeeze (0..1) */
  --squeeze: 0;
}
.headline span {
  display: block;
  letter-spacing: calc(-0.015em - 0.045em * var(--squeeze));
  transform: scaleY(calc(1 - 0.06 * var(--squeeze)));
  transform-origin: left bottom;
}
.headline em { font-style: italic; font-weight: 500; color: var(--paper); }

/* crushed typography: the serif gets crushed into a raw condensed block,
   each line jolting as it lands */
body.crushed .headline {
  font-family: "Anton", var(--font-sans);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(36px, 4.6vw, 80px);
  line-height: 1.02;
  letter-spacing: 0.01em;
}
body.crushed .headline em {
  font-style: normal;
  color: var(--paper);
}
body.crushed .headline span {
  animation: jolt 0.5s cubic-bezier(0.22, 0.9, 0.3, 1.2) both;
}
body.crushed .headline span:nth-child(2) { animation-delay: 0.05s; }
body.crushed .headline span:nth-child(3) { animation-delay: 0.1s; }
@keyframes jolt {
  0% { transform: translateY(-14px) rotate(-1.2deg); }
  55% { transform: translateY(4px) rotate(0.6deg); }
  100% { transform: translateY(0) rotate(0); }
}

body.crushed .sub,
body.crushed .kicker { color: rgba(60, 52, 40, 0.7); }

.sub {
  margin-top: auto;
  padding-bottom: 8px;
  font-size: 15px;
  font-weight: 200;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 42ch;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 86, 72, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(220, 86, 72, 0); }
}

/* ---------- media ---------- */

/* statue top locks to the headline's cap height: both columns align to
   the row top, media offset by the kicker's height */
.hero-media {
  min-width: 0;
  align-self: start;
  margin-top: 8px;
}
/* copy column stretches the full hero height so the sub line can sit
   at the very bottom of the section */
.hero-copy {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.media-wrap {
  position: relative;
  width: fit-content;
  margin-inline: auto;
}

.media-frame {
  position: relative;
  aspect-ratio: 834 / 1112;
  height: min(78vh, 60vw);
  overflow: visible;
  /* keep vertical scroll native on touch while press-and-hold still works */
  touch-action: pan-y;
}

/* touch affordance for the crush interaction — hidden unless coarse pointer */
.media-hint {
  display: none;
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: opacity 0.4s ease;
}
@media (pointer: coarse) {
  .media-hint { display: block; }
}
.media-hint.is-hidden { opacity: 0; }

.media-frame canvas#origami {
  width: 100%;
  height: 100%;
  display: block;
  background: url("assets/poster.jpg") center / cover no-repeat;
  /* zoom past the footage's own margins so the face reads large */
  transform: scale(1.24);
  /* whites in the footage melt into the white page — no visible frame */
  mix-blend-mode: multiply;
  /* dissolve every edge so the footage floats on the page */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 88%, transparent 100%),
    linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 88%, transparent 100%),
    linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-composite: intersect;
}


/* camera preview — floats in the gap between copy and statue,
   lower third of the hero, never competing with her face */
.cam-wrap {
  position: absolute;
  bottom: 5%;
  left: 34%;
  width: 150px;
  height: 280px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  z-index: 5;
}
.cam-wrap.live { opacity: 1; transform: scale(1); }

.cam-preview {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  object-fit: cover;
  transform: scaleX(-1);
  border: 1px solid var(--hairline);
  background: #f4f4f4;
  box-shadow: 0 12px 32px rgba(30, 31, 31, 0.12);
}

/* red ring + dot light up while a hand is being tracked */
.track-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(30, 31, 31, 0.25);
  border: 2px solid #ffffff;
  transition: background 0.25s ease;
}
.cam-wrap.hand .track-dot {
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
.cam-wrap.hand .cam-preview {
  border: 2px solid var(--accent);
}

/* ---------- responsive ---------- */

/* crush/jolt motion is decorative — disable under reduced motion */
@media (prefers-reduced-motion: reduce) {
  body.crushed .headline span { animation: none; }
  .headline span { transform: none; }
  .cam-wrap.hand .track-dot { animation: none; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 110px;
    gap: 48px;
  }
  .hero-media { margin-top: 0; }
  .media-wrap { margin-left: 0; }
  .media-frame { height: min(48vh, 74vw); }
  /* milder zoom so the scaled canvas can't bleed past a 320px column */
  .media-frame canvas#origami { transform: scale(1.12); }
  /* hand tracking is unusable on small/touch devices — never show the feed */
  .cam-wrap { display: none; }
  /* keep Work/Studio reachable — never remove primary nav on mobile */
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 13px; }
}

@media (max-width: 640px) {
  /* the kicker is decorative metadata; dropping it keeps the header one line */
  .brand .kicker { display: none; }
  .site-header { padding: 14px 20px; }
  :root { --header-h: 72px; }
}

@media (max-width: 480px) {
  .hero {
    padding: 96px 20px 32px;
    min-height: auto;
    gap: 32px;
  }
  .hero-copy { align-self: start; }
  .sub { margin-top: 20px; }
  .headline { font-size: clamp(34px, 11vw, 44px); }
}

@media (max-width: 400px) {
  /* swap to the short pill label so nothing wraps at 320px */
  .pill .label-long { display: none; }
  .pill .label-short { display: inline; }
}
