/* Sutraa public site — hand-woven, no build step.
   Palette: paper / ink / saffron / marigold / indigo. */

:root {
  --paper: #faf4e8;
  --paper-2: #f3ead7;
  --ink: #171310;
  --ink-soft: #4a4238;
  --saffron: #ff5310;
  --marigold: #ffb300;
  --indigo: #4b3df5;
  --green: #0e9f6e;
  --red: #e02424;
  --card-dark: #1b1613;
  --border: 2.5px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  background-image: radial-gradient(rgba(23, 19, 16, 0.13) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  overflow-x: hidden;
}

a { color: inherit; }
::selection { background: var(--marigold); color: var(--ink); }

/* ---------- ticker ---------- */
.ticker {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: var(--border);
  user-select: none;
}
.ticker--saffron { background: var(--saffron); color: var(--ink); border-top: var(--border); }
.ticker__track {
  display: inline-block;
  padding: 0.5rem 0;
  animation: ticker 40s linear infinite;
}
.ticker--reverse .ticker__track { animation-direction: reverse; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem clamp(1rem, 4vw, 2.5rem);
  background: var(--paper);
  border-bottom: var(--border);
}
.nav__brand {
  font-family: var(--serif);
  font-size: 1.6rem;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.nav__brand .dev { color: var(--saffron); font-size: 1.15rem; }
.nav__links {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
  align-items: center;
}
.nav__links a:not(.btn) {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
}
.nav__links a:not(.btn):hover { border-bottom-color: var(--saffron); }
@media (max-width: 720px) {
  .nav__links a.nav__hide { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  border-radius: 10px;
  padding: 0.55rem 1.15rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--saffron { background: var(--saffron); color: #fff; }
.btn--indigo { background: var(--indigo); color: #fff; }
.btn--marigold { background: var(--marigold); }
.btn--ghost { box-shadow: none; }
.btn--big { font-size: 1.1rem; padding: 0.8rem 1.6rem; border-radius: 12px; }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: clamp(3.5rem, 9vw, 7rem) 1.25rem 3.5rem;
  max-width: 70rem;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.9rem, 9.5vw, 6.8rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.hero h1 em {
  font-style: italic;
  color: var(--saffron);
}
.hero__sub {
  max-width: 38rem;
  margin: 1.6rem auto 0;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--ink-soft);
}
.hero__sub strong { color: var(--ink); }
.hero__cta {
  margin-top: 2.2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}
.hero__note {
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.squiggle { display: block; margin: 0.6rem auto 0; max-width: min(28rem, 70vw); }
.squiggle path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 2.2s 0.3s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* stickers */
.sticker {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--marigold);
  box-shadow: 3px 3px 0 var(--ink);
  user-select: none;
  animation: floaty 5s ease-in-out infinite;
}
.sticker:hover { animation: wiggle 0.4s ease; }
.sticker--indigo { background: var(--indigo); color: #fff; }
.sticker--paper { background: var(--paper); }
.sticker--green { background: var(--green); color: #fff; }
@keyframes floaty {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}
@keyframes wiggle {
  25% { rotate: 4deg; } 75% { rotate: -4deg; }
}
@media (max-width: 900px) { .sticker { display: none; } }

/* install pill */
.install {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--mono);
  font-size: clamp(0.85rem, 2.4vw, 1.05rem);
  background: var(--ink);
  color: var(--paper);
  border: var(--border);
  border-radius: 12px;
  padding: 0.75rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.install .dollar { color: var(--marigold); user-select: none; }
.install button {
  font-family: var(--mono);
  font-size: 0.75rem;
  background: var(--paper);
  color: var(--ink);
  border: none;
  border-radius: 7px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-weight: 700;
}
.install button:hover { background: var(--marigold); }

/* ---------- window card ---------- */
.window {
  background: #fffdf7;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.window__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  background: var(--paper-2);
  border-bottom: var(--border);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.window__bar .dot { width: 11px; height: 11px; border-radius: 50%; border: 1.6px solid var(--ink); }
.dot--r { background: #ff5f57; } .dot--y { background: #febc2e; } .dot--g { background: #28c840; }
.window__bar .title { margin-left: 0.5rem; }
.window--dark { background: var(--card-dark); color: #f5efe4; }
.window--dark .window__bar { background: #262019; color: #b8ad9d; border-bottom-color: var(--ink); }

/* terminal / code */
pre.code {
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.9vw, 0.9rem);
  line-height: 1.7;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  background: var(--card-dark);
  color: #f0e9dc;
  text-align: left;
}
.tok-kw { color: #ff8b63; }
.tok-str { color: #ffd166; }
.tok-fn { color: #9aa4ff; }
.tok-com { color: #877c6d; font-style: italic; }
.cursor {
  display: inline-block; width: 0.55em; height: 1.1em;
  background: var(--marigold); vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-term { max-width: 46rem; margin: 3rem auto 0; text-align: left; }

/* ---------- sections ---------- */
.section {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2.5rem);
}
.section__kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--saffron);
  font-weight: 700;
}
.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  margin: 0.4rem 0 0.8rem;
}
.section h2 em { color: var(--indigo); }
.section__lede { max-width: 42rem; color: var(--ink-soft); font-size: 1.05rem; }

/* products */
.products { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr)); margin-top: 2.5rem; }
.product { display: flex; flex-direction: column; }
.product__body { padding: 1.5rem 1.6rem 1.8rem; display: flex; flex-direction: column; gap: 0.9rem; flex: 1; }
.product__name {
  font-family: var(--serif);
  font-size: 2.3rem;
  line-height: 1;
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
}
.product__dev { font-size: 1.15rem; color: var(--saffron); }
.product__tag {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 700;
  border: 2px solid currentColor; border-radius: 999px; padding: 0.15rem 0.6rem;
  align-self: center;
}
.product__pitch { font-size: 1.02rem; }
.product ul { list-style: none; display: grid; gap: 0.45rem; font-size: 0.95rem; }
.product ul li::before { content: "✔ "; color: var(--green); font-weight: 700; }
.window--dark .product ul li::before { color: var(--marigold); }
.product__foot { margin-top: auto; display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; padding-top: 0.5rem; }
.product .pkg {
  font-family: var(--mono); font-size: 0.82rem;
  background: var(--paper-2); border: 2px solid var(--ink);
  padding: 0.3rem 0.6rem; border-radius: 8px;
}
.window--dark .pkg { background: #262019; border-color: #3a3128; color: #ffd166; }

/* capabilities grid */
.caps { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); margin-top: 2.5rem; }
.cap pre.code { font-size: 0.74rem; padding: 0.9rem 1rem; }
.cap .window__bar .title { font-weight: 700; color: var(--ink); }

/* feature grid (sessions, serve, adapters, …) */
.feats { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); margin-top: 2.5rem; }
.feat__body { padding: 1.1rem 1.2rem 1.2rem; display: grid; gap: 0.8rem; align-content: start; }
.feat__pitch { font-size: 0.93rem; color: var(--ink-soft); }
.feat__pitch strong { color: var(--ink); }
.feat__pitch code, .feats-note code { font-family: var(--mono); font-size: 0.85em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 5px; }
.feat pre.code { font-size: 0.72rem; padding: 0.8rem 0.9rem; border-radius: 10px; }
.feats-note { margin-top: 1.6rem; font-size: 0.92rem; color: var(--ink-soft); max-width: 52rem; }

/* tiers table */
.tiers { margin-top: 2rem; overflow-x: auto; }
.tiers table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.95rem; background: #fffdf7; }
.tiers th, .tiers td { border: 2px solid var(--ink); padding: 0.7rem 0.9rem; text-align: left; }
.tiers th { background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.tiers .tier-badge { font-family: var(--mono); font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 6px; border: 2px solid var(--ink); }
.tier-h { background: var(--green); color: #fff; }
.tier-m { background: var(--marigold); }
.tier-l { background: var(--paper-2); }

/* pricing */
.pricing { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); margin-top: 2.5rem; align-items: stretch; }
.price-card { padding: 1.8rem 1.7rem; display: flex; flex-direction: column; gap: 1rem; position: relative; }
.price-card__name { font-family: var(--mono); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; }
.price-card__price { font-family: var(--serif); font-size: 3.2rem; line-height: 1; }
.price-card__price small { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-soft); }
.price-card ul { list-style: none; display: grid; gap: 0.5rem; font-size: 0.95rem; }
.price-card ul li::before { content: "— "; color: var(--saffron); font-weight: 700; }
.price-card .btn { margin-top: auto; text-align: center; }
.price-flag {
  position: absolute; top: -1rem; right: 1.2rem; rotate: 6deg;
  background: var(--saffron); color: #fff; font-family: var(--mono); font-size: 0.72rem;
  font-weight: 700; padding: 0.3rem 0.7rem; border: 2px solid var(--ink); border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
}

/* faq */
.faq { max-width: 46rem; margin: 2rem auto 0; display: grid; gap: 1rem; }
.faq details { background: #fffdf7; border: var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.faq summary {
  cursor: pointer; font-weight: 700; padding: 1rem 1.2rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 1.3rem; color: var(--saffron); }
.faq details[open] summary::after { content: "−"; }
.faq .a { padding: 0 1.2rem 1.1rem; color: var(--ink-soft); }
.faq .a code { font-family: var(--mono); font-size: 0.85em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 5px; }

/* footer */
.footer {
  border-top: var(--border);
  background: var(--ink);
  color: var(--paper);
  padding: 3rem clamp(1rem, 4vw, 2.5rem) 2.2rem;
  text-align: center;
}
.footer .thread-art {
  font-family: var(--mono); color: var(--marigold);
  font-size: clamp(0.5rem, 1.6vw, 0.8rem); line-height: 1.4; overflow-x: auto; white-space: pre;
}
.footer__word { font-family: var(--serif); font-size: 2rem; margin-top: 1.2rem; }
.footer__links { display: flex; gap: 1.4rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; font-size: 0.9rem; }
.footer__links a { color: var(--paper); text-decoration: none; border-bottom: 2px solid var(--saffron); }
.footer__fine { margin-top: 1.4rem; font-family: var(--mono); font-size: 0.75rem; color: #8d8375; }

/* reveal on scroll */
.reveal { opacity: 0; translate: 0 26px; transition: opacity 0.6s ease, translate 0.6s ease; }
.reveal.is-in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; translate: none; transition: none; }
  .ticker__track, .sticker, .squiggle path, .cursor { animation: none; }
  .squiggle path { stroke-dashoffset: 0; }
}

/* =========================================================
   dashboard
   ========================================================= */
.dash {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 4vw, 2rem) 4rem;
  display: grid;
  gap: 1.8rem;
}
.dash h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 6vw, 3rem); }
.dash h1 em { color: var(--saffron); }
.dash-grid { display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.panel__body { padding: 1.3rem 1.4rem; display: grid; gap: 0.8rem; }
.panel__body .row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; font-size: 0.95rem; }
.panel__body .row .k { color: var(--ink-soft); font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.plan-badge {
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem; text-transform: uppercase;
  border: 2px solid var(--ink); border-radius: 999px; padding: 0.15rem 0.7rem;
  background: var(--paper-2);
}
.plan-badge--pro { background: var(--marigold); }
.meter { height: 14px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fffdf7; }
.meter > div { height: 100%; background: var(--indigo); min-width: 2px; transition: width 0.5s ease; }
.meter--hot > div { background: var(--saffron); }

.keys-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.keys-table th { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); text-align: left; padding: 0.5rem 0.6rem; border-bottom: 2px solid var(--ink); }
.keys-table td { padding: 0.6rem; border-bottom: 1.5px solid var(--paper-2); vertical-align: middle; }
.keys-table code { font-family: var(--mono); font-size: 0.82rem; }
.key-status { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 6px; border: 1.5px solid var(--ink); }
.key-status--active { background: #d3f5e5; }
.key-status--revoked { background: #f5d3d3; color: var(--red); }
.btn--danger { background: #fff; color: var(--red); font-size: 0.78rem; padding: 0.3rem 0.7rem; box-shadow: 2px 2px 0 var(--ink); }

.newkey {
  background: var(--card-dark); color: var(--paper);
  border: var(--border); border-radius: 12px; padding: 1.1rem 1.2rem;
  display: grid; gap: 0.7rem;
}
.newkey code { font-family: var(--mono); font-size: 0.85rem; word-break: break-all; color: var(--marigold); }
.newkey .warn { font-size: 0.82rem; color: #cfc4b2; }

.upgrade-cta { border: var(--border); border-radius: 12px; background: var(--marigold); padding: 1.2rem 1.4rem; box-shadow: var(--shadow-sm); display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.upgrade-cta p { max-width: 30rem; font-size: 0.95rem; }

.gate { text-align: center; padding: clamp(4rem, 12vw, 8rem) 1.5rem; }
.gate h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 7vw, 3.6rem); }
.gate p { margin: 1rem auto 2rem; max-width: 30rem; color: var(--ink-soft); }
.toast {
  position: fixed; bottom: 1.4rem; left: 50%; translate: -50% 0; z-index: 100;
  background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 0.85rem;
  border: 2px solid var(--marigold); border-radius: 10px; padding: 0.6rem 1.1rem;
  box-shadow: var(--shadow-sm); opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.toast.show { opacity: 1; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
