:root {
  --paper: #f3efe7;
  --ink: #16150f;
  --muted: #6b665a;
  --line: #d9d2c3;
  --accent: #c2410c;
  --card: #faf7f1;
  --term: #0f0e0b;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(16px, 5vw, 64px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12110e;
    --ink: #ece6d9;
    --muted: #958e7e;
    --line: #2a2822;
    --accent: #f97316;
    --card: #1a1915;
    --term: #0a0907;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; }
em { font-style: italic; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad);
  transition: background .3s, border-color .3s, padding .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); border-color: var(--line); padding-block: 12px; }
.mark { font: 400 1.7rem var(--serif); text-decoration: none; }
.mark span { color: var(--accent); }
.nav nav { display: flex; gap: clamp(14px, 2.6vw, 30px); align-items: center; font-size: .92rem; }
.nav nav a { text-decoration: none; position: relative; white-space: nowrap; }
.nav nav a:not(.nav-cta)::after { content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 0; background: currentColor; transition: width .25s; }
.nav nav a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta { border: 1px solid var(--ink); border-radius: 999px; padding: 7px 16px; transition: background .2s, color .2s; }
.nav-cta:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 760px) { .nav nav a:not(.nav-cta) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 999px; padding: 14px 24px;
  font: 500 .95rem var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn span { transition: transform .2s; }
.btn:hover span { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: wait; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(28px, 5vw, 72px); align-items: end;
  padding: 120px var(--pad) 56px; max-width: 1440px; margin: 0 auto;
}
.hero-meta { color: var(--muted); display: flex; align-items: center; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 #16a34a80; animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px #16a34a00; } 100% { box-shadow: 0 0 0 0 #16a34a00; } }
.sep { opacity: .4; }
.hero-title { font: 400 clamp(3rem, 8.2vw, 8rem)/0.93 var(--serif); letter-spacing: -0.02em; }
.hero-title .line { display: block; }
.hero-title em { color: var(--accent); }
.js .hero-title .line { opacity: 0; transform: translateY(30%); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.js .hero-title.in .line { opacity: 1; transform: none; }
.hero-title .line:nth-child(2) { transition-delay: .12s; }
.hero-title .line:nth-child(3) { transition-delay: .24s; }
.lede { max-width: 560px; color: var(--muted); font-size: 1.1rem; margin-top: 32px; }
.lede strong { color: var(--ink); font-weight: 500; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }

.hero-photo { position: relative; align-self: stretch; display: flex; align-items: flex-end; }
.hero-photo figure { position: relative; width: 100%; border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 5; border: 1px solid var(--line); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.hero-photo figure:hover img { transform: scale(1.03); }
.hero-photo figcaption { position: absolute; left: 12px; bottom: 12px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(6px); padding: 6px 10px; border-radius: 4px; }
.code-chip {
  position: absolute; left: -36px; top: 18%; z-index: 2; width: min(270px, 80%);
  background: var(--term); color: #d6cfbf; border-radius: 6px; padding: 12px 14px; border: 1px solid #2a2822;
  box-shadow: 0 20px 40px -20px #0006; font: 400 .72rem/1.7 var(--mono);
}
.code-chip .k { color: #f97316; }
.code-chip .ok { color: #4ade80; }
.code-chip .dim { color: #7c7566; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-photo { max-width: 420px; }
  .code-chip { left: auto; right: -8px; top: auto; bottom: 18%; }
}

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 16px 0; }
.track { display: flex; gap: 28px; width: max-content; animation: slide 45s linear infinite; text-transform: uppercase; color: var(--muted); }
.track i { color: var(--accent); font-style: normal; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 10vw, 120px) var(--pad); max-width: 1280px; margin: 0 auto; }
.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 36px; }
.idx { color: var(--accent); }
.section-head h2 { font: 400 clamp(2.3rem, 5vw, 3.9rem)/1.02 var(--serif); letter-spacing: -0.01em; }
.section-lede { color: var(--muted); max-width: 600px; margin-bottom: 40px; font-size: 1.05rem; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); max-width: calc(1280px - 2 * var(--pad)); width: calc(100% - 2 * var(--pad)); margin: clamp(56px, 8vw, 96px) auto 0; }
.stat { background: var(--paper); padding: 28px 24px; display: grid; gap: 6px; }
.stat b { font: 400 clamp(2.3rem, 4.6vw, 3.4rem)/1 var(--serif); font-weight: 400; }
.stat span.mono { color: var(--muted); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------- services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.service { background: var(--paper); padding: 32px 28px; display: flex; flex-direction: column; gap: 12px; transition: background .3s, transform .35s; }
.service:hover { background: var(--card); }
.s-num { color: var(--accent); }
.service h3 { font: 400 1.8rem/1.1 var(--serif); }
.service p { color: var(--muted); font-size: .95rem; flex: 1; }
.tags { display: flex; gap: 6px; list-style: none; flex-wrap: wrap; }
.tags li { border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; color: var(--muted); }
@media (max-width: 960px) { .services { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .services { grid-template-columns: 1fr; } }

/* ---------- demo ---------- */
.demo-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.demo-tabs button { font: inherit; background: none; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; transition: all .2s; }
.demo-tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.demo-tabs button:not(.on):hover { color: var(--ink); border-color: var(--ink); }
.pipeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stage { padding: 26px 22px 32px; border-right: 1px solid var(--line); transition: background .3s; }
.stage:nth-child(4) { border-right: 0; }
.stage span { color: var(--muted); }
.stage h4 { font: 400 1.6rem var(--serif); margin: 10px 0 8px; }
.stage p { color: var(--muted); font-size: .92rem; }
.stage.active { background: var(--card); }
.stage.active span { color: var(--accent); }
.flow { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.flow span { display: block; height: 100%; width: 25%; background: var(--accent); transition: transform .5s cubic-bezier(.4,.1,.2,1); }
@media (max-width: 760px) {
  .pipeline { grid-template-columns: 1fr 1fr; }
  .stage:nth-child(2) { border-right: 0; }
  .stage:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .flow { display: none; }
}
.terminal { margin-top: 24px; background: var(--term); color: #d6cfbf; border-radius: 6px; overflow: hidden; border: 1px solid #2a2822; }
.term-bar { display: flex; gap: 6px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #2a2822; color: #7c7566; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a372f; }
.term-bar span { margin-left: 8px; }
#term { padding: 18px; min-height: 220px; white-space: pre-wrap; line-height: 1.75; font-size: .8rem; }
#term .k { color: #f97316; }
#term .ok { color: #4ade80; }
#term .dim { color: #7c7566; }
.cur { display: inline-block; width: 8px; height: 1em; background: #d6cfbf; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- process ---------- */
.process { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.process li { border-top: 2px solid var(--ink); padding-top: 18px; }
.process span { color: var(--accent); }
.process h3 { font: 400 1.6rem/1.15 var(--serif); margin: 8px 0; }
.process p { color: var(--muted); font-size: .95rem; }
@media (max-width: 900px) { .process { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .process { grid-template-columns: 1fr; } }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about-text { color: var(--muted); font-size: 1.06rem; margin-bottom: 16px; max-width: 580px; }
.about-text strong { color: var(--ink); font-weight: 500; }
.timeline { list-style: none; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--accent); padding-top: 5px; }
.timeline h3 { font: 400 1.45rem/1.2 var(--serif); }
.timeline p { color: var(--muted); font-size: .93rem; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- toolkit ---------- */
.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stack-grid div { background: var(--paper); padding: 24px; }
.stack-grid h4 { font: 400 1.45rem var(--serif); margin-bottom: 6px; }
.stack-grid p { color: var(--muted); font-size: .93rem; }
@media (max-width: 900px) { .stack-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stack-grid { grid-template-columns: 1fr; } }

/* ---------- certifications ---------- */
.cert-list { list-style: none; border-top: 1px solid var(--line); }
.cert-list li { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); transition: padding .25s, background .25s; }
.cert-list li:hover { padding-left: 10px; background: var(--card); }
.cert-list span { color: var(--accent); }
.cert-list b { font: 400 1.35rem var(--serif); font-weight: 400; }
.cert-list em { font-style: normal; color: var(--muted); font-size: .92rem; text-align: right; }
@media (max-width: 600px) { .cert-list li { grid-template-columns: 1fr; gap: 2px; } .cert-list em { text-align: left; } }

/* ---------- reviews ---------- */
.rating { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; color: var(--muted); }
.rating b { font: 400 3rem var(--serif); color: var(--ink); }
.stars { color: #e3a008; letter-spacing: 2px; }
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.review { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 24px; display: grid; gap: 12px; }
.review blockquote { font: 400 1.2rem/1.45 var(--serif); }
.review figcaption { color: var(--muted); }

/* ---------- faq ---------- */
.faq { border-top: 1px solid var(--line); max-width: 880px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 44px 22px 0; font: 400 1.5rem var(--serif); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 400 1.6rem var(--sans); color: var(--accent); transition: transform .3s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 44px 22px 0; max-width: 700px; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 6vw, 80px); }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.links { list-style: none; display: grid; gap: 10px; }
.links a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.links a:hover { color: var(--accent); border-color: var(--accent); }
form { display: grid; gap: 18px; }
label { display: grid; gap: 6px; }
label > span { color: var(--muted); text-transform: uppercase; }
label em { text-transform: none; opacity: .7; }
input, textarea, select {
  font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); padding: 8px 0; outline: none; resize: vertical; border-radius: 0;
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
select option { background: var(--paper); color: var(--ink); }
.hp { position: absolute; left: -9999px; }
.form-status { min-height: 1.2em; }
.form-status.ok { color: #16a34a; }
.form-status.err { color: var(--accent); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 40px var(--pad) 28px; }
.foot-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot .mark { display: inline-block; margin-bottom: 8px; }
.foot p { color: var(--muted); font-size: .92rem; max-width: 360px; }
.foot h5 { font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.foot ul { list-style: none; display: grid; gap: 6px; }
.foot ul a { text-decoration: none; font-size: .95rem; }
.foot ul a:hover { color: var(--accent); }
.foot-base { max-width: 1280px; margin: 32px auto 0; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.foot-base a { text-decoration: none; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .js .hero-title .line { opacity: 1; transform: none; }
}

.code-chip { white-space: pre; top: auto; bottom: 16%; width: auto; }
@media (max-width: 900px) { .code-chip { right: -6px; bottom: 24%; font-size: .66rem; } }
