:root {
  --bg: #0b0d12;
  --surface: #12151c;
  --surface-2: #181c25;
  --border: #232836;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #7c9cff;
  --accent-ink: #0b0d12;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #f1f3f7;
    --border: #e3e6ec;
    --text: #12151c;
    --muted: #5d667a;
    --accent: #3b5bdb;
    --accent-ink: #ffffff;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .06);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; letter-spacing: -.01em; }
.nav { display: flex; gap: 24px; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--text); }

/* Hero */
.hero { padding: 88px 0 56px; max-width: 680px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 56px); line-height: 1.05; letter-spacing: -.03em; font-weight: 700;
}
.bio { margin: 0 0 32px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.links { display: flex; gap: 8px; }
.icon-link {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--muted); background: var(--surface);
  transition: color .15s, border-color .15s, transform .15s;
}
.icon-link:hover { color: var(--text); border-color: var(--muted); transform: translateY(-1px); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600;
  transition: transform .15s, filter .15s, background .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* Sections */
.section { padding: 40px 0 24px; }
.section-head { margin-bottom: 24px; }
.section-head h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.section-head p { margin: 0; color: var(--muted); }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Cards */
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 120% at 0% 0%, hsl(var(--h) 70% 60% / .9), transparent 60%),
    radial-gradient(120% 120% at 100% 100%, hsl(calc(var(--h) + 60) 70% 45% / .9), transparent 60%),
    hsl(var(--h) 30% 18%);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255, 255, 255, .9);
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
}
.cover-placeholder span { opacity: .8; }

/* 404 */
.notfound { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 80px 0; }
.notfound .code { font-size: clamp(72px, 14vw, 128px); font-weight: 700; line-height: 1; letter-spacing: -.05em; color: var(--accent); margin: 0 0 12px; }
.notfound h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.02em; }
.notfound p { margin: 0 0 28px; color: var(--muted); }
.badge {
  position: absolute; top: 12px; right: 12px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; font-weight: 600;
}

.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.card h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.tagline { margin: 2px 0 0; color: var(--accent); font-size: 14px; font-weight: 500; }
.desc { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li {
  padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 500;
}

.how { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.how summary {
  cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.how summary::-webkit-details-marker { display: none; }
.how summary::before {
  content: ""; width: 6px; height: 6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.how[open] summary::before { transform: rotate(45deg); }
.how ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.how li + li { margin-top: 4px; }

.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 18px; }
.card-actions .btn-primary { flex: 1; }

/* Footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; padding: 24px 20px; font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }

a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .hero { padding: 56px 0 32px; }
  .grid { grid-template-columns: 1fr; }
  .nav { gap: 16px; }
}

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

/* A section with a single project shows it as a wide, featured card. */
@media (min-width: 820px) {
  .grid:has(> .card:only-child) { grid-template-columns: 1fr; }
  .card:only-child { flex-direction: row; }
  .card:only-child .cover { flex: 0 0 55%; aspect-ratio: auto; min-height: 100%; }
  .card:only-child .cover img { position: absolute; inset: 0; object-position: left center; }
  .card:only-child .card-body { padding: 28px; }
  .card:only-child h3 { font-size: 22px; }
  .card:only-child .card-actions .btn-primary { flex: 0 1 220px; }
}
