/* Self-hosted fonts; the SC files are subset by tools/build_fonts.py */
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/NotoSerifSC-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/NotoSerifSC-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #121010;
  --panel: #1b1817;
  --ink: #e9e2d6;
  --muted: #8c8379;
  --safelight: #c8392b;
  --amber: #e0a23b;
  --line: #2c2725;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --gutter: 5vw;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { background: var(--bg); color: var(--ink); font-family: var(--serif); line-height: 1.7; overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

/* film grain */
body::after {
  content: ""; position: fixed; inset: -50%; pointer-events: none; z-index: 100; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-2%)} }

.kicker, .meta, .index-label { font-family: var(--mono); color: var(--safelight); font-size: 12px; letter-spacing: .2em; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter); border-bottom: 1px solid var(--line);
  background: rgba(18,16,16,.88); backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
}
.logo { display: flex; align-items: center; gap: 10px; }
.bulb { width: 10px; height: 10px; border-radius: 50%; background: var(--safelight); box-shadow: 0 0 12px 3px rgba(200,57,43,.6); animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 22px 6px rgba(200,57,43,.35); } }
.site-header nav { display: flex; gap: 28px; }
.site-header nav a { color: var(--muted); transition: color .2s; }
.site-header nav a:hover { color: var(--safelight); }

/* hero */
.hero { padding: 12vh var(--gutter) 7vh; }
.hero .meta { margin-bottom: 24px; }
.hero h1 { font-size: clamp(44px, 9vw, 128px); line-height: 1.04; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero p { max-width: 540px; color: var(--muted); margin-top: 28px; font-size: 16px; }

/* film strip */
.strip-wrap { overflow: hidden; padding: 20px 0 70px; }
.strip { display: flex; width: max-content; background: #050404; padding: 32px 0; position: relative; animation: roll 80s linear infinite; }
.strip-wrap:hover .strip { animation-play-state: paused; }
@keyframes roll { to { transform: translateX(-50%); } }
.strip::before, .strip::after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px; opacity: .85;
  background: repeating-linear-gradient(90deg, transparent 0 14px, #d8cfc0 14px 26px, transparent 26px 40px);
}
.strip::before { top: 9px; } .strip::after { bottom: 9px; }
.frame { position: relative; padding: 0 10px; }
.frame img { height: 240px; width: auto; max-width: none; filter: saturate(.6) contrast(1.05) sepia(.12); transition: filter .4s; }
.frame:hover img { filter: none; }
.frame span { position: absolute; bottom: -26px; left: 12px; font-family: var(--mono); font-size: 10px; color: var(--amber); letter-spacing: .1em; }

/* index bar */
.index-bar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 18px var(--gutter); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.index-links { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.index-links a { font-size: 14px; color: var(--muted); transition: color .2s; }
.index-links a b { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--safelight); margin-right: 6px; }
.index-links a:hover { color: var(--ink); }

/* series */
.series { padding: 9vh var(--gutter) 4vh; }
.series + .series { border-top: 1px solid var(--line); }
.series-head { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 28px; align-items: baseline; margin-bottom: 40px; }
.series-no { font-family: var(--mono); color: var(--safelight); font-size: 14px; }
.series-head h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.2; }
.series-head h2 small { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .2em; margin-left: 14px; font-weight: 400; }
.series-count { font-family: var(--mono); color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.series-head p { grid-column: 2 / 4; color: var(--muted); max-width: 560px; font-size: 15px; }

.grid { columns: 3 300px; column-gap: 26px; }
.card { break-inside: avoid; margin-bottom: 26px; display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); transition: transform .3s, border-color .3s; }
.card:hover, .card:focus-visible { transform: translateY(-4px); border-color: var(--safelight); outline: none; }
.card .pic { overflow: hidden; background: #0a0909; }
.card img { width: 100%; height: auto; filter: saturate(.55) contrast(1.05); transition: filter .5s, transform .8s; }
.card:hover img, .card:focus-visible img { filter: none; transform: scale(1.02); }
.card .info { padding: 14px 16px 18px; }
.card h3 { font-size: 17px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card h3 span { font-family: var(--mono); font-size: 10px; color: var(--amber); letter-spacing: .1em; font-weight: 400; }
dl.exif { display: grid; grid-template-columns: auto 1fr; gap: 1px 14px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
dl.exif div { display: contents; }
dl.exif dt { color: var(--safelight); }

@media (hover: none) {
  .card img, .frame img { filter: none; }
}

/* about & contact */
.about { display: grid; grid-template-columns: 1fr 1.4fr; gap: 6vw; padding: 12vh var(--gutter); border-top: 1px solid var(--line); align-items: center; }
.about-photo img { width: 100%; filter: saturate(.5) contrast(1.1); border: 12px solid #050404; }
.about h2, .contact h2 { font-size: 34px; margin: 10px 0 20px; }
.about p, .contact p { color: var(--muted); margin-bottom: 14px; }
.gear { font-family: var(--mono); font-size: 12px; color: var(--amber); margin-top: 26px; letter-spacing: .05em; line-height: 2; }

.contact { padding: 12vh var(--gutter); border-top: 1px solid var(--line); text-align: center; }
.contact .mail { display: inline-block; margin-top: 18px; font-family: var(--mono); font-size: clamp(18px, 3vw, 30px); color: var(--amber); border-bottom: 1px solid currentColor; padding-bottom: 4px; transition: color .2s; }
.contact .mail:hover { color: var(--safelight); }
.socials { display: flex; justify-content: center; gap: 12px 36px; flex-wrap: wrap; margin-top: 30px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.socials b { font-weight: 400; color: var(--safelight); margin-right: 8px; letter-spacing: .1em; }
.socials a { transition: color .2s; }
.socials a:hover { color: var(--ink); }

.site-footer { padding: 28px var(--gutter); border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); flex-wrap: wrap; gap: 10px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(6,5,5,.97); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; animation: fade .25s ease; }
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lb-figure { height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; padding: 48px 0 28px; min-width: 0; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; box-shadow: 0 0 0 10px #000; }
.lb-figure figcaption { text-align: center; }
.lb-head { display: flex; gap: 14px; align-items: baseline; justify-content: center; margin-bottom: 6px; }
.lb-no { font-family: var(--mono); font-size: 11px; color: var(--safelight); letter-spacing: .15em; }
.lb-head h3 { font-size: 20px; }
.lightbox dl.exif { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.lightbox dl.exif div { display: flex; gap: 6px; }
.lb-nav { font-size: 44px; color: var(--muted); height: 100%; transition: color .2s; }
.lb-nav:hover { color: var(--ink); }
.lb-close { position: absolute; top: 14px; right: 18px; font-size: 20px; color: var(--muted); z-index: 2; padding: 8px; }
.lb-close:hover { color: var(--safelight); }

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .site-header nav { gap: 16px; }
  .about { grid-template-columns: 1fr; }
  .frame img { height: 160px; }
  .series-head { grid-template-columns: auto 1fr; }
  .series-count { grid-column: 2; }
  .series-head p { grid-column: 1 / 3; }
  .lightbox { grid-template-columns: 1fr; }
  .lb-figure { padding: 56px 12px 24px; }
  .lb-nav { position: absolute; bottom: 10px; height: auto; font-size: 34px; padding: 4px 18px; }
  .lb-prev { left: 0; } .lb-next { right: 0; }
}
