/* ---- Theme ---- */
:root {
  --bg:        #131316;   /* near-black background */
  --panel:     #1b1b1f;   /* slightly lifted surface */
  --text:      #cfcfd6;   /* light grey text */
  --text-dim:  #8a8a92;   /* secondary grey */
  --border:    #6f6291;   /* muted purple edges */
  --border-soft: #3a3550; /* quieter purple for inner lines */
  --link:      #b9aede;   /* desaturated purple for links */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.6;
}

/* ---- Header / logo ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.logo:hover { text-decoration: none; }

.logo img {
  display: block;
  height: 40px;
  width: auto;
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav a:hover,
.nav a:focus,
.nav a[aria-current="page"] {
  color: var(--text);
}

/* ---- Front page: centered box ---- */
.center-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 2.25rem;
}

.card h1 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
}

.card p {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
}

.contact {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.contact li {
  margin: 0 0 0.4rem;
}

.contact .label {
  display: inline-block;
  width: 5.5rem;
  color: var(--text-dim);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
}

a, .links a {
  color: var(--link);
  text-decoration: none;
}

a:hover, a:focus { text-decoration: underline; }

/* ---- Gallery page ---- */
.gallery-main {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.grid {
  display: grid;
  /* >=180px per tile, but never more than 6 per row (the 5rem = 5 gaps of 1rem) */
  grid-template-columns: repeat(auto-fill, minmax(max(180px, (100% - 5rem) / 6), 1fr));
  gap: 1rem;
}

.grid figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
}

/* ---- Accessibility / motion ---- */
a:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}

/* ---- Small screens ---- */
@media (max-width: 480px) {
  .card { padding: 1.5rem 1.5rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---- Lightbox (pure CSS, radio-driven so scroll position is kept) ---- */
.grid label { display: block; cursor: pointer; }

/* hidden radios that drive which lightbox (if any) is open.
   position:fixed keeps them in the viewport, so clicking a thumbnail
   never scrolls the page to reach an off-screen radio. */
.lb-toggle {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: rgba(10, 10, 12, 0.92);
}

/* a checked radio reveals the lightbox immediately after it */
.lb-toggle:checked + .lightbox { display: flex; }

/* full-area click target behind the image closes the lightbox */
.lightbox .backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: zoom-out;
}

.lightbox .shot {
  position: relative;
  z-index: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

.lightbox .shot img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;        /* full image, never cropped */
  border: 1px solid var(--border);
  background: var(--panel);
}

.lightbox figcaption {
  margin-top: 0.85rem;
  max-width: 60ch;
  color: var(--text-dim);
  font-size: 0.95rem;
  text-align: center;
}

.lightbox figcaption:empty { display: none; }   /* no caption -> no empty gap */

.lightbox .close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  z-index: 2;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
}

.lightbox .close:hover { color: var(--text); }

/* previous / next controls */
.lightbox .lb-prev,
.lightbox .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  padding: 0.5rem 0.75rem;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.lightbox .lb-prev { left: 0.75rem; }
.lightbox .lb-next { right: 0.75rem; }

.lightbox .lb-prev:hover,
.lightbox .lb-next:hover { color: var(--text); }

/* ---- Content pages (video, games) ---- */
.page {
  flex: 1;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

.page-inner {
  max-width: 760px;
  margin: 0 auto;
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
}

/* ---- Video page ---- */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-item h2 {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.video-item p {
  margin: 0.25rem 0 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---- Games page ---- */
.game-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.game-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  padding: 1.25rem 1.5rem;
}

.game-item h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.game-item h2 a { color: var(--link); }

.game-item p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}
