:root {
  /* Brand colors */
  --primary: #FF9800;
  --primary-light: #FFB74D;
  --primary-dark: #F57C00;
  --highlight: #FFAA00;
  
  /* Semantic tokens (Dark - Default) */
  --void: #040404;
  --surface: #0F0F0F;
  --text: #B0B0B1;
  --text-muted: #7C7C7C;
  --white: #FFFFFF;
  --border: #111111;
  --border-subtle: #1a1a1a;
  --nav-bg: rgba(4, 4, 4, 0.92);
  --table-hover: #080808;
}

@media (prefers-color-scheme: light) {
  :root {
    --void: #FAFAF9;
    --surface: #FFFFFF;
    --text: #3F3F46;
    --text-muted: #71717A;
    --white: #18181B;
    --border: #E5E7EB;
    --border-subtle: #F1F5F9;
    --nav-bg: rgba(250, 250, 249, 0.92);
    --table-hover: #F9FAFB;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: -0.02em;
  background: var(--void);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--white);
}

h1 { font-size: 2.5rem; margin-bottom: 2rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.5rem; }
h3 { font-size: 1.125rem; margin: 1.5rem 0 0.5rem; }
p  { margin-bottom: 1rem; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-light); }

/* Code */
code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: var(--primary-light);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 0.875rem; }

/* Layout */
.content { max-width: 72ch; margin: 0 auto; padding: 4rem 2rem 6rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 900px; margin: 0 auto; padding: 0 2rem;
  height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}

.nav-logo {
  display: flex; align-items: center; gap: 0.625rem;
  text-decoration: none;
}

.nav-logo:hover .logo-img {
  animation: rotate360 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.logo-img {
  height: 28px; width: auto;
  display: block;
}

.logo-wordmark {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  color: var(--text);
  transition: color 0.2s;
}

.nav-logo:hover .logo-wordmark { color: var(--white); }

.nav-links {
  list-style: none; display: flex; gap: 0.25rem;
}
.nav-links a {
  font-family: 'Inter', sans-serif; font-size: 0.875rem; font-weight: 400;
  color: var(--text-muted); padding: 0.375rem 0.75rem;
  border-radius: 4px; transition: color 0.2s, background 0.2s, transform 0.2s;
}
.nav-links a:hover { color: var(--white); background: var(--border-subtle); transform: translateY(-1px); }
.nav-links a.active { color: var(--primary); }
.nav-github { margin-left: 0.5rem; border: 1px solid var(--border-subtle); }
.nav-github:hover { border-color: var(--primary); }

/* Responsive Nav & Hamburger */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 40px;
  position: relative; z-index: 1000;
}

.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text); margin: 4px auto;
  transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  
  .nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .nav-links-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--nav-bg); backdrop-filter: blur(24px);
    display: flex; align-items: center; justify-content: center;
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 500;
  }

  .nav.is-open .nav-links-container { transform: translateX(0); }

  .nav-links {
    flex-direction: column; align-items: center; gap: 2rem;
  }

  .nav-links a { font-size: 1.5rem; color: var(--white); }
  .nav-github { margin-left: 0; border-width: 2px; }
}

@media (max-width: 480px) {
  .logo-wordmark { display: none !important; }
}

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 2rem; text-align: center; font-size: 0.8125rem; color: var(--text-muted); }
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--primary); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.9375rem; }
th {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
  text-align: left; padding: 0.625rem 1rem; border-bottom: 1px solid var(--border-subtle);
}
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
td:first-child { color: var(--primary-light); font-family: 'IBM Plex Mono', monospace; font-size: 0.875em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--table-hover); }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card {
  background: var(--surface); border: 1px solid var(--border-subtle); border-radius: 8px;
  padding: 1.5rem; transition: border-color 0.2s;
}
.card h3 { margin-top: 0; }
.card p  { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 0; }
.card:hover { border-color: var(--primary); }
.card a { display: block; font-family: 'Inter', sans-serif; font-size: 0.875rem; font-weight: 600; margin-top: 0.75rem; color: var(--primary); }
.card a:hover { color: var(--primary-light); }

/* Swatches */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.swatch { border-radius: 6px; overflow: hidden; border: 1px solid var(--border-subtle); }
.swatch-color { height: 80px; width: 100%; }
.swatch-info { background: var(--surface); padding: 0.75rem; }
.swatch-info strong { display: block; font-size: 0.875rem; color: var(--white); margin-bottom: 0.25rem; }
.swatch-info span  { display: block; font-size: 0.8125rem; color: var(--text-muted); }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* W mark rotation animation */
@keyframes rotate360 {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}