/* Relling — shared site chrome. Load AFTER tokens.css + base.css, BEFORE page styles.
   Single source for: nav, buttons, section scaffolding, hero atmosphere,
   reveals, CTA card, footer. Page-specific layout stays in each page. */

/* mobile layout-viewport guard: an element poking past the right edge would
   otherwise EXPAND the layout viewport on phones (body overflow-x alone does
   not prevent it) and the fixed nav then renders wider than the screen */
html { overflow-x: clip; }

/* ---- Grounded nav: one flat full-width bar (logo + links) + deploy button ---- */
.nav-dock { position: fixed; top: 0; left: 0; right: 0; z-index: 300; pointer-events: none; --navh: 55px; }
/* the bar itself: a constant full-width frosted strip with a bottom hairline,
   pinned to the top so it never grows when a mega-menu drops below it */
.nav-dock::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: var(--navh); background: var(--nav-bg); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); border-bottom: var(--hairline) solid var(--border); pointer-events: none; z-index: -1; }
.nav-bar { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--margin); display: flex; align-items: flex-start; gap: 16px; }
.nav-logo { pointer-events: auto; display: inline-flex; align-items: center; }
/* nav shows the Ξ mark only — the "Relling" wordmark text is dropped here */
.nav-logo .wordmark { width: 24px; height: 28px; -webkit-mask-image: url('/assets/img/mark.svg'); mask-image: url('/assets/img/mark.svg'); }
.pill { pointer-events: auto; background: var(--nav-bg); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); border: var(--hairline) solid var(--border); border-radius: 14px; box-shadow: var(--nav-shadow); -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
/* both pills share one fixed height — stretch + content sizing can disagree by a
   pixel across browsers/zoom, which reads as the deploy button being bigger */
.navbar-pill { flex: 1; display: inline-flex; align-items: center; justify-content: space-between; gap: clamp(24px, 3vw, 40px); padding: 0 24px; height: 54px; }
.navbar-links { display: inline-flex; align-items: center; gap: clamp(20px, 2.5vw, 28px); }
.navbar-pill a { display: inline-flex; align-items: center; align-self: stretch; font-size: 13px; letter-spacing: 0.08em; color: var(--text-2); transition: color .3s var(--ease); white-space: nowrap; }
.navbar-pill a:hover, .navbar-pill a[aria-current] { color: var(--text); }
/* deploy is no longer a pill: a compact solid-amber button, top-aligned so it
   stays in the bar while the links' mega-menu expands the row below it */
.deploy-pill { display: inline-flex; align-items: center; height: 36px; margin-top: 9px; padding: 0 18px; font-size: 13px; letter-spacing: 0.06em; font-weight: 500; border: 0; border-radius: 8px; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--signal); color: var(--on-signal); transition: background .3s var(--ease), transform .3s var(--ease); white-space: nowrap; }
.deploy-pill:hover, .deploy-pill[aria-current] { background: var(--signal-hi); }

/* ---- Nav dropdowns: the pill itself expands downward (linear motion) ---- */
/* the pill becomes a column: nav row on top, expansion rows beneath. Radius is
   fixed at half the closed height so the collapsed state still reads as a pill
   and the open state morphs into a rounded panel. */
/* closed: transparent, only the full-width bar strip shows (flat, grounded).
   open: lifts into a floating card hung under the bar. */
.navbar-pill { flex-direction: column; align-items: stretch; height: auto; padding: 0; gap: 0; border-radius: 12px; background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.navbar-pill.expanded { background: linear-gradient(var(--nav-bg), var(--nav-bg)), rgb(252, 253, 254); border-color: var(--border); box-shadow: var(--nav-shadow); }
.navbar-row { display: flex; align-items: center; justify-content: space-between; gap: clamp(24px, 3vw, 40px); padding: 0 24px; height: 54px; }
/* chevron marks links that expand the bar */
.nav-link[data-drop]::after { content: ""; width: 5px; height: 5px; margin: -3px 0 0 7px; flex-shrink: 0;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: 0.45; transition: transform .4s var(--ease); }
.nav-link.drop-open::after { transform: rotate(225deg) translate(-2px, -2px); }
/* expansion rows: 0fr -> 1fr, clipped — the bar grows straight down with the
   expo-out house curve; the content settles in a beat behind the bar, which is
   what keeps the motion from reading as a mechanical slide */
/* visibility keeps collapsed links out of the tab order (no invisible focus
   stops) — delayed on close so it doesn't cut the collapse animation */
.nav-expand { display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .5s var(--ease), visibility 0s linear .5s; }
.nav-expand.open { grid-template-rows: 1fr; visibility: visible;
  transition: grid-template-rows .5s var(--ease), visibility 0s; }
.nav-expand-clip { overflow: hidden; min-height: 0; }
.nav-expand-in { margin: 0 14px; padding: 8px 10px 14px; border-top: var(--hairline) solid var(--border);
  opacity: 0; transform: translateY(-10px);
  transition: opacity .25s var(--ease-soft), transform .5s var(--ease); }
.nav-expand.open .nav-expand-in { opacity: 1; transform: none;
  transition: opacity .45s var(--ease-soft) .06s, transform .5s var(--ease); }
.nav-drop-eyebrow { display: block; padding: 8px 12px 4px; font-family: var(--sub); font-weight: 600;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute); }
/* link rows — override the pill-wide anchor styling */
.navbar-pill .nav-expand a { display: block; align-self: auto; padding: 8px 12px; border-radius: 8px;
  letter-spacing: 0; white-space: normal; transition: background .25s var(--ease-soft); }
.nav-expand a:hover { background: var(--hover); }
.nav-expand a b { display: block; font-family: var(--grotesk); font-weight: 500; font-size: 13.5px;
  letter-spacing: -0.01em; color: var(--text); }
.nav-expand a span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--text-mute); }
/* layouts: section references flow in columns; the library is two groups */
.nav-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 14px; }
.nav-cols-ind { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .nav-cols-ind { grid-template-columns: repeat(3, 1fr); } }

/* hamburger (phone only) */
.nav-burger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 44px; height: 44px; margin-right: -10px; padding: 0; background: none; border: 0; cursor: pointer; pointer-events: auto; }
.nav-burger span { width: 18px; height: 1.6px; background: var(--text); border-radius: 1px;
  transition: transform .45s var(--ease), opacity .25s var(--ease); }
.nav-burger.open span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }
.nav-menu { display: none; }
.nav-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }

@media (max-width: 600px) {
  /* phone nav: full-bleed bar, wordmark + hamburger + DEPLOY */
  .nav-dock { --navh: 53px; }
  .nav-bar { padding: 0 12px; gap: 8px; }
  .navbar-pill { border-radius: 12px; min-width: 0; }
  .navbar-row { padding: 0 18px; gap: 12px; height: 52px; }
  .nav-logo .wordmark { width: 22px; height: 26px; }
  .navbar-links { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-menu { display: grid; }
  .nav-menu-in { display: flex; flex-direction: column; padding: 4px 8px 10px; }
  .navbar-pill .nav-menu-in a { font-family: var(--grotesk); font-weight: 500; font-size: 17px;
    letter-spacing: -0.01em; padding: 13px 12px; border-radius: 8px; color: var(--text); }
  .navbar-pill .nav-menu-in a[aria-current] { color: var(--signal-text); }
  .deploy-pill { padding: 0 14px; height: 36px; margin-top: 8px; font-size: 12px; letter-spacing: 0.05em; }
}
@media (max-width: 920px), (hover: none) {
  /* no hover surface — the top-level links just navigate */
  .nav-expand:not(.nav-menu) { display: none; }
  .nav-link[data-drop]::after { display: none; }
}

/* ---- Live dot (the one place cyan moves) ---- */
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--signal); display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 55%, transparent); animation: dot-pulse 2.6s infinite;
}
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 45%, transparent); }
  70% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--signal) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 0%, transparent); }
}

/* ---- Kicker ---- */
.kicker { display: inline-flex; align-items: center; gap: var(--space-sm); color: var(--signal-text); }
.kicker .dia { font-size: 9px; opacity: 0.8; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sub); font-size: 12px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 13px 22px; border: var(--hairline) solid var(--border-strong); color: var(--text);
  background: none; cursor: pointer;
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease);
}
.btn:hover { border-color: var(--text); transform: translateY(-2px); }
.btn--primary { background: var(--signal); border-color: var(--signal-text); color: var(--on-signal); }
.btn--primary:hover { background: var(--signal-hi); border-color: var(--signal-hi); color: var(--on-signal-hi); box-shadow: 0 8px 24px color-mix(in srgb, var(--signal) 28%, transparent); }
.btn--ghost { border: none; padding-inline: 0; color: var(--text-2); }
.btn--ghost:hover { color: var(--signal-text); transform: translateX(3px); }

/* ---- Section scaffolding ---- */
.section { padding: var(--section) 0; }
@media (max-width: 600px) {
  .section { padding-block: clamp(48px, 9vw, 64px); }
  .section-head { margin-bottom: var(--space-3xl); }
  /* manual headline breaks are desktop composition — let phones wrap naturally */
  .section-head h1 br, .section-head h2 br, .cta-inner h2 br { display: none; }
}
.section--alt { background: var(--surface); }
.section[data-theme="dark"], .section--alt[data-theme="dark"] { background: var(--bg); color: var(--text); }
.section-head { max-width: 60ch; margin-bottom: var(--space-4xl); }
.section-head .eyebrow { display: flex; align-items: baseline; gap: var(--space-md); margin-bottom: var(--space-lg); }
.eyebrow { display: flex; align-items: baseline; gap: var(--space-md); }
.section-num { font-family: var(--sub); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; color: var(--signal-text); }

/* ---- Head split: section head + side image ---- */
.head-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(40px, 5vw, 88px); align-items: center; margin-bottom: var(--space-4xl); }
.head-split .section-head { margin-bottom: 0; }
.head-img { border-radius: var(--radius-card); overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); }
.head-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 920px) {
  .head-split { grid-template-columns: 1fr; gap: var(--space-3xl); }
}

/* ---- Hero atmosphere: aura orbs ---- */
.hero-aura { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(74px); will-change: transform, filter; -webkit-backface-visibility: hidden; backface-visibility: hidden; transform: translate3d(0, 0, 0); }
.orb-n1  { width: 50vw; height: 50vw; right: -10vw; top: -16vw; background: radial-gradient(circle at 40% 40%, rgba(255,255,255,0.06), rgba(255,255,255,0) 68%); animation: drift1 30s ease-in-out infinite alternate; }
.orb-n2  { width: 38vw; height: 38vw; left: -8vw; bottom: -20vw; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05), rgba(255,255,255,0) 70%); animation: drift2 36s ease-in-out infinite alternate; }
.orb-sig { width: 32vw; height: 32vw; right: 8vw; top: 8vw; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--signal) 14%, transparent), transparent 70%); animation: drift3 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(-4vw, 5vw, 0) scale(1.10); } }
@keyframes drift2 { to { transform: translate3d(5vw, -4vw, 0) scale(1.12); } }
@keyframes drift3 { to { transform: translate3d(-6vw, 6vw, 0) scale(1.18); } }

/* ---- Hero grid: faint base + cursor-revealed spotlight ---- */
.hero-gridfx, .hero-gridfx-spot { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--border-strong) 1px, transparent 1px), linear-gradient(90deg, var(--border-strong) 1px, transparent 1px);
  background-size: 52px 52px; }
.hero-gridfx { opacity: 0.18;
  -webkit-mask: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.5) 55%, transparent 85%);
          mask: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.5) 55%, transparent 85%); }
/* cursor-follow grid spotlight removed — was distracting on hover */
.hero-gridfx-spot { display: none; }

/* ---- Scroll reveals ---- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .85s cubic-bezier(.16,1,.3,1), transform .85s cubic-bezier(.16,1,.3,1); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }
.reveal.stagger { opacity: 1; transform: none; }
.reveal.stagger > * { opacity: 0; transform: translateY(10px); transition: opacity .55s ease, transform .55s ease; }
.reveal.stagger.in > * { opacity: 1; transform: none; }
.reveal.stagger.in > *:nth-child(1){transition-delay:.04s}.reveal.stagger.in > *:nth-child(2){transition-delay:.09s}
.reveal.stagger.in > *:nth-child(3){transition-delay:.14s}.reveal.stagger.in > *:nth-child(4){transition-delay:.19s}
.reveal.stagger.in > *:nth-child(5){transition-delay:.24s}.reveal.stagger.in > *:nth-child(6){transition-delay:.29s}

/* ---- CTA band: near-full-width black card ---- */
/* the band hugs the same inset as the section panels so the card matches their
   width — margin (not padding) so the gap collapses with section margins and
   reads identical to the section-to-section spacing */
.cta-band { background: var(--surface); padding: 0 clamp(10px, 1.4vw, 22px) clamp(14px, 2vh, 24px); margin-block: clamp(14px, 2vh, 24px) 0; }
.cta-band .wrap { max-width: none; padding-inline: 0; }
.cta-band[data-theme="dark"] { background: transparent; color: var(--text); }
.cta-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: stretch; gap: clamp(28px, 4vw, 64px); background: #16181b; border-radius: var(--radius-panel); overflow: hidden; padding: clamp(32px, 4.5vw, 60px); }
.cta-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.cta-copy h2 { margin: var(--space-md) 0 0; max-width: 15ch; }
.cta-lede { margin: var(--space-xl) 0 0; max-width: 52ch; font-family: var(--grotesk); font-weight: 400; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.62; color: var(--text-2); text-wrap: pretty; }
.cta-actions { margin-top: clamp(28px, 3.5vw, 44px); display: flex; align-items: center; gap: var(--space-xl); flex-wrap: wrap; }
.cta-figure { position: relative; border-radius: var(--radius-card); overflow: hidden; min-height: 240px; }
.cta-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 96%); }
.cta-figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, #16181b 0%, rgba(22,24,27,0.5) 32%, transparent 64%); }
@media (max-width: 760px) {
  .cta-inner { grid-template-columns: 1fr; }
  .cta-figure { min-height: 168px; order: -1; }
  .cta-figure img { -webkit-mask-image: linear-gradient(to bottom, #000 42%, transparent 100%); mask-image: linear-gradient(to bottom, #000 42%, transparent 100%); }
  .cta-figure::after { background: none; }
}

/* ---- Footer: full-bleed wordmark + base rail, reveal-on-scroll ---- */
.page-flow { position: relative; z-index: 1; background: var(--bg); }
/* footer height sets where the CTA card rests at maximal scroll — keep it
   tight enough that the card's top clears the fixed nav pill (~78px + air) */
footer { position: sticky; bottom: 0; z-index: 0; background: var(--bg); padding: clamp(40px, 5.5vh, 72px) 0 0; }
/* the sign is CROPPED, not scaled: full-bleed width, ~68% of its natural
   height, mask anchored top — the wordmark peeks instead of towering
   (the full-height sign made the footer ~500px of watermark on desktop) */
.foot-sign { width: 100%; height: clamp(96px, 24vw, 346px); background: var(--border-strong);
  -webkit-mask: url('/assets/img/word-v4.svg') no-repeat top center / 100% auto;
          mask: url('/assets/img/word-v4.svg') no-repeat top center / 100% auto; opacity: 0.5; }
/* rail above the sign: icon mark + site map / signature, then a faint rule */
.foot-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-lg) var(--space-3xl); }
.foot-mark { width: 30px; height: 35px; background: var(--text-2); opacity: 0.85; transition: opacity .3s var(--ease);
  -webkit-mask: url('/assets/img/mark.svg') no-repeat center / contain;
          mask: url('/assets/img/mark.svg') no-repeat center / contain; }
.foot-mark:hover { opacity: 1; }
.foot-top { margin-bottom: clamp(40px, 6vh, 72px); }
/* footer CTA: filled with the same muted tone as the wordmark sign — no signal blue */
.foot-cta { background: var(--border-strong); border-color: transparent; color: var(--text); font-size: 11px; padding: 11px 18px; }
.foot-cta:hover { background: var(--text-2); border-color: transparent; color: var(--bg); }
.foot-base { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: var(--space-md) var(--space-2xl); }
.foot-base span, .foot-base a { font-family: var(--sub); font-size: 11px; letter-spacing: 0.05em; color: var(--text-mute); transition: color .3s var(--ease); }
.foot-base a:hover { color: var(--text); }
.foot-base .sig { color: var(--text-2); }
.foot-links { display: inline-flex; gap: var(--space-2xl); }
@supports (animation-timeline: view()) {
  .foot-sign, .foot-base { animation: foot-rise linear both; animation-timeline: view(); animation-range: entry 0% cover 48%; }
  @keyframes foot-rise { from { transform: translateY(60px); } to { transform: translateY(0); } }
}
@media (max-width: 600px) {
  /* phone footer: one left-aligned stack — mark, links, signature, CTA */
  footer { padding-top: 56px; }
  .foot-top { flex-direction: column; align-items: flex-start; gap: var(--space-2xl); margin-bottom: 48px; }
  .foot-base { flex-direction: column; align-items: flex-start; gap: var(--space-xl); width: 100%; }
  .foot-base .sig { order: 2; }
  .foot-links { order: 1; gap: var(--space-xl); }
  .foot-links a { font-size: 13px; }
  .foot-cta { order: 3; margin-top: var(--space-md); }
}

/* ---- Shared reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.stagger > * { opacity: 1; transform: none; transition: none; }
  .orb { animation: none; }
  .hero-aura { transform: none !important; }
  .live-dot { animation: none; }
  .hero-gridfx-spot { display: none; }
}
