/* ==========================================================================
   GAMPHACE — Design System
   Palette sampled directly from the client's approved layout mockup.
   ========================================================================== */

:root {
  /* ---- Core neutrals ---- */
  --ink:            #111111;
  --ink-soft:       #1C1C1C;
  --ink-70:         rgba(17, 17, 17, 0.70);
  --ink-45:         rgba(17, 17, 17, 0.55);
  --ink-12:         rgba(17, 17, 17, 0.12);
  --ink-06:         rgba(17, 17, 17, 0.06);

  --bone:           #F7F5F3;
  --bone-deep:      #EFEBE7;
  --paper:          #FFFFFF;

  /* ---- Brand rose ----
     Sampled from the mockup CTA as #C65873. That exact value fails WCAG AA
     for small text (3.83:1 on bone) and for white labels on a rose button
     (4.16:1), so the working token is darkened three steps along the same
     hue to #B8425F — 4.85:1 and 5.27:1. The original sits in --rose-brand
     for large decorative fills where contrast rules don't bite. */
  --rose:           #B8425F;
  --rose-brand:     #C65873;
  --rose-deep:      #98354E;
  --rose-soft:      #D9909F;
  --rose-mist:      #F0DCDE;
  --rose-wash:      #FAF1F1;

  /* ---- Supporting ---- */
  --concrete:       #B2A495;
  --sand:           #D8CDC1;

  /* ---- Semantic ---- */
  --bg:             var(--bone);
  --fg:             var(--ink);
  --rule:           var(--ink-12);
  --accent:         var(--rose);

  /* ---- Type ---- */
  --font-display: "Anton", "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --step--1: clamp(0.78rem, 0.76rem + 0.10vw, 0.84rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
  --step-1:  clamp(1.15rem, 1.08rem + 0.35vw, 1.40rem);
  --step-2:  clamp(1.45rem, 1.30rem + 0.75vw, 2.00rem);
  --step-3:  clamp(1.95rem, 1.60rem + 1.75vw, 3.25rem);
  --step-4:  clamp(2.40rem, 1.80rem + 3.00vw, 4.60rem);
  --step-5:  clamp(2.90rem, 1.90rem + 4.60vw, 6.00rem);

  /* ---- Space ---- */
  --gutter: clamp(1.15rem, 0.70rem + 2.2vw, 3.75rem);
  --section-y: clamp(3.75rem, 2.20rem + 7vw, 8.50rem);
  --measure: 62ch;
  --max: 1560px;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 220ms;
  --dur: 480ms;
  --dur-slow: 900ms;

  --shadow-sm: 0 1px 2px rgba(17,17,17,.05), 0 2px 8px rgba(17,17,17,.04);
  --shadow-md: 0 4px 12px rgba(17,17,17,.07), 0 18px 40px rgba(17,17,17,.07);
  --shadow-lg: 0 8px 24px rgba(17,17,17,.09), 0 32px 80px rgba(17,17,17,.10);

  --header-h: 76px;
}

@media (max-width: 860px) { :root { --header-h: 62px; } }

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute must win over any display value, including inline
   styles on flex/grid containers. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; background: var(--bone-deep); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--rose); color: #fff; }

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: 940px; }
.wrap--text   { max-width: 760px; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.55); }
.section--dark { background: var(--ink); color: var(--bone); }
.section--dark .eyebrow { color: var(--rose-soft); }
.section--rose { background: var(--rose-wash); }
.section--paper { background: var(--paper); }

.stack > * + * { margin-top: var(--stack-gap, 1rem); }

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 200;
  background: var(--ink); color: #fff;
  padding: .8rem 1.2rem; border-radius: 4px;
  font-size: var(--step--1); font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* ==========================================================================
   Type helpers
   ========================================================================== */

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose);
  margin: 0 0 1rem;
}

.display-xl { font-size: var(--step-5); }
.display-l  { font-size: var(--step-4); }
.display-m  { font-size: var(--step-3); }
.display-s  { font-size: var(--step-2); }

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-70);
  max-width: var(--measure);
}
.section--dark .lede { color: rgba(247,245,243,.72); }

.muted { color: var(--ink-45); }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  --btn-bd: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1rem 2rem;
  min-height: 48px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--rose  { --btn-bg: var(--rose); --btn-bd: var(--rose); }
.btn--rose:hover { --btn-bg: var(--rose-deep); --btn-bd: var(--rose-deep); }

.btn--light { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; }
.btn--light:hover { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }

.btn--outline { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--ink); }
.btn--outline:hover { --btn-bg: var(--ink); --btn-fg: #fff; }

.btn--ghost-light { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.55); }
.btn--ghost-light:hover { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; }

.btn--block { width: 100%; }
.btn--sm { padding: .7rem 1.3rem; min-height: 40px; font-size: .72rem; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45; pointer-events: none;
}

.link-underline {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding-bottom: 3px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--dur) var(--ease-out);
}
.link-underline:hover { background-size: 0% 1px; background-position: 100% 100%; }

/* ==========================================================================
   Scroll-reveal animation system
   ========================================================================== */

/* Reveal states only apply once JS has confirmed it is running (html.js).
   Without that guard a JS failure — or an ES-module block on file:// — would
   leave the whole page at opacity 0 and looking broken. */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal="fade"]  { transform: none; }
.js [data-reveal="left"]  { transform: translate3d(-32px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(32px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(1.04); }

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Masked line-by-line headline reveal */
.reveal-lines { display: block; }
.reveal-lines .line { display: block; overflow: hidden; }
.js .reveal-lines .line > span {
  display: block;
  transform: translate3d(0, 105%, 0);
  transition: transform 1000ms var(--ease-out);
  transition-delay: var(--line-delay, 0ms);
}
.js .reveal-lines.is-in .line > span { transform: none; }

/* Image "curtain" reveal */
.img-reveal { position: relative; overflow: hidden; }
.js .img-reveal > img { transform: scale(1.12); transition: transform 1400ms var(--ease-out); }
.js .img-reveal.is-in > img { transform: scale(1); }
.js .img-reveal::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--bone);
  transform-origin: bottom;
  transition: transform 1100ms var(--ease-out);
}
.js .img-reveal.is-in::after { transform: scaleY(0); }

/* When the page loaded in a background tab the reveal transitions never run,
   so they are switched off and the content is simply shown. */
.no-reveal-anim [data-reveal],
.no-reveal-anim .reveal-lines .line > span,
.no-reveal-anim .img-reveal > img { transition: none !important; }
.no-reveal-anim .img-reveal::after { display: none !important; }

/* Hero entrance.
   Deliberately animates TRANSFORM ONLY and never opacity. Above-the-fold
   calls-to-action must be visible and clickable even if the animation never
   runs — which is exactly what happens when a page loads in a background tab,
   where CSS transitions are paused until the tab is brought to the front. */
.hero-rise {
  animation: heroRise 800ms var(--ease-out) both;
  animation-delay: var(--rise-delay, 0ms);
}
@keyframes heroRise {
  from { transform: translate3d(0, 22px, 0); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-rise { animation: none; }
}

/* Counting numerals */
.tabular { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .reveal-lines .line > span { transform: none !important; }
  .img-reveal::after { display: none; }
  .img-reveal > img { transform: none !important; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.center { text-align: center; }
.center .lede { margin-inline: auto; }

.grid { display: grid; gap: var(--grid-gap, 1.5rem); }
.flex { display: flex; }
.aspect-portrait { aspect-ratio: 3 / 4; }
.aspect-tall { aspect-ratio: 4 / 5; }
.aspect-wide { aspect-ratio: 16 / 9; }
.object-cover { width: 100%; height: 100%; object-fit: cover; }
