/* ==========================================================================
   EDITORIAL INK — 2. Layout
   Ambient layers, nav, section shells, hero, footer.
   ========================================================================== */

/* ---------- Ambient: grain + scroll progress ---------- */
/* A single inline SVG turbulence tile, tiled by background-repeat. Kept at 3.5%
   so it warms the paper without ever reading as texture-for-texture's-sake. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 900;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  width: 100%;
  height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: fixed;
  top: 0; left: 0;
  z-index: 800;
  /* Symmetric 1fr / auto / 1fr rather than flex + space-between. With
     space-between the middle group is placed by whatever space the mark and
     the CTA leave over, so unequal side widths push it off-centre; equal outer
     tracks put the links dead centre in the bar no matter what flanks them. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 22px var(--gutter);
  transition: padding .4s var(--ease-out), background .4s var(--ease-out),
              box-shadow .4s var(--ease-out), transform .5s var(--ease-out);
}

/* Condensed pill state once the hero is behind us */
.nav.is-stuck {
  padding-top: 12px;
  padding-bottom: 12px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 var(--rule);
}
/* Hide on scroll-down, restore on scroll-up */
.nav.is-hidden { transform: translateY(-115%); }

.nav__mark {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.nav__cta { justify-self: end; }
.nav__mark-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--coral);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  padding-top: 2px;
  border-radius: 3px;
  transition: transform .45s var(--ease-out);
}
.nav__mark:hover .nav__mark-glyph { transform: rotate(-8deg) scale(1.07); }
.nav__mark-text { font-size: .74rem; }

/* Six items now; the gap flexes so they never crowd the mark or the CTA on a
   narrow laptop before the mobile breakpoint takes over. */
.nav__links { justify-self: center; display: flex; gap: clamp(16px, 2.1vw, 30px); }
.nav__links a {
  position: relative;
  padding: 4px 0;
  color: var(--fg-muted);
  transition: color .25s;
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform .4s var(--ease-out);
}
.nav__links a:hover,
.nav__links a.is-current { color: var(--ink); }
.nav__links a:hover::after,
.nav__links a.is-current::after { transform: scaleX(1); transform-origin: 0 50%; }

/* Opens a file rather than scrolling to a section, so it carries a small
   arrow to say so. */
.nav__cv { display: inline-flex; align-items: center; gap: 4px; }
.nav__cv span { font-size: .82em; transition: transform .35s var(--ease-out); }
.nav__cv:hover span { transform: translate(2px, -2px); }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 0 6px;
}
.burger span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform .4s var(--ease-out), opacity .3s;
}
.burger span:last-child { width: 62%; margin-left: auto; }
.burger.is-open span:first-child { transform: translateY(3.75px) rotate(45deg); }
.burger.is-open span:last-child  { width: 100%; transform: translateY(-3.75px) rotate(-45deg); }

@media (max-width: 940px) {
  /* Back to flex here. The burger is a fourth child, and in a three-column
     grid it would wrap onto a second row once the links and CTA are hidden. */
  .nav { display: flex; justify-content: space-between; }
  /* .btn sets display:inline-flex from components.css, which loads later — so
     these need the extra specificity to actually win. */
  .nav .nav__links,
  .nav .nav__cta { display: none; }
  .burger { display: flex; }
}

/* ---------- Fullscreen mobile menu ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 790;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  padding: 120px var(--gutter) 48px;
  background: var(--ink);
  color: var(--paper);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .8s var(--ease-out);
  pointer-events: none;
}
.menu.is-open { clip-path: inset(0 0 0 0); pointer-events: auto; }

.menu__links { display: flex; flex-direction: column; gap: 6px; }
.menu__link {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(247, 244, 239, .12);
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1.05;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), color .25s;
}
.menu.is-open .menu__link { opacity: 1; transform: none; }
.menu__link span { font-size: .68rem; color: #FF6647; }
.menu__link i { margin-left: .3em; font-style: normal; font-size: .42em; color: #FF6647; }
.menu__link:hover { color: #FF6647; }

/* Stagger the links in behind the curtain wipe */
.menu.is-open .menu__link:nth-child(1) { transition-delay: .30s; }
.menu.is-open .menu__link:nth-child(2) { transition-delay: .36s; }
.menu.is-open .menu__link:nth-child(3) { transition-delay: .42s; }
.menu.is-open .menu__link:nth-child(4) { transition-delay: .48s; }
.menu.is-open .menu__link:nth-child(5) { transition-delay: .54s; }
.menu.is-open .menu__link:nth-child(6) { transition-delay: .60s; }

.menu__foot { display: flex; flex-wrap: wrap; gap: 22px; color: rgba(247,244,239,.6); }
.menu__foot a:hover { color: #FF6647; }

/* ==========================================================================
   SECTION SHELL
   ========================================================================== */
.section {
  position: relative;
  padding: var(--section-y) var(--gutter);
  background: var(--bg);
  color: var(--fg);
}
.section--ink { background: var(--bg); color: var(--fg); }

.section__head {
  max-width: var(--maxw);
  margin: 0 auto clamp(48px, 7vw, 96px);
}

[id] { scroll-margin-top: 96px; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: 132px var(--gutter) 84px;
  overflow: hidden;
}

/* Oversized ghost word bleeding off the left edge */
.hero::before {
  content: 'GROWTH';
  position: absolute;
  left: -.06em;
  bottom: -.16em;
  z-index: 0;
  font-family: var(--font-display);
  font-size: clamp(9rem, 26vw, 26rem);
  font-weight: 600;
  line-height: .8;
  letter-spacing: -.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(18, 16, 14, .055);
  pointer-events: none;
  user-select: none;
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  color: var(--fg-muted);
}
.eyebrow__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 0 rgba(255, 77, 46, .55);
  animation: pulse 2.6s var(--ease-out) infinite;
}

.hero__title {
  /* Sized to leave the CTAs and stat row above the fold on a 1440x900 laptop */
  font-size: clamp(2.5rem, 6.1vw, 5.4rem);
  font-weight: 500;
  line-height: 1.04;
}

.hero__sub {
  max-width: 46ch;
  margin-top: 26px;
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  font-weight: 300;
  color: var(--fg-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 4vw, 56px);
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.hero__stat dt { color: var(--fg-subtle); margin-bottom: 6px; }
.hero__stat dd { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 500; }

/* ---------- Hero figure ---------- */
.hero__figure {
  position: relative;
  justify-self: center;
  width: min(100%, 420px);
}

/* Offset accent plate behind the portrait — the editorial "print block" */
.hero__plate {
  position: absolute;
  inset: 26px -26px -26px 26px;
  background: var(--coral);
  border-radius: 4px;
}

.portrait {
  position: relative;
  z-index: 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform .9s var(--ease-out), filter .9s var(--ease-out);
}
.portrait:hover img { transform: scale(1.035); }

.portrait figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Right padding keeps "Est. 2023" clear of the seal overlapping this corner */
  padding: 14px 96px 14px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: .66rem;
}
.portrait figcaption i { color: var(--coral); font-style: normal; }

/* Rotating type seal, overlapping the plate corner */
.seal {
  position: absolute;
  right: -54px;
  bottom: -44px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.seal svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  animation: spin 26s linear infinite;
}
.seal text {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 2.4px;
  fill: var(--ink);
}
.seal__mid { font-size: 1.5rem; color: var(--coral); }

.scroll-cue {
  position: absolute;
  left: var(--gutter);
  bottom: 34px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--fg-subtle);
}
.scroll-cue__line {
  position: relative;
  width: 62px;
  height: 1px;
  background: var(--rule-strong);
  overflow: hidden;
}
.scroll-cue__line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--coral);
  transform-origin: 0 50%;
  animation: sweep 2.4s var(--ease-in-out) infinite;
}

@media (max-width: 940px) {
  .hero { min-height: auto; padding-top: 128px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure { order: -1; width: min(100%, 340px); justify-self: start; }
  .seal { width: 104px; height: 104px; right: -22px; bottom: -30px; }
  .seal text { font-size: 17px; }
  .portrait figcaption { padding-right: 76px; }
  .scroll-cue { display: none; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.foot {
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}

.foot__ribbon {
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.foot__ribbon-track {
  display: flex;
  align-items: center;
  /* Roughly one word-width of air on each side of the sparkle. JS tops the
     track up with more copies to suit, so a wider gap costs no continuity. */
  gap: clamp(44px, 5vw, 96px);
  width: max-content;
  font-family: var(--font-display);
  /* Deliberately kept well under the section headings — this is a footer
     flourish, not a headline, and at 5rem it read as a second hero. */
  font-size: clamp(1.4rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  white-space: nowrap;
  animation: slide 26s linear infinite;
}
.foot__ribbon-track i { font-style: normal; font-size: .34em; color: var(--accent); }
.foot__ribbon:hover .foot__ribbon-track { animation-play-state: paused; }

.foot__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px var(--gutter);
  color: var(--fg-subtle);
}
.foot__clock b { color: var(--accent); font-weight: 500; }
.foot__top { transition: color .25s; }
.foot__top:hover { color: var(--accent); }
