/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Inter-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/Inter-800.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;

  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f7f7fb;
  --text: #16171d;
  --text-muted: #5b5f6b;
  --border: #e4e4ec;
  --code-bg: #f3f3f8;
  --shadow: 0 1px 2px rgba(16, 17, 23, 0.04), 0 8px 24px rgba(16, 17, 23, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-soft: #1e1b4b;

    --bg: #0e0f13;
    --bg-elevated: #15171d;
    --bg-subtle: #121318;
    --text: #e9eaef;
    --text-muted: #9b9ea9;
    --border: #262830;
    --code-bg: #1a1c23;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-soft: #1e1b4b;

  --bg: #0e0f13;
  --bg-elevated: #15171d;
  --bg-subtle: #121318;
  --text: #e9eaef;
  --text-muted: #9b9ea9;
  --border: #262830;
  --code-bg: #1a1c23;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ---------- Reset / base ---------- */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

img, svg {
  max-width: 100%;
  display: block;
}

code, pre {
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
}
pre code {
  background: none;
  padding: 0;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  z-index: 20;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a:not(.btn) {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.94rem;
}
.header-nav a:not(.btn):hover {
  color: var(--text);
  text-decoration: none;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}
.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
}
.hero-kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.hero p.lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Sections ---------- */
section {
  padding: 48px 0;
}
section + section {
  border-top: 1px solid var(--border);
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.section-heading h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.section-heading .section-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Project cards ---------- */
.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.project-card.featured {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-title-row h3 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 700;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.project-dek {
  color: var(--text-muted);
  margin: 0 0 18px;
  max-width: 640px;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.highlights {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
}
@media (max-width: 620px) {
  .highlights {
    grid-template-columns: 1fr;
  }
}
.highlights li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--text);
}
.highlights li::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--accent);
}
.highlights .highlight-label {
  color: var(--text-muted);
}

.project-more {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* Coming-soon / placeholder card */
.project-card.placeholder {
  border-style: dashed;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 24px;
  text-align: center;
}

/* ---------- About / contact ---------- */
.about-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.about-card p {
  color: var(--text-muted);
  margin: 0 0 20px;
}
.about-card p:last-of-type {
  margin-bottom: 0;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}
.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.contact-links svg {
  width: 16px;
  height: 16px;
}

.todo-note {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .todo-note {
    color: #fcd34d;
    background: #3f2d05;
  }
}
:root[data-theme="dark"] .todo-note {
  color: #fcd34d;
  background: #3f2d05;
}

/* ---------- Architecture page ---------- */
.breadcrumb {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.arch-article h2 {
  font-size: 1.3rem;
  margin-top: 40px;
}
.arch-article h2:first-of-type {
  margin-top: 0;
}
.arch-article p {
  color: var(--text-muted);
}
.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.arch-tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: var(--bg-elevated);
}
.arch-tile h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.arch-tile p {
  margin: 0;
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer-links {
  display: flex;
  gap: 16px;
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .header-nav {
    gap: 10px;
  }
  .header-nav a:not(.btn) {
    display: none;
  }
  .btn-sm {
    padding: 7px 12px;
    font-size: 0.82rem;
  }
}
