/* ==========================================================================
   Graphite — Carbono Dev managed OneCLI
   Design tokens mirror carbonodev.com so the subdomain reads as one brand.
   ========================================================================== */

:root {
  /* Carbono palette */
  --bg: #0b0b0c;
  --bg-elevated: #141416;
  --bg-soft: #1c1c1f;
  --paper: #fafaf8;
  --ink: #141416;
  --text: #f5f5f4;
  --text-muted: #a1a1aa;
  --text-dim: #6b6b74;
  --border: #ffffff1a;
  --border-strong: #ffffff2e;
  --accent: #4a6cf7;
  --accent-hover: #3a58d4;
  --accent-muted: #4a6cf724;
  --warn: #e0a34a;

  /* Type */
  --font-display: "Poppins", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-hero: clamp(42px, 6.4vw, 78px);
  --text-section: clamp(30px, 4vw, 46px);

  /* Layout */
  --max: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-glow: 0 0 80px #4a6cf733;
}

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

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Graphite lattice: the page sits on a sheet of carbon ---------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(60deg, #ffffff0a 0 1px, transparent 1px 64px),
    repeating-linear-gradient(-60deg, #ffffff0a 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, #ffffff07 0 1px, transparent 1px 64px);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, #0009 45%, transparent 85%);
}

/* Grain — keeps the flat dark from looking like a default template */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 2; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

a { color: inherit; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================  shared atoms  ============================== */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 30px #4a6cf73d;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text-muted); background: #ffffff08; }

.btn .arrow { transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }

section { padding-block: clamp(72px, 11vw, 128px); }

.section-head { max-width: 680px; margin-bottom: clamp(40px, 6vw, 64px); }

.section-head h2 {
  font-size: var(--text-section);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 600;
  margin: 0 0 18px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0;
  max-width: 60ch;
}

.rule {
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 70%);
  border: 0;
  margin: 0;
}

/* ============================  header  ================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: #0b0b0ccc;
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -.01em;
}

.brand .mark { width: 24px; height: 24px; flex: none; }

.brand .parent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding-left: 11px;
  border-left: 1px solid var(--border);
  font-weight: 400;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .16s ease;
}
.nav a:hover { color: var(--text); }

.nav .btn { padding: 9px 16px; }

@media (max-width: 860px) {
  .nav a:not(.btn) { display: none; }
  .brand .parent { display: none; }
}

/* =============================  hero  ================================== */

.hero {
  position: relative;
  padding-top: clamp(64px, 10vw, 112px);
  padding-bottom: clamp(56px, 8vw, 96px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -340px;
  left: 50%;
  width: 900px;
  height: 900px;
  translate: -50% 0;
  background: radial-gradient(circle, #4a6cf726 0%, transparent 62%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

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

.hero h1 {
  font-size: var(--text-hero);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 600;
  margin: 0 0 24px;
}

.hero h1 .dim { color: var(--text-dim); }

.hero h1 .glint {
  background: linear-gradient(100deg, var(--text) 30%, #93a7ff 50%, var(--text) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: glint 7s ease-in-out infinite;
}

@keyframes glint {
  0%, 62% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

.hero .lede {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 34px;
  max-width: 52ch;
}

.hero .lede strong { color: var(--text); font-weight: 500; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .02em;
}

.hero-meta span { display: flex; align-items: center; gap: 8px; }

.hero-meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* staggered entrance */
.reveal { opacity: 0; animation: rise .8s cubic-bezier(.2, .7, .3, 1) forwards; }
.reveal-1 { animation-delay: .05s; }
.reveal-2 { animation-delay: .16s; }
.reveal-3 { animation-delay: .27s; }
.reveal-4 { animation-delay: .38s; }
.reveal-5 { animation-delay: .5s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ------------------  the swap: hero centrepiece  ----------------------- */

.swap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, #1c1c1f 0%, #101012 100%);
  box-shadow: var(--shadow-glow), 0 24px 60px #00000066;
  overflow: hidden;
}

.swap-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.swap-bar .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2f2f35;
}
.swap-bar .dot.live { background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 #4a6cf766; }
  50% { opacity: .6; box-shadow: 0 0 0 5px #4a6cf700; }
}

.swap-bar .spacer { margin-left: auto; text-transform: none; letter-spacing: 0; }

.swap-body { padding: 26px 20px 30px; }

.lane {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.node {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.node .chip {
  display: block;
  padding: 10px 6px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.gate {
  width: 92px;
  padding: 14px 8px;
  border-radius: 10px;
  border: 1px solid #4a6cf759;
  background: #4a6cf714;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #a9baff;
  position: relative;
}

.gate::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 10px;
  border: 1px solid #4a6cf7;
  opacity: 0;
  animation: gateflash 4.8s ease-in-out infinite;
}

@keyframes gateflash {
  0%, 42%, 58%, 100% { opacity: 0; }
  48%, 52% { opacity: .9; }
}

.track {
  position: relative;
  height: 1px;
  margin: 40px 0 20px;
  background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 12px);
}

.packet {
  position: absolute;
  top: 50%;
  left: 0;
  translate: 0 -50%;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  animation: travel 4.8s cubic-bezier(.55, 0, .45, 1) infinite;
}

@keyframes travel {
  0% { left: 0%; transform: translate(0, -50%); opacity: 0; }
  8% { opacity: 1; }
  100% { left: 100%; transform: translate(-100%, -50%); opacity: 1; }
}

.packet .before,
.packet .after { display: block; }

.packet .before { color: var(--warn); animation: swapout 4.8s linear infinite; }
.packet .after {
  position: absolute;
  inset: 5px 11px;
  color: #9dffc8;
  animation: swapin 4.8s linear infinite;
}

@keyframes swapout { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes swapin  { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }

.swap-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 3px 14px;
}

.swap-note b { color: var(--text-muted); font-weight: 400; }

/* ============================  problem  ================================ */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card {
  background: var(--bg);
  padding: 32px 28px 34px;
  transition: background .2s ease;
}
.card:hover { background: var(--bg-elevated); }

.card .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .14em;
  display: block;
  margin-bottom: 18px;
}

.card h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 10px;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* ===========================  how it works  ============================ */

.steps {
  display: grid;
  gap: 1px;
  background: var(--border);
  border-block: 1px solid var(--border);
}

.step {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
  padding-block: 34px;
  background: var(--bg);
}

@media (max-width: 820px) {
  .step { grid-template-columns: 1fr; gap: 16px; }
}

.step .idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .1em;
  padding-top: 4px;
}

.step h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0 0 8px;
}

.step p { margin: 0; color: var(--text-muted); font-size: 15px; }

.code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0;
  color: var(--text-muted);
  white-space: pre;
}

.code .c { color: var(--text-dim); }
.code .k { color: #a9baff; }
.code .s { color: #9dffc8; }
.code .f { color: var(--warn); }

/* ============================  managed  ================================ */

.managed { background: var(--bg-elevated); border-block: 1px solid var(--border); }

.ops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 40px;
}

.op { border-top: 1px solid var(--border); padding-top: 18px; }

.op h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 7px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.op h3::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  rotate: 45deg;
  flex: none;
}

.op p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

/* ============================  no lock-in  ============================= */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

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

.oss-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  background: linear-gradient(160deg, #1c1c1f 0%, #0f0f11 100%);
}

.oss-panel ul { list-style: none; margin: 0; padding: 0; }

.oss-panel li {
  display: flex;
  gap: 13px;
  padding-block: 13px;
  font-size: 15px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.oss-panel li:last-child { border-bottom: 0; }

.oss-panel li::before {
  content: "→";
  color: var(--accent);
  font-family: var(--font-mono);
  flex: none;
}

/* =============================  faq  =================================== */

.faq { max-width: 780px; }

.faq details {
  border-bottom: 1px solid var(--border);
  padding-block: 20px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 18px;
  flex: none;
  transition: transform .2s ease;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq p {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  max-width: 68ch;
}

/* =============================  cta  =================================== */

.cta {
  position: relative;
  text-align: center;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  bottom: -420px;
  left: 50%;
  width: 1000px;
  height: 700px;
  translate: -50% 0;
  background: radial-gradient(circle, #4a6cf72e 0%, transparent 64%);
  pointer-events: none;
}

.cta .wrap { position: relative; }

.cta h2 {
  font-size: var(--text-section);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: 0 auto 18px;
  max-width: 16ch;
}

.cta p {
  color: var(--text-muted);
  margin: 0 auto 32px;
  max-width: 54ch;
  font-size: 17px;
}

.cta .hero-actions { justify-content: center; }

/* ============================  footer  ================================= */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 40px;
  font-size: 14px;
  color: var(--text-dim);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: center;
  justify-content: space-between;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 22px; }

.site-footer a { text-decoration: none; transition: color .16s ease; }
.site-footer a:hover { color: var(--text); }

.site-footer .legal { font-family: var(--font-mono); font-size: 12px; }

/* ==========================  legal pages  ============================== */

.legal-page { padding-block: clamp(56px, 8vw, 88px) clamp(72px, 10vw, 112px); }

.legal-page .wrap { max-width: 760px; }

.legal-head { margin-bottom: 44px; }

.legal-head h1 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.08;
  margin: 0 0 14px;
}

.legal-head .stamp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.prose { color: var(--text-muted); font-size: 15.5px; }

.prose h2 {
  color: var(--text);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 44px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.prose h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 8px;
}

.prose p { margin: 0 0 14px; }

.prose ul { margin: 0 0 16px; padding-left: 0; list-style: none; }

.prose li {
  display: flex;
  gap: 12px;
  margin-bottom: 9px;
}

.prose li::before {
  content: "—";
  color: var(--accent);
  font-family: var(--font-mono);
  flex: none;
}

.prose a { color: #a9baff; text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: #fff; }

.prose strong { color: var(--text); font-weight: 500; }

.callout {
  border: 1px solid #4a6cf759;
  background: #4a6cf714;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 22px 0;
  color: var(--text);
  font-size: 15px;
}

.callout p:last-child { margin-bottom: 0; }

.contact-block {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 2;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 26px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.back-link:hover { color: var(--text); }
