/* ============================================================
   Master Plan Studio — masterplan-studio.com
   Black / grain / grotesk / ember. Swiss grid, pixel accents.
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-2: #111110;
  --ink: #f2f1ee;
  --dim: #8f8e89;
  --faint: #7d7c76;
  --red: #ff3d17;
  --line: rgba(242, 241, 238, 0.14);
  --font-sans: "Helvetica Now Display", "Neue Haas Grotesk Display Pro",
    "Helvetica Neue", Helvetica, Inter, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, "IBM Plex Mono", monospace;
  --pad: clamp(20px, 4vw, 64px);
  --max: 1440px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--red); color: var(--bg); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

a { color: inherit; text-decoration: none; }

/* ---------- grain ---------- */

.grain {
  position: fixed;
  inset: -100px;
  z-index: 90;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-36px, 22px); }
  50% { transform: translate(24px, -30px); }
  75% { transform: translate(-18px, -14px); }
  100% { transform: translate(30px, 26px); }
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  transition: background 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(10, 10, 10, 0.75);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

.nav__mark {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav__mark .dot { color: var(--red); font-weight: 700; }

.nav__right { display: flex; align-items: center; gap: 28px; }

.nav__clock { color: var(--dim); font-variant-numeric: tabular-nums; }

.nav__cta {
  color: var(--ink);
  padding: 8px 14px;
  border: 1px solid var(--line);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

@media (hover: hover) {
  .nav__cta:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--bg);
  }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__ember {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% 118%, rgba(255, 61, 23, 0.5), rgba(255, 61, 23, 0.1) 45%, transparent 72%),
    radial-gradient(60% 30% at 50% 108%, rgba(255, 100, 40, 0.35), transparent 70%);
  animation: ember 7s ease-in-out infinite alternate;
}

@keyframes ember {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

.hero__inner { position: relative; z-index: 2; width: 100%; }

.hero__title {
  font-size: clamp(56px, 10.5vw, 168px);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.015em;
  display: flex;
  flex-direction: column;
}

.hero__word { display: block; position: relative; width: fit-content; }

.hero__sub {
  margin-top: clamp(24px, 3vw, 44px);
  max-width: 420px;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.45;
  color: var(--dim);
}

.hero__meta { position: absolute; inset: 0; z-index: 2; pointer-events: none; color: var(--dim); }

.hero__meta span { position: absolute; }

.hero__meta-tl { top: 76px; left: var(--pad); }
.hero__meta-tr { top: 76px; right: var(--pad); }
.hero__meta-bl { bottom: 28px; left: var(--pad); }
.hero__meta-br { bottom: 28px; right: var(--pad); }

@media (max-width: 720px) {
  .hero__meta-tl, .hero__meta-tr { display: none; }
}

@media (max-width: 640px) {
  .nav__clock { display: none; }
  .nav { padding-top: 14px; padding-bottom: 14px; }
}

/* keep the widest hero word ("FORWARD.") inside the grid margin on
   very narrow screens — the 56px clamp floor overflows below ~330px */
@media (max-width: 360px) {
  .hero__title { font-size: clamp(36px, 15.5vw, 56px); }
}

/* ---------- ticker ---------- */

.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 13px 0;
  background: var(--bg);
  position: relative;
  z-index: 3;
}

.ticker__track {
  display: flex;
  width: max-content;
  color: var(--dim);
  animation: ticker 36s linear infinite;
}

.ticker__group { display: inline-flex; align-items: center; white-space: nowrap; }

.ticker__group span { padding: 0 18px; }

.ticker__group i { color: var(--red); font-style: normal; font-size: 8px; }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

.section { padding: clamp(90px, 12vw, 170px) 0; position: relative; }

.section--rule { border-top: 1px solid var(--line); }

.label {
  color: var(--dim);
  margin-bottom: clamp(40px, 5vw, 72px);
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.label__num { color: var(--red); }

.section__intro {
  max-width: 640px;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: clamp(48px, 6vw, 88px);
}

/* ---------- 01 hello ---------- */

.hello__typed {
  color: var(--red);
  margin-bottom: clamp(28px, 3vw, 44px);
  min-height: 1em;
}

.typed__cursor { animation: blink 1.05s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0; } }

.statement {
  font-size: clamp(30px, 4.6vw, 68px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 1180px;
}

.statement em { font-style: normal; color: var(--red); }

/* ---------- 02 about ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 120px);
  align-items: center;
}

.about__display {
  font-size: clamp(44px, 6.5vw, 104px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about__x { color: var(--red); font-weight: 400; padding: 0.02em 0; }

.about__machine { position: relative; }

.about__copy p { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: var(--dim); }

.about__copy p + p { margin-top: 1.1em; }

.about__copy .about__bold { color: var(--ink); font-weight: 500; }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
}

/* ---------- 03 capabilities ---------- */

.caps { list-style: none; border-top: 1px solid var(--line); }

.caps__row {
  display: flex;
  align-items: baseline;
  gap: clamp(20px, 4vw, 64px);
  padding: clamp(16px, 2vw, 26px) 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s ease;
}

.caps__num { color: var(--faint); transition: color 0.25s ease; }

@media (hover: hover) {
  .caps__row:hover { padding-left: 12px; }
  .caps__row:hover .caps__num { color: var(--red); }
}

.caps__name {
  font-size: clamp(20px, 2.6vw, 38px);
  font-weight: 500;
  letter-spacing: -0.01em;
  position: relative;
}

/* ---------- 04 clients ---------- */

.clients {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.clients li {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(28px, 3.4vw, 52px) clamp(16px, 2vw, 28px);
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 500;
  color: var(--dim);
  transition: color 0.25s ease, background 0.25s ease;
}

@media (hover: hover) {
  .clients li:hover { color: var(--ink); background: var(--bg-2); }
}

.clients__note {
  margin-top: clamp(28px, 3vw, 44px);
  max-width: 560px;
  color: var(--dim);
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clients__request { color: var(--faint); }

@media (max-width: 860px) {
  .clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 05 founder ---------- */

.founder {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 120px);
}

.founder__display,
.plan__display {
  font-size: clamp(40px, 6vw, 96px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.02;
  position: relative;
  width: fit-content;
  height: fit-content;
}

.founder__copy p { color: var(--dim); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.6; }

.founder__copy p + p { margin-top: 1.2em; }

.founder__sig { color: var(--ink); margin-top: 2em; }

@media (max-width: 860px) {
  .founder { grid-template-columns: 1fr; }
}

/* ---------- 06 plan / how we work ---------- */

.plan__display { margin-bottom: clamp(32px, 4vw, 56px); }

.plan__copy { max-width: 640px; }

.plan__copy p { color: var(--dim); font-size: clamp(17px, 1.5vw, 21px); line-height: 1.55; }

.plan__copy p + p { margin-top: 1.1em; }

.plan__pipeline {
  margin-top: clamp(56px, 7vw, 96px);
  display: flex;
  align-items: stretch;
  gap: clamp(12px, 2vw, 28px);
  flex-wrap: wrap;
}

.plan__node {
  border: 1px solid var(--line);
  padding: clamp(18px, 2vw, 28px) clamp(20px, 2.4vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 200px;
  min-width: 200px;
  transition: border-color 0.3s ease;
}

@media (hover: hover) {
  .plan__node:hover { border-color: rgba(255, 61, 23, 0.55); }
}

.plan__node-label { color: var(--red); }

.plan__node-name { font-size: clamp(17px, 1.5vw, 21px); font-weight: 500; }

.plan__arrow { align-self: center; color: var(--faint); letter-spacing: 0.2em; }

@media (max-width: 860px) {
  .plan__arrow { display: none; }
}

/* ---------- 07 contact ---------- */

.contact {
  position: relative;
  border-top: 1px solid var(--line);
  padding: clamp(100px, 13vw, 190px) 0 clamp(90px, 11vw, 160px);
  overflow: hidden;
}

.contact__ember {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 65% at 50% 125%, rgba(255, 61, 23, 0.55), rgba(255, 61, 23, 0.12) 48%, transparent 75%),
    radial-gradient(70% 35% at 50% 112%, rgba(255, 110, 46, 0.4), transparent 70%);
  animation: ember 8s ease-in-out infinite alternate;
}

.contact .container { position: relative; z-index: 2; }

.constellation {
  width: min(720px, 100%);
  height: auto;
  display: block;
  margin: 0 auto clamp(40px, 5vw, 72px);
  overflow: visible;
}

.constellation__line {
  stroke: rgba(242, 241, 238, 0.55);
  stroke-width: 1;
  stroke-dasharray: 0.014 0.01;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.4s ease;
}

.constellation.is-drawn .constellation__line { stroke-dashoffset: 0; }

.constellation.is-drawn .constellation__line:nth-of-type(2) { transition-delay: 0.9s; }

.constellation__node { fill: var(--ink); }

.constellation__text {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.contact__ask {
  text-align: center;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 400;
  color: var(--dim);
  margin-bottom: clamp(18px, 2vw, 28px);
}

.contact__email {
  display: block;
  width: fit-content;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(26px, 4.6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.015em;
  position: relative;
  transition: color 0.25s ease;
}

@media (hover: hover) {
  .contact__email:hover { color: var(--red); }
}

.contact__meta {
  margin-top: clamp(56px, 7vw, 96px);
  display: flex;
  justify-content: center;
  gap: clamp(24px, 5vw, 72px);
  flex-wrap: wrap;
  color: var(--dim);
}

@media (hover: hover) {
  .contact__meta a:hover { color: var(--red); }
}

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 22px 0; background: var(--bg); }

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
  flex-wrap: wrap;
}

@media (hover: hover) {
  .footer__inner a:hover { color: var(--ink); }
}

.footer__mps { color: var(--dim); }

/* ---------- reveal (JS-gated: without JS everything stays visible) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js [data-reveal].in { opacity: 1; transform: none; }

/* decode overlays */

.decode-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  image-rendering: pixelated;
}

.is-decoding { color: transparent !important; }

.is-decoding em, .is-decoding span { color: transparent !important; }

/* ---------- reduced motion / no-js ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .ticker__track, .hero__ember, .contact__ember, .typed__cursor { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .constellation__line { stroke-dashoffset: 0; }
}

/* ---------- print ---------- */

@media print {
  body { background: #fff; color: #111; }
  .grain, .hero__field, .hero__ember, .contact__ember, .ticker, .decode-canvas { display: none !important; }
  .nav { position: static; background: none; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .is-decoding, .is-decoding em, .is-decoding span { color: inherit !important; }
  .hero { min-height: auto; padding: 40px 0; }
  .hero__meta { display: none; }
  body, .about__copy p, .founder__copy p, .plan__copy p, .section__intro,
  .clients li, .clients__note, .contact__meta, .footer__inner, .label,
  .hello__typed, .hero__sub, .caps__num { color: #111; }
  .statement em, .label__num { color: #c22e10; }
}
