/* ============================================================
   Tokens
   ============================================================ */
:root {
  /* color */
  --bg: #0a0d10;
  --bg-raised: #12161b;
  --bg-inset: #14181d;
  --border: #232a31;
  --border-strong: #333c44;

  --text: #edf0f1;
  --text-dim: #98a2aa;
  --text-faint: #5c6670;

  --accent: #d99a45;
  --accent-strong: #f0b25c;
  --accent-rgb: 217, 154, 69;

  /* type */
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --fs-100: 0.8125rem;
  --fs-200: 0.9375rem;
  --fs-300: 1rem;
  --fs-400: 1.15rem;
  --fs-500: 1.5rem;
  --fs-600: 2.1rem;
  --fs-700: 2.75rem;

  /* layout */
  --container-w: 1100px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 3px;
}

@media (min-width: 760px) {
  :root {
    --fs-400: 1.25rem;
    --fs-500: 1.75rem;
    --fs-600: 2.6rem;
    --fs-700: 3.5rem;
  }
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p, dl, dd { margin: 0; }

/* ============================================================
   Base
   ============================================================ */
html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-300);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.container {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 760px) {
  .container { padding-inline: 2.5rem; }
}

.prose {
  max-width: 62ch;
}

.prose p + p { margin-top: var(--space-2); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6em 1em;
  z-index: 100;
  font-family: var(--font-mono);
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 13, 16, 0.92);
  backdrop-filter: blur(6px);
  z-index: 50;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-2);
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-300);
  color: var(--text);
}
.brand-role {
  font-size: var(--fs-100);
  color: var(--text-faint);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.site-nav a {
  font-size: var(--fs-200);
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--fs-100);
}
.lang-btn {
  padding: 0.35em 0.7em;
  color: var(--text-dim);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.lang-btn + .lang-btn {
  border-left: 1px solid var(--border-strong);
}
.lang-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
}
.lang-btn:hover:not([aria-pressed="true"]) {
  color: var(--accent);
}

/* ============================================================
   Motion
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-main > *,
.status-panel {
  animation: rise 0.5s ease both;
}
.hero-main > *:nth-child(1) { animation-delay: 0.02s; }
.hero-main > *:nth-child(2) { animation-delay: 0.08s; }
.hero-main > *:nth-child(3) { animation-delay: 0.14s; }
.hero-main > *:nth-child(4) { animation-delay: 0.2s; }
.status-panel { animation-delay: 0.26s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-block: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
    gap: var(--space-5);
  }
}

.hero h1 {
  font-size: var(--fs-700);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.hero-role {
  font-size: var(--fs-400);
  color: var(--text);
  font-weight: 500;
  max-width: 42ch;
  margin-bottom: var(--space-2);
}

.hero-pitch {
  color: var(--text-dim);
  max-width: 56ch;
  margin-bottom: var(--space-3);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 3px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.hero-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.status-panel {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.status-row + .status-row {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.status-row dt {
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  color: var(--accent);
  margin-bottom: 0.35em;
}
.status-row dd {
  font-size: var(--fs-200);
  color: var(--text-dim);
  line-height: 1.5;
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.section h2 {
  font-size: var(--fs-600);
  margin-bottom: var(--space-4);
}
.section .prose {
  color: var(--text-dim);
}

/* ============================================================
   Stack
   ============================================================ */
.stack-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .stack-grid { grid-template-columns: repeat(3, 1fr); }
}

.stack-group h3 {
  font-size: var(--fs-300);
  color: var(--text);
  margin-bottom: var(--space-2);
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--border-strong);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}
.tag-list li {
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35em 0.6em;
  background: var(--bg-raised);
}

/* ============================================================
   Projects
   ============================================================ */
.project {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-3);
}

.project-index {
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  color: var(--text-faint);
  padding-top: 0.2em;
}

.project-flagship {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.project-flagship .project-index {
  color: var(--accent);
}
.project-flagship h3 {
  font-size: var(--fs-500);
  margin-bottom: var(--space-2);
}
.project-lede {
  color: var(--text);
  font-size: var(--fs-400);
  max-width: 62ch;
  margin-bottom: var(--space-3);
}
.project-flagship p:not(.project-lede) {
  color: var(--text-dim);
  max-width: 66ch;
  margin-bottom: var(--space-2);
}
.project-flagship .tag-list {
  margin-top: var(--space-3);
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  margin-bottom: var(--space-3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-500);
  color: var(--accent-strong);
  font-weight: 700;
}
.stat-label {
  font-size: var(--fs-100);
  color: var(--text-faint);
}

.project-list {
  display: grid;
  gap: var(--space-4);
}
.project-list .project h3 {
  font-size: var(--fs-400);
  margin-bottom: 0.5em;
}
.project-list .project p {
  color: var(--text-dim);
  max-width: 66ch;
  margin-bottom: var(--space-2);
}

/* ============================================================
   Contact
   ============================================================ */
.contact-links {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: var(--fs-300);
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 3px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding-block: var(--space-3);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--fs-100);
  color: var(--text-faint);
  font-family: var(--font-mono);
}
