:root {
  color-scheme: light dark;
  --bg: #f5f1e8;
  --surface: rgba(255, 252, 246, 0.9);
  --surface-strong: #fffdf8;
  --text: #1d2a1f;
  --muted: #5b675b;
  --accent: #1f6a46;
  --accent-strong: #144a31;
  --accent-text: #fffdf8;
  --line: rgba(29, 42, 31, 0.12);
  --shadow: 0 24px 60px rgba(29, 42, 31, 0.08);
  --radius: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a12;
    --surface: rgba(20, 30, 21, 0.85);
    --surface-strong: #162018;
    --text: #e6ede6;
    --muted: #8a9e8a;
    --accent: #4db87a;
    --accent-strong: #6dcf94;
    --accent-text: #0a1a0e;
    --line: rgba(232, 240, 232, 0.1);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-family: "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(31, 106, 70, 0.14), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(162, 131, 58, 0.18), transparent 28rem),
    var(--bg);
  background-attachment: fixed;
}

@media (prefers-color-scheme: dark) {
  html {
    background:
      radial-gradient(circle at top left, rgba(31, 106, 70, 0.2), transparent 34rem),
      radial-gradient(circle at bottom right, rgba(100, 80, 20, 0.18), transparent 28rem),
      var(--bg);
    background-attachment: fixed;
  }
}

body {
  margin: 0;
  min-height: 100vh;
}

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

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

/* ── Site-wide navigation ─────────────────────────── */

.site-header {
  padding: 1rem 0 0;
}

.nav {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
}

.nav-links a:hover {
  color: var(--text);
}

/* ── Page layout ──────────────────────────────────── */

.page {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.hero,
.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero {
  padding: 2.5rem;
  margin-bottom: 1rem;
}

.section {
  padding: 1.75rem 2rem;
  margin-top: 1rem;
}


/* ── Typography ───────────────────────────────────── */

.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.25rem);
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.08rem;
  max-width: 44rem;
  color: var(--muted);
}

.system-req {
  margin: 0.75rem 0 0;
  font-size: 0.83rem;
  color: var(--muted);
}

/* ── Actions / buttons ────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity 0.15s, transform 0.15s;
}

.button {
  color: var(--accent-text);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #6dcf94));
}

.button-secondary {
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.button:hover,
.button-secondary:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.button:active,
.button-secondary:active {
  opacity: 1;
  transform: translateY(0);
}

/* ── Feature grid ─────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  padding: 1.25rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 0.93rem;
  color: var(--muted);
  margin: 0;
}

/* ── Inline code ──────────────────────────────────── */

code {
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.88em;
  background: var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* ── List ─────────────────────────────────────────── */

ul {
  margin: 0;
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.4rem;
}

li {
  color: var(--muted);
}

/* ── Meta / contact ───────────────────────────────── */

.meta {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.5rem 1rem;
}

.meta dt {
  font-weight: 600;
  color: var(--text);
}

.meta dd {
  margin: 0;
  color: var(--muted);
}

/* ── Footer line ──────────────────────────────────── */

.footer {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* ── Screenshot gallery ───────────────────────────── */

.section-intro {
  margin: 0 0 1.25rem;
  font-size: 0.93rem;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.gallery-item {
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-strong);
  aspect-ratio: 16 / 10;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Hover overlay */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 45%, transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover::after {
  opacity: 1;
}

.gallery-label {
  position: absolute;
  bottom: 0.6rem;
  left: 0.75rem;
  right: 2.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  z-index: 1;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
  pointer-events: none;
}

.gallery-zoom {
  position: absolute;
  bottom: 0.5rem;
  right: 0.65rem;
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  z-index: 1;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.gallery-item:hover .gallery-label,
.gallery-item:hover .gallery-zoom {
  opacity: 1;
  transform: translateY(0);
}

/* ── Lightbox ─────────────────────────────────────── */

.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 4rem 1.5rem 1.5rem;
  max-height: 100vh;
  box-sizing: border-box;
}

.lightbox-nav {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.lightbox-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  max-width: calc(100vw - 11rem);
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  text-align: center;
  max-width: 56rem;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 720px) {
  .page {
    padding-top: 0.75rem;
  }

  .hero,
  .section {
    padding: 1.25rem;
    border-radius: 18px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .meta {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .lightbox-figure {
    max-width: calc(100vw - 8rem);
  }
}

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .lightbox-body {
    gap: 0.5rem;
    padding: 3.5rem 0.5rem 1rem;
  }

  .lightbox-figure {
    max-width: calc(100vw - 6rem);
  }

  .lightbox-nav {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.4rem;
  }
}

@media (max-width: 420px) {
  .nav-links {
    display: none;
  }
}
