/* =========================================================
   NEOPLASTIC — single-page styles
   Palette: Mondrian (black, white, red, blue, yellow)
   Type: Inter (sans), Fraunces italic accent
   ========================================================= */

:root {
  --red: #E5202C;
  --blue: #1F4FFF;
  --yellow: #FFCC00;
  --black: #000000;
  --white: #FFFFFF;
  --ink: #0A0A0A;
  --text: #141414;
  --muted: #6B7280;
  --muted-2: #9CA3AF;
  --line: #000000;
  --line-soft: #E5E7EB;
  --bg-soft: #FAFAFA;

  --container: 1180px;
  --pad: clamp(20px, 4vw, 56px);
  --border-w: 1.5px;
  --radius: 999px;

  --fs-display: clamp(40px, 6.4vw, 68px);
  --fs-h2: clamp(28px, 3.8vw, 42px);
  --fs-h3: 17px;
  --fs-body: 16px;
  --fs-small: 14px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

/* Reset / base ----------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

html, body { overflow-x: clip; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, p { margin: 0; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--black);
  color: var(--white);
  padding: 10px 14px;
  z-index: 9999;
  border-radius: 6px;
}
.skip-link:focus { left: 8px; }

/* Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad);
}

/* Typography helpers --------------------------------------------------- */
.display {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: break-word;
  text-wrap: balance;
}
.display .accent {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: -0.01em;
}
.section-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ink);
}
.section-title.left { text-align: left; }

.lede {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--muted);
  max-width: 36ch;
  margin-top: 18px;
}

/* Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 15px;
  border: 1.5px solid transparent;
  transition: transform .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.btn-primary:hover { background: #1A1A1A; transform: translateY(-1px); }
.btn-link {
  padding: 8px 0;
  color: var(--ink);
  font-weight: 500;
}
.btn-link.blue { color: var(--blue); }
.btn-link:hover { transform: translateX(2px); }

/* Header / Nav -------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: var(--border-w) solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink);
}
.brand-mark { width: 28px; height: 28px; flex: 0 0 28px; }
.brand-word { font-size: 14px; }

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 36px);
}
.primary-nav a {
  font-size: 14.5px;
  color: var(--ink);
  font-weight: 500;
  padding: 6px 2px;
}
.primary-nav a:hover { color: var(--blue); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.primary-nav-mobile {
  display: none;
  border-top: var(--border-w) solid var(--line);
  background: var(--white);
}
.primary-nav-mobile.is-open { display: block; }
.primary-nav-mobile ul { padding: 8px var(--pad) 16px; display: flex; flex-direction: column; gap: 4px; }
.primary-nav-mobile a {
  display: block;
  padding: 12px 0;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}

/* HERO ---------------------------------------------------------------- */
.hero {
  border-bottom: var(--border-w) solid var(--line);
  overflow: visible;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
  min-height: clamp(380px, 50vh, 500px);
}
.hero-copy {
  padding-block: clamp(40px, 5.5vw, 64px);
  padding-right: clamp(20px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: var(--border-w) solid var(--line);
}
.hero-visual {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
  position: relative;
}
.hero-visual picture { display: block; }
.hero-visual img {
  display: block;
  height: auto;
  width: auto;
  max-width: none;
  max-height: clamp(280px, 38vh, 380px);
}

/* FEATURES ------------------------------------------------------------ */
.features {
  border-bottom: var(--border-w) solid var(--line);
  padding-block: clamp(56px, 7vw, 92px);
}
.features .section-title { margin-bottom: clamp(36px, 5vw, 56px); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(20px, 2.8vw, 36px);
}
.feature-grid > li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}
.feature-icon {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 6px;
}
.feature-grid h3 { font-size: var(--fs-h3); font-weight: 600; }
.feature-grid p { font-size: var(--fs-small); color: var(--muted); line-height: 1.5; }

/* ARCHITECTURE -------------------------------------------------------- */
.architecture {
  border-bottom: var(--border-w) solid var(--line);
  padding-block: clamp(56px, 7vw, 92px);
}
.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.arch-intro p { color: var(--muted); margin-top: 18px; }
.arch-intro .btn-link { margin-top: 18px; display: inline-flex; }
.arch-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.arch-card {
  border: var(--border-w) solid var(--line);
  background: var(--white);
  padding: 0 0 20px 0;
  display: flex;
  flex-direction: column;
}
.arch-card-h {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--white);
  padding: 12px;
  font-size: 13px;
}
.arch-card-h.blue { background: var(--blue); }
.arch-card-h.red  { background: var(--red); }
.arch-card h3 {
  padding: 18px 18px 8px;
  font-size: 16px;
  font-weight: 600;
}
.arch-card ul {
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}
.arch-card li {
  font-size: var(--fs-small);
  color: var(--ink);
  position: relative;
  padding-left: 16px;
}
.arch-card li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 6px; height: 6px;
  background: var(--ink);
  border-radius: 50%;
}
.arch-card footer {
  margin-top: 14px;
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* STATS --------------------------------------------------------------- */
.stats {
  background: var(--black);
  color: var(--white);
  border-bottom: var(--border-w) solid var(--line);
  padding-block: clamp(40px, 5.5vw, 64px);
  position: relative;
  overflow: hidden;
}
/* Right-edge Mondrian trim: red top, white middle, blue bottom + small accent */
.stats::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: clamp(40px, 7vw, 110px);
  background:
    linear-gradient(
      var(--red)   0    35%,
      #fff         35%  62%,
      var(--blue)  62%  100%
    );
  border-left: var(--border-w) solid var(--white);
  display: none;
}
.stats::before {
  content: '';
  position: absolute;
  right: clamp(40px, 7vw, 110px);
  top: 35%;
  width: clamp(28px, 4vw, 40px);
  height: clamp(28px, 4vw, 40px);
  background: var(--red);
  border: 2px solid var(--white);
  display: none;
}
@media (min-width: 1100px) {
  .stats::after, .stats::before { display: block; }
  .stats .container { padding-right: clamp(110px, 9vw, 170px); }
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 48px);
}
.stat-value {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-value .stat-unit { font-size: .7em; font-weight: 700; }
.stat-label { margin-top: 8px; font-size: 14px; font-weight: 600; }
.stat-note  { color: #B5B5B5; font-size: 12.5px; margin-top: 4px; }

/* PIPELINE ------------------------------------------------------------ */
.pipeline {
  border-bottom: var(--border-w) solid var(--line);
  padding-block: clamp(56px, 7vw, 92px);
}
.pipe-grid {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}
.pipe-intro p { color: var(--muted); margin-top: 16px; }
.pipe-intro .btn-link { margin-top: 18px; display: inline-flex; }

.pipe-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 1.8vw, 22px);
}
.pipe-steps li {
  border: 1.5px solid var(--line-soft);
  background: var(--white);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pipe-icon {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 6px;
}
.pipe-num {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-right: 6px;
}
.pipe-steps h3 { font-size: 15.5px; font-weight: 600; white-space: nowrap; }
.pipe-steps p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* CLOSING ------------------------------------------------------------- */
.closing {
  padding-block: clamp(56px, 7vw, 92px);
  background: var(--white);
}
.closing-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.closing-art svg { width: clamp(120px, 14vw, 180px); height: auto; }
.closing-copy p { margin-top: 14px; color: var(--muted); max-width: 52ch; }

/* FOOTER -------------------------------------------------------------- */
.site-footer {
  border-top: var(--border-w) solid var(--line);
  padding-block: clamp(28px, 4vw, 44px);
  background: var(--white);
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 36px);
  flex-wrap: wrap;
}
.foot-brand { display: flex; flex-direction: column; gap: 8px; }
.foot-brand .brand { display: inline-flex; }
.foot-brand p { color: var(--muted); font-size: 14px; max-width: 36ch; }
.foot-meta { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.foot-meta .tagline { font-size: 13px; color: var(--ink); line-height: 1.45; }
.foot-meta .copyright { color: var(--muted); font-size: 13px; }

/* Responsive breakpoints ---------------------------------------------- */

/* Large desktop: keep as-is */

/* Tablet landscape — hero stacks here so left text never gets squeezed */
@media (max-width: 900px) {
  :root { --fs-display: clamp(40px, 6.4vw, 60px); }

  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { border-right: none; border-bottom: var(--border-w) solid var(--line); padding-right: 0; }
  .hero-visual { padding: 24px 0; }
  .hero-visual img { max-height: clamp(280px, 46vw, 420px); width: 100%; height: auto; object-fit: contain; object-position: center; }

  /* 6-col base; each feature spans 2 cols → row1: 3 items.
     Row 2 explicitly positioned so the last 2 items center under row 1. */
  .feature-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .feature-grid > li { grid-column: span 2; }
  .feature-grid > li:nth-child(4) { grid-column: 2 / span 2; }
  .feature-grid > li:nth-child(5) { grid-column: 4 / span 2; }

  .arch-grid    { grid-template-columns: 1fr; gap: 28px; }
  .pipe-grid    { grid-template-columns: 1fr; }
  .pipe-steps   { grid-template-columns: repeat(4, 1fr); }
  .closing-grid { grid-template-columns: auto 1fr; }
}

/* Tablet portrait / large phone */
@media (max-width: 760px) {
  :root { --fs-display: clamp(36px, 8vw, 52px); }

  .primary-nav { display: none; }
  .nav-toggle { display: inline-flex; }

  .arch-cards { grid-template-columns: 1fr; }
  .pipe-steps { grid-template-columns: repeat(2, 1fr); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }

  .closing-grid { grid-template-columns: 1fr; }
  .closing-art { display: none; }

  .footer-row { flex-direction: column; align-items: flex-start; gap: 18px; }
  .foot-meta { text-align: left; }
}

/* Phone */
@media (max-width: 560px) {
  :root { --pad: 20px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid > li,
  .feature-grid > li:nth-child(4) { grid-column: auto; }
  /* Orphan 5th item centers itself on its own row */
  .feature-grid > li:nth-child(5) {
    grid-column: 1 / -1;
    justify-self: center;
    text-align: center;
    align-items: center;
    max-width: 18rem;
  }
  .pipe-steps   { grid-template-columns: 1fr; }
  .brand-word   { font-size: 13px; letter-spacing: 0.16em; }
  .nav { gap: 12px; }
  .stat-value  { font-size: 38px; }
}

@media (max-width: 360px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid > li { grid-column: auto; }
  .brand-word { display: none; }
}
