/* HOME page styles */

/* === HERO === */
.hero {
  position: relative;
  padding: 130px 0 56px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 32px;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(22,19,16,0.18);
  padding-bottom: 14px;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 0;
  font-size: clamp(54px, 9.5vw, 156px);
  line-height: 0.88;
  letter-spacing: -0.035em;
  margin: 16px 0;
}
.hero-title span {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s cubic-bezier(.2,.8,.2,1), transform 1.1s cubic-bezier(.2,.8,.2,1);
}
.hero-title.in span { opacity: 1; transform: none; }
.hero-title .hl-1 { transition-delay: .15s; }
.hero-title .hl-2 { transition-delay: .28s; padding-left: 7vw; }
.hero-title .hl-3 { transition-delay: .42s; padding-left: 2vw; }
.hero-title em { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; color: var(--ember); }
.hero-title .hl-4 { transition-delay: .55s; padding-left: 16vw; }
.hero-title .hl-5 { transition-delay: .68s; padding-left: 7vw; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}

.hero-foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: end;
  border-top: 1px solid rgba(22,19,16,0.18);
  padding-top: 22px;
}
.hero-blurb {
  max-width: 520px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.hero-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-self: end;
}
.btn-link {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color .2s;
}
.btn-link:hover { color: var(--ember); border-color: var(--ember); }

.hero-sidemarks {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

/* Subtle grid bg */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(22,19,16,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22,19,16,0.04) 1px, transparent 1px);
  background-size: 96px 96px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 60%, black 30%, transparent 80%);
}

.hero-flourish {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  height: 50px;
  pointer-events: none;
  opacity: 0.55;
}
.hero-flourish svg { width: 100%; height: 100%; }

@media (max-width: 720px) {
  .hero { padding-top: 110px; padding-bottom: 40px; min-height: auto; }
  .hero-title { font-size: clamp(44px, 12vw, 84px); margin: 8px 0; }
  .hero-title .hl-2, .hero-title .hl-3, .hero-title .hl-4, .hero-title .hl-5 { padding-left: 0; }
  .hero-foot { grid-template-columns: 1fr; }
  .hero-cta { justify-self: start; flex-direction: column; align-items: flex-start; }
}

/* === MARQUEE === */
.marquee {
  background: var(--ink);
  color: var(--paper);
  padding: 28px 0;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  font-size: clamp(36px, 5vw, 64px);
  animation: scroll-x 38s linear infinite;
}
.marquee-track .display, .marquee-track .display-italic {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
}
.marquee-track .display-italic { font-style: italic; color: var(--ember); }
.marquee .dot { color: var(--ember); font-size: 0.6em; }
@keyframes scroll-x {
  to { transform: translateX(-50%); }
}

/* === INTRO ESSAY === */
.intro {
  padding: var(--s-10) 0 var(--s-9);
}
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s-7);
}
.intro-meta { padding-top: 16px; }
.intro-body { max-width: 720px; }
.intro-body .lede {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 32px;
  font-weight: 400;
  font-variation-settings: "opsz" 72, "SOFT" 70;
}
.intro-body p {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 20px;
  max-width: 60ch;
}
.signoff { margin-top: 32px; }
@media (max-width: 720px) {
  .intro-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* === SCROLLY 3D === */
.scrolly {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  padding-top: var(--s-9);
}
.scrolly .section-head { border-bottom-color: rgba(245,241,234,0.15); }
.scrolly .section-head .num { color: rgba(245,241,234,0.55); }
.process-nav-wrap {
  position: sticky;
  top: 82px;
  z-index: 12;
  margin-top: calc(var(--s-7) * -1);
  margin-bottom: var(--s-6);
  pointer-events: none;
}
.process-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(245,241,234,0.16);
  border: 1px solid rgba(245,241,234,0.16);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}
.process-tab {
  min-height: 54px;
  padding: 12px 14px;
  background: rgba(22,19,16,0.82);
  color: rgba(245,241,234,0.66);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .25s, color .25s;
}
.process-tab span {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ember);
}
.process-tab:hover,
.process-tab:focus-visible,
.process-tab.is-active {
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
.scrolly-stage {
  position: relative;
  height: 480vh; /* 4 acts × ~120vh each */
  margin-top: var(--s-6);
}
.scene-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.scene {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 2200px;
  perspective-origin: 50% 55%;
  transform-style: preserve-3d;
}
/* Floor */
.scene-floor {
  position: absolute;
  left: 50%;
  top: 78%;
  width: 240%;
  height: 240%;
  transform: translate(-50%, 0) rotateX(72deg);
  background-image:
    linear-gradient(to right, rgba(245,241,234,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245,241,234,0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 65%);
}
/* Ambient glow */
.scene::before {
  content:"";
  position: absolute;
  left: 50%; top: 50%;
  width: 800px; height: 800px;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(200,85,61,0.18) 0%, transparent 60%);
  pointer-events: none;
}

.plate {
  position: absolute;
  left: 50%; top: 50%;
  width: min(640px, 80vw);
  /* aspect roughly 4:3 */
  height: min(440px, 56vw);
  transform-origin: center center;
  transform-style: preserve-3d;
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.45),
    0 8px 24px rgba(0,0,0,0.35);
  /* will be positioned via JS-driven CSS vars */
  --tx: -50%;
  --ty: -50%;
  --tz: 0px;
  --rx: 0deg;
  --ry: 0deg;
  --rz: 0deg;
  --o: 1;
  transform: translate(var(--tx), var(--ty)) translateZ(var(--tz)) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz));
  opacity: var(--o);
  transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .6s ease;
}
.plate.is-active {
  box-shadow:
    0 0 0 1px rgba(38,100,234,0.65),
    0 40px 100px rgba(0,0,0,0.52),
    0 12px 32px rgba(38,100,234,0.22);
}
.plate-label {
  position: absolute;
  top: 14px; left: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plate-label::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--ember);
  border-radius: 50%;
  display: inline-block;
}
.plate.is-active .plate-label::before {
  box-shadow: 0 0 0 8px rgba(38,100,234,0.14);
}
.plate-content {
  position: absolute;
  inset: 50px 36px 36px;
}

/* Plate 1: Discovery (paper notebook look) */
.plate-1 {
  background: #F8F3E7;
  background-image:
    linear-gradient(to bottom, transparent 31px, rgba(22,19,16,0.07) 32px);
  background-size: 100% 32px;
}
.discovery {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 100, "WONK" 1;
  font-size: clamp(16px, 2.4vw, 22px);
  line-height: 32px;
  color: var(--ink);
}
.d-line { display: block; }
.d-bullet { color: var(--ember); margin-right: 8px; font-style: normal; }
.d-line em { font-style: italic; color: var(--ember-deep); }
.d-scribble {
  position: absolute;
  bottom: 18px; right: 18px;
  width: 120px; height: 50px;
}
.d-scribble svg { width: 100%; height: 100%; }

/* Plate 2: Wireframe */
.plate-2 {
  background: var(--paper);
}
.wireframe { inset: 50px 36px 36px; }
.wf-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  opacity: 0.4;
}
.wf-col { background: rgba(22,19,16,0.05); height: 100%; }
.wf-blocks {
  position: absolute;
  inset: 12px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 60px 18px 18px 18px 1fr 56px;
  gap: 12px;
}
.wf-block { background: var(--ink); border-radius: 2px; }
.wf-h1 { grid-column: 1 / 9; grid-row: 1 / 2; }
.wf-h2 { grid-column: 1 / 5; grid-row: 2 / 3; opacity: 0.5; }
.wf-p1 { grid-column: 1 / 8; grid-row: 3 / 4; opacity: 0.3; }
.wf-p2 { grid-column: 1 / 6; grid-row: 4 / 5; opacity: 0.3; }
.wf-img { grid-column: 1 / 13; grid-row: 5 / 6; background: repeating-linear-gradient(45deg, rgba(22,19,16,0.15) 0 8px, transparent 8px 16px); border: 1px solid var(--ink); }
.wf-cta { grid-column: 1 / 4; grid-row: 6 / 7; background: var(--ember); }

/* Plate 3: Prototype */
.plate-3 {
  background: #FAF6EE;
  padding: 0;
}
.prototype {
  inset: 50px 36px 24px;
}
.pt-h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #3F4A2C;
  margin-bottom: 8px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.pt-h1 em { font-style: italic; color: #6B7C4A; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.pt-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6B7C4A;
  margin-bottom: 16px;
}
.pt-body {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 380px;
  margin-bottom: 22px;
}
.pt-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--stone); display: inline-block; }
.pt-color-row { display: flex; gap: 8px; }
.sw { width: 28px; height: 28px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }

/* Plate 4: Ship (browser) */
.plate-4 {
  background: var(--paper);
  width: min(720px, 86vw);
  height: min(480px, 60vw);
}
.ship {
  inset: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ship-browser {
  flex: 1;
  background: #FAF6EE;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border: 1px solid rgba(22,19,16,0.1);
  display: flex;
  flex-direction: column;
}
.bb-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(22,19,16,0.04);
  border-bottom: 1px solid rgba(22,19,16,0.1);
}
.bb-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(22,19,16,0.18);
}
.bb-url {
  margin-left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--stone);
}
.bb-body {
  flex: 1;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bb-nav {
  display: flex;
  justify-content: space-between;
  font-family: var(--serif);
  font-size: 12px;
  color: #3F4A2C;
}
.bb-hero { padding: 8px 0 6px; }
.bb-h1 {
  font-family: var(--serif);
  font-size: clamp(20px, 3.2vw, 32px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #3F4A2C;
  margin-bottom: 8px;
}
.bb-h1 em { font-style: italic; color: #6B7C4A; }
.bb-blurb {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--stone-2);
  margin-bottom: 8px;
  max-width: 80%;
}
.bb-cta {
  font-family: var(--sans);
  font-size: 11px;
  display: inline-block;
  border-bottom: 1px solid #3F4A2C;
  color: #3F4A2C;
  padding-bottom: 1px;
}
.bb-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: auto;
}
.bb-card {
  height: 50px;
  background: linear-gradient(135deg, rgba(63,74,44,0.15), rgba(168,145,92,0.25));
  border-radius: 3px;
}
.ship-stats {
  display: flex;
  gap: 24px;
  padding: 4px 8px;
}
.ship-stats > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--stone);
}
.ship-stats .mono-num {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
}

/* Stage HUD */
.scene-hud {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 5;
}
.hud-progress {
  width: 200px;
  height: 1px;
  background: rgba(245,241,234,0.2);
  position: relative;
}
.hud-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--ember);
  transition: width .3s ease;
}
.hud-counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--paper);
}
.hud-counter .mono-label { color: rgba(245,241,234,0.55); }
.hud-counter .mono-num {
  font-size: 16px;
  color: var(--paper);
}
.scene-caption {
  position: absolute;
  left: var(--gutter);
  top: 150px;
  z-index: 5;
  width: min(360px, 40vw);
  padding: 18px 20px;
  background: rgba(22,19,16,0.72);
  border: 1px solid rgba(245,241,234,0.14);
  backdrop-filter: blur(18px);
}
.scene-caption .mono-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(245,241,234,0.58);
}
.scene-caption strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* Scrolly text steps */
.scrolly-text {
  position: relative;
  margin-top: -100vh;
}
.text-step {
  height: 120vh;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.text-step:first-child { padding-top: 0; }
.text-inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  pointer-events: auto;
}
/* alternate sides */
.step-card {
  max-width: 500px;
  padding: 28px;
  background: rgba(22,19,16,0.70);
  border: 1px solid rgba(245,241,234,0.14);
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  backdrop-filter: blur(18px);
  transition: border-color .3s, background .3s, transform .3s;
}
.text-step.active .step-card,
.step-card:hover {
  border-color: rgba(38,100,234,0.58);
  background: rgba(22,19,16,0.82);
}
.text-step[data-step="1"] .step-card { grid-column: 1; }
.text-step[data-step="2"] .step-card { grid-column: 2; justify-self: end; text-align: right; }
.text-step[data-step="3"] .step-card { grid-column: 1; }
.text-step[data-step="4"] .step-card { grid-column: 2; justify-self: end; text-align: right; }

.ts-num {
  color: var(--ember) !important;
  margin-bottom: 12px;
}
.ts-title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.ts-title em { font-style: italic; color: var(--ember); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.text-step p {
  color: rgba(245,241,234,0.78);
  font-size: 17px;
  line-height: 1.55;
  margin-bottom: 16px;
}
.ts-list {
  list-style: none;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(245,241,234,0.55);
  display: grid;
  gap: 6px;
}

@media (max-width: 800px) {
  .scrolly-stage { height: 520vh; }
  .text-step { height: 130vh; }
  .text-step[data-step="2"] .step-card,
  .text-step[data-step="4"] .step-card { grid-column: 1; justify-self: start; text-align: left; }
  .text-inner { grid-template-columns: 1fr; }
  .plate { width: 88vw; }
}

/* === DISCIPLINES === */
.disciplines {
  padding: var(--s-10) 0 var(--s-9);
}
.disc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(22,19,16,0.18);
  border: 1px solid rgba(22,19,16,0.18);
}
.disc {
  background: var(--paper);
  padding: var(--s-7) var(--s-6);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background .25s, color .25s;
}
.disc::before {
  content:"";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
  z-index: 0;
}
.disc:hover::before { transform: scaleY(1); }
.disc:hover { color: var(--paper); }
.disc:hover .disc-num { color: var(--ember); }
.disc > * { position: relative; z-index: 1; }
.disc-num {
  margin-bottom: 32px;
  transition: color .25s;
}
.disc h3 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.disc p {
  font-size: 16px;
  line-height: 1.55;
  margin-top: auto;
  max-width: 32ch;
}
@media (max-width: 800px) {
  .disc-grid { grid-template-columns: 1fr; }
}

/* === PRINCIPLES === */
.principles {
  background: var(--paper-2);
  padding: var(--s-10) 0;
}
.prin-list {
  list-style: none;
  display: grid;
  gap: 0;
  margin-top: var(--s-6);
}
.prin-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--s-6);
  padding: var(--s-6) 0;
  border-bottom: 1px solid rgba(22,19,16,0.18);
  align-items: baseline;
  transition: padding .35s ease;
}
.prin-list li:hover { padding-left: 16px; }
.prin-list li:first-child { border-top: 1px solid rgba(22,19,16,0.18); }
.prin-n {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ember);
}
.prin-list p {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 72, "SOFT" 60;
}
@media (max-width: 600px) {
  .prin-list li { grid-template-columns: 1fr; gap: 12px; }
}

/* === CTA === */
.cta-block {
  padding: var(--s-11) 0 var(--s-10);
  text-align: center;
  background: var(--paper);
  position: relative;
}
.cta-mark { margin-bottom: 24px; display: inline-block; animation: spin 18s linear infinite; }
.cta-mark img { width: 56px; height: auto; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.cta-title {
  font-size: clamp(80px, 14vw, 220px);
  margin-bottom: 32px;
}
.cta-title em {
  font-style: italic;
  color: var(--ember);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.cta-blurb {
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
}
