/* TrueCom Design Tokens */
:root {
  /* Colors - light */
  --bg: #FAFAF9;
  --bg-2: #F4F3F1;
  --bg-3: #ECEAE6;
  --fg: #1A1A19;
  --fg-2: #2B2B29;
  --muted: #55554F;
  --muted-2: #6F6F6A;
  --hairline: #D8D5CF;
  --hairline-strong: #B8B4AC;

  --accent: oklch(48% 0.16 155);
  --accent-hover: oklch(46% 0.15 155);
  --accent-soft: oklch(96% 0.03 155);

  --danger: oklch(55% 0.14 25);
  --warning: oklch(70% 0.12 80);

  /* Typography */
  --font-display: "Söhne", "Inter Tight", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* Scale (1.25 modular) */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5625rem;
  --fs-2xl: 1.953rem;
  --fs-3xl: 2.441rem;
  --fs-4xl: 3.052rem;
  --fs-5xl: 3.815rem;

  /* Spacing (8pt) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 32px;
  --s-6: 48px;
  --s-7: 64px;
  --s-8: 96px;
  --s-9: 128px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E0D;
    --bg-2: #151514;
    --bg-3: #1C1C1A;
    --fg: #F2F1EE;
    --fg-2: #D9D8D3;
    --muted: #8B8B85;
    --muted-2: #6B6B66;
    --hairline: #242422;
    --hairline-strong: #32322F;
    --accent: oklch(62% 0.14 155);
    --accent-hover: oklch(68% 0.14 155);
    --accent-soft: oklch(22% 0.04 155);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

h1 { font-size: var(--fs-5xl); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--hairline-strong);
  transition: color 150ms, text-decoration-color 150ms;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

code, pre, .mono { font-family: var(--font-mono); letter-spacing: 0.01em; }

code.inline {
  font-size: 0.9em;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 2px;
}

/* Layout */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.prose {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}

.hair { height: 1px; background: var(--hairline); width: 100%; border: 0; margin: 0; }
.hair-v { width: 1px; background: var(--hairline); align-self: stretch; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: 4px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: all 150ms;
  line-height: 1;
}
.btn-primary { background: var(--accent); color: #FAFAF9; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #FAFAF9; }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn-secondary:hover { background: var(--fg); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--fg); text-decoration: underline; text-underline-offset: 4px; padding: 10px 0; }
.btn-ghost:hover { color: var(--accent); }

/* Badge */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 6px;
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  color: var(--muted);
}
.badge.accent { color: var(--accent); border-color: var(--accent); }

/* Code block */
.codeblock {
  position: relative;
  background: #141413;
  color: #E8E6E1;
  border-radius: 4px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  border: 1px solid var(--hairline);
}
.codeblock pre { margin: 0; white-space: pre; }
.codeblock .tok-k { color: #E39E6A; }
.codeblock .tok-s { color: #B5CEA8; }
.codeblock .tok-c { color: #6A6A65; font-style: italic; }
.codeblock .tok-f { color: #79C0B9; }
.codeblock .tok-p { color: #C9C6C0; }
.codeblock .tok-n { color: #D9D8D3; }

/* Callout */
.callout {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 24px 0;
}
.callout h4 {
  font-size: var(--fs-md);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0;
}

/* Tables */
table.tp {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
table.tp th, table.tp td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
table.tp th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom-color: var(--hairline-strong);
}
table.tp td.mono, table.tp th.mono { font-family: var(--font-mono); font-size: 0.8125rem; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--s-5);
  height: 60px;
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.logo {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}
.logo .t-mark {
  display: inline-block;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 1px;
}
.nav-links {
  display: flex;
  gap: var(--s-4);
  font-size: var(--fs-sm);
  margin-left: var(--s-4);
}
.nav-links a {
  text-decoration: none;
  color: var(--fg-2);
  padding: 6px 0;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); }
.nav-right { margin-left: auto; display: flex; gap: var(--s-3); align-items: center; }
.nav-right a.signin { font-size: var(--fs-sm); text-decoration: none; color: var(--fg-2); }
.nav-right a.signin:hover { color: var(--accent); }

/* Footer */
.footer {
  border-top: 1px solid var(--hairline);
  padding: var(--s-7) 0 var(--s-5);
  margin-top: var(--s-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--s-5);
  padding-bottom: var(--s-6);
}
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--s-3);
  font-weight: 500;
}
.footer-col a {
  display: block;
  padding: 4px 0;
  font-size: var(--fs-sm);
  text-decoration: none;
  color: var(--fg-2);
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s-4);
  border-top: 1px solid var(--hairline);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.footer-bottom .brand { font-family: var(--font-mono); }
.footer-bottom .social { display: flex; gap: var(--s-3); }
.footer-bottom .social a { color: var(--muted); text-decoration: none; }
.footer-bottom .social a:hover { color: var(--accent); }

/* Hero shared */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--s-4);
}

/* Sections */
section.tp-section {
  padding: var(--s-8) 0;
  border-top: 1px solid var(--hairline);
}
section.tp-section.no-border { border-top: 0; }

.section-head {
  max-width: 720px;
  margin-bottom: var(--s-6);
}
.section-head h2 { margin-bottom: var(--s-3); }
.section-head p { color: var(--muted); font-size: var(--fs-md); }

/* Grids */
.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-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }
.grid-3x2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--hairline); }
.grid-3x2 > * {
  padding: var(--s-5);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.grid-3x2 > *:nth-child(3n) { border-right: 0; }
.grid-3x2 > *:nth-child(n+4) { /* last row */ }
.grid-3x2 > *:nth-last-child(-n+3) { border-bottom: 0; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Kbd / pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* Responsive */
@media (max-width: 900px) {
  h1 { font-size: var(--fs-4xl); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-3x2 { grid-template-columns: 1fr; }
  .grid-3x2 > * { border-right: 0 !important; border-bottom: 1px solid var(--hairline) !important; }
  .grid-3x2 > *:last-child { border-bottom: 0 !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
