:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b7280;
  --subtle: #a1a1aa;
  --accent: #2563eb;
  --border: #e5e7eb;
  --status: #10b981;
}

:root[data-theme="dark"],
:root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --fg: #fafafa;
    --muted: #9ca3af;
    --subtle: #52525b;
    --accent: #60a5fa;
    --border: #1f1f22;
    --status: #34d399;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --fg: #fafafa;
  --muted: #9ca3af;
  --subtle: #52525b;
  --accent: #60a5fa;
  --border: #1f1f22;
  --status: #34d399;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 40%),
    radial-gradient(circle at 80% 100%, color-mix(in srgb, var(--accent) 5%, transparent) 0%, transparent 50%);
  background-attachment: fixed;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero,
.what-i-do,
.work,
.how-i-work,
.stack,
.experience,
.links,
footer {
  animation: fadeUp 0.6s ease-out backwards;
}

.hero         { animation-delay: 0.05s; }
.what-i-do    { animation-delay: 0.12s; }
.how-i-work   { animation-delay: 0.19s; }
.experience   { animation-delay: 0.26s; }
.stack        { animation-delay: 0.33s; }
.work         { animation-delay: 0.40s; }
.links        { animation-delay: 0.47s; }
footer        { animation-delay: 0.54s; }

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  font-weight: 600;
  line-height: 1.1;
}

.lead {
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0 0 1rem;
  line-height: 1.3;
}

.tagline {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
  max-width: 56ch;
  line-height: 1.6;
}

.tagline a,
.experience .where a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.tagline a:hover,
.experience .where a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.hero-ctas {
  display: flex;
  gap: 0.625rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.125rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--fg) 92%, var(--accent));
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  border-color: var(--muted);
}

section {
  margin-top: 3.5rem;
}

section h2 {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--subtle);
  font-weight: 500;
  margin: 0 0 1.25rem;
}

.what-i-do ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.what-i-do li {
  padding: 0.55rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
  transition: border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
  cursor: default;
}

.what-i-do li:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  transform: translateY(-1px);
  color: var(--accent);
}

.work-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.work-list li {
  position: relative;
  padding-left: 1.375rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
}

.work-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--subtle);
}

.how-i-work p {
  margin: 0;
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.65;
  max-width: 62ch;
}

.how-i-work p + p {
  margin-top: 1rem;
  color: var(--muted);
}

.stack-groups {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.stack-groups > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.25rem;
  align-items: baseline;
}

.stack-groups dt {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
}

.stack-groups dd {
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.stack-sub {
  color: var(--subtle);
  margin-right: 0.35em;
}

.stack-note {
  color: var(--subtle);
}

.experience ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.experience li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.25rem;
  align-items: baseline;
}

.experience .when {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--subtle);
  letter-spacing: 0.02em;
}

.experience .role {
  font-weight: 500;
  color: var(--fg);
  font-size: 1rem;
}

.experience .where {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 0.125rem;
}

.links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.links li {
  border-top: 1px solid var(--border);
}

.links li:last-child {
  border-bottom: 1px solid var(--border);
}

.links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.25rem;
  color: var(--fg);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.2s ease, padding 0.2s ease;
  position: relative;
}

.links a::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--accent);
  transition: height 0.2s ease;
}

.links a:hover {
  color: var(--accent);
  padding-left: 0.75rem;
}

.links a:hover::before {
  height: 60%;
}

.link-meta {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--subtle);
  font-weight: 400;
}

footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--subtle);
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

footer p {
  margin: 0;
}

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
  z-index: 10;
}

.theme-toggle:hover {
  transform: scale(1.05);
  border-color: var(--muted);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 520px) {
  main { padding: 5rem 1.25rem 3rem; }
  .theme-toggle { top: 1rem; right: 1rem; }
  section { margin-top: 2.5rem; }
  .experience li,
  .stack-groups > div {
    grid-template-columns: 6rem 1fr;
    gap: 0.875rem;
  }
  .lead { max-width: none; }
}

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