:root {
  --paper: #f2ede4;
  --paper-2: #ece6da;
  --panel: #f8f4ec;
  --ink: #100f0d;
  --ink-2: #201e1a;
  --muted: #6b665c;
  --line: rgba(16, 15, 13, 0.16);
  --line-soft: rgba(16, 15, 13, 0.09);
  --accent: #ff5b12;
  --accent-ink: #1a0a02;
  --maxw: 1240px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img {
  display: block;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- intro / load animation ---------- */
.intro-lock,
.intro-lock body {
  overflow: hidden;
}

#intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  background: var(--ink);
}

.intro-panel {
  position: absolute;
  inset: -2px;
  background: var(--ink);
  background-image: radial-gradient(120% 80% at 50% 50%, #1b1a17 0%, #0c0b09 72%);
  transition: transform 1.45s cubic-bezier(0.72, 0, 0.16, 1);
  will-change: transform;
}

.intro-top {
  clip-path: polygon(0 0, 100% 0, 100% 43%, 0 57%);
}

.intro-bot {
  clip-path: polygon(0 57%, 100% 43%, 100% 100%, 0 100%);
}

/* seam: outer element is positioned + rotated by JS to sit exactly on the split cut */
.intro-seam {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 2px;
  transform: translate(-50%, -50%) rotate(-5.7deg);
  transform-origin: center;
  pointer-events: none;
}

.intro-seam-line {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(255, 91, 18, 0.6);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  animation: seamDraw 0.9s cubic-bezier(0.5, 0, 0.18, 1) forwards 2.05s;
}

.intro-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.9s ease, transform 1s cubic-bezier(0.4, 0, 0.2, 1), filter 0.9s ease;
}

.intro-logo-wrap {
  position: relative;
  width: min(52vw, 540px);
  transform: scale(1.03);
  animation: logoSettle 0.85s cubic-bezier(0.32, 1.28, 0.62, 1) forwards 2.1s;
}

.intro-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.intro-svg polygon {
  fill: #f4f1ea;
  fill-opacity: 0;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--len, 0);
  stroke-dashoffset: var(--len, 0);
  filter: drop-shadow(0 0 5px rgba(255, 91, 18, 0.35));
  animation: drawPoly 1.25s cubic-bezier(0.45, 0, 0.16, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.13s + 0.35s);
}

.intro-svg polygon:nth-child(1) { --i: 2; }
.intro-svg polygon:nth-child(2) { --i: 0; }
.intro-svg polygon:nth-child(3) { --i: 3; }
.intro-svg polygon:nth-child(4) { --i: 4; }
.intro-svg polygon:nth-child(5) { --i: 6; }
.intro-svg polygon:nth-child(6) { --i: 5; }
.intro-svg polygon:nth-child(7) { --i: 1; }

.intro-word {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: #8a857a;
  opacity: 0;
  animation: wordIn 0.85s var(--ease) forwards 1.5s;
}

#intro.leaving .intro-top {
  transform: translate(-3%, -106%);
}

#intro.leaving .intro-bot {
  transform: translate(3%, 106%);
}

#intro.leaving .intro-stage {
  opacity: 0;
  transform: scale(0.975) translateY(-52px);
  filter: blur(2px);
  transition-delay: 0.12s;
}

#intro.leaving .intro-seam-line {
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes drawPoly {
  0% {
    stroke-dashoffset: var(--len, 0);
    fill-opacity: 0;
    stroke-opacity: 1;
  }
  52% {
    stroke-dashoffset: 0;
    fill-opacity: 0;
    stroke-opacity: 1;
  }
  78% {
    fill-opacity: 1;
    stroke-opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    fill-opacity: 1;
    stroke-opacity: 0;
  }
}

@keyframes logoSettle {
  to {
    transform: scale(1);
  }
}

/* fallback: if JS never removes the overlay (e.g. scripting off), clear it anyway */
#intro {
  animation: introAutohide 0.6s ease forwards 5.4s;
}

@keyframes introAutohide {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@keyframes seamDraw {
  0% { transform: scaleX(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scaleX(1); opacity: 1; }
}

@keyframes wordIn {
  from { opacity: 0; transform: translateY(6px); letter-spacing: 0.42em; }
  to { opacity: 1; transform: none; letter-spacing: 0.28em; }
}

/* ---------- mono / label type ---------- */
.label,
.card-tag,
.cap-tag,
.foot-label,
.spec-k,
.card-link,
.pt-idx,
.marquee i {
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  font-weight: 500;
}

.label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin: 0;
}

.idx {
  color: var(--accent);
  font-weight: 600;
}

.serif {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
}

.arr {
  display: inline-block;
  transition: transform 260ms var(--ease);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 237, 228, 0.8);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand-logo {
  height: 26px;
  width: auto;
  transition: transform 300ms var(--ease);
}

.brand:hover .brand-logo {
  transform: scale(1.05) rotate(-1deg);
}

.nav {
  position: relative;
  display: flex;
  gap: 30px;
  margin-left: auto;
  padding-bottom: 8px;
  font-size: 0.98rem;
  font-weight: 500;
}

.nav-link {
  color: var(--muted);
  padding: 2px 0;
  transition: color 240ms var(--ease);
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link.is-active {
  color: var(--ink);
}

.nav-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 420ms var(--ease), width 420ms var(--ease);
}

/* header scroll-progress fill */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0.85;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 13px 22px;
  border: 1.5px solid var(--ink);
  transition: background 220ms var(--ease), color 220ms var(--ease), transform 220ms var(--ease),
    border-color 220ms var(--ease);
  white-space: nowrap;
}

.btn:hover .arr {
  transform: translateX(5px);
}

.btn-solid {
  background: var(--ink);
  color: var(--paper);
}

.btn-solid:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-2);
  padding: 10px 16px;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost:hover .dot {
  animation: pulse 1s ease-in-out infinite;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.9rem;
}

/* ---------- shell + hero ---------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  padding: 84px 48px 84px 0;
  border-right: 1px solid var(--line);
}

.hero h1 {
  margin: 24px 0 0;
  font-size: clamp(3rem, 7.4vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
  font-weight: 700;
  max-width: 15ch;
}

.hero h1 .serif {
  letter-spacing: -0.01em;
}

.lede {
  margin: 30px 0 0;
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

/* spec panel */
.spec {
  padding: 44px 0 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.spec-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 17px 0;
  border-top: 1px solid var(--line-soft);
}

.spec-row:first-child {
  border-top: 0;
}

.spec-k {
  color: var(--muted);
  min-width: 74px;
}

.spec-v {
  font-size: 1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 91, 18, 0.5);
  animation: pulse 1.8s ease-in-out infinite;
}

.spec-focus {
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
}

.spec-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-tags li {
  border: 1px solid var(--line);
  padding: 6px 11px;
  font-size: 0.86rem;
  font-weight: 500;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}

.spec-tags li:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- kinetic marquee ---------- */
.marquee {
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 22px 0;
  margin: 0;
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 34px;
  white-space: nowrap;
  will-change: transform;
  animation: scroll-x 34s linear infinite;
  padding-left: 34px;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track span {
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.marquee-track i {
  color: var(--accent);
  font-size: 0.9rem;
  font-style: normal;
}

/* ---------- generic block ---------- */
.block {
  padding: 92px 0;
  border-bottom: 1px solid var(--line);
}

.block-head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  column-gap: 40px;
  margin-bottom: 56px;
}

.block-head .label {
  grid-column: 1 / -1;
}

.block-head h2 {
  margin: 20px 0 0;
  max-width: 16ch;
  font-size: clamp(2.3rem, 4.8vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.block-lede {
  margin: 0 0 8px;
  color: var(--muted);
  max-width: 40ch;
  font-size: 1.06rem;
  line-height: 1.55;
}

/* ---------- product cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.card {
  position: relative;
  padding: 32px 30px 28px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 330px;
  background: var(--paper);
  transition: background 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 4px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease);
}

.card:last-child {
  border-right: 0;
}

.card:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-4px);
  z-index: 2;
}

.card:hover::before {
  transform: scaleX(1);
}

.card-tag {
  color: var(--accent);
  margin: 0 0 22px;
  transition: color 300ms var(--ease);
}

.card:hover .card-tag {
  color: var(--accent-ink);
}

.card h3 {
  margin: 0;
  font-size: 2.1rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1;
}

.card-body {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.99rem;
  line-height: 1.58;
  transition: color 300ms var(--ease);
}

.card:hover .card-body {
  color: var(--accent-ink);
}

.card-link {
  margin-top: auto;
  padding-top: 24px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.12em;
  transition: color 300ms var(--ease);
}

.card:hover .card-link {
  color: var(--accent-ink);
}

.card:hover .card-link .arr {
  transform: translateX(6px);
}

/* ---------- approach points ---------- */
.points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.points article {
  padding: 34px 28px 34px 0;
  border-right: 1px solid var(--line-soft);
  transition: transform 300ms var(--ease);
}

.points article:last-child {
  border-right: 0;
  padding-right: 0;
}

.points article:not(:first-child) {
  padding-left: 28px;
}

.points article:hover {
  transform: translateY(-4px);
}

.pt-idx {
  color: var(--accent);
  display: block;
  margin-bottom: 18px;
  font-size: 0.82rem;
}

.points h3 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.points p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.99rem;
}

/* ---------- capabilities ---------- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.cap {
  padding: 28px 24px;
  border-right: 1px solid var(--line-soft);
  transition: background 240ms var(--ease);
}

.cap:last-child {
  border-right: 0;
}

.cap:hover {
  background: var(--panel);
}

.cap-tag {
  color: var(--ink);
  margin: 0 0 16px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.cap p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* ---------- company ---------- */
.company-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
  border-top: 1px solid var(--line);
}

.company-copy {
  padding: 40px 48px 40px 0;
  border-right: 1px solid var(--line);
}

.company-copy > p {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.55;
  font-weight: 500;
}

.founder-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.founder-text {
  color: var(--muted);
  margin: 16px 0 24px;
  font-size: 1.05rem;
  line-height: 1.55;
}

.inline-link {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
  transition: color 200ms var(--ease);
}

.inline-link:hover {
  color: var(--accent);
}

.registry {
  padding: 40px 0 40px 48px;
}

.registry dl {
  margin: 20px 0 0;
}

.registry dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.registry dl div:first-child {
  border-top: 0;
}

.registry dt {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-top: 3px;
}

.registry dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  font-size: 0.97rem;
}

/* ---------- footer ---------- */
.footer {
  background: var(--ink);
  color: #d6d1c7;
}

.footer-cta {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 76px 24px 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.label-invert {
  color: #8a857a;
}

.footer-big {
  display: block;
  margin-top: 20px;
  font-size: clamp(2.4rem, 6.4vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--paper);
  max-width: 16ch;
  transition: color 240ms var(--ease);
}

.footer-big .serif {
  color: var(--accent);
}

.footer-big:hover {
  color: var(--accent);
}

.footer-big:hover .serif {
  color: var(--paper);
}

.footer-big:hover .arr {
  transform: translateX(10px);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 40px;
}

.footer-logo {
  height: 26px;
  width: auto;
}

.footer-tag {
  margin: 16px 0 0;
  color: #8a857a;
  font-size: 0.96rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foot-label {
  color: #75716a;
  margin: 0 0 4px;
}

.footer-col a {
  color: #d6d1c7;
  font-size: 0.96rem;
  width: fit-content;
  transition: color 180ms var(--ease), transform 180ms var(--ease);
}

.footer-col a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

.foot-fine {
  margin: 0;
  color: #8a857a;
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-base {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #75716a;
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

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

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 91, 18, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 91, 18, 0);
  }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero,
  .company-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .company-copy {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
  }

  .hero-copy {
    padding: 56px 0;
  }

  .spec,
  .registry {
    padding: 36px 0;
  }

  .cards,
  .points,
  .cap-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .cap,
  .points article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .card:last-child,
  .cap:last-child,
  .points article:last-child {
    border-bottom: 0;
  }

  .points article,
  .points article:not(:first-child) {
    padding: 28px 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .nav {
    display: none;
  }

  .topbar-cta {
    margin-left: auto;
  }

  .block {
    padding: 60px 0;
  }

  .block-head {
    margin-bottom: 38px;
  }

  .footer-cols {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .footer-base {
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #intro {
    display: none;
  }

  .marquee-track {
    animation: none;
  }

  .intro-svg polygon,
  .intro-seam-line,
  .intro-word,
  .live-dot,
  .btn-ghost:hover .dot {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}
