/* ========== Warefly Design System ========== */
:root {
  /* Accent · Iris */
  --accent-50:  oklch(0.975 0.015 276);
  --accent-100: oklch(0.94  0.040 276);
  --accent-200: oklch(0.88  0.080 276);
  --accent-300: oklch(0.78  0.130 276);
  --accent-400: oklch(0.68  0.180 276);
  --accent-500: oklch(0.56  0.210 276);
  --accent-600: oklch(0.48  0.200 276);
  --accent-700: oklch(0.40  0.170 276);
  --accent-800: oklch(0.32  0.130 276);
  --accent-900: oklch(0.24  0.090 276);

  /* Neutral · Slate */
  --ink-900: oklch(0.18 0.010 270);
  --ink-800: oklch(0.24 0.010 270);
  --ink-700: oklch(0.32 0.010 270);
  --ink-600: oklch(0.42 0.010 270);
  --ink-500: oklch(0.52 0.010 270);
  --ink-400: oklch(0.65 0.009 270);
  --ink-300: oklch(0.78 0.008 270);
  --ink-200: oklch(0.88 0.006 270);
  --ink-100: oklch(0.94 0.004 270);
  --ink-50:  oklch(0.975 0.003 270);
  --bg:      oklch(0.99 0.002 270);

  /* Semantic */
  --success: oklch(0.70 0.16 155);
  --warning: oklch(0.78 0.15 80);
  --danger:  oklch(0.62 0.22 25);
  --info:    oklch(0.65 0.15 235);

  /* Elevation */
  --elev-0: inset 0 0 0 1px var(--ink-200);
  --elev-1: 0 1px 2px rgba(24,26,40,0.04), 0 0 0 1px var(--ink-200);
  --elev-2: 0 4px 14px -4px rgba(24,26,40,0.08), 0 0 0 1px var(--ink-200);
  --elev-3: 0 20px 40px -12px rgba(32,26,80,0.18), 0 0 0 1px var(--ink-200);

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Layout */
  --side-w: 280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: var(--bg);
  font-feature-settings: 'ss01','cv11';
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ========== Sidebar ========== */
.ds-side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  border-right: 1px solid var(--ink-200);
  background: var(--ink-50);
  padding: 28px 24px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 28px;
}
.ds-brand { display: flex; align-items: center; gap: 12px; }
.ds-brand-mark { width: 44px; height: auto; display: block; }
.ds-brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.ds-brand-sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); margin-top: 2px; }

.ds-nav { display: flex; flex-direction: column; gap: 22px; }
.ds-nav-group { display: flex; flex-direction: column; gap: 2px; }
.ds-nav-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-500); margin-bottom: 6px; padding-left: 10px;
}
.ds-nav a {
  display: block; padding: 7px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-700);
  transition: background 0.15s, color 0.15s;
}
.ds-nav a:hover { background: var(--ink-100); color: var(--ink-900); }

.ds-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.ds-kbd {
  display: inline-block; font-family: var(--font-mono); font-size: 11.5px;
  padding: 4px 8px; border: 1px solid var(--ink-200); border-radius: 6px;
  background: #fff; color: var(--ink-700); width: fit-content;
}
.ds-side-note { font-size: 11.5px; color: var(--ink-500); line-height: 1.5; }

/* ========== Main ========== */
.ds-main {
  margin-left: var(--side-w);
  padding: 80px 72px 120px;
  max-width: 1180px;
}
.ds-sect { margin-bottom: 120px; }
.ds-sect-head {
  display: flex; gap: 28px; align-items: flex-start;
  padding-bottom: 32px; margin-bottom: 40px;
  border-bottom: 1px solid var(--ink-200);
}
.ds-sect-num {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-400);
  letter-spacing: 0.08em; padding-top: 6px; min-width: 28px;
}
.ds-h1 {
  font-size: 80px; font-weight: 700; letter-spacing: -0.04em;
  line-height: 0.98; margin: 0 0 24px;
}
.ds-h2 {
  font-size: 36px; font-weight: 600; letter-spacing: -0.025em;
  line-height: 1.1; margin: 0 0 12px;
}
.ds-sect-sub { font-size: 16px; color: var(--ink-600); max-width: 62ch; line-height: 1.55; margin: 0; }
.ds-sect-sub code { background: var(--ink-100); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; color: var(--ink-900); }

/* Hero */
.ds-hero { padding-top: 16px; }
.ds-eyebrow {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-500);
  letter-spacing: 0.06em; margin-bottom: 28px;
  display: inline-flex; align-items: center; gap: 8px;
}
.ds-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent-500); display: inline-block; }
.ds-lede { font-size: 19px; line-height: 1.55; color: var(--ink-600); max-width: 62ch; margin: 0 0 56px; }
.ds-hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ds-hero-card {
  border: 1px solid var(--ink-200); border-radius: 12px; padding: 18px;
  background: #fff; display: flex; flex-direction: column; gap: 8px;
}
.ds-hero-kicker {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-500);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.ds-hero-val {
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 10px;
}
.ds-hero-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-500); }
.ds-swatch-chip { width: 18px; height: 18px; border-radius: 5px; display: inline-block; }

/* Grid helpers */
.ds-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.ds-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.ds-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.ds-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }

/* Panels */
.panel {
  border: 1px solid var(--ink-200); border-radius: 14px;
  background: #fff; overflow: hidden;
}
.panel-head {
  padding: 12px 16px; border-bottom: 1px solid var(--ink-200);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--ink-500); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
  background: var(--ink-50);
}
.panel-head .mono { color: var(--ink-700); }
.panel-body { padding: 24px; }
.panel-foot {
  padding: 10px 16px; border-top: 1px solid var(--ink-200);
  font-size: 11.5px; color: var(--ink-500); background: var(--ink-50);
}
.row-gap-lg { display: flex; flex-direction: column; gap: 20px; }

/* ========== Logo section ========== */
.logo-hero {
  border: 1px solid var(--ink-200); border-radius: 20px;
  padding: 80px; background: #fff;
  display: flex; justify-content: center; align-items: center;
  margin-bottom: 16px;
  background-image:
    radial-gradient(circle at 20% 30%, oklch(0.97 0.03 276 / 0.6) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, oklch(0.97 0.02 280 / 0.5) 0%, transparent 50%);
}
.logo-hero-svg { width: 320px; height: auto; display: block; }

.logo-card {
  margin: 0;
  border: 1px solid var(--ink-200); border-radius: 14px;
  background: #fff; overflow: hidden;
}
.logo-stage {
  aspect-ratio: 3 / 2; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.logo-stage svg { width: 60%; max-width: 180px; height: auto; }
.stage-light { background: var(--ink-50); }
.stage-ink { background: var(--ink-900); }
.logo-card figcaption {
  padding: 14px 16px; border-top: 1px solid var(--ink-200);
  display: flex; justify-content: space-between; align-items: baseline; font-size: 13px;
}
.logo-card figcaption strong { font-weight: 600; }
.logo-card figcaption span { color: var(--ink-500); font-size: 12px; }

/* Clear space diagram */
.clearspace { display: flex; justify-content: center; align-items: center; padding: 56px; }
.cs-wrap { position: relative; padding: 40px; }
.cs-mark svg { width: 220px; height: auto; display: block; }
.cs-wrap::before {
  content: ''; position: absolute; inset: 0;
  border: 1px dashed var(--accent-400);
  border-radius: 8px;
}
.cs-label {
  position: absolute; font-family: var(--font-mono); font-size: 11px; color: var(--accent-600);
  background: #fff; padding: 2px 6px;
}
.cs-top { top: -10px; left: 50%; transform: translateX(-50%); }
.cs-bottom { bottom: -10px; left: 50%; transform: translateX(-50%); }
.cs-left { left: -14px; top: 50%; transform: translateY(-50%); }
.cs-right { right: -14px; top: 50%; transform: translateY(-50%); }

/* Minimum sizes */
.minsize { display: flex; flex-direction: column; gap: 24px; padding: 32px 28px; }
.ms-row { display: flex; align-items: center; gap: 24px; }
.ms-row .mono { color: var(--ink-500); font-size: 12px; }

/* Do / Don't */
.panel.do .panel-head { color: var(--success); }
.panel.dont .panel-head { color: var(--danger); }
.rules { margin: 0; padding: 20px 24px 24px 40px; color: var(--ink-700); font-size: 14px; line-height: 1.6; }
.rules li { margin-bottom: 6px; }

/* ========== Color ========== */
.palette { margin-bottom: 24px; }
.palette-label {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-500); margin-bottom: 10px;
}
.ramp {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px;
}
.swatch {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--ink-200);
  background: #fff;
  display: flex; flex-direction: column;
}
.sw-color { height: 76px; }
.sw-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.sw-step { font-family: var(--font-mono); font-size: 11px; color: var(--ink-700); }
.sw-hex { font-family: var(--font-mono); font-size: 10px; color: var(--ink-500); }

.semantic { margin-top: 24px; }
.sem {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--ink-200); border-radius: 12px; background: #fff;
}
.sem-sw { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.sem-meta { display: flex; flex-direction: column; gap: 2px; }
.sem-meta strong { font-size: 14px; font-weight: 600; }
.sem-meta .mono { font-size: 11px; color: var(--ink-500); }

/* Code panel */
.codepanel .code {
  margin: 0; padding: 20px 24px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  color: var(--ink-800); background: var(--ink-50);
  overflow-x: auto;
}
.codepanel .code code { background: none; padding: 0; color: inherit; }

/* ========== Type ========== */
.type-spec {
  border: 1px solid var(--ink-200); border-radius: 14px;
  padding: 28px; background: #fff;
}
.type-kicker {
  font-size: 11.5px; color: var(--ink-500); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 8px;
}
.type-name { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 24px; }
.type-sample { margin-bottom: 24px; min-height: 140px; }
.type-weights {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--ink-200);
  font-size: 11px; color: var(--ink-500);
}

.scale { margin-top: 24px; border-top: 1px solid var(--ink-200); }
.scale-row {
  display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--ink-200);
}
.scale-tag { font-size: 11px; color: var(--ink-500); white-space: nowrap; }
.scale-val { color: var(--ink-900); }

/* ========== Space / radii ========== */
.space-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.space-bar { height: 12px; background: var(--accent-500); border-radius: 3px; }
.space-row .mono { font-size: 12px; color: var(--ink-600); }

.radii { margin-top: 16px; }
.radii-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px; border: 1px solid var(--ink-200); border-radius: 14px; background: #fff;
}
.radii-box { width: 56px; height: 56px; background: var(--accent-100); border: 1px solid var(--accent-300); }
.radii-card .mono { font-size: 11px; color: var(--ink-500); }

/* Elevation */
.elev-card {
  height: 120px; border-radius: 14px; background: #fff; padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 13px; font-weight: 500;
}
.elev-card .mono { font-size: 11px; color: var(--ink-500); font-weight: 400; }

/* ========== Icons ========== */
.icon-card {
  display: flex; flex-direction: column; gap: 20px;
  padding: 22px; background: #fff;
  border: 1px solid var(--ink-200); border-radius: 16px;
  transition: box-shadow .15s, transform .15s;
}
.icon-card:hover { box-shadow: var(--elev-2); }
.icon-frame {
  width: 56px; height: 56px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-50), var(--accent-100));
  color: var(--accent-700);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--accent-200);
}
.icon-frame.sm { width: 40px; height: 40px; border-radius: 10px; }
.icon-frame svg { width: 64%; height: 64%; }
.icon-meta { display: flex; flex-direction: column; gap: 6px; }
.icon-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.icon-sub { font-size: 13.5px; color: var(--ink-600); }
.icon-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.icon-tags span {
  font-size: 10.5px; color: var(--ink-600);
  padding: 3px 8px; border-radius: 999px;
  background: var(--ink-100);
}

/* ========== Buttons ========== */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  font-family: var(--font-sans); font-weight: 500; font-size: 14px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
  line-height: 1;
}
.btn-sm { font-size: 13px; padding: 8px 12px; border-radius: 8px; }
.btn-lg { font-size: 15px; padding: 14px 20px; border-radius: 12px; }
.btn-primary {
  background: var(--accent-500); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 6px 14px -6px oklch(0.4 0.2 276 / 0.6);
}
.btn-primary:hover { background: var(--accent-600); }
.btn-secondary {
  background: var(--ink-900); color: #fff;
}
.btn-secondary:hover { background: var(--ink-700); }
.btn-ghost {
  background: transparent; color: var(--ink-900);
  border-color: var(--ink-200);
}
.btn-ghost:hover { background: var(--ink-50); border-color: var(--ink-300); }
.btn-ink {
  background: var(--ink-100); color: var(--ink-900); border-color: var(--ink-200);
}
.btn-ink:hover { background: var(--ink-200); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-arrow { transition: transform 0.2s; }
.btn:hover .btn-arrow { transform: translateX(2px); }

/* ========== Inputs ========== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-size: 12px; font-weight: 500; color: var(--ink-700); letter-spacing: 0; }
.input {
  font-family: inherit; font-size: 14px; color: var(--ink-900);
  padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--ink-200); background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.input:focus {
  outline: none;
  border-color: var(--accent-400);
  box-shadow: 0 0 0 3px oklch(0.56 0.21 276 / 0.15);
}
textarea.input { resize: vertical; font-family: inherit; }

/* ========== Cards ========== */
.case-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--ink-200); border-radius: 16px;
  background: #fff; overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.case-card:hover { box-shadow: var(--elev-2); transform: translateY(-1px); }
.case-thumb {
  aspect-ratio: 4/3; position: relative;
  border-bottom: 1px solid var(--ink-200);
}
.case-thumb-mark {
  position: absolute; left: 16px; bottom: 14px;
  font-size: 12px; color: var(--accent-700);
  background: #fff; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--accent-200);
}
.case-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.case-kicker { font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink-500); }
.case-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.case-desc { font-size: 14px; line-height: 1.55; color: var(--ink-600); }
.case-meta { margin-top: 10px; font-size: 11px; color: var(--ink-500); display: flex; gap: 6px; align-items: center; }

.svc-card {
  padding: 24px; background: #fff;
  border: 1px solid var(--ink-200); border-radius: 16px;
  display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow 0.15s;
}
.svc-card:hover { box-shadow: var(--elev-2); }
.svc-head { display: flex; align-items: center; gap: 14px; }
.svc-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.svc-desc { font-size: 14px; line-height: 1.55; color: var(--ink-600); flex-grow: 1; }
.svc-link { font-size: 13px; font-weight: 500; color: var(--accent-700); margin-top: 6px; }

/* ========== Badges ========== */
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
  background: var(--ink-100); color: var(--ink-700);
  border: 1px solid var(--ink-200);
  display: inline-flex; align-items: center; gap: 6px;
}
.badge.mono { font-family: var(--font-mono); font-size: 11px; font-weight: 400; }
.badge-accent { background: var(--accent-50); color: var(--accent-700); border-color: var(--accent-200); }
.badge-ink { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.badge-success { background: oklch(0.96 0.04 155); color: oklch(0.36 0.14 155); border-color: oklch(0.88 0.08 155); }
.badge-warning { background: oklch(0.97 0.04 80); color: oklch(0.42 0.13 80); border-color: oklch(0.88 0.10 80); }
.badge-danger  { background: oklch(0.97 0.03 25); color: oklch(0.40 0.18 25); border-color: oklch(0.88 0.10 25); }

/* ========== Footer of DS ========== */
.ds-foot {
  display: grid; grid-template-columns: 2fr 1fr; gap: 40px;
  margin-top: 80px; padding-top: 40px; border-top: 1px solid var(--ink-200);
}
.ds-foot-brand { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-700); margin-bottom: 12px; font-weight: 500; }
.ds-foot p { font-size: 13.5px; line-height: 1.6; color: var(--ink-600); max-width: 60ch; margin: 0; }
.ds-foot-links { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ds-foot-links a { color: var(--ink-700); }
.ds-foot-links a:hover { color: var(--accent-600); }

/* Responsive */
@media (max-width: 1100px) {
  .ds-side { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--ink-200); }
  .ds-main { margin-left: 0; padding: 48px 32px 80px; }
  .ds-h1 { font-size: 56px; }
  .ds-hero-grid { grid-template-columns: repeat(2, 1fr); }
  .ds-grid-4, .ds-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .ds-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .scale-row { grid-template-columns: 1fr; gap: 8px; }
}
