:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #767676;
  --link: #0057b8;
  --border: #e2e2e2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181b;
    --text: #e8e8e8;
    --muted: #9a9a9a;
    --link: #6cb0ff;
    --border: #2c2f33;
  }
}

:root[data-theme="dark"] {
  --bg: #15181b;
  --text: #e8e8e8;
  --muted: #9a9a9a;
  --link: #6cb0ff;
  --border: #2c2f33;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

nav a {
  margin-right: 1rem;
  text-decoration: none;
  color: var(--link);
}

.date {
  color: var(--muted);
  font-size: 0.9rem;
}

img {
  max-width: 100%;
}

#theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}

#theme-toggle:hover {
  border-color: var(--link);
}

.app-icon {
  border-radius: 20%;
  flex-shrink: 0;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.page-header .app-icon {
  width: 56px;
  height: 56px;
}

.project-list {
  list-style: none;
  padding: 0;
}

.project-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.6rem 0;
}

.project-list .app-icon {
  width: 32px;
  height: 32px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 0;
}

.gallery-item {
  aspect-ratio: 9 / 19.5;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: none;
  line-height: 0;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  border-color: var(--link);
}

.lightbox {
  border: none;
  border-radius: 12px;
  padding: 0;
  background: var(--bg);
  max-width: min(90vw, 480px);
  max-height: 90vh;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
}

.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
