/* ═══════════════════════════════════════════════════════════════════════════
   Visualsbysalim — production stylesheet
   Design system: "Classical" (editorial, book-like)
   Tokens sourced from the design handoff (classical-tokens.css).
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Palette sampled from the photographs themselves:
     warm median #725c38 (stone, roof tile, tilework, low sun)
     cool median #568ca9 (sky, water, fog, winter light)
     neutral median #7d7d7c — his greys are dead neutral, so the paper is too,
     which keeps the 65 black-and-white frames honest. */
  --color-bg: #f1f2f2;          /* cool paper */
  --color-surface: #e7e8e8;
  --color-plate-mat: #fcfcfc;   /* the mat stays white — no tint on the print */
  --color-text: #1d1f20;        /* neutral ink */
  --color-accent: #a2703f;      /* ochre — terracotta, not gold */
  --color-accent-700: #6d4a29;
  --color-cool: #4a7d94;        /* sky slate — interaction only */
  --color-divider: color-mix(in srgb, #1d1f20 15%, transparent);
  --color-neutral-900: #22262a;

  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "Lora", Georgia, serif;
  --font-heading-weight: 600;

  --space-1: 4.6px;
  --space-2: 9.2px;
  --space-3: 13.8px;
  --space-4: 18.4px;
  --space-6: 27.6px;
  --space-8: 36.8px;

  --radius-sm: 2px;
  --radius-md: 4px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

  /* No grade, no filter. Photographs are shown exactly as shot. */

  --ease: cubic-bezier(.4, 0, .2, 1);
  --measure: 1180px;
}


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

html { scroll-behavior: smooth; }

/* anchor targets clear the sticky topbar when navigated to */
#top, section[id] { scroll-margin-top: 76px; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden; /* the editorial feature frame bleeds to 94vw */
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0 0 var(--space-3); }
img { display: block; max-width: 100%; }
figure { margin: 0; }

a { color: var(--color-accent); text-underline-offset: 3px; }
a:hover { color: var(--color-cool); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.kicker {
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-feature-settings: 'tnum';
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-cool) 10%, transparent); color: var(--color-cool); border-color: var(--color-cool); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }

/* ── Top nav ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  background: color-mix(in srgb, var(--color-bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.brand {
  font-family: var(--font-heading); font-weight: 600; font-size: 19px;
  letter-spacing: .01em; color: var(--color-text); text-decoration: none;
  margin-right: auto; white-space: nowrap;
}
.brand:hover { color: var(--color-text); }

/* the "by" in the wordmark — italic, gold, quietly smaller */
.by {
  font-style: italic;
  font-weight: 400;
  color: var(--color-accent);
}
.navlinks {
  display: none; gap: var(--space-4);
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
}
.navlinks a { color: var(--color-text); text-decoration: none; opacity: .7; }
.navlinks a:hover { opacity: 1; color: var(--color-cool); }

/* ── Folio spine (fixed left rail) ─────────────────────────────────────── */
.spine {
  position: fixed; left: var(--space-4); top: 50%; transform: translateY(-50%);
  z-index: 50; display: none; flex-direction: column; gap: var(--space-4);
}
.spine a {
  display: flex; align-items: center; gap: var(--space-2);
  text-decoration: none;
  font-family: var(--font-heading); font-feature-settings: 'tnum';
  font-size: 14px; letter-spacing: .06em;
  color: color-mix(in srgb, var(--color-text) 38%, transparent);
  transition: color .35s ease;
}
.spine .tick {
  height: 1px; width: 12px; background: var(--color-divider);
  transition: width .4s ease, background .35s ease;
}
.spine a.active { color: var(--color-accent); }
.spine a.active .tick { width: 30px; background: var(--color-accent); }

/* ── Cover masthead ────────────────────────────────────────────────────── */
.masthead {
  position: relative;
  min-height: 100vh;
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-6);
  display: flex; flex-direction: column; justify-content: center;
}
.masthead-kicker {
  display: flex; align-items: baseline; gap: var(--space-3);
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--color-accent); font-feature-settings: 'tnum';
}
.masthead-kicker .rule { flex: 1; height: 1px; background: var(--color-divider); }
.masthead h1 {
  font-size: clamp(42px, 11vw, 150px);
  line-height: .95; font-weight: 400; letter-spacing: -.03em;
  margin: var(--space-4) 0 var(--space-6);
}
.masthead h1 .by {
  font-size: .45em;
  letter-spacing: 0;
  margin: 0 .04em;
}
.tagline {
  max-width: 48ch;
  font-size: clamp(17px, 2vw, 21px);
  font-style: italic; line-height: 1.5;
  color: color-mix(in srgb, var(--color-text) 74%, transparent);
  margin: 0;
}
.hero-figure { margin-top: var(--space-8); }
.hero-caption {
  display: flex; justify-content: space-between; gap: var(--space-4);
  margin-top: var(--space-3);
  font-size: 12px; font-style: italic;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.hero-caption .cue {
  font-feature-settings: 'tnum'; font-style: normal;
  letter-spacing: .08em; text-transform: uppercase; font-size: 10px;
  align-self: center;
}

.series-index {
  margin-top: var(--space-6);
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-4);
}
.series-index a {
  display: flex; align-items: baseline; gap: var(--space-2);
  text-decoration: none; color: var(--color-text);
}
.series-index a:hover .si-title { color: var(--color-cool); }
.series-index .si-folio { font-feature-settings: 'tnum'; font-size: 11px; color: var(--color-accent); }
.series-index .si-title { font-family: var(--font-heading); font-size: clamp(18px, 2vw, 24px); transition: color .3s ease; }
.scroll-cue {
  margin-left: auto; display: flex; color: var(--color-accent);
  animation: vbs-cue 2.4s ease-in-out infinite;
}
@keyframes vbs-cue {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ── Series sections ───────────────────────────────────────────────────── */
.series {
  position: relative;
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-divider);
}
.ghost-folio {
  position: absolute; top: calc(var(--space-6) * -0.4); right: 0; z-index: 0;
  font-family: var(--font-heading); font-weight: 400;
  font-size: clamp(140px, 22vw, 300px); line-height: .72;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--color-accent) 34%, transparent);
  opacity: .5; pointer-events: none; user-select: none;
  font-feature-settings: 'tnum';
}
.series-head {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: auto 1fr; align-items: end;
  gap: var(--space-4); margin-bottom: var(--space-6);
}
.series-head h2 {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 400; line-height: 1; letter-spacing: -.02em;
  margin: var(--space-2) 0 0;
}
.series-blurb {
  justify-self: end; text-align: right; max-width: 36ch;
  font-size: 14px; font-style: italic; line-height: 1.55;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
  margin: 0;
}

/* ── Galleries ─────────────────────────────────────────────────────────── */
.gallery { position: relative; z-index: 1; }

/* Single column by default (phones, narrow windows) — the two-column
   magazine spread switches on only when there is genuinely room for it. */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 900px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery .frame.feature { grid-column: 1 / -1; margin: var(--space-6) 0 var(--space-8); }
  /* staggered top offsets so the two columns never line up */
  .gallery .frame.d2 { margin-top: calc(var(--space-8) + var(--space-6)); }
  .gallery .frame.d3 { margin-top: var(--space-6); }
  .gallery .frame.d4 { margin-top: var(--space-8); }
}

/* The feature frame bleeds past the text measure only when the viewport is
   wide enough to absorb it — never on a half-width window or a phone.
   The bleed is done with a negative margin, not justify-self: an item wider
   than its grid track ignores centring and anchors left, pushing the corner
   ticks off-screen. The 76px allowance covers the scrollbar + the ticks. */
@media (min-width: 1280px) {
  .gallery .frame.feature[data-orient="wide"] {
    --bleed: min(1440px, calc(100vw - 76px));
    width: var(--bleed);
    margin-left: calc((100% - var(--bleed)) / 2);
  }
}
.gallery .frame.feature[data-orient="tall"] {
  width: min(600px, 100%);
  justify-self: center;
}

/* — show-all control — */
.more-row { grid-column: 1 / -1; display: flex; justify-content: center; margin-top: var(--space-6); }
.more-btn { font-family: var(--font-heading); font-size: 14px; }
.count-note {
  grid-column: 1 / -1; text-align: center;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 38%, transparent);
  font-feature-settings: 'tnum'; margin-top: var(--space-4);
}

/* ── Plates ────────────────────────────────────────────────────────────── */
.plate-wrap { position: relative; }
.plate-wrap .ct {
  position: absolute; width: 13px; height: 13px;
  opacity: .5; pointer-events: none;
}
.plate-wrap .ct.tl { top: -7px; left: -7px; border-top: 1px solid var(--color-accent); border-left: 1px solid var(--color-accent); }
.plate-wrap .ct.tr { top: -7px; right: -7px; border-top: 1px solid var(--color-accent); border-right: 1px solid var(--color-accent); }
.plate-wrap .ct.bl { bottom: -7px; left: -7px; border-bottom: 1px solid var(--color-accent); border-left: 1px solid var(--color-accent); }
.plate-wrap .ct.br { bottom: -7px; right: -7px; border-bottom: 1px solid var(--color-accent); border-right: 1px solid var(--color-accent); }

.hero-figure .plate-wrap .ct { width: 16px; height: 16px; }
.hero-figure .plate-wrap .ct.tl { top: -9px; left: -9px; }
.hero-figure .plate-wrap .ct.tr { top: -9px; right: -9px; }
.hero-figure .plate-wrap .ct.bl { bottom: -9px; left: -9px; }
.hero-figure .plate-wrap .ct.br { bottom: -9px; right: -9px; }

.plate-box {
  position: relative;
  border: 6px solid var(--color-plate-mat);
  outline: 1px solid var(--color-divider);
  overflow: hidden;
  background: var(--color-plate-mat);
  cursor: zoom-in;
  transition: transform .55s var(--ease), box-shadow .55s var(--ease);
}
.hero-figure .plate-box { border-width: 8px; }
/* aspect-ratio is set inline per plate from the photo's true dimensions */
.plate-box:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
/* The image defines the frame's height from its own aspect-ratio, so the
   photograph is shown whole — never cropped to fit a box. (Putting the ratio
   on the mat instead would crop by the border width.) */
.plate-box img {
  display: block;
  width: 100%;
  height: auto;
}
/* an empty slot — waiting for a photograph */
.plate-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  text-align: center;
  color: color-mix(in srgb, var(--color-text) 40%, transparent);
  font-style: italic; font-size: 13px;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, color-mix(in srgb, var(--color-text) 2.5%, transparent) 14px 15px);
  cursor: default;
}
.plate-empty svg { opacity: .45; }
.plate-box:has(.plate-empty) { cursor: default; }
.plate-box:has(.plate-empty):hover { transform: none; box-shadow: none; }

.frame figcaption {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--space-2); margin-top: var(--space-3);
}
.frame .folio { font-feature-settings: 'tnum'; font-size: 10px; letter-spacing: .12em; color: var(--color-accent); }
.frame .cap-tick { flex: 0 0 20px; height: 1px; background: var(--color-divider); transform: translateY(-3px); }
.frame .cap { font-size: 12px; font-style: italic; line-height: 1.4; color: color-mix(in srgb, var(--color-text) 56%, transparent); }
.frame .meta {
  margin-left: auto; font-feature-settings: 'tnum';
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 40%, transparent);
}

/* ── About ─────────────────────────────────────────────────────────────── */
.about {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-divider);
  display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-8);
}
.about h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 400; line-height: 1.02; letter-spacing: -.02em;
  margin: var(--space-2) 0 0;
}
.about-copy {
  column-count: 2; column-gap: var(--space-6);
  text-align: justify; hyphens: auto;
  font-size: 15px; line-height: 1.62;
  color: color-mix(in srgb, var(--color-text) 82%, transparent);
}
.about-copy p:first-child { margin-top: 0; }
.about-copy p:last-child { margin-bottom: 0; }

/* ── Contact ───────────────────────────────────────────────────────────── */
.contact {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-divider);
  text-align: center;
}
.contact h2 {
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 400; line-height: 1; letter-spacing: -.02em;
  margin: var(--space-3) 0 var(--space-4);
}
.contact p {
  max-width: 46ch; margin: 0 auto var(--space-6);
  font-size: 16px; line-height: 1.55;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.contact-actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--color-divider); }
.site-footer .inner {
  max-width: var(--measure); margin: 0 auto;
  padding: var(--space-6);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--space-3);
  font-size: 12px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.site-footer .mark { font-family: var(--font-heading); font-size: 16px; color: var(--color-text); }
.site-footer .copyright { font-feature-settings: 'tnum'; }
.grade-toggle {
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  padding: 2px 4px;
}
.grade-toggle:hover { color: var(--color-accent); }
.grade-toggle .on { color: var(--color-accent); }

/* ── Lightbox ──────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  place-items: center;
  padding: clamp(20px, 5vw, 72px);
  background: color-mix(in srgb, var(--color-neutral-900) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox.open { display: grid; }
.lightbox button {
  display: grid; place-items: center;
  background: transparent; color: #fff; cursor: pointer;
  border: 1px solid color-mix(in srgb, #fff 28%, transparent);
}
.lightbox button:hover { border-color: color-mix(in srgb, #fff 60%, transparent); }
.lb-close {
  position: absolute; top: 20px; right: 24px;
  width: 44px; height: 44px; border-radius: var(--radius-md);
}
.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
}
.lb-prev { left: clamp(12px, 3vw, 40px); }
.lb-next { right: clamp(12px, 3vw, 40px); }
.lb-figure {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
}
.lb-mat {
  border: 8px solid color-mix(in srgb, #fff 8%, transparent);
  outline: 1px solid color-mix(in srgb, #fff 14%, transparent);
  background: #000;
}
.lb-mat img { display: block; max-width: min(1200px, 84vw); max-height: 74vh; object-fit: contain; }
.lb-caption {
  display: flex; gap: var(--space-4); align-items: baseline;
  color: color-mix(in srgb, #fff 78%, transparent); font-size: 13px;
}
.lb-caption .t { font-style: italic; }
.lb-caption .n { font-feature-settings: 'tnum'; font-size: 11px; letter-spacing: .08em; opacity: .65; }

/* ── Scroll reveals ────────────────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.shown { opacity: 1; transform: none; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (min-width: 821px) {
  .navlinks { display: flex; }
}
@media (min-width: 1340px) {
  /* below 1340px the fixed rail would sit on top of the 1180px text measure */
  .spine { display: flex; }
}
/* Below 900px the series header stacks and the copy goes single-column —
   the same width at which the gallery drops to one column. */
@media (max-width: 899px) {
  .series-head { grid-template-columns: 1fr; align-items: start; }
  .series-blurb { justify-self: start; text-align: left; max-width: 46ch; }
  .about { grid-template-columns: 1fr; gap: var(--space-6); }
  .about-copy { column-count: 1; }
  .ghost-folio { font-size: clamp(110px, 26vw, 190px); }
}

@media (max-width: 720px) {
  .wrap, .masthead { padding-left: var(--space-4); padding-right: var(--space-4); }
  .topbar { padding-left: var(--space-4); padding-right: var(--space-4); gap: var(--space-2); }
  .topbar .btn { padding: var(--space-1) var(--space-2); font-size: 13px; }
  .lb-prev, .lb-next { width: 40px; height: 40px; }
  .lb-close { top: 12px; right: 12px; }
  .masthead { min-height: auto; padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .series { padding: var(--space-6) 0; }
  .hero-caption { flex-wrap: wrap; gap: var(--space-2); }
}

@media (max-width: 540px) {
  .topbar { flex-wrap: wrap; row-gap: var(--space-2); justify-content: center; }
  .brand { flex: 1 1 auto; }
  #top, section[id] { scroll-margin-top: 150px; } /* wrapped topbar is taller */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue { animation: none; }
  .plate-box, .plate-box:hover { transition: none; transform: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* contents list on the cover — chapter counts sit quietly after each title */
.series-index { gap: var(--space-3) var(--space-6); }
.series-index .si-count {
  font-feature-settings: 'tnum'; font-size: 10px;
  color: color-mix(in srgb, var(--color-text) 34%, transparent);
  margin-left: 4px; align-self: flex-start;
}
.series-index .si-title { font-size: clamp(16px, 1.6vw, 21px); }

/* Seventeen chapters make the spine tall — keep it a whisper, not a wall. */
.spine { gap: var(--space-2); }
.spine a { font-size: 11px; letter-spacing: .04em; opacity: .85; }
.spine .tick { width: 8px; }
.spine a.active .tick { width: 22px; }
.spine a.active { opacity: 1; }
