:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1d23;
  --text-muted: #5c6370;
  --border: #e4e6ea;
  --accent: #4f5fe8;
  --accent-contrast: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #181b21;
    --text: #e8eaee;
    --text-muted: #9aa1ad;
    --border: #2a2e36;
    --accent: #7c89ff;
    --accent-contrast: #101216;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

.container.narrow {
  max-width: 720px;
}

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

a:hover {
  text-decoration: underline;
}

/* Password gate */

#gate {
  display: none;
}

html.locked #gate {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 1.5rem;
}

html.locked .site-header,
html.locked main,
html.locked .site-footer {
  display: none;
}

.gate-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 22rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.gate-card h1 {
  font-size: 1.25rem;
}

.gate-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.gate-card input {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.gate-card input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.gate-error {
  color: #e05661;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero */

.hero {
  padding: 6rem 0 4rem;
}

.hero-kicker {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 34rem;
  margin-top: 1rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
}

.button:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.button.primary:hover {
  filter: brightness(1.1);
}

/* Sections */

.section {
  padding: 3rem 0;
}

.section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Project cards */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.15rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.card code {
  font-size: 0.85em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
}

.tags li {
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.card-links {
  font-size: 0.9rem;
}

.card-links a[aria-disabled="true"] {
  color: var(--text-muted);
  pointer-events: none;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}
