/* uniflo — minimal gallery theme */

:root {
  --bg: #0b0b0f;
  --bg-elev: #141419;
  --text: #f3f3f6;
  --muted: #9a9aa6;
  --line: rgb(255 255 255 / .12);
  --accent: #6cb8ff;
  --radius: 12px;
  --max: 1200px;
  --pad: clamp(16px, 4vw, 32px);
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f8;
    --bg-elev: #ffffff;
    --text: #121218;
    --muted: #6b6b76;
    --line: rgb(0 0 0 / .1);
    --accent: #1d6fd1;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:has(dialog[open]) { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
h1, h2 { letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(100% - 2 * var(--pad), var(--max));
  margin-inline: auto;
}

/* Skip link */
.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #0b0b0f;
  transform: translateY(-200%);
}
.skip:focus { transform: none; z-index: 100; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.01em;
}
.logo-mark { width: 26px; height: 26px; }
.nav {
  display: flex;
  gap: clamp(12px, 2.5vw, 28px);
  font-size: 14px;
  color: var(--muted);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 6px 0; transition: color .2s ease; }
.nav a:hover { color: var(--text); }
.nav .short { display: none; }

@media (max-width: 480px) {
  .site-header .container { gap: 10px; height: 54px; }
  .logo { font-size: 1rem; gap: 7px; }
  .logo-mark { width: 22px; height: 22px; }
  .nav { font-size: 13px; gap: 14px; }
  .nav .full { display: none; }
  .nav .short { display: inline; }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: #000;
}
.hero picture { position: absolute; inset: 0; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / .8) 0%, rgb(0 0 0 / .25) 45%, rgb(0 0 0 / 0) 80%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  min-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: 160px 56px;
  color: #fff;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 700;
}
.hero p {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: rgb(255 255 255 / .82);
}

/* Sections */
.section { padding-block: clamp(48px, 8vw, 88px) 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 22px;
}
.section-head h2,
.section-head h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}
.lede { margin: 0; color: var(--muted); font-size: .95rem; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 22px 16px;
}
.card a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .6, .2, 1), filter .3s ease;
}
.card a:hover img { transform: scale(1.035); }
.card figcaption {
  margin-top: 9px;
  font-size: .85rem;
  color: var(--muted);
}

/* About */
.about-text {
  max-width: 34em;
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}

/* Credits page */
.ext { color: var(--accent); }
.credits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.credits a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: transform .3s ease;
}
.credits a:hover { transform: translateY(-2px); }
.credits picture { flex: none; width: 84px; height: 63px; border-radius: 6px; overflow: hidden; }
.credits img { width: 100%; height: 100%; object-fit: cover; }
.credits span {
  display: flex;
  flex-direction: column;
  font-size: .85rem;
  color: var(--muted);
}
.credits strong { font-weight: 500; color: var(--text); }

/* 404 */
.notfound { padding-block: clamp(80px, 18vh, 180px); text-align: center; }
.notfound h1 { margin: 0 0 8px; font-size: clamp(4rem, 14vw, 9rem); font-weight: 800; color: var(--muted); }
.btn {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b0b0f;
  font-weight: 600;
  transition: opacity .2s ease;
}
.btn:hover { opacity: .85; }

/* Footer */
.site-footer {
  margin-top: clamp(56px, 9vw, 104px);
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}
.site-footer p { margin: 0 0 6px; }
.site-footer p:last-child { margin-bottom: 0; }
.icp a { color: var(--text); }
.site-footer a:hover { text-decoration: underline; }

/* Lightbox */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
  color: #fff;
}
.lightbox::backdrop {
  background: rgb(0 0 0 / .88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(88vw, 1400px);
  margin: 0 auto;
  padding: 24px;
}
.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 8px;
}
.lightbox figcaption {
  padding: 14px 0 0;
  font-size: .9rem;
  color: rgb(255 255 255 / .8);
}
.lb-btn {
  position: fixed;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .12);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease;
}
.lb-btn:hover { background: rgb(255 255 255 / .22); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { top: 50%; left: 16px; transform: translateY(-50%); }
.lb-next { top: 50%; right: 16px; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lb-prev, .lb-next { display: none; }
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
