/* Section 01 — The Promise / fluid editorial foundation */

.ed-page {
  --fluid: calc(100vw / 1440);
  --hero-gutter: max(var(--space-md), calc(48 * var(--fluid)));
  --hero-grid-gap: calc(16 * var(--fluid));
  --hero-header-top: max(var(--space-sm), calc(24 * var(--fluid)));
  --hero-rule: 1px;
  background: var(--color-bg);
}

/* Foundation type roles: expressive serif statements vs. technical utility copy. */
.ed-h1,
.ed-h2,
.ed-h3,
.ed-h4,
.ed-h5,
.ed-h6 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.064em;
  line-height: 0.92;
  text-transform: uppercase;
}

.ed-h1 { font-size: calc(144 * var(--fluid)); line-height: 0.83333; }
.ed-h2 { font-size: calc(96 * var(--fluid)); line-height: 0.91667; }
.ed-h3 { font-size: calc(72 * var(--fluid)); line-height: 0.88889; }
.ed-h4 { font-size: calc(56 * var(--fluid)); line-height: 1; }
.ed-h5 { font-size: calc(40 * var(--fluid)); line-height: 1; }
.ed-h6 { font-size: calc(24 * var(--fluid)); line-height: 1; }

.ed-p1,
.ed-p2,
.ed-p3,
.ed-p4,
.ed-p5,
.ed-p6 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ed-p1 { font-size: calc(32 * var(--fluid)); line-height: 1; }
.ed-p2 { font-size: calc(24 * var(--fluid)); line-height: 1.16667; }
.ed-p3 { font-size: calc(20 * var(--fluid)); line-height: 1.2; }
.ed-p4 { font-size: calc(16 * var(--fluid)); line-height: 1.5; }
.ed-p5 { font-size: calc(12 * var(--fluid)); line-height: 1.66667; }
.ed-p6 { font-size: calc(10 * var(--fluid)); line-height: 1.6; }

.skip-link {
  position: fixed;
  z-index: 2147483647;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border: var(--hero-rule) solid var(--color-text);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
  text-decoration: none;
  transform: translateY(calc(-100% - var(--space-lg)));
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Fixed navigation chrome */
#site-header {
  position: fixed;
  z-index: 60;
  top: var(--hero-header-top);
  right: var(--hero-gutter);
  left: var(--hero-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-text);
  font-family: var(--font-mono);
  isolation: isolate;
}

#header-logo {
  position: relative;
  z-index: 2;
  color: currentColor;
  font-size: var(--font-size-small);
  font-weight: 720;
  letter-spacing: 0.22em;
  line-height: 1;
  text-decoration: none;
}

#header-nav {
  position: relative;
  z-index: 2;
}

#header-nav ul {
  display: flex;
  gap: clamp(var(--space-sm), calc(25 * var(--fluid)), var(--space-lg));
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

#header-nav li {
  line-height: 1;
}

#header-nav a {
  display: inline-block;
  overflow: clip;
  color: currentColor;
  font-size: var(--font-size-small);
  font-weight: 500;
  letter-spacing: 0.075em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

#header-line {
  position: absolute;
  top: calc(100% + var(--space-xs));
  left: 0;
  width: 0;
}

.o-dashline {
  --dashline-color: var(--color-accent);
  height: var(--hero-rule);
  background: repeating-linear-gradient(90deg, var(--dashline-color) 0 2px, transparent 2px 4px);
}

#header-veil {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-color: color-mix(in srgb, var(--color-bg) 78%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity calc(var(--dur-fast) * 0.45) var(--ease-in-out);
}

/* The nav hover no longer drops a full-screen veil — it washed out the whole
   hero and read as an accidental "grey-out". The header stays legible on its own. */

#site-header.is-light {
  color: var(--color-bg);
}

#site-header.is-light a,
#site-header.is-light #header-logo {
  color: var(--color-bg);
}

#mobile-menu-toggle {
  position: relative;
  z-index: 2;
  display: none;
  min-width: 3rem;
  min-height: 3rem;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-xs);
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
  letter-spacing: 0.08em;
}

.mobile-menu-mark {
  position: relative;
  display: block;
  width: 1rem;
  height: 1rem;
}

.mobile-menu-mark i {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: var(--hero-rule);
  background: currentColor;
  transform-origin: center;
  transition: transform var(--dur-fast) var(--ease-out);
}

.mobile-menu-mark i:first-child { transform: translateY(-3px); }
.mobile-menu-mark i:last-child { transform: translateY(3px); }

html.is-menu-active .mobile-menu-mark i:first-child { transform: rotate(45deg); }
html.is-menu-active .mobile-menu-mark i:last-child { transform: rotate(-45deg); }

/* Full-screen mobile index */
#mobile-menu {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: calc(var(--space-xl) + var(--space-md)) var(--hero-gutter) var(--space-md);
  background: var(--color-bg);
  color: var(--color-text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  transition:
    transform var(--dur-base) var(--ease-expo),
    opacity var(--dur-fast) var(--ease-in-out),
    visibility 0s linear var(--dur-base);
}

html.is-menu-active #mobile-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

#mobile-menu nav {
  display: flex;
  align-items: center;
}

#mobile-menu ol {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

#mobile-menu li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  align-items: baseline;
  border-bottom: var(--hero-rule) solid color-mix(in srgb, var(--color-line) 28%, transparent);
}

#mobile-menu li > span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}

#mobile-menu li a {
  padding: var(--space-sm) 0;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 10vw, 3.25rem);
  font-weight: 450;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
}

.mobile-menu-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: var(--hero-rule) solid var(--color-line);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-menu-meta a {
  text-decoration: none;
}

/* Hero stage: 65vh of controlled desktop scroll-out, one 100vh poster.
   The extra scroll-out (was 50vh) lets the seam handoff hold fully assembled
   for a beat before it clears, so hero and section 02 have room to breathe. */
.section-01-hero {
  position: relative;
  height: calc(var(--app-vh, 1vh) * 165);
  min-height: 165svh;
  background: var(--color-bg);
  color: var(--color-text);
}

.hero-stage {
  position: sticky;
  top: 0;
  height: calc(var(--app-vh, 1vh) * 100);
  min-height: 100svh;
  overflow: clip;
  background: var(--color-bg);
}

.hero-content-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--hero-grid-gap);
  padding-inline: var(--hero-gutter);
  transform-origin: 38% 52%;
  will-change: transform, filter, opacity;
}

.hero-index {
  position: absolute;
  top: calc(118 * var(--fluid));
  left: calc(var(--hero-gutter) + ((100% - (var(--hero-gutter) * 2) - (var(--hero-grid-gap) * 11)) / 12) + var(--hero-grid-gap));
  display: flex;
  gap: calc(8 * var(--fluid));
  align-items: center;
  color: var(--color-text);
  font-size: max(0.6875rem, calc(11 * var(--fluid)));
  font-weight: 520;
  white-space: nowrap;
}

.hero-index > span {
  display: inline-block;
}

.hero-promise {
  grid-column: 2 / 12;
  align-self: start;
  margin-top: calc(165 * var(--fluid));
}

.hero-title {
  max-width: calc(1140 * var(--fluid));
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: min(var(--font-size-display), calc(120 * var(--fluid)));
  font-variation-settings: "wght" 430;
  font-weight: 430;
  letter-spacing: -0.057em;
  line-height: 1;
  text-wrap: balance;
}

.hero-title-line {
  display: block;
}

.hero-title .word {
  will-change: transform, opacity;
}

/* SplitText's word masks (inline overflow: clip) follow the 0.91 line box, which
   severs Playfair's descenders at rest. Keep the top edge hard so the entrance
   stays masked, but let ink bleed past the bottom and the tracking-tight sides. */
.hero-title .word-mask {
  overflow: visible !important;
  clip-path: inset(0 -0.12em -0.35em -0.12em);
}

.hero-support {
  width: min(calc(590 * var(--fluid)), 48ch);
  margin-top: clamp(var(--space-sm), calc(25 * var(--fluid)), var(--space-lg));
}

.hero-copy {
  margin: 0;
  color: var(--color-text-muted);
  font-family: var(--font-text);
  font-size: var(--font-size-body);
  font-weight: 430;
  letter-spacing: -0.012em;
  line-height: 1.5;
}

.hero-copy .line {
  will-change: transform;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-top: clamp(var(--space-md), calc(27 * var(--fluid)), var(--space-lg));
  will-change: transform, opacity;
}

.hero-cta {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: max(0.6875rem, calc(11 * var(--fluid)));
  font-weight: 580;
  letter-spacing: 0.075em;
  line-height: 1.1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-cta--primary {
  padding: calc(15 * var(--fluid)) calc(20 * var(--fluid));
  border: var(--hero-rule) solid var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
}

.hero-cta--primary .flipper-clone {
  color: var(--color-accent);
}

.hero-cta--secondary {
  position: relative;
  padding: calc(15 * var(--fluid)) 0;
}

.hero-cta--secondary::after {
  position: absolute;
  right: 0;
  bottom: calc(8 * var(--fluid));
  left: 0;
  height: var(--hero-rule);
  background: var(--color-line);
  content: "";
  transform: scaleX(0.24);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-out);
}

.hero-cta--secondary:hover::after,
.hero-cta--secondary:focus-visible::after {
  transform: scaleX(1);
}

.hero-cta-arrow {
  flex: 0 0 auto;
  font-size: 1.1em;
  transition: transform var(--dur-fast) var(--ease-out);
}

.hero-cta:hover .hero-cta-arrow {
  transform: translate(0.12em, -0.12em);
}

.hero-cta--secondary:hover .hero-cta-arrow {
  transform: translate(0.12em, 0.12em);
}

/* Split-flap characters; JS appends the clone inside the moving glyph. */
.flipper-char {
  position: relative;
  display: inline-block;
  will-change: transform;
}

.flipper-clone {
  position: absolute;
  top: 100%;
  left: 0;
}

/* Desktop handoff: the next argument arrives before the promise has fully dispersed. */
.hero-seam {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--hero-grid-gap);
  padding-inline: var(--hero-gutter);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: clip-path, transform, opacity;
}

.hero-seam-rule {
  position: absolute;
  top: calc(126 * var(--fluid));
  bottom: calc(76 * var(--fluid));
  left: calc(var(--hero-gutter) + (((100% - (var(--hero-gutter) * 2) - (var(--hero-grid-gap) * 11)) / 12) * 3) + (var(--hero-grid-gap) * 3));
  width: var(--hero-rule);
  background: color-mix(in srgb, var(--color-line) 35%, transparent);
  transform: scaleY(0);
  transform-origin: bottom;
}

.hero-seam-index {
  grid-column: 2 / 4;
  align-self: start;
  margin: calc(142 * var(--fluid)) 0 0;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: max(0.6875rem, calc(11 * var(--fluid)));
  font-weight: 520;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero-seam-copy {
  grid-column: 5 / 12;
  align-self: start;
  margin-top: calc(205 * var(--fluid));
}

.hero-seam-copy h2 {
  max-width: 17ch;
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-text);
  font-size: clamp(2.75rem, calc(55 * var(--fluid)), 4rem);
  font-weight: 440;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.hero-seam-copy h2 em {
  color: var(--color-accent);
  font-style: normal;
  font-weight: 700;
}

.hero-seam-copy p {
  max-width: 48ch;
  margin: clamp(var(--space-md), calc(34 * var(--fluid)), var(--space-lg)) 0 0;
  color: var(--color-text-muted);
  font-family: var(--font-text);
  font-size: var(--font-size-body);
  letter-spacing: -0.012em;
  line-height: 1.5;
}

.hero-bottom {
  position: absolute;
  z-index: 2;
  right: var(--hero-gutter);
  bottom: 0;
  left: var(--hero-gutter);
  font-family: var(--font-mono);
  font-size: max(0.6875rem, calc(11 * var(--fluid)));
  font-weight: 500;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.hero-bottom-line {
  width: 0;
  height: var(--hero-rule);
  background: var(--color-line);
  transform-origin: left;
}

.hero-bottom ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: max(var(--space-xs), calc(13 * var(--fluid))) 0 max(var(--space-sm), calc(16 * var(--fluid)));
  list-style: none;
}

.hero-bottom li {
  display: flex;
  gap: var(--space-xs);
  align-items: baseline;
  color: var(--color-text);
  white-space: nowrap;
  will-change: transform, opacity;
}

.hero-bottom li:nth-child(2) { justify-self: center; }
.hero-bottom li:nth-child(3) { justify-self: end; }

.hero-bottom li > span {
  color: var(--color-text-muted);
  font-size: 0.78em;
}

/* Static analog grain binds the flat field into one editorial surface. */
.ed-noise {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 10%;
  mix-blend-mode: soft-light;
  opacity: 0.1;
  pointer-events: none;
}

.ed-rotate-guard {
  display: none;
}

html.is-locked body,
html.is-locked #site-header {
  padding-right: var(--scrollbar-width, 0px);
}

html.is-locked {
  overflow: hidden;
}

@media (max-width: 1100px) and (min-width: 768px) {
  #header-nav ul {
    gap: var(--space-sm);
  }

  #header-nav a {
    font-size: 0.6875rem;
  }

  .hero-promise {
    grid-column: 2 / 13;
  }

  .hero-title {
    font-size: min(var(--font-size-display), calc(112 * var(--fluid)));
  }

  .hero-seam-copy {
    grid-column: 5 / 13;
  }
}

@media (max-width: 767.98px) {
  .ed-page {
    --fluid: calc(100vw / 390);
    --hero-gutter: max(var(--space-md), calc(22 * var(--fluid)));
    --hero-grid-gap: calc(8 * var(--fluid));
    --hero-header-top: max(var(--space-sm), calc(18 * var(--fluid)));
  }

  .desktop-only {
    display: none;
  }

  #mobile-menu-toggle {
    display: inline-flex;
  }

  #header-logo {
    font-size: 0.75rem;
  }

  /* Mobile is a resolved composition, not a scroll-scrubbed transition state. */
  .section-01-hero {
    height: calc(var(--app-vh, 1vh) * 100);
    min-height: 100svh;
  }

  .hero-stage {
    position: relative;
  }

  .hero-seam {
    display: none;
  }

  .hero-content-layer {
    display: block;
  }

  .hero-index {
    top: calc(108 * var(--fluid));
    left: var(--hero-gutter);
    gap: var(--space-xs);
    font-size: 0.6875rem;
  }

  .hero-promise {
    margin: 0;
    padding-top: calc(151 * var(--fluid));
  }

  .hero-title {
    max-width: none;
    font-size: clamp(2.75rem, 13.4vw, 3.35rem);
    letter-spacing: -0.055em;
    line-height: 1.01;
  }

  .hero-title-line {
    display: block;
  }

  .hero-support {
    width: 100%;
    max-width: 34rem;
    margin-top: var(--space-md);
  }

  .hero-copy {
    max-width: 36ch;
    font-size: clamp(0.9375rem, 4.1vw, 1.0625rem);
    line-height: 1.45;
  }

  .hero-actions {
    flex-direction: column;
    gap: var(--space-2xs);
    align-items: stretch;
    margin-top: var(--space-md);
  }

  .hero-cta {
    width: 100%;
    min-height: 3rem;
    justify-content: space-between;
    font-size: 0.625rem;
  }

  .hero-cta--primary {
    padding: var(--space-sm);
  }

  .hero-cta--secondary {
    width: fit-content;
    min-height: 2.75rem;
    padding: var(--space-sm) 0;
  }

  .hero-cta--secondary::after {
    bottom: calc(var(--space-xs) * 0.5);
  }

  .hero-bottom {
    font-size: 0.625rem;
    letter-spacing: 0.055em;
  }

  .hero-bottom ul {
    column-gap: var(--space-xs);
    padding: var(--space-sm) 0;
  }

  .hero-bottom li {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    line-height: 1.25;
    white-space: normal;
  }

  .hero-bottom li:nth-child(2) {
    justify-self: stretch;
    text-align: center;
  }

  .hero-bottom li:nth-child(3) {
    justify-self: stretch;
    text-align: right;
  }

  .hero-bottom li > span {
    display: block;
    margin-bottom: var(--space-2xs);
  }
}

@media (max-width: 767.98px) and (max-height: 740px) {
  .hero-index {
    top: calc(82 * var(--fluid));
  }

  .hero-promise {
    padding-top: calc(116 * var(--fluid));
  }

  .hero-title {
    font-size: clamp(2.25rem, 11.4vw, 2.8rem);
  }

  .hero-support {
    margin-top: var(--space-sm);
  }

  .hero-copy {
    font-size: 0.875rem;
    line-height: 1.38;
  }

  .hero-actions {
    margin-top: var(--space-sm);
  }

  .hero-cta {
    min-height: 2.75rem;
  }

  .hero-bottom ul {
    padding: var(--space-xs) 0;
  }
}

@media (orientation: landscape) and (max-width: 991px) and (pointer: coarse) and (max-height: 520px) {
  .ed-rotate-guard {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    color: var(--color-text);
  }

  .ed-rotate-guard p {
    font-size: var(--font-size-small);
  }
}

@media (prefers-reduced-motion: reduce) {
  #header-veil {
    transition: none;
  }

  .hero-cta--secondary::after,
  .hero-cta-arrow,
  #mobile-menu,
  .mobile-menu-mark i {
    transition: none;
  }
}
