/* Author: Yananart <yananart@yananart.cn> */

/*
 * Public homepage. Four themes, four compositions:
 *   editorial  a split masthead over an asymmetric photo sequence
 *   gallery    a centred title over a matted, two-column salon hang
 *   cinema     a narrow title over a staggered, full-width film strip
 *   index      a compact masthead over a three-column contact sheet
 * Every image keeps a 3:2 frame at every viewport width. Colour and type
 * tokens live in theme.css; this file owns composition only.
 */

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

:root {
  --home-page: 1120px;
  --home-pad: 24px;
}

[data-theme="cinema"] { --home-pad: 28px; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; }

button,
a { touch-action: manipulation; }

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

.skip {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 40;
  padding: 9px 15px;
  border-radius: var(--radius-xs);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease-out);
}

.skip:focus { transform: none; }

.page {
  width: min(var(--home-page), calc(100% - var(--home-pad) * 2));
  margin: 0 auto;
}

/* ---------- top line ---------- */

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding-top: 12px;
}

.topline-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.topline-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.topline-name { opacity: 0.78; }

.topline-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 22px;
}

.topline-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 1px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.16s ease;
}

.topline-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 1px;
  background: var(--line-strong);
  transition: background-color 0.16s ease;
}

.topline-nav a:hover { color: var(--accent); }
.topline-nav a:hover::after { background: var(--accent); }

/* ---------- editorial ---------- */

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 20px;
  align-items: end;
  padding: clamp(44px, 6vw, 76px) 0 clamp(34px, 4.5vw, 52px);
  border-bottom: 1px solid var(--line);
}

.hero-title {
  grid-column: 1 / span 8;
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 5.9rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hero-title::before {
  content: "";
  display: block;
  width: 30px;
  height: 3px;
  margin-bottom: clamp(18px, 2.4vw, 28px);
  background: var(--accent);
}

.hero-tagline {
  grid-column: 9 / -1;
  margin: 0 0 8px;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.02rem);
  line-height: 1.7;
  text-wrap: pretty;
}

.tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin: clamp(24px, 3vw, 34px) 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.tags li { display: inline-flex; align-items: baseline; }

.tags li + li::before {
  content: "·";
  margin: 0 10px;
  color: var(--line-strong);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  width: 100%;
  max-width: 1080px;
  margin: clamp(38px, 5vw, 56px) auto 0;
}

.gallery.is-broken-all { display: none; }

.shot { margin: 0; min-width: 0; }
.shot:only-child { grid-column: 1 / -1; max-width: calc((100% - 2 * clamp(16px, 2.2vw, 24px)) / 3); }

.shot-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 1px 2px var(--shadow), 0 24px 48px -38px var(--shadow-strong);
  cursor: zoom-in;
  transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.shot-btn:hover,
.shot-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px var(--shadow), 0 30px 56px -34px var(--shadow-strong);
}

.shot-btn img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

.shot-btn:hover img,
.shot-btn:focus-visible img { transform: scale(1.012); }

.shot-caption { display: none; }

.shot.is-broken .shot-btn img { opacity: 0.08; }

.shot.is-broken .shot-btn::after {
  content: "图片暂时无法加载";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.about {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(36px, 6vw, 76px);
  margin-top: clamp(60px, 7vw, 88px);
  padding-top: clamp(40px, 4.5vw, 54px);
  border-top: 1px solid var(--line);
}

.profile {
  position: sticky;
  top: 32px;
  align-self: start;
  padding-top: 18px;
  border-top: 2px solid var(--accent);
}

.avatar {
  display: block;
  width: 84px;
  height: 84px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}

.profile h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.bio {
  margin: 7px 0 0;
  max-width: 28ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-wrap: pretty;
}

.email {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}

.email:hover { border-bottom-color: currentColor; }

.links {
  display: flex;
  flex-direction: column;
  margin: 22px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.16s ease;
}

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

.links .arrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  transition: transform 0.16s ease, color 0.16s ease;
}

.links a:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }

.notes { min-width: 0; }

.intro {
  margin: 0 0 34px;
  max-width: 56ch;
  font-size: clamp(1.12rem, 1.8vw, 1.26rem);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

.card {
  padding: 26px 0 28px;
  border-top: 1px solid var(--line);
}

.card:first-of-type { border-top: 0; padding-top: 0; }

.card h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.16rem, 1.4vw, 1.28rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.card p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  text-wrap: pretty;
}

.card pre {
  margin: 15px 0 0;
  padding: 15px 17px;
  border-radius: var(--radius-xs);
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
}

.card pre code { font: inherit; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.card-link:hover { text-decoration-thickness: 2px; }

/* ---------- gallery ---------- */

[data-theme="gallery"] .topline {
  position: relative;
  justify-content: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

[data-theme="gallery"] .topline-nav {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

[data-theme="gallery"] .topline-nav a {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

[data-theme="gallery"] .hero {
  display: block;
  padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 5vw, 60px);
  border-bottom: 0;
  text-align: center;
}

[data-theme="gallery"] .hero-title {
  font-family: var(--display);
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

[data-theme="gallery"] .hero-title::before {
  width: 1px;
  height: 46px;
  margin: 0 auto clamp(20px, 2.6vw, 28px);
}

[data-theme="gallery"] .hero-tagline {
  max-width: 34rem;
  margin: 22px auto 0;
  padding: 0;
  border-left: 0;
  text-align: center;
}

[data-theme="gallery"] .tags {
  justify-content: center;
  margin-top: 18px;
}

[data-theme="gallery"] .gallery {
  margin-top: clamp(28px, 4vw, 44px);
}

[data-theme="gallery"] .shot-btn {
  padding: clamp(4px, 0.6vw, 6px);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: none;
}

[data-theme="gallery"] .shot-btn:hover,
[data-theme="gallery"] .shot-btn:focus-visible {
  transform: none;
  border-color: var(--control-line);
  box-shadow: 0 18px 34px -30px var(--shadow-strong);
}

[data-theme="gallery"] .shot-btn img { border-radius: 0; }

[data-theme="gallery"] .about {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: clamp(54px, 7vw, 82px);
  padding-top: clamp(34px, 4vw, 48px);
}

[data-theme="gallery"] .profile {
  position: static;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 30px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

[data-theme="gallery"] .avatar {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
}

[data-theme="gallery"] .profile h2 { font-weight: 600; }
[data-theme="gallery"] .bio { margin-left: auto; margin-right: auto; }
[data-theme="gallery"] .email { justify-content: center; }

[data-theme="gallery"] .links {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 24px;
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

[data-theme="gallery"] .links a { border-bottom: 0; }

[data-theme="gallery"] .notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 42px;
  max-width: 780px;
  margin: 34px auto 0;
}

[data-theme="gallery"] .intro {
  grid-column: 1 / -1;
  max-width: 52ch;
  margin: 0 auto 30px;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(1.15rem, 1.8vw, 1.3rem);
}

[data-theme="gallery"] .card {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

[data-theme="gallery"] .card:first-of-type {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ---------- cinema ---------- */

[data-theme="cinema"] .topline {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

[data-theme="cinema"] .topline-nav a,
[data-theme="index"] .topline-nav a,
[data-theme="paper"] .topline-nav a {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

[data-theme="cinema"] .hero {
  display: block;
  padding: clamp(72px, 10vw, 128px) 0 clamp(52px, 7vw, 84px);
  border-bottom: 0;
  text-align: center;
}

[data-theme="cinema"] .hero-title {
  font-size: clamp(3.4rem, 10vw, 7.2rem);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

[data-theme="cinema"] .hero-title::before {
  width: 1px;
  height: 64px;
  margin: 0 auto clamp(24px, 3vw, 34px);
}

[data-theme="cinema"] .hero-tagline {
  max-width: 30rem;
  margin: 24px auto 0;
  padding: 0;
  border-left: 0;
  text-align: center;
}

[data-theme="cinema"] .tags {
  justify-content: center;
  margin-top: 20px;
}

[data-theme="cinema"] .gallery {
  margin-top: clamp(36px, 5vw, 56px);
}

[data-theme="cinema"] .shot:nth-child(2) { margin-top: clamp(18px, 3vw, 32px); }
[data-theme="cinema"] .shot:nth-child(3) { margin-top: clamp(8px, 1.5vw, 16px); }

[data-theme="cinema"] .shot-btn {
  border-radius: 1px;
  box-shadow: 0 30px 70px -50px var(--shadow-strong);
}

[data-theme="cinema"] .about {
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: clamp(34px, 5vw, 64px);
}

[data-theme="cinema"] .profile {
  order: 2;
  border-top-color: var(--line-strong);
}

[data-theme="cinema"] .notes { order: 1; }

[data-theme="cinema"] .intro {
  max-width: 48ch;
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  font-weight: 350;
  line-height: 1.6;
}

/* ---------- index ---------- */

[data-theme="index"] .topline {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 58px;
  padding: 6px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

[data-theme="index"] .hero {
  align-items: start;
  padding: clamp(36px, 5vw, 64px) 0 clamp(26px, 3vw, 38px);
}

[data-theme="index"] .hero-title {
  grid-column: 1 / span 7;
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 0.98;
}

[data-theme="index"] .hero-title::before {
  width: 18px;
  height: 18px;
  margin-bottom: 18px;
  border-radius: 2px;
}

[data-theme="index"] .hero-tagline {
  grid-column: 9 / -1;
  margin: 0;
  padding: 0;
  border-left: 0;
  font-size: 14px;
  line-height: 1.75;
}

[data-theme="index"] .tags { margin-top: 20px; }

[data-theme="index"] .gallery {
  margin-top: clamp(26px, 3.5vw, 40px);
  counter-reset: shot;
}

[data-theme="index"] .shot {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
}

[data-theme="index"] .shot::before {
  counter-increment: shot;
  content: counter(shot, decimal-leading-zero);
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 5px;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.3;
}

[data-theme="index"] .shot-btn,
[data-theme="index"] .shot-btn:hover,
[data-theme="index"] .shot-btn:focus-visible {
  transform: none;
  border-radius: 0;
  box-shadow: none;
}

[data-theme="index"] .shot-caption {
  display: block;
  padding: 7px 9px 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="index"] .about {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 2px clamp(28px, 4vw, 52px);
  margin-top: clamp(34px, 4vw, 48px);
  padding-top: 0;
  border-top: 0;
}

[data-theme="index"] .profile {
  position: static;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

[data-theme="index"] .notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}

[data-theme="index"] .intro {
  grid-column: 1 / -1;
  margin-bottom: 24px;
  font-size: 1.05rem;
}

[data-theme="index"] .card { padding: 18px 0; }
[data-theme="index"] .card h3 { font-size: 1.05rem; }
[data-theme="index"] .card p { font-size: 14px; }

/* ---------- paper ---------- */

[data-theme="paper"] {
  --home-pad: 28px;
}

[data-theme="paper"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 82% -8%, var(--accent-soft), transparent 62%),
    radial-gradient(700px 420px at -10% 30%, #7860380d, transparent 60%);
}

[data-theme="paper"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 46%);
  mask-image: linear-gradient(to bottom, #000, transparent 46%);
}

[data-theme="paper"] .page { position: relative; }

[data-theme="paper"] .topline {
  position: absolute;
  top: 22px;
  right: 0;
  left: 0;
  z-index: 5;
  display: flex;
  min-height: 0;
  padding: 0;
}

[data-theme="paper"] .hero {
  column-gap: 24px;
  padding: 92px 0 48px;
}

[data-theme="paper"] .hero-title {
  font-weight: 500;
  font-size: clamp(3.25rem, 9vw, 6.75rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

[data-theme="paper"] .hero-title::before { display: none; }

[data-theme="paper"] .hero-tagline {
  max-width: 30ch;
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
  font-size: clamp(0.98rem, 1.45vw, 1.08rem);
}

[data-theme="paper"] .tags {
  gap: 4px 0;
  margin-top: 30px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

[data-theme="paper"] .tags li + li::before {
  content: "/";
  margin: 0 11px;
  color: var(--line-strong);
}

[data-theme="paper"] .gallery {
  margin-top: 56px;
}

[data-theme="paper"] .shot-btn {
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: none;
}

[data-theme="paper"] .shot-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px #1c1a151a;
}

[data-theme="paper"] .shot-btn:hover,
[data-theme="paper"] .shot-btn:focus-visible {
  transform: none;
  box-shadow: none;
}

[data-theme="paper"] .shot-btn img {
  filter: saturate(0.94) contrast(1.02);
  transition: transform 0.65s var(--ease-out), filter 0.35s ease;
}

[data-theme="paper"] .shot-btn:hover img,
[data-theme="paper"] .shot-btn:focus-visible img {
  filter: saturate(1.04) contrast(1.03);
  transform: scale(1.035);
}

[data-theme="paper"] .about {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: clamp(40px, 7vw, 96px);
  margin-top: clamp(60px, 7vw, 88px);
  padding-top: clamp(42px, 5vw, 60px);
}

[data-theme="paper"] .profile {
  top: 40px;
  padding-top: 18px;
}

[data-theme="paper"] .avatar {
  width: 92px;
  height: 92px;
  margin-bottom: 20px;
}

[data-theme="paper"] .profile h2 {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

[data-theme="paper"] .bio {
  max-width: 30ch;
  font-size: 0.95rem;
}

[data-theme="paper"] .email { margin-top: 8px; }

[data-theme="paper"] .links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  margin-top: 24px;
  padding-top: 0;
}

[data-theme="paper"] .links a:hover { background: var(--accent-soft); }

[data-theme="paper"] .notes { counter-reset: note-card; }

[data-theme="paper"] .card { counter-increment: note-card; }

[data-theme="paper"] .card h3 {
  position: relative;
  padding-top: 14px;
}

[data-theme="paper"] .card h3::before {
  content: counter(note-card, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
}

[data-theme="paper"] .intro {
  margin-bottom: 38px;
  max-width: 62ch;
  font-family: var(--display);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.7;
  color: var(--ink);
}

[data-theme="paper"] .card { padding: 30px 0 34px; }

[data-theme="paper"] .card h3 {
  font-family: var(--display);
  font-size: clamp(1.24rem, 1.6vw, 1.36rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

[data-theme="paper"] .card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

[data-theme="paper"] .site-footer {
  margin-top: clamp(72px, 10vw, 104px);
}

[data-theme="paper"] .site-footer-inner { padding: 25px 0 52px; }

/* ---------- footer ---------- */

.version-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

.version-link:hover,
.version-link[aria-expanded="true"] {
  color: var(--accent);
  text-decoration-style: solid;
}

.version-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.version-number { font-variant-numeric: tabular-nums; }

/* ---------- release notes ---------- */

.release-popover {
  position: fixed;
  inset: auto 24px 80px auto;
  width: min(388px, calc(100vw - 48px));
  max-height: min(72vh, 640px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px var(--shadow-strong), 0 2px 10px var(--shadow);
  overflow: hidden;
}

.release-popover[open] {
  display: flex;
  flex-direction: column;
  animation: release-in 0.2s var(--ease-out) both;
}

.release-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
}

.release-eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.release-title {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.release-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -8px -12px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.release-close:hover { background: var(--surface-2); color: var(--ink); }
.release-close:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.release-body {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 22px 20px;
  overscroll-behavior: contain;
}

.release-entry {
  padding: 17px 0 16px;
  border-bottom: 1px solid var(--line);
}

.release-entry:last-child {
  padding-bottom: 6px;
  border-bottom: 0;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.release-version {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.release-entry.is-current .release-version { color: var(--accent); }

.release-current {
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.6;
}

.release-breaking {
  padding: 1px 6px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-pill);
  color: var(--danger);
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.6;
}

.release-date {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.release-entry h3 {
  margin: 7px 0 0;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.005em;
}

.release-changes {
  margin: 8px 0 0;
  padding-left: 1.05em;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.release-changes li::marker { color: var(--line-strong); }
.release-changes li + li { margin-top: 3px; }

.release-loading,
.release-error {
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.release-error { color: var(--danger); }

/* ---------- lightbox ---------- */

.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 92vh;
  overscroll-behavior: contain;
}

.lightbox[open] { animation: lightbox-in 0.22s var(--ease-out) both; }

.lightbox::backdrop {
  background: var(--overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lightbox img {
  display: block;
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 30px 80px -20px var(--shadow-strong);
  transition: opacity 0.18s ease;
}

.lightbox.is-loading img { opacity: 0.42; }
.lightbox.is-broken img { opacity: 0.24; }

.lightbox-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 2px solid var(--chrome-ink);
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  animation: lightbox-spin 0.8s linear infinite;
}

.lightbox.is-loading .lightbox-loader {
  opacity: 1;
  visibility: visible;
}

.lightbox-error {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--chrome-ink);
  border-radius: 999px;
  background: var(--chrome);
  color: var(--chrome-ink);
  font-family: var(--mono);
  font-size: 12px;
  transform: translate(-50%, -50%);
}

.lightbox-error[hidden] { display: none; }

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--chrome-ink);
  border-radius: 50%;
  background: var(--chrome);
  color: var(--chrome-ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.lightbox-close:hover { background: var(--chrome-ink); color: var(--chrome); }
.lightbox-close:focus-visible { outline-color: var(--chrome-ink); outline-offset: 3px; }

.lightbox-nav {
  position: fixed;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--chrome-ink);
  border-radius: 50%;
  background: var(--chrome);
  color: var(--chrome-ink);
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.16s ease;
}

.lightbox-nav.is-prev { left: clamp(12px, 3vw, 28px); }
.lightbox-nav.is-next { right: clamp(12px, 3vw, 28px); }
.lightbox-nav:hover { background: var(--chrome-ink); color: var(--chrome); }
.lightbox-nav:focus-visible { outline-color: var(--chrome-ink); outline-offset: 3px; }
.lightbox-nav[hidden] { display: none; }

.lightbox-count {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 1;
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--chrome-ink);
  border-radius: 999px;
  background: var(--chrome);
  color: var(--chrome-ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  transform: translateX(-50%);
}

.lightbox-count[hidden] { display: none; }

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

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 40px;
  }

  .hero-title { grid-column: 1; }
  .hero-tagline { grid-column: 1; margin: 24px 0 0; max-width: 40ch; }
  .tags { margin-top: 24px; }

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

  .about { grid-template-columns: 1fr; gap: 34px; }
  .profile { position: static; }
  .links { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }

  [data-theme="gallery"] .notes { grid-template-columns: 1fr; max-width: 640px; }
  [data-theme="gallery"] .intro { margin-bottom: 24px; }

  [data-theme="cinema"] .shot:nth-child(n) { margin-top: 0; }
  [data-theme="cinema"] .about { grid-template-columns: 1fr; gap: 34px; }
  [data-theme="cinema"] .profile { order: 0; }
  [data-theme="cinema"] .notes { order: 1; }

  [data-theme="index"] .hero { grid-template-columns: 1fr; }
  [data-theme="index"] .hero-title { grid-column: 1; }
  [data-theme="index"] .hero-tagline { grid-column: 1; margin-top: 22px; }
  [data-theme="index"] .gallery { grid-template-columns: 1fr 1fr; }
  [data-theme="index"] .about { grid-template-columns: 1fr; gap: 30px; }
  [data-theme="index"] .notes { grid-template-columns: 1fr; }
  [data-theme="index"] .intro { margin-bottom: 22px; }

  [data-theme="paper"] .hero { padding: 72px 0 40px; }
  [data-theme="paper"] .gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  [data-theme="paper"] .about { grid-template-columns: 1fr; gap: 40px; }
  [data-theme="paper"] .profile {
    position: static;
    display: grid;
    grid-template-columns: 92px 1fr;
    column-gap: 20px;
    align-items: center;
  }
  [data-theme="paper"] .avatar { grid-row: span 2; margin-bottom: 0; }
  [data-theme="paper"] .profile h2,
  [data-theme="paper"] .bio,
  [data-theme="paper"] .email { grid-column: 2; }
  [data-theme="paper"] .email { margin-top: 2px; }
  [data-theme="paper"] .links { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

@media (min-width: 621px) and (max-width: 900px) {
  .gallery .shot:nth-child(3):last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - clamp(14px, 2vw, 24px)) / 2);
  }
}

@media (max-width: 620px) {
  :root { --home-pad: 16px; }
  [data-theme="cinema"] { --home-pad: 20px; }

  .topline { min-height: 62px; padding-top: 8px; }
  .hero { padding-top: 32px; }
  .hero-title { font-size: clamp(2.8rem, 15vw, 3.9rem); }
  .hero-tagline { font-size: 14px; }

  .gallery { grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }

  .about { margin-top: 46px; padding-top: 34px; }
  .links { grid-template-columns: 1fr; }

  [data-theme="gallery"] .hero { padding-top: 44px; }
  [data-theme="gallery"] .hero-title { font-size: clamp(3rem, 15vw, 4.4rem); }
  [data-theme="gallery"] .gallery { grid-template-columns: 1fr; }
  [data-theme="gallery"] .notes { grid-template-columns: 1fr; }
  [data-theme="gallery"] .links { display: flex; }

  [data-theme="cinema"] .hero { padding: 56px 0 42px; }
  [data-theme="cinema"] .hero-title { font-size: clamp(3rem, 16vw, 4.6rem); }
  [data-theme="cinema"] .shot:nth-child(n) { margin-top: 0; }

  [data-theme="index"] .topline { min-height: 54px; }
  [data-theme="index"] .hero { padding-top: 28px; }
  [data-theme="index"] .hero-title { font-size: clamp(2.3rem, 12vw, 3.4rem); }
  [data-theme="index"] .gallery { grid-template-columns: 1fr; gap: 12px; }

  [data-theme="paper"] { --home-pad: 18px; }
  [data-theme="paper"] .topline { top: 14px; }
  [data-theme="paper"] .hero { padding: 66px 0 32px; }
  [data-theme="paper"] .gallery { grid-template-columns: 1fr; gap: 14px; margin-top: 36px; }
  [data-theme="paper"] .about { margin-top: 40px; padding-top: 32px; }
  [data-theme="paper"] .links { grid-template-columns: 1fr; }

  .site-footer { margin-top: 50px; }
  .site-footer-inner { padding-bottom: 30px; }
  .site-tech { line-height: 1.7; overflow-wrap: anywhere; }

  .lightbox img { max-height: 74vh; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 25px; }
  .lightbox-nav.is-prev { left: 8px; }
  .lightbox-nav.is-next { right: 8px; }
  .lightbox-count { bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .release-popover {
    inset: auto 0 0;
    width: 100%;
    max-height: 82vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .release-popover[open] { animation-name: release-sheet-in; }
  .release-head { padding: 18px 18px 14px; }
  .release-body { padding: 2px 18px calc(18px + env(safe-area-inset-bottom)); }
  .release-date { margin-left: 0; }
}

@media (max-width: 480px) {
  .avatar { width: 72px; height: 72px; }
  .card { padding: 22px 0 24px; }
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lightbox-spin {
  to { transform: rotate(360deg); }
}

@keyframes release-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes release-sheet-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .shot-btn:hover,
  .shot-btn:focus-visible,
  .shot-btn:hover img,
  .shot-btn:focus-visible img,
  .links a:hover .arrow { transform: none; }

  .lightbox-loader { animation: none; }
}

/* ---------- 404 ---------- */

.notfound-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.notfound-brand {
  align-self: flex-start;
  margin: 22px 24px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}
.notfound-brand:hover { color: var(--ink); }

.notfound {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 12vh;
  text-align: center;
}

.notfound-code {
  margin: 0;
  color: var(--line-strong);
  font-family: var(--mono);
  font-size: clamp(84px, 20vw, 180px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.9;
  opacity: 0.5;
}

.notfound h1 {
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.notfound p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.notfound-home {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 2px 3px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.notfound-home:hover { border-bottom-color: var(--ink); color: var(--ink); }

.notfound-foot {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
}

.notfound-foot .site-footer-inner { padding: 18px 0 28px; }

.release-copy {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  cursor: pointer;
}
.release-copy:hover { border-color: var(--ink); color: var(--ink); }
.release-copy:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.release-entry.is-target {
  background: var(--accent-soft);
  transition: background-color 0.2s ease;
}
