/* ═══════════════════════════════════════════════════════════════
   Signature kit — the patterns award-winning sites are made of.
   Opt-in: a page loads signature.css + signature.js on top of theme.css.
   Tokens first (fluid type, rhythm, motion), then the patterns. Every
   pattern degrades to a static layout without JavaScript and respects
   prefers-reduced-motion. Colours come from theme.css variables.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Fluid type scale — a real display size on desktop, readable on a phone. */
  --fs-display: clamp(2.75rem, 1.2rem + 6.5vw, 7rem);
  --fs-h1:      clamp(2.25rem, 1.1rem + 4.5vw, 4.75rem);
  --fs-h2:      clamp(1.75rem, 1rem + 2.8vw, 3.25rem);
  --fs-h3:      clamp(1.25rem, 1rem + 1.1vw, 1.75rem);
  --fs-lead:    clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  --fs-body:    clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --fs-small:   0.875rem;
  --lh-display: 0.95;
  --lh-tight:   1.1;
  --lh-body:    1.6;
  --ls-display: -0.03em;
  --ls-caps:    0.14em;

  /* Rhythm — generous, consistent vertical space is most of the "premium" feeling. */
  --space-1: clamp(0.5rem, 0.4rem + 0.4vw, 0.75rem);
  --space-2: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
  --space-3: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  --space-4: clamp(4rem, 3rem + 4vw, 7rem);
  --space-5: clamp(6rem, 4rem + 8vw, 12rem);
  --container-xl: 1440px;
  --container-l:  1200px;
  --container-m:  880px;
  --gutter: clamp(1rem, 4vw, 3rem);

  /* Motion — one vocabulary for the whole page. */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:   0.35s;
  --dur-base:   0.8s;
  --dur-slow:   1.4s;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0.01s; --dur-base: 0.01s; --dur-slow: 0.01s; }
  .sig-marquee__track { animation: none !important; }
}

/* ── Type ───────────────────────────────────────────────────── */
.sig-display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); font-weight: 700; text-wrap: balance; }
.sig-h1      { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
.sig-h2      { font-size: var(--fs-h2); line-height: var(--lh-tight); letter-spacing: -0.015em; font-weight: 600; text-wrap: balance; }
.sig-h3      { font-size: var(--fs-h3); line-height: 1.25; font-weight: 600; }
.sig-lead    { font-size: var(--fs-lead); line-height: 1.5; max-width: 42ch; }
.sig-body    { font-size: var(--fs-body); line-height: var(--lh-body); max-width: 62ch; }
.sig-caps    { font-size: var(--fs-small); letter-spacing: var(--ls-caps); text-transform: uppercase; font-weight: 600; opacity: 0.7; }
.sig-serif   { font-family: var(--font-display, Georgia, "Times New Roman", serif); font-weight: 400; }

/* ── Layout ─────────────────────────────────────────────────── */
.sig-container   { width: min(100% - 2 * var(--gutter), var(--container-xl)); margin-inline: auto; }
.sig-container-l { width: min(100% - 2 * var(--gutter), var(--container-l)); margin-inline: auto; }
.sig-container-m { width: min(100% - 2 * var(--gutter), var(--container-m)); margin-inline: auto; }
.sig-section     { padding-block: var(--space-5); }
.sig-section--m  { padding-block: var(--space-4); }
.sig-grid        { display: grid; gap: var(--space-3); grid-template-columns: repeat(12, 1fr); }
/* Spans are set on the END line so an offset can move the START without losing the span. */
.sig-grid > [class*="sig-col-"] { grid-column: 1 / -1; }
@media (min-width: 860px) {
  .sig-grid > .sig-col-4 { grid-column: auto / span 4; } .sig-grid > .sig-col-5 { grid-column: auto / span 5; }
  .sig-grid > .sig-col-6 { grid-column: auto / span 6; } .sig-grid > .sig-col-7 { grid-column: auto / span 7; }
  .sig-grid > .sig-col-8 { grid-column: auto / span 8; }
  .sig-grid > .sig-offset-1 { grid-column-start: 7; }
}

/* ── Hero with a staged entrance ────────────────────────────── */
/* Lines of the headline, the lead and the actions arrive in sequence; the media fades in last. */
.sig-hero { min-height: 100svh; display: grid; align-content: center; position: relative; padding-block: calc(var(--nav-h, 72px) + var(--space-3)) var(--space-4); overflow: clip; }
.sig-hero__media { position: absolute; inset: 0; z-index: -1; }
.sig-hero__media img, .sig-hero__media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sig-hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55)); }
.sig-hero [data-stage] { opacity: 0; transform: translateY(28px); }
.sig-hero.is-ready [data-stage] { opacity: 1; transform: none; transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.sig-hero.is-ready [data-stage="2"] { transition-delay: .15s; }
.sig-hero.is-ready [data-stage="3"] { transition-delay: .3s; }
.sig-hero.is-ready [data-stage="4"] { transition-delay: .45s; }
.sig-hero.is-ready .sig-hero__media { animation: sig-fade var(--dur-slow) var(--ease-out) both; }
@keyframes sig-fade { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }

/* ── Reveal on scroll ───────────────────────────────────────── */
/* .sig-reveal moves up and fades; .sig-reveal--clip unmasks an image from the bottom;
   .sig-reveal--lines animates each line of a headline (signature.js splits them). */
.sig-reveal { opacity: 0; transform: translateY(32px); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.sig-reveal.is-visible { opacity: 1; transform: none; }
/* The clip sits on the CHILD: an observed element that is itself fully clipped never intersects. */
.sig-reveal--clip { opacity: 1; transform: none; }
.sig-reveal--clip > * { clip-path: inset(100% 0 0 0); transition: clip-path var(--dur-slow) var(--ease-inout); }
.sig-reveal--clip.is-visible > * { clip-path: inset(0 0 0 0); }
.sig-reveal--clip img { transform: scale(1.12); transition: transform calc(var(--dur-slow) * 1.4) var(--ease-out); }
.sig-reveal--clip.is-visible img { transform: none; }
.sig-reveal--lines { opacity: 1; transform: none; }
.sig-reveal--lines .sig-line { display: block; overflow: hidden; }
.sig-reveal--lines .sig-line > span { display: block; transform: translateY(110%); transition: transform var(--dur-base) var(--ease-out); }
.sig-reveal--lines.is-visible .sig-line > span { transform: none; }
.sig-reveal--lines.is-visible .sig-line:nth-child(2) > span { transition-delay: .08s; }
.sig-reveal--lines.is-visible .sig-line:nth-child(3) > span { transition-delay: .16s; }
.sig-reveal--lines.is-visible .sig-line:nth-child(4) > span { transition-delay: .24s; }
[data-stagger] > .sig-reveal:nth-child(2) { transition-delay: .1s; }
[data-stagger] > .sig-reveal:nth-child(3) { transition-delay: .2s; }
[data-stagger] > .sig-reveal:nth-child(4) { transition-delay: .3s; }
[data-stagger] > .sig-reveal:nth-child(5) { transition-delay: .4s; }
[data-stagger] > .sig-reveal:nth-child(6) { transition-delay: .5s; }

/* ── Sticky narrative ───────────────────────────────────────── */
/* Left column stays while the right column's steps scroll past it. */
.sig-sticky { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .sig-sticky { grid-template-columns: 5fr 7fr; }
  .sig-sticky__pin { position: sticky; top: calc(var(--nav-h, 72px) + var(--space-2)); align-self: start; }
}
.sig-sticky__step { padding-block: var(--space-3); border-top: 1px solid var(--glass-bd, rgba(255,255,255,.1)); }

/* ── Parallax media ─────────────────────────────────────────── */
.sig-parallax { overflow: clip; border-radius: var(--radius-lg, 24px); }
.sig-parallax img { width: 100%; height: 120%; object-fit: cover; display: block; will-change: transform; }

/* ── Marquee ────────────────────────────────────────────────── */
.sig-marquee { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.sig-marquee__track { display: inline-flex; gap: var(--space-3); padding-right: var(--space-3); animation: sig-marquee 28s linear infinite; }
.sig-marquee:hover .sig-marquee__track { animation-play-state: paused; }
@keyframes sig-marquee { to { transform: translateX(-50%); } }

/* ── Buttons with intent ────────────────────────────────────── */
.sig-btn { position: relative; display: inline-flex; align-items: center; gap: .6em; padding: .95em 1.6em; border-radius: 999px; font-weight: 600; text-decoration: none; overflow: hidden; isolation: isolate; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.sig-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--color-accent, #fff); transform: translateY(101%); transition: transform var(--dur-fast) var(--ease-out); }
.sig-btn:hover::before, .sig-btn:focus-visible::before { transform: none; }
.sig-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.sig-btn .sig-arrow { transition: transform var(--dur-fast) var(--ease-out); }
.sig-btn:hover .sig-arrow { transform: translateX(4px); }
.sig-magnetic { will-change: transform; }

/* ── Image treatment ────────────────────────────────────────── */
.sig-media { border-radius: var(--radius-lg, 24px); overflow: clip; }
.sig-media img { display: block; width: 100%; height: auto; transition: transform var(--dur-slow) var(--ease-out); }
.sig-media:hover img { transform: scale(1.03); }
.sig-duotone img { filter: saturate(.85) contrast(1.05); }

/* ── Numbers that count ─────────────────────────────────────── */
.sig-counter { font-variant-numeric: tabular-nums; font-size: var(--fs-h1); line-height: 1; letter-spacing: -0.02em; }

/* ── Page transition veil ───────────────────────────────────── */
.sig-veil { position: fixed; inset: 0; background: var(--color-bg, #000); z-index: 9999; transform: scaleY(1); transform-origin: top; pointer-events: none; }
html.is-loaded .sig-veil { transform: scaleY(0); transition: transform var(--dur-base) var(--ease-inout) .1s; }
html.is-leaving .sig-veil { transform: scaleY(1); transform-origin: bottom; transition: transform var(--dur-fast) var(--ease-inout); }

/* ── Cursor dot (desktop, pointer devices only) ─────────────── */
@media (hover: hover) and (pointer: fine) {
  .sig-cursor { position: fixed; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--color-accent, #fff); mix-blend-mode: difference; pointer-events: none; z-index: 10000; transform: translate(-50%, -50%); transition: width .25s, height .25s; }
  .sig-cursor.is-active { width: 44px; height: 44px; }
}

/* ═══════════════════════════════════════════════════════════════
   v2 — techniques of 2025–26 award sites. Static and readable without
   JavaScript; motion only when signature.js has loaded its vendors.
   ═══════════════════════════════════════════════════════════════ */

/* Lenis smooth scroll (from lenis.css). */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

/* Page transitions between pages of the same site (Chrome, Edge, Safari 18.2+; others just navigate). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: sig-vt-out .45s var(--ease-inout) both; }
  ::view-transition-new(root) { animation: sig-vt-in .6s var(--ease-out) both; }
}
@keyframes sig-vt-out { to { opacity: 0; transform: translateY(-2vh) scale(.985); } }
@keyframes sig-vt-in { from { opacity: 0; transform: translateY(3vh); } }

/* ── Kinetic type ───────────────────────────────────────────── */
/* Hidden only between script start and the split, never longer than 3 s. */
html.sig-js .sig-split:not(.is-split) { visibility: hidden; }
.sig-split { font-kerning: none; }
.sig-mega { font-size: clamp(3.5rem, 1rem + 13vw, 15rem); line-height: .86; letter-spacing: -0.045em; font-weight: 800; }
.sig-condensed { font-size: clamp(3rem, 1rem + 8vw, 9rem); line-height: .9; letter-spacing: -0.02em; font-weight: 300; }

/* ── Live WebGL background ──────────────────────────────────── */
.sig-shader { position: relative; isolation: isolate; overflow: clip; background-size: 200% 200%; }
.sig-shader__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }

/* ── Media that grows to full screen ────────────────────────── */
.sig-zoom { position: relative; height: 100svh; overflow: clip; display: grid; place-items: center; }
.sig-zoom__media { position: absolute; inset: 0; clip-path: inset(0); }
.sig-zoom__media > img, .sig-zoom__media > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sig-zoom__over { position: relative; z-index: 1; text-align: center; }

/* ── Horizontal section ─────────────────────────────────────── */
.sig-horizontal { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.sig-horizontal.is-pinned { overflow: clip; scroll-snap-type: none; }
.sig-horizontal__track { display: flex; gap: var(--space-3); width: max-content; padding-inline: var(--gutter); }
.sig-horizontal__track > * { flex: 0 0 auto; scroll-snap-align: start; }
.sig-horizontal.is-pinned { height: 100svh; display: flex; align-items: center; }

/* ── Scroll-scrubbed sequence ───────────────────────────────── */
.sig-sequence { position: relative; height: 100svh; overflow: clip; }
.sig-sequence > video, .sig-sequence__canvas, .sig-sequence > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sig-sequence [data-at] { position: absolute; z-index: 1; }

/* ── Self-drawing lines ─────────────────────────────────────── */
.sig-draw svg { overflow: visible; }
.sig-draw :is(path, line, polyline, circle, ellipse) { fill: none; stroke: currentColor; stroke-width: var(--sig-stroke, 1.25); vector-effect: non-scaling-stroke; }

/* ── Cinematic film sections ────────────────────────────────── */
/* The film stays full screen while captions scroll over it; the next film covers it. */
.sig-film { position: relative; min-height: 200svh; }
.sig-film > video, .sig-film > img { position: sticky; top: 0; width: 100%; height: 100svh; object-fit: cover; display: block; }
.sig-film__captions { position: relative; margin-top: -100svh; min-height: 200svh; display: grid; align-content: space-around; padding: var(--space-5) var(--gutter); color: #fff; }
.sig-film::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.3)); }

/* ── Stacking cards ─────────────────────────────────────────── */
.sig-stack { display: grid; gap: var(--space-3); }
.sig-stack__card { position: sticky; top: calc(var(--nav-h, 72px) + var(--space-2) + var(--i, 0) * 18px); transform-origin: 50% 0; will-change: transform; }

/* ── Cascading list ─────────────────────────────────────────── */
.sig-cascade { list-style: none; padding: 0; margin: 0; }

/* ── Tilt and float ─────────────────────────────────────────── */
.sig-tilt { transform-style: preserve-3d; will-change: transform; }
.sig-tilt [data-depth] { will-change: transform; }
.sig-float { animation: sig-float 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.37s); }
@keyframes sig-float { 50% { transform: translateY(-14px) rotate(1.5deg); } }

/* ── Self-demonstrating interface ───────────────────────────── */
.sig-ui { position: relative; }
.sig-ui [data-ui-step] { transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), background-color .35s, box-shadow .35s; }
.sig-ui:not(.is-static) [data-ui-step]:not(.is-on) { opacity: .35; }
html:not(.sig-js) .sig-ui [data-ui-step] { opacity: 1; }
.sig-ui__pointer { position: absolute; top: 0; left: 0; width: 22px; height: 22px; z-index: 5; pointer-events: none; }
.sig-type::after { content: "▍"; margin-left: 1px; animation: sig-caret 1s steps(1) infinite; opacity: .6; }
@keyframes sig-caret { 50% { opacity: 0; } }

/* ── Cursor with a label ────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
  .sig-cursor { display: grid; place-items: center; }
  .sig-cursor.has-label { width: 84px; height: 84px; mix-blend-mode: normal; color: var(--color-bg, #000); }
  .sig-cursor.has-label::after { content: attr(data-label); font-size: .75rem; font-weight: 600; letter-spacing: .04em; }
}

@media (prefers-reduced-motion: reduce) {
  .sig-float, .sig-type::after { animation: none; }
}

/* ── List with a picture following the pointer ──────────────── */
.sig-hoverlist { position: relative; }
.sig-hoverlist [data-img] { cursor: default; }
.sig-hoverlist__img { position: absolute; left: 0; top: 0; z-index: 3; width: clamp(180px, 20vw, 300px); aspect-ratio: 4 / 5; border-radius: 14px; background: center / cover no-repeat; pointer-events: none; opacity: 0; scale: .8; transition: opacity .3s var(--ease-out), scale .45s var(--ease-out); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.sig-hoverlist__img.is-on { opacity: 1; scale: 1; }

/* ── Immersive scene: one live background behind a long story ─ */
.sig-scene { position: relative; }
.sig-scene__bg { position: sticky; top: 0; height: 100svh; margin-bottom: -100svh; z-index: 0; }
.sig-scene__chapter { position: relative; z-index: 1; min-height: 100svh; display: grid; align-content: center; }
/* Line masks get room for ascenders and descenders: tight display line-heights clipped them. */
.sig-l-mask { padding-block: .12em .1em; margin-block: -.12em -.1em; }
