/* Docs-site local styles. Layout + chrome only — all color values come from
   @doro/design-tokens via CSS custom properties. */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: "Fraunces", serif; letter-spacing: -0.01em; }
h1 { font-size: 44px; line-height: 1.05; font-weight: 600; }
h2 { font-size: 30px; line-height: 1.15; font-weight: 600; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 600; font-family: "Inter Tight", sans-serif; letter-spacing: -0.005em; }
h4 { font-size: 14px; font-weight: 600; font-family: "Inter Tight", sans-serif; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); }

code, pre { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }

a { color: inherit; }

/* layout ------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 20px 40px;
  border-right: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 16px;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 16px;
}
.brand-mark {
  width: 36px; height: 36px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 20px;
}
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.005em; }
.brand-meta { font-size: 11px; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.08em; }

.nav-group { margin-bottom: 22px; }
.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--muted-foreground));
  padding: 0 10px 8px;
  font-weight: 600;
}
.nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: background 140ms ease;
}
.nav a:hover { background: hsl(var(--muted)); }
.nav a.active { background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); font-weight: 500; }

.main { padding: 36px 56px 120px; max-width: 1100px; }

.hero {
  padding: 48px 0 56px;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 56px;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: hsl(var(--primary));
  font-weight: 600;
  margin-bottom: 14px;
}
.hero p.lead { font-size: 18px; color: hsl(var(--muted-foreground)); margin-top: 18px; max-width: 56ch; }

section[id] { padding-top: 16px; margin-bottom: 72px; scroll-margin-top: 24px; }
section > h2 { margin-bottom: 6px; }
section > p.section-lead { color: hsl(var(--muted-foreground)); max-width: 60ch; margin-bottom: 28px; font-size: 16px; }

.subsection { margin-top: 40px; }
.subsection > h3 { margin-bottom: 14px; }
.subsection > p { color: hsl(var(--muted-foreground)); margin-bottom: 18px; max-width: 60ch; }

/* primitives ---------------------------------------------------- */

.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  padding: 22px;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.btn-secondary:hover { background: hsl(var(--secondary) / 0.8); }
.btn-outline { background: transparent; border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.btn-outline:hover { background: hsl(var(--muted)); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--muted)); }

.input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid hsl(var(--input));
  background: transparent;
  color: hsl(var(--foreground));
  border-radius: 8px;
  font: inherit; font-size: 14px;
  min-width: 240px;
}
.input:focus { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.badge.secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.badge.outline { background: transparent; border: 1px solid hsl(var(--border)); color: hsl(var(--foreground)); }
.badge.warn { background: hsl(var(--warning)); color: hsl(var(--warning-foreground)); }
.badge.destructive { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }

/* color swatches ------------------------------------------------ */

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.swatch {
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  overflow: hidden;
  background: hsl(var(--card));
}
.swatch-preview { height: 84px; }
.swatch-meta { padding: 12px 14px; font-size: 12.5px; }
.swatch-meta strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.swatch-meta code { font-size: 11.5px; color: hsl(var(--muted-foreground)); }

/* type scale ---------------------------------------------------- */

.type-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid hsl(var(--border));
  align-items: baseline;
}
.type-row:first-of-type { border-top: none; }
.type-meta code { display: block; color: hsl(var(--muted-foreground)); font-size: 11.5px; }
.type-sample { color: hsl(var(--foreground)); }

/* spacing scale ------------------------------------------------- */

.spacing-row {
  display: grid;
  grid-template-columns: 80px 80px 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid hsl(var(--border));
  font-size: 13px;
}
.spacing-row:first-of-type { border-top: none; }
.spacing-bar { height: 12px; background: hsl(var(--primary)); border-radius: 3px; }

/* code blocks --------------------------------------------------- */

pre {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
}
.dark pre { background: hsl(142 24% 12%); color: hsl(95 40% 96%); }
code.inline {
  background: hsl(var(--muted));
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

/* data tables --------------------------------------------------- */

table.meta {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.meta th, table.meta td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid hsl(var(--border));
}
table.meta th {
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.4);
}

/* theme toggle -------------------------------------------------- */

.theme-toggle {
  margin-top: 0;
  margin-bottom: 28px;
  padding: 4px;
  background: hsl(var(--muted));
  border-radius: 10px;
  display: inline-flex;
  gap: 2px;
}
.theme-toggle button {
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 7px;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.theme-toggle button.active {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.06);
}

/* package cards ------------------------------------------------- */

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.package-card {
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  padding: 22px;
  background: hsl(var(--card));
  display: flex; flex-direction: column; gap: 10px;
}
.package-card .pkg-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: hsl(var(--primary));
}
.package-card .pkg-role { font-weight: 600; font-size: 15px; }
.package-card .pkg-desc { color: hsl(var(--muted-foreground)); font-size: 13.5px; }
.package-card .pkg-deployable {
  margin-top: auto;
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* tree view ----------------------------------------------------- */

.tree {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.75;
  background: hsl(var(--muted) / 0.35);
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  padding: 18px 20px;
  white-space: pre;
  overflow-x: auto;
  color: hsl(var(--foreground));
}
.tree .comment { color: hsl(var(--muted-foreground)); }

/* component demo strips ---------------------------------------- */

.demo-strip {
  padding: 28px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .main { padding: 28px 24px 80px; }
  .two-col { grid-template-columns: 1fr; }
}
