:root {
  color-scheme: light dark;
  --bg: #f6f8fa;
  --card-bg: rgba(255, 255, 255, 0.92);
  --fg: #1a1a1a;
  --muted: #57606a;
  --border: #d0d7de;
  --accent: #0969da;
  --webring-arrow: #2b7a58;
  --bg-overlay: rgba(246, 248, 250, 0.78);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --card-bg: rgba(13, 17, 23, 0.90);
    --fg: #e6edf3;
    --muted: #8b949e;
    --border: #30363d;
    --accent: #58a6ff;
    --webring-arrow: #88ccaa;
    --bg-overlay: rgba(13, 17, 23, 0.76);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-overlay), var(--bg-overlay)),
    url("/files/bg_art.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.card-banner {
  height: 115px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 2rem 2rem 1.75rem;
}

body.home .card.has-banner .card-body {
  padding-top: 0;
}

a {
  color: var(--accent);
}

p {
  margin: 0 0 0.85em;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4 {
  line-height: 1.25;
}

h2 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

h3 {
  margin-top: 1.1rem;
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  padding: 0.75rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Figures & Photo Grid */

figure {
  margin: 1.25rem 0;
  text-align: center;
}

figure img {
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  width: 100%;
  object-fit: cover;
}

figcaption {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1.25rem 0;
  text-align: center;
}

.photo-grid figure {
  margin: 0;
}

.photo-grid figure img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Homepage */

body.home main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.home .card-body {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.portrait {
  width: 144px;
  height: 144px;
  object-fit: cover;
  border-radius: 50%;
  align-self: center;
  border: 4px solid var(--card-bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.card.has-banner .portrait {
  margin-top: -72px;
}

body.home h1.title {
  font-size: 2.15rem;
  font-weight: 600;
  margin: 1rem 0 0.75rem;
}

.links {
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.links a {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.95rem;
  font-size: 0.9rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Webring footer */

.webring-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.25rem 0.6rem 0;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.webring-title {
  letter-spacing: 0.03em;
}

.webring-arrow {
  font-size: 1.15rem;
  color: var(--webring-arrow);
  text-decoration: none;
  transition: transform 0.15s ease, color 0.15s ease;
}

.webring-arrow:hover {
  transform: scale(1.15);
  color: var(--accent);
}

@media (max-width: 600px) {
  main {
    padding: 1rem 0.75rem;
  }

  .card-body {
    padding: 1.5rem 1.15rem 1.35rem;
  }

  .card-banner {
    height: 92px;
  }

  .portrait {
    width: 124px;
    height: 124px;
  }

  .card.has-banner .portrait {
    margin-top: -62px;
  }

  body.home h1.title {
    font-size: 1.75rem;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }
}
