:root {
  --coffee: #6F4E37;
  --coffee-dark: #553524;
  --coffee-deep: #3b241a;
  --k8s: #326CE5;
  --k8s-dark: #2350b8;
  --cream: #F5E6C8;
  --cream-soft: #FBF4E6;
  --ink: #2a1f18;
  --muted: #6b5d51;
  --line: #e7dcc9;
  --bg: #fffdf9;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(85, 53, 36, 0.10);
  --shadow-lg: 0 24px 60px rgba(85, 53, 36, 0.16);
  --maxw: 1120px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --display: "Bricolage Grotesque", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --focus: 0 0 0 3px rgba(50, 108, 229, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.narrow { max-width: 760px; }

a { color: var(--k8s); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 0.4em; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); text-align: center; }
p { margin: 0 0 1em; text-wrap: pretty; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
a:focus-visible, .btn:focus-visible, summary:focus-visible, button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(111, 78, 55, 0.09);
  color: var(--coffee-dark);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}

.muted { color: var(--muted); }
.center { text-align: center; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--coffee), var(--coffee-dark));
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: var(--white);
  color: var(--coffee-dark);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--coffee); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 249, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}
.brand:hover { text-decoration: none; }
.brand-name { color: var(--coffee); }
.brand-let { color: var(--k8s); }
.brand-bean {
  width: 22px;
  height: 28px;
  background: linear-gradient(160deg, #8A6244, var(--coffee-dark));
  border-radius: 60% 60% 55% 55% / 70% 70% 50% 50%;
  transform: rotate(-16deg);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.brand-bean::after {
  content: "";
  position: absolute;
  inset: 3px 45% 3px 45%;
  border-radius: 40%;
  background: var(--cream);
  transform: rotate(4deg);
  opacity: 0.85;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-links a { color: var(--ink); font-weight: 500; }
.nav-links a:hover { color: var(--coffee); }
.nav-links .btn-ghost { padding: 8px 16px; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--coffee-dark);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bars::before { transform: translateY(-6px); }
.nav-toggle-bars::after { transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(0) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-2px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 84px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(50, 108, 229, 0.10), transparent 60%),
    radial-gradient(700px 500px at 0% 0%, rgba(111, 78, 55, 0.10), transparent 55%),
    var(--cream-soft);
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--coffee-dark);
  background: rgba(111, 78, 55, 0.10);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 800;
  margin-bottom: 0.5em;
}
.accent { color: var(--coffee); }
.lede {
  font-size: 1.18rem;
  color: #4a3b30;
  max-width: 40ch;
}
.sub { color: var(--muted); }
.hero-cta {
  display: flex;
  gap: 14px;
  margin: 26px 0 20px;
  flex-wrap: wrap;
}
.hero-cta.center { justify-content: center; }
.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--coffee-dark);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 999px;
}

/* Hero visual: stack comparison */
.stack-compare {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
}
.stack {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.stack figcaption {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
}
.layer {
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.layer span { font-weight: 400; font-size: 0.78rem; opacity: 0.85; }
.layer-app { background: linear-gradient(135deg, var(--k8s), var(--k8s-dark)); }
.layer-jvm { background: linear-gradient(135deg, #8A6244, var(--coffee)); }
.layer-os { background: linear-gradient(135deg, #8b8175, #6b5d51); }
.layer.tall { padding: 40px 14px; }
.stack-note {
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  margin: 10px 0 0;
}
.stack-arrow {
  font-size: 1.8rem;
  color: var(--coffee);
  font-weight: 700;
}
.stack-after .layer-app { box-shadow: var(--shadow-lg); outline: 2px solid rgba(50,108,229,0.25); }

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section.alt { background: var(--cream-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-lede {
  text-align: center;
  max-width: 62ch;
  margin: 0 auto 40px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- Code compare ---------- */
.code-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 36px 0 24px;
}
.code-card {
  background: #241814;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.2);
}
.code-card.wide { max-width: 820px; margin: 32px auto; }
.code-card.highlight { outline: 2px solid var(--k8s); }
.ship-config { margin-top: 56px; }
.ship-config h3 { text-align: center; font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin-bottom: 0.4em; }
.ship-config .section-lede { margin-bottom: 24px; }
.code-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #1b1210;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f56; }
.dot.amber { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.code-title {
  margin-left: 8px;
  color: #b9a99a;
  font-size: 0.8rem;
  font-family: var(--mono);
}
.code-card pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
}
.code-card code {
  background: none;
  color: #e9dfd4;
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 0;
  white-space: pre;
}
.c-kw { color: #ff9d6b; font-weight: 700; }
.c-cm { color: #7f8c7a; font-style: italic; }
.c-key { color: #78b6ff; }
.c-val { color: #ffd580; }

/* ---------- Value tiles (borderless, icon-chip led) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 28px;
  margin-top: 44px;
}
.card {
  padding: 4px 0;
}
.card[href] {
  color: inherit;
}
.card[href]:hover {
  color: var(--coffee);
  text-decoration: none;
}
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: rgba(111, 78, 55, 0.10);
  color: var(--coffee);
}
.card-icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.08rem; margin-bottom: 0.3em; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Steps: connected horizontal flow ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 48px 0 30px;
}
.step {
  position: relative;
  padding: 0 20px;
  text-align: center;
}
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 25px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px);
  z-index: 0;
}
.step-num {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coffee), var(--coffee-dark));
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 18px;
  box-shadow: 0 0 0 6px var(--bg);
}
.section.alt .step-num { box-shadow: 0 0 0 6px var(--cream-soft); }
.step h3 { font-size: 1.05rem; margin-bottom: 0.3em; }
.step p { margin: 0 auto; max-width: 24ch; color: var(--muted); font-size: 0.92rem; }

/* ---------- Architecture diagram (SVG) ---------- */
.arch-fig { margin: 44px 0 26px; }
.arch-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}
.arch-img-desktop { max-width: 1000px; }
.arch-img-mobile { display: none; max-width: 400px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 36px 0 20px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 640px;
}
th, td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}
thead th {
  background: var(--coffee-deep);
  color: var(--cream);
  font-size: 0.9rem;
}
tbody th { color: var(--ink); font-weight: 700; background: var(--cream-soft); }
td { color: var(--muted); }
.col-highlight { background: rgba(50, 108, 229, 0.07); }
thead .col-highlight { background: var(--k8s); color: #fff; }
tbody td.col-highlight strong { color: var(--coffee-dark); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }

/* ---------- FAQ ---------- */
details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 20px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease;
}
details[open] { border-color: var(--coffee); }
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--coffee);
  font-weight: 400;
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details p { padding-bottom: 16px; margin: 0; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  padding: 80px 0;
  background:
    radial-gradient(700px 400px at 50% 120%, rgba(50,108,229,0.18), transparent 60%),
    linear-gradient(135deg, var(--coffee-dark), var(--coffee-deep));
  color: #fff;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.82); max-width: 52ch; margin: 0 auto 26px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--coffee-deep);
  color: var(--cream);
  padding: 48px 0 28px;
}
.site-footer .brand-name, .site-footer .brand-let { color: #fff; }
.site-footer .brand { color: #fff; }
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-grid .muted { color: rgba(245,230,200,0.7); }
.footer-grid nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-grid nav a { color: var(--cream); }
.footer-grid nav a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  font-size: 0.86rem;
  color: rgba(245,230,200,0.6);
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .lede { max-width: none; }
  .code-compare { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  /* Steps become a vertical connected flow */
  .steps {
    grid-template-columns: 1fr;
    gap: 6px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }
  .step {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 4px 18px;
    text-align: left;
    padding: 0 0 22px;
    align-items: start;
  }
  .step:not(:last-child)::before {
    top: 50px;
    left: 24px;
    width: 2px;
    height: calc(100% - 50px);
    background: repeating-linear-gradient(180deg, var(--line) 0 8px, transparent 8px 14px);
  }
  .step-num { grid-row: span 2; margin-bottom: 0; }
  .step p { margin: 0; max-width: none; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .arch-img-desktop { display: none; }
  .arch-img-mobile { display: block; }
  .nav-links {
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 24px 22px;
    background: rgba(255, 253, 249, 0.98);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .nav-links[data-open] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links a:not(.btn) { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-links .btn-ghost { margin-top: 10px; justify-content: center; padding: 12px 16px; }
}
@media (max-width: 620px) {
  .cards, .steps { grid-template-columns: 1fr; }
  .stack-compare { flex-direction: column; }
  .stack-arrow { transform: rotate(90deg); }
  .hero { padding: 48px 0 60px; }
  .section { padding: 56px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; animation: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- Scroll reveal (JS-gated per element; content never hidden without JS) ---------- */
[data-reveal] {
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].reveal-init {
  opacity: 0;
  transform: translateY(18px);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
[data-reveal][data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal][data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal][data-reveal-delay="3"] { transition-delay: 0.24s; }
