/* Strata Studio — Design System Stylesheet */

:root {
  /* ── Color · Surface ─────────────────────────── */
  --space:        #0B0F1A;
  --space-2:      #11162A;
  --space-3:      #1A2138;
  --surface:      #14182A;
  --surface-2:    #1C2240;
  --line:         rgba(230,232,239,.08);
  --line-strong:  rgba(230,232,239,.16);

  /* ── Color · Ink ─────────────────────────────── */
  --ink:          #E6E8EF;
  --ink-2:        rgba(230,232,239,.72);
  --ink-3:        rgba(230,232,239,.52);
  --ink-4:        rgba(230,232,239,.32);

  /* ── Color · Stack (the brand gradient) ──────── */
  --stack-1:      #34c8e8;  /* cyan */
  --stack-2:      #3aa0f5;  /* electric blue */
  --stack-3:      #5878f5;  /* indigo */
  --stack-4:      #6a5cd8;  /* lavender-purple */
  --stack-5:      #5a3ab8;  /* deep purple */
  --accent:       var(--stack-2);
  --accent-soft:  rgba(58,160,245,.16);

  /* ── Color · Semantic ────────────────────────── */
  --success: #3ce0b8;
  --warning: #ffc94a;
  --danger:  #ff5a4a;
  --info:    var(--stack-1);

  /* ── Typography ──────────────────────────────── */
  --font-display: 'Saira', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* type scale — modular, 1.25 ratio */
  --t-12: 12px;   --lh-12: 16px;
  --t-13: 13px;   --lh-13: 20px;
  --t-14: 14px;   --lh-14: 22px;
  --t-16: 16px;   --lh-16: 24px;
  --t-18: 18px;   --lh-18: 26px;
  --t-22: 22px;   --lh-22: 28px;
  --t-28: 28px;   --lh-28: 34px;
  --t-36: 36px;   --lh-36: 42px;
  --t-48: 48px;   --lh-48: 54px;
  --t-64: 64px;   --lh-64: 68px;
  --t-96: 96px;   --lh-96: 96px;

  /* ── Spacing ─────────────────────────────────── */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* ── Radius ──────────────────────────────────── */
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 16px;
  --r-5: 22px;
  --r-pill: 999px;

  /* ── Elevation ───────────────────────────────── */
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 4px 14px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.5);
  --shadow-3: 0 12px 32px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.6);
  --shadow-glow: 0 0 0 1px rgba(58,160,245,.4), 0 8px 32px rgba(58,160,245,.25);

  /* ── Motion ──────────────────────────────────── */
  --ease-out:   cubic-bezier(.2,.7,.3,1);
  --ease-in:    cubic-bezier(.5,0,.95,.5);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
  --d-fast:   120ms;
  --d-base:   200ms;
  --d-slow:   320ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--space);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-14);
  line-height: var(--lh-14);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

/* ── Layout ─────────────────────────────────────── */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--s-12); }

.section { padding: var(--s-24) 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-8); margin-bottom: var(--s-10); }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-48); line-height: var(--lh-48); letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.section-num { font-family: var(--font-mono); font-size: var(--t-12); letter-spacing: .14em; color: var(--ink-4); text-transform: uppercase; }

.kicker { font-family: var(--font-mono); font-size: var(--t-12); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.lede { font-family: var(--font-display); font-size: var(--t-22); line-height: var(--lh-28); color: var(--ink-2); max-width: 820px; font-weight: 400; letter-spacing: -.01em; text-wrap: pretty; margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-4); }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s-3); }

.row { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }

.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--s-6); }
.tile-h { font-family: var(--font-mono); font-size: var(--t-12); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-3); }
.tile p { color: var(--ink-2); margin: 0; line-height: var(--lh-14); }

.swatch { display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 5/4; padding: var(--s-4); border-radius: var(--r-3); position: relative; overflow: hidden; }
.swatch .name { font-family: var(--font-mono); font-size: var(--t-12); font-weight: 600; letter-spacing: .04em; }
.swatch .meta { font-family: var(--font-mono); font-size: var(--t-12); letter-spacing: .04em; opacity: .7; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2); padding: 0 var(--s-5); height: 40px;
  border-radius: var(--r-pill); border: 0;
  font-family: var(--font-body); font-size: var(--t-14); font-weight: 600;
  cursor: pointer; transition: transform var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4ab0ff; box-shadow: var(--shadow-glow); }

.btn-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-secondary:hover { background: var(--space-3); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }

.btn-danger { background: var(--danger); color: #fff; }

.btn-icon { width: 40px; padding: 0; }

.btn-sm { height: 32px; font-size: var(--t-13); padding: 0 var(--s-4); }
.btn-lg { height: 48px; font-size: var(--t-16); padding: 0 var(--s-6); }

/* ── Inputs ─────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field-label { font-family: var(--font-mono); font-size: var(--t-12); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.input, .textarea, .select {
  background: var(--space-2); color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: 12px var(--s-4);
  font-family: var(--font-body); font-size: var(--t-14);
  outline: none;
  transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }

/* checkbox / radio */
.check, .radio { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; user-select: none; font-size: var(--t-14); }
.check input, .radio input { position: absolute; opacity: 0; pointer-events: none; }
.check .box, .radio .box { width: 18px; height: 18px; border: 1.5px solid var(--line-strong); background: var(--space-2); display: inline-flex; align-items: center; justify-content: center; transition: all var(--d-fast) var(--ease-out); }
.check .box { border-radius: 4px; }
.radio .box { border-radius: 50%; }
.check input:checked + .box, .radio input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box::after { content: ''; width: 10px; height: 10px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='white'><path d='M1 5 L4 8 L9 2' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.radio input:checked + .box::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

/* Switch */
.switch { position: relative; width: 44px; height: 26px; background: var(--space-3); border-radius: var(--r-pill); cursor: pointer; transition: background var(--d-base) var(--ease-out); border: 1px solid var(--line-strong); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: all var(--d-base) var(--ease-out); }
.switch[data-on='true'] { background: var(--accent); border-color: var(--accent); }
.switch[data-on='true']::after { left: 20px; background: #fff; }

/* ── Badges / Chips ─────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: var(--s-2); padding: 4px 10px; border-radius: var(--r-pill); font-family: var(--font-mono); font-size: var(--t-12); letter-spacing: .06em; line-height: 1; }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: rgba(60,224,184,.16); color: var(--success); }
.badge-warning { background: rgba(255,201,74,.16); color: var(--warning); }
.badge-danger { background: rgba(255,90,74,.16); color: var(--danger); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

.chip { display: inline-flex; align-items: center; gap: var(--s-2); padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-strong); font-size: var(--t-13); color: var(--ink); cursor: pointer; transition: all var(--d-fast) var(--ease-out); }
.chip:hover { border-color: var(--line-strong); background: var(--space-3); }
.chip[data-active='true'] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ── Card ───────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-4); padding: var(--s-6); transition: border-color var(--d-base) var(--ease-out), transform var(--d-base) var(--ease-out); }
.card:hover { border-color: var(--line-strong); }
.card h4 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-18); margin: 0 0 var(--s-2); letter-spacing: -.01em; }
.card p { color: var(--ink-2); margin: 0; }

/* ── List item ──────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .icon { width: 40px; height: 40px; border-radius: var(--r-2); background: var(--space-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-14); }
.list-item .sub { font-size: var(--t-13); color: var(--ink-3); }
.list-item .meta { font-family: var(--font-mono); font-size: var(--t-12); color: var(--ink-3); }

/* ── Segmented control ──────────────────────────── */
.seg { display: inline-flex; padding: 4px; background: var(--space-2); border-radius: var(--r-pill); border: 1px solid var(--line-strong); }
.seg button { background: transparent; border: 0; padding: 8px 16px; border-radius: var(--r-pill); font-family: var(--font-body); font-size: var(--t-13); font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all var(--d-fast) var(--ease-out); }
.seg button[data-active='true'] { background: var(--accent); color: #fff; }

/* ── Tabs ───────────────────────────────────────── */
.tabs { display: flex; gap: var(--s-6); border-bottom: 1px solid var(--line); }
.tab { padding: 14px 0; position: relative; font-family: var(--font-display); font-weight: 500; font-size: var(--t-14); color: var(--ink-3); cursor: pointer; }
.tab[data-active='true'] { color: var(--ink); }
.tab[data-active='true']::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }

/* ── Banner / Alert ─────────────────────────────── */
.banner { display: flex; gap: var(--s-4); padding: var(--s-4) var(--s-5); border-radius: var(--r-3); border: 1px solid var(--line); }
.banner-success { background: rgba(60,224,184,.08); border-color: rgba(60,224,184,.3); color: var(--success); }
.banner-warning { background: rgba(255,201,74,.08); border-color: rgba(255,201,74,.3); color: var(--warning); }
.banner-danger { background: rgba(255,90,74,.08); border-color: rgba(255,90,74,.3); color: var(--danger); }
.banner-info { background: var(--accent-soft); border-color: rgba(58,160,245,.3); color: var(--stack-1); }
.banner-body { font-size: var(--t-13); color: var(--ink-2); }
.banner-body strong { color: var(--ink); display: block; margin-bottom: 2px; font-family: var(--font-display); font-size: var(--t-14); }

/* ── Code / token table ─────────────────────────── */
code, .mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.kbd { display: inline-block; padding: 2px 6px; border-radius: 4px; background: var(--space-3); border: 1px solid var(--line-strong); border-bottom-width: 2px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }

table.tokens { width: 100%; border-collapse: collapse; font-size: var(--t-13); }
table.tokens th, table.tokens td { padding: 12px var(--s-4); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.tokens th { font-family: var(--font-mono); font-size: var(--t-12); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
table.tokens td.t { font-family: var(--font-mono); color: var(--ink); }
table.tokens td.v { font-family: var(--font-mono); color: var(--ink-3); }
table.tokens td.desc { color: var(--ink-2); }

/* ── Stack logo ─────────────────────────────────── */
.stack-mark { display: inline-block; }

/* ── iOS frame (compact, native-ish) ────────────── */
.iphone {
  position: relative;
  width: 280px; height: 580px;
  border-radius: 44px;
  background: var(--space-2);
  box-shadow: var(--shadow-3), 0 0 0 10px #000, 0 0 0 12px rgba(255,255,255,.04);
  overflow: hidden;
}
.iphone .island { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 110px; height: 32px; border-radius: 20px; background: #000; z-index: 5; }
.iphone .status { position: absolute; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 16px 28px 0; font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 13px; font-weight: 600; color: var(--ink); z-index: 4; }
.iphone .screen { position: absolute; top: 52px; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; }

/* ── Page chrome ────────────────────────────────── */
.cover { padding: var(--s-24) 0 var(--s-20); border-bottom: 1px solid var(--line); }
.cover .stack-mark { margin-bottom: var(--s-8); }
.cover .wordmark { font-family: var(--font-display); font-weight: 700; font-size: clamp(64px, 12vw, 180px); line-height: .9; letter-spacing: .04em; margin: 0; }
.cover .tagline { font-family: var(--font-display); font-weight: 400; font-size: var(--t-28); line-height: var(--lh-28); margin: var(--s-6) 0 0; max-width: 720px; color: var(--ink-2); letter-spacing: -.01em; }

.toc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px var(--s-8); margin-top: var(--s-12); padding-top: var(--s-8); border-top: 1px solid var(--line); }
.toc a { display: flex; gap: var(--s-4); padding: var(--s-2) 0; color: var(--ink-2); }
.toc a:hover { color: var(--ink); }
.toc a .num { font-family: var(--font-mono); font-size: var(--t-12); color: var(--ink-4); width: 36px; }

footer.foot { padding: var(--s-12) 0 var(--s-20); border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--t-13); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-6); }
