:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #5a5a5a;
  --color-border: #e0e0e0;
  --color-accent: #2a5dbd;
  --color-placeholder-bg: #f4f4f4;
  --color-placeholder-border: #c0c0c0;
  --color-placeholder-text: #6a6a6a;
  --color-toggle-hover-bg: #f0f0f0;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  --max-width: 800px;
}

[data-theme='dark'] {
  --color-bg: #11141a;
  --color-text: #e8e8e8;
  --color-text-muted: #9aa0a8;
  --color-border: #2a2f38;
  --color-accent: #7aa8ff;
  --color-placeholder-bg: #1a1e25;
  --color-placeholder-border: #3a4150;
  --color-placeholder-text: #8a8f98;
  --color-toggle-hover-bg: #1f242d;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  color-scheme: light;
}

[data-theme='dark'] {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  line-height: 1.2;
  margin-top: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p {
  text-wrap: pretty;
}

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

a:hover {
  text-decoration: underline;
}

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

.site-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
}

.site-footer-logo {
  display: inline-flex;
  margin-bottom: var(--space-sm);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.site-nav a[aria-current="page"] {
  font-weight: 600;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background-color: var(--color-toggle-hover-bg);
}

.theme-toggle-icon {
  display: none;
}

[data-theme='dark'] .theme-toggle-icon--sun {
  display: block;
}

:root:not([data-theme='dark']) .theme-toggle-icon--moon,
[data-theme='light'] .theme-toggle-icon--moon {
  display: block;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-sm);
}

main > section,
main > article {
  margin-bottom: var(--space-xl);
}

.tagline {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 60ch;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-placeholder-bg);
  border: 2px dashed var(--color-placeholder-border);
  color: var(--color-placeholder-text);
  font-size: 0.875rem;
  text-align: center;
  padding: var(--space-md);
  margin: var(--space-md) 0;
  border-radius: 4px;
}

.placeholder--logo {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  font-size: 0.625rem;
  border-width: 1px;
  flex-shrink: 0;
}

.placeholder--portrait { aspect-ratio: 4 / 5; }
.placeholder--hero     { aspect-ratio: 16 / 9; }
.placeholder--wide     { aspect-ratio: 16 / 9; }
.placeholder--video    { aspect-ratio: 16 / 9; }
.placeholder--card     { aspect-ratio: 4 / 3; }

.featured-item,
.project-card {
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-md);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) var(--space-sm);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-align: center;
}

@media (min-width: 640px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
  }

  main {
    padding: var(--space-xl) var(--space-lg);
  }

  h1 { font-size: 2.5rem; }

  .project-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .project-card {
    border-bottom: none;
    margin-bottom: 0;
  }
}
