/* ================================================================
   LAYOUT — Section frames, nav, hero, ticker, stats, services,
   work-scroll, process, capabilities, faq, contact, footer.
   ================================================================ */

/* ==== Section frame ==== */
.section {
  position: relative;
  padding: var(--sp-section) var(--sp-gutter);
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}
.section--dark {
  background: var(--ink);
  color: var(--paper);
  max-width: 100%;
  border-top: none;
}
.section--dark .section-label  { color: rgba(245,242,236,0.35); }
.section--dark .section-label::before { background: rgba(245,242,236,0.35); }
.section--dark .manifesto__text .word { color: rgba(245,242,236,0.1); }
.section--dark .manifesto__text .word.is-on { color: var(--paper); }
.section--dark .manifesto__text .word.is-accent { color: var(--accent); }

/* Inner max-width for dark sections */
.section--dark > * {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sp-gutter);
  padding-right: var(--sp-gutter);
}
/* Override padding already on section */
.manifesto.section--dark {
  padding-left: 0;
  padding-right: 0;
}

.section__header {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: clamp(60px, 8vw, 120px);
}
.section__title { max-width: 14ch; font-size: var(--fs-display); }
.section-label { display: inline-flex; align-items: center; gap: 12px; }
.section-label::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.4; }

/* ==== NAV ==== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px var(--sp-gutter);
  transition: padding var(--t-med) var(--ease-out), background var(--t-med), backdrop-filter var(--t-med);
}
.nav.is-scrolled {
  padding: 12px var(--sp-gutter);
  background: rgba(245,242,236,0.82);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--rule);
}
.nav__logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
}
.nav__logo i { font-style: italic; font-weight: 400; color: var(--mute); margin-left: 3px; }
.nav__links {
  display: flex; gap: 32px; justify-self: center;
}
.nav__links a {
  font-size: 14px; font-weight: 500; position: relative;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px;
  height: 1px; background: var(--ink);
  transition: right var(--t-fast) var(--ease-out);
}
.nav__links a:hover::after { right: 0; }

.nav__right { justify-self: end; display: flex; align-items: center; gap: 12px; }

.nav__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 1px solid var(--ink); border-radius: 100px;
  font-size: 13px; font-weight: 500;
  background: var(--ink); color: var(--paper);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.nav__cta:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }

.nav__burger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 6px; width: 40px; height: 40px;
  border: 1px solid var(--rule-strong); border-radius: 50%;
}
.nav__burger span {
  display: block; width: 18px; height: 1px; background: var(--ink);
  transition: transform var(--t-med) var(--ease-inout), opacity var(--t-fast);
}
.nav__burger.is-open span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__burger.is-open span:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav { grid-template-columns: 1fr auto; }
  .nav__right { gap: 8px; }
  .nav__cta { display: none; }
  .nav__burger { display: flex; }
}

/* ==== MOBILE NAV OVERLAY ==== */
.nav-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  clip-path: circle(0% at calc(100% - 40px) 36px);
  transition: clip-path 0.85s var(--ease-inout);
  display: flex; flex-direction: column;
  justify-content: center;
  padding: var(--sp-gutter);
  pointer-events: none;
}
.nav-overlay.is-open {
  clip-path: circle(170% at calc(100% - 40px) 36px);
  pointer-events: auto;
}
.nav-overlay__close {
  position: absolute; top: 20px; right: var(--sp-gutter);
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(245,242,236,0.2);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.3s 0.2s, background var(--t-fast), color var(--t-fast);
}
.nav-overlay.is-open .nav-overlay__close { opacity: 1; }
.nav-overlay__close:hover { background: var(--paper); color: var(--ink); }

.nav-overlay__nav {
  display: flex; flex-direction: column; gap: 8px;
}
.nav-overlay__link {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-display);
  font-size: clamp(44px, 11vw, 96px);
  font-weight: 700; letter-spacing: -0.03em;
  color: var(--paper);
  opacity: 0; transform: translateX(-30px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), color var(--t-fast);
  line-height: 1.0;
}
.nav-overlay__link[data-index]::before {
  content: attr(data-index);
  font-family: var(--font-mono); font-size: 11px;
  color: rgba(245,242,236,0.35); letter-spacing: 0.05em; font-weight: 400;
  margin-bottom: 4px;
}
.nav-overlay__link:hover { color: var(--accent); }
.nav-overlay.is-open .nav-overlay__link {
  opacity: 1; transform: translateX(0);
}
.nav-overlay.is-open .nav-overlay__link:nth-child(1) { transition-delay: 0.15s; }
.nav-overlay.is-open .nav-overlay__link:nth-child(2) { transition-delay: 0.22s; }
.nav-overlay.is-open .nav-overlay__link:nth-child(3) { transition-delay: 0.29s; }
.nav-overlay.is-open .nav-overlay__link:nth-child(4) { transition-delay: 0.36s; }
.nav-overlay.is-open .nav-overlay__link:nth-child(5) { transition-delay: 0.43s; }

.nav-overlay__footer {
  position: absolute; bottom: var(--sp-gutter); left: var(--sp-gutter); right: var(--sp-gutter);
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 12px;
  opacity: 0; transition: opacity 0.4s 0.5s;
}
.nav-overlay.is-open .nav-overlay__footer { opacity: 1; }
.nav-overlay__footer a, .nav-overlay__footer span {
  color: rgba(245,242,236,0.5); font-size: 13px;
}
.nav-overlay__footer a:hover { color: var(--paper); }

/* ==== HERO ==== */
.hero {
  position: relative; min-height: 100svh;
  padding: calc(var(--nav-h) + 20px) var(--sp-gutter) 60px;
  display: flex; align-items: center;
  max-width: var(--max-w); margin: 0 auto;
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; }
.hero__sub {
  margin-top: 28px;
  font-family: var(--font-mono); font-size: var(--fs-mono);
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--mute); line-height: 1.9;
  opacity: 0;
}
.hero__corner {
  position: absolute;
  padding: clamp(16px, 3vw, 40px);
  z-index: 2;
}
.hero__corner--tl { top: 0; left: 0; }
.hero__corner--tr { top: 0; right: 0; text-align: right; }
.hero__corner--bl { bottom: 0; left: 0; }
.hero__corner--br { bottom: 0; right: 0; text-align: right; }
.hero__corner .mono { display: block; line-height: 1.5; }

.hero__title { position: relative; z-index: 2; }
.hero__title .hero-line { display: block; }
.hero__title .clip-wrap { overflow: hidden; }

.hero__scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  z-index: 2; animation: floatY 2.8s ease-in-out infinite;
}

/* Floating shapes */
.hero__shapes {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden;
}
.shape {
  position: absolute;
  color: var(--ink); opacity: 0.12;
  transition: transform 0.1s;
  will-change: transform;
}
.shape--ring {
  width: clamp(240px, 30vw, 480px); height: clamp(240px, 30vw, 480px);
  right: -60px; bottom: -80px;
  border: 1.5px dashed currentColor; border-radius: 50%;
}
.shape--cross {
  width: 34px; height: 34px; right: 26%; top: 22%; opacity: 0.3;
  background:
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}
.shape--dots {
  width: 90px; height: 90px; left: 6%; bottom: 22%; opacity: 0.18;
  background-image: radial-gradient(currentColor 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}
.shape--line-v {
  width: 1px; height: clamp(120px, 16vh, 200px);
  background: var(--accent);
  right: 16%; top: 28%; opacity: 0.7;
}
.shape--circle-sm {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid currentColor;
  left: 12%; top: 28%; opacity: 0.25;
}
.shape--bracket {
  width: 40px; height: 60px;
  right: 36%; bottom: 18%; opacity: 0.2;
  border: 1px solid currentColor;
  border-right: none;
}

@media (max-width: 600px) {
  .shape--ring { opacity: 0.06; }
  .shape--dots, .shape--circle-sm, .shape--bracket { display: none; }
}

/* ==== TICKER ==== */
.ticker { overflow: hidden; }
.ticker__row {
  display: flex; overflow: hidden;
  padding: 22px 0; border-top: 1px solid var(--rule);
}
.ticker__row--dark {
  background: var(--ink); border-top: none;
  border-bottom: 1px solid var(--rule);
}
.ticker__row--dark .ticker__track { color: var(--paper); }
.ticker__row--dark .sep { color: var(--accent); }
.ticker__track {
  display: inline-flex; white-space: nowrap; gap: 28px; align-items: center;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 52px);
  font-weight: 600; letter-spacing: -0.02em;
  animation: marquee 38s linear infinite;
  will-change: transform;
}
.ticker__track--rev { animation-direction: reverse; animation-duration: 30s; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.sep { color: var(--accent); font-size: 0.7em; }

/* ==== STATS ==== */
.stats {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: clamp(40px,6vw,80px) var(--sp-gutter);
  max-width: var(--max-w); margin: 0 auto;
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
}
.stat {
  background: var(--paper);
  padding: clamp(28px,4vw,56px) clamp(20px,3vw,40px);
  display: flex; flex-direction: column; gap: 10px;
  transition: background var(--t-med);
}
.stat:hover { background: var(--paper-2); }
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 100px);
  font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  color: var(--ink);
}
.stat__label { margin-top: 4px; }
@media (max-width: 700px) {
  .stats__grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 380px) {
  .stats__grid { grid-template-columns: 1fr; }
}

/* ==== MANIFESTO ==== */
.manifesto__text {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  line-height: 1.08; max-width: 18ch;
  font-weight: 500; letter-spacing: -0.02em;
}
.manifesto__text .word {
  display: inline-block;
  transition: color 0.35s var(--ease-out);
}

/* ==== SERVICES ==== */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule);
}
.service {
  background: var(--paper);
  padding: clamp(24px,3vw,40px);
  display: flex; flex-direction: column; gap: 14px;
  position: relative; min-height: 340px;
  overflow: hidden; isolation: isolate;
}
.service::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.65s var(--ease-out);
  z-index: 0;
}
.service > * { position: relative; z-index: 1; }
.service:hover::before { transform: translateY(0); }
.service:hover { color: var(--paper); }
.service:hover .service__desc { color: rgba(245,242,236,0.6); }
.service:hover .service__list { color: rgba(245,242,236,0.45); }
.service:hover .service__demo { color: var(--paper); }
.service:hover .demo-cube__face { border-color: rgba(245,242,236,0.45); }
.service:hover .demo-cube__face--front { background: var(--accent); }
.service:hover .demo-browser__bar { background: rgba(245,242,236,0.1); }
.service:hover .demo-browser__row { background: rgba(245,242,236,0.18); }
.service:hover .demo-browser__row--lg { background: rgba(245,242,236,0.6); }

.service--wide { grid-column: span 2; }

.service__demo {
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; color: var(--ink);
}
.service__title { font-size: clamp(20px,2vw,27px); }
.service__desc { font-size: 14px; color: var(--mute); max-width: 36ch; }
.service__list {
  display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: auto;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--mute);
}
.service__list li::before { content: "→ "; }

@media (max-width: 900px) {
  .services__grid { grid-template-columns: repeat(2,1fr); }
  .service--wide { grid-column: span 2; }
}
@media (max-width: 560px) {
  .services__grid { grid-template-columns: 1fr; }
  .service--wide { grid-column: span 1; }
  .service { min-height: auto; }
}

/* ==== WORK — horizontal scroll ==== */
.work.section { overflow: hidden; }
.work__header { padding-bottom: 0; margin-bottom: 0; }
.work__drag-hint {
  display: none;
  margin-top: 8px;
}
@media (max-width: 767px) { .work__drag-hint { display: block; } }

.work-outer {
  position: relative; overflow: hidden;
  margin-top: clamp(40px,5vw,80px);
  /* height set by JS on desktop for pin */
}
.work-track {
  display: flex; align-items: stretch; gap: clamp(16px,2vw,28px);
  padding: 0 var(--sp-gutter) clamp(32px,4vw,60px);
  will-change: transform;
  /* Mobile: native scroll */
}
@media (max-width: 767px) {
  .work-outer { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .work-outer::-webkit-scrollbar { display: none; }
  .work-track {
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
  }
}

.work-item {
  flex: 0 0 clamp(260px, 38vw, 560px);
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 16px;
  cursor: none;
}
.work-item--lg {
  flex: 0 0 clamp(300px, 52vw, 740px);
}
.work-item__media {
  aspect-ratio: 4/3; overflow: hidden;
  background: var(--paper-2); position: relative;
}
.work-item--lg .work-item__media { aspect-ratio: 16/10; }
.work-item__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease-out), filter 0.6s;
}
.work-item:hover .work-item__media img { transform: scale(1.06); filter: brightness(0.93); }
.work-item__meta { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.work-item__meta .mono { font-size: 10px; }
.work-item__meta h3 {
  font-family: var(--font-display); font-size: clamp(20px,2.2vw,30px);
  font-weight: 600; letter-spacing: -0.015em; line-height: 1.1;
}

/* ==== PROCESS ==== */
.process__container {
  display: grid; grid-template-columns: 1fr 1.5fr;
  gap: clamp(40px,6vw,120px); position: relative;
}
.process__sticky { position: sticky; top: 18vh; height: fit-content; }
.process__number {
  font-family: var(--font-display);
  font-size: clamp(120px, 22vw, 320px);
  font-weight: 700; line-height: 0.82;
  letter-spacing: -0.04em; display: block;
}
.process__steps { display: flex; flex-direction: column; gap: clamp(80px,12vw,160px); }
.process__step { display: flex; flex-direction: column; gap: 16px; }
.process__step h3 { font-size: clamp(28px,3.5vw,48px); }
.process__step p { font-size: 17px; max-width: 44ch; }
.process__step ul {
  margin-top: 8px; display: flex; flex-direction: column; gap: 8px;
  padding-top: 16px; border-top: 1px solid var(--rule);
}
.process__step li {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.03em; color: var(--mute); text-transform: uppercase;
}
.process__step li::before { content: "—  "; }
@media (max-width: 800px) {
  .process__container { grid-template-columns: 1fr; }
  .process__sticky { position: static; }
  .process__number { font-size: 96px; margin-bottom: 24px; }
}

/* ==== CAPABILITIES ==== */
.capabilities__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px,8vw,160px); }
.capabilities__grid h4 { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.capabilities__grid ul { display: flex; flex-direction: column; gap: 14px; }
.capabilities__grid li {
  font-family: var(--font-display); font-size: clamp(18px,1.8vw,26px); font-weight: 400; letter-spacing: -0.01em;
}
@media (max-width: 700px) { .capabilities__grid { grid-template-columns: 1fr; gap: 48px; } }

/* ==== FAQ ==== */
.faq__list { border-top: 1px solid var(--rule-strong); }
.faq__item { border-bottom: 1px solid var(--rule-strong); }
.faq__item summary {
  list-style: none; cursor: pointer;
  padding: 30px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
  font-family: var(--font-display);
  font-size: clamp(20px,2.3vw,30px);
  font-weight: 500; letter-spacing: -0.01em;
  transition: color var(--t-fast);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--mute); }
.faq__icon { width: 18px; height: 18px; position: relative; flex-shrink: 0; }
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; background: var(--ink);
  transition: transform var(--t-med) var(--ease-out);
}
.faq__icon::before { left:0; right:0; top:8.5px; height:1px; }
.faq__icon::after  { top:0; bottom:0; left:8.5px; width:1px; }
.faq__item[open] .faq__icon::after { transform: rotate(90deg); }
.faq__item p { padding: 0 0 28px; max-width: 64ch; color: var(--mute); font-size: 16px; }

/* ==== CONTACT ==== */
.contact__grid {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: clamp(40px,6vw,100px);
}
.contact__details {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 32px 24px; padding-top: 16px;
}
.contact__details > div { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--rule); padding-top: 16px; }
.contact__details .label { font-size: var(--fs-mono); }
.contact__details a { border-bottom: 1px solid var(--ink); padding-bottom: 2px; width: fit-content; }
.contact__details a:hover { color: var(--mute); border-color: transparent; }
.contact__social { display: flex; flex-wrap: wrap; gap: 14px; }
.contact__social a { font-size: 14px; }
.contact__success {
  padding: 28px; background: var(--ink); color: var(--paper); margin-bottom: 32px;
}
.contact__success h3 { font-size: clamp(20px,2vw,26px); margin: 12px 0 8px; }
.contact__success .mono { color: var(--accent); }
.contact__success p { color: rgba(245,242,236,0.65); font-size: 14px; }
@media (max-width: 800px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__details { grid-template-columns: 1fr; gap: 24px; }
}

/* ==== FOOTER ==== */
.footer {
  padding: clamp(60px,10vw,140px) var(--sp-gutter) 32px;
  border-top: 1px solid var(--rule);
  max-width: var(--max-w); margin: 0 auto;
}
.footer__wordmark {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(72px,17vw,260px);
  line-height: 0.85; letter-spacing: -0.04em; margin-bottom: 56px;
}
.footer__wordmark i { font-weight: 400; color: var(--mute); font-style: italic; }
.footer__bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-top: 24px; border-top: 1px solid var(--rule); flex-wrap: wrap;
}
.footer__top {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500;
  padding: 10px 18px; border: 1px solid var(--ink); border-radius: 100px;
  transition: background var(--t-fast), color var(--t-fast);
}
.footer__top:hover { background: var(--ink); color: var(--paper); }
