:root {
  color-scheme: dark;
  --bg: #10100f;
  --paper: #161614;
  --paper-soft: #1e1e1b;
  --text: #f4f1ea;
  --muted: #a7a095;
  --quiet: #6f6a62;
  --line: rgba(244, 241, 234, 0.14);
  --accent: #d7ff5f;
  --accent-ink: #10100f;
  --blue: #8ab8ff;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --font-head: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-body: "Inter", system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --paper-soft: #ebe5d9;
  --text: #151512;
  --muted: #655f56;
  --quiet: #8a8175;
  --line: rgba(21, 21, 18, 0.16);
  --accent: #5d6f00;
  --accent-ink: #fffdf8;
  --blue: #155bb5;
  --shadow: 0 28px 70px rgba(46, 38, 24, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.12;
}

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

h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: 0; }

.eyebrow, .section-eyebrow, .hero-card-eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 18px;
}
.hero-card-eyebrow { color: var(--quiet); margin-bottom: 0; }

/* header */
.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  padding: 26px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.logo-dot { color: var(--quiet); }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}
.primary-nav a {
  color: var(--muted);
  transition: color 160ms ease;
}
.primary-nav a:hover { color: var(--text); }

#theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 56px;
  align-items: start;
  padding: 64px 0 78px;
  border-bottom: 1px solid var(--line);
}

#hero-name {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 800;
  line-height: 0.96;
  margin-bottom: 24px;
}

.lead {
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.65;
  max-width: 46ch;
  margin: 0 0 30px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid var(--line);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-ghost {
  background: rgba(127, 127, 127, 0.04);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); }

.hero-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-card-glow { display: none; }
.hero-card-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 0 20px;
  position: relative;
}
.hero-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* facts */
.facts { padding: 0; border-bottom: 1px solid var(--line); }
.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.fact-card {
  padding: 28px 28px 32px 0;
  border-right: 1px solid var(--line);
}
.fact-card + .fact-card { padding-left: 28px; }
.fact-card:last-child { border-right: 0; }
.fact-num {
  font-family: var(--font-mono);
  color: var(--quiet);
  font-size: 0.82rem;
  margin-bottom: 28px;
}
.fact-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.fact-card p {
  margin: 0;
  max-width: 290px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* sections */
section { padding: 68px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
section h2 { font-size: clamp(1.7rem, 3.2vw, 2.2rem); margin-bottom: 0; }
.section-eyebrow { margin-bottom: 18px; }

/* contacts */
.contacts-grid {
  display: grid;
  border-top: 1px solid var(--line);
  margin-top: 32px;
}
.contact-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  border-radius: 0;
  transition: transform 160ms ease;
}
.contact-card:hover { border-color: var(--line); transform: translateY(-2px); }
.contact-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: none;
  color: var(--accent);
  flex-shrink: 0;
}
.contact-name { display: block; font-weight: 800; font-size: 1.1rem; }
.contact-sub { color: var(--muted); font-size: 0.9rem; font-family: var(--font-mono); }

/* work */
.work-group-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--quiet);
  font-weight: 600;
  margin: 28px 0 14px;
}
.work-group-title:first-of-type { margin-top: 0; }
.work-grid { border-top: 1px solid var(--line); margin-top: 32px; }
.work-card {
  display: block;
  position: relative;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 26px 40px 26px 0;
  transition: transform 160ms ease;
}
.work-card:hover { transform: translateY(-2px); }
.work-card::after {
  content: "↗";
  position: absolute;
  top: 26px;
  right: 0;
  color: var(--accent);
}
.work-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.work-card h3 { font-size: 1.25rem; font-weight: 800; }
.work-card p { margin: 0; max-width: 620px; color: var(--muted); line-height: 1.6; font-size: 0.95rem; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.badge-live { color: var(--accent); border-color: var(--accent); }
.badge-dev { color: var(--muted); }

/* footer */
.site-footer {
  padding: 28px 0 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--quiet);
}
.footer-status { display: flex; align-items: center; gap: 8px; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 56px; }
  .facts-grid { grid-template-columns: 1fr; }
  .fact-card,
  .fact-card + .fact-card {
    padding: 26px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .fact-card:last-child { border-bottom: 0; }
}

@media (max-width: 560px) {
  .site-header, main, .site-footer { width: min(100% - 24px, 1180px); }
  .primary-nav a { display: none; }
  .hero { padding: 48px 0 56px; }
  #hero-name { font-size: 3rem; }
  .lead { font-size: 1.05rem; }
  .hero-actions { display: grid; }
  .btn { width: 100%; }
  section { padding: 48px 0; }
  .work-card { padding-right: 30px; }
  .site-footer { flex-direction: column; gap: 8px; align-items: flex-start; }
}
