/* ============================================================
   Gallery — shared foundation
   type, colour, texture, lightbox
   ============================================================ */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-roman-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-roman-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-italic-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-italic-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #08080a;
  --bg-soft: #0c0c0f;
  --fg: #f2ede4;
  --fg-dim: rgba(242, 237, 228, 0.6);
  --fg-faint: rgba(242, 237, 228, 0.36);
  --line: rgba(242, 237, 228, 0.13);
  --accent: #c8a97e;

  --font-display: "Cormorant Garamond", "Songti SC", "Noto Serif SC", "Source Han Serif SC",
    "SimSun", Georgia, "Times New Roman", serif;
  --font-meta: ui-sans-serif, -apple-system, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC",
    "Microsoft YaHei", sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(18px, 3.4vw, 56px);
}

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

html {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 300;
  overflow: hidden;
}

img { display: block; max-width: 100%; }

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(200, 169, 126, 0.28); }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* --- atmosphere ------------------------------------------------ */

.grain {
  position: fixed;
  inset: -60%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxODAnIGhlaWdodD0nMTgwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC44NScgbnVtT2N0YXZlcz0nNCcgc3RpdGNoVGlsZXM9J3N0aXRjaCcvPjxmZUNvbG9yTWF0cml4IHR5cGU9J3NhdHVyYXRlJyB2YWx1ZXM9JzAnLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0nMTgwJyBoZWlnaHQ9JzE4MCcgZmlsdGVyPSd1cmwoJTIzbiknIG9wYWNpdHk9JzAuNTUnLz48L3N2Zz4=");
  animation: grain-shift 6s steps(4) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(-2%, 1%, 0); }
  50%  { transform: translate3d(1%, -2%, 0); }
  75%  { transform: translate3d(-1%, -1%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(4, 4, 6, 0.55) 100%),
    linear-gradient(to bottom, rgba(4, 4, 6, 0.5), transparent 22%, transparent 78%, rgba(4, 4, 6, 0.62));
}

/* --- shared type utilities ------------------------------------- */

.eyebrow {
  font-family: var(--font-meta);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.rule {
  display: inline-block;
  width: 3.2rem;
  height: 1px;
  background: var(--line);
  vertical-align: middle;
}

/* --- shared chrome --------------------------------------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(18px, 2.6vw, 34px) var(--gutter);
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }

.mark {
  font-size: 15px;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  font-family: var(--font-meta);
  font-weight: 400;
  color: rgba(242, 237, 228, 0.86);
  white-space: nowrap;
}

.mark em {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.02em;
  font-size: 19px;
  text-transform: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
}

.nav a {
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.4s var(--ease);
  padding: 4px 0;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}

.nav a:hover { color: var(--fg); }
.nav a:hover::after { transform: scaleX(1); }

/* ============================================================
   Lightbox
   ============================================================ */

.lb {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.lb.is-open { opacity: 1; }

.lb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 7, 0.88);
  -webkit-backdrop-filter: blur(28px) saturate(0.7);
  backdrop-filter: blur(28px) saturate(0.7);
}

.lb__stage {
  position: absolute;
  inset: clamp(56px, 8vh, 96px) 0 clamp(152px, 19vh, 208px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(20px, 7vw, 130px);
}

.lb__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 44px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform-origin: center center;
  will-change: transform, opacity;
}

.lb__progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  width: 0;
  background: linear-gradient(to right, rgba(200, 169, 126, 0.15), var(--accent));
  transition: width 0.7s var(--ease-out);
  z-index: 2;
}

.lb__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 2.6vw, 34px) var(--gutter);
  z-index: 3;
}

.lb__eyebrow { color: var(--fg-faint); }

.lb__close {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.35s var(--ease);
}

.lb__close svg { width: 12px; height: 12px; }
.lb__close:hover { color: var(--fg); }
.lb__close kbd {
  font: inherit;
  letter-spacing: 0.12em;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 5px;
  color: var(--fg-faint);
}

.lb__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(20px, 3vw, 40px) var(--gutter);
}

.lb__cap {
  max-width: min(680px, 76vw);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease) 0.12s, transform 0.7s var(--ease-out) 0.12s;
}

.lb.is-open .lb__cap { opacity: 1; transform: none; }

.lb__num {
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--accent);
}

.lb__title {
  margin: 10px 0 8px;
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.lb__title span {
  font-style: normal;
  font-size: 0.42em;
  letter-spacing: 0.16em;
  color: var(--fg-faint);
  margin-left: 0.9em;
  vertical-align: middle;
}

.lb__desc {
  margin: 12px 0 0;
  max-width: 46ch;
  font-size: clamp(13px, 1.05vw, 15px);
  font-style: italic;
  line-height: 1.6;
  color: rgba(242, 237, 228, 0.62);
}

.lb__meta {
  margin: 0;
  max-width: 100%;
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
  line-height: 1.9;
}

.lb__arrows {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lb__arrow {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.lb__arrow:hover {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

.lb__arrow svg { width: 15px; height: 15px; }

.lb__count {
  font-family: var(--font-meta);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--fg-faint);
  margin: 0 10px;
  font-variant-numeric: tabular-nums;
}

.lb__hint {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 2.2vw, 28px);
  transform: translateX(-50%);
  z-index: 3;
  font-family: var(--font-meta);
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(242, 237, 228, 0.22);
  pointer-events: none;
}

/* --- motion preferences ---------------------------------------- */

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

@media (max-width: 700px) {
  .lb__hint { display: none; }
  .lb__title span { display: block; margin: 6px 0 0; }
  .lb__desc { display: none !important; }
  .lb__bottom { flex-direction: column; align-items: flex-start; gap: 20px; }
  .nav { gap: 14px; }
}
