/* ===========================================================
   Roullix — travel photography
   Clean build — vanilla HTML/CSS/JS, no framework
   Type system: Inter throughout — weight 100 for big display
   titles, weight 500 for meta/eyebrow text, weight 700 for
   the logo wordmark.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;300;400;500;700&display=swap');

:root {
  --page-bg: #e8e3da;
  --page-bg-rgb: 232, 227, 218;
  --bg: #f4efe6;
  --ink: #1a1a1a;
  --ink-soft: #6b6a64;
  --line: rgba(20,20,20,0.12);
  --accent: #c9622b;
  --dark-ink: #f2efe9;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

/* Reserve the scrollbar's width permanently, whether or not it's actually
   active — otherwise toggling body's overflow (see the splash lock in
   main.js) changes the usable viewport width, and every fixed-position
   element (header, splash logo, menu) visibly shifts sideways the instant
   scroll is re-enabled. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Splash / intro loader ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--page-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash__stack {
  position: relative;
  width: clamp(200px, 25vw, 310px);
  height: clamp(200px, 25vw, 310px);
  animation: splashPulse 1.4s ease-in-out infinite;
}
.splash__logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.15s ease;
}
.splash__logo--cik {
  opacity: 0;
}
.splash.is-cik .splash__logo--roullix {
  opacity: 0;
}
.splash.is-cik .splash__logo--cik {
  opacity: 1;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.94); opacity: 0.85; }
}

@media (max-width: 900px) {
  body { cursor: auto; }
}

/* ---------- Custom cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 28px; height: 28px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 420;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
  mix-blend-mode: difference;
}
.cursor.is-big { width: 60px; height: 60px; }
/* over the lightbox arrows: solid bold gold ring instead of the thin
   difference-blended one, and no mix-blend-mode so the gold reads true */
.cursor.is-arrow {
  width: 44px;
  height: 44px;
  border-width: 2px;
  border-color: #c9a227;
  mix-blend-mode: normal;
}
@media (max-width: 900px) { .cursor { display: none; } }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 20px; left: 4vw;
  z-index: 410;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-mark {
  width: 64px; height: auto;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.4s ease;
  transform-origin: center;
}
.site-header.is-scrolled .logo-mark {
  transform: scale(0.6875); /* shrinks the fixed 64px box down to ~44px, anchored on its own centre */
}

/* ---------- Menu trigger: lines pill ---------- */
.menu-toggle {
  position: fixed;
  top: 36px; right: clamp(20px, 4vw, 56px);
  z-index: 410;
  outline: none;
  display: flex;
  align-items: center;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
}
.menu-toggle__lines {
  width: 30px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.menu-toggle__lines span {
  display: block;
  height: 1.2px;
  width: 100%;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.menu-toggle.is-open .menu-toggle__lines { width: 20px; }
.menu-toggle.is-open .menu-toggle__lines span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle.is-open .menu-toggle__lines span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Menu overlay: slim top curtain, not full-screen ---------- */
.menu-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 250;
  background: var(--bg);
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}
.menu-overlay.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.menu-panel { display: flex; flex-direction: column; }

.menu-panel__row {
  display: flex;
  justify-content: flex-end;
  padding: 57px clamp(100px, 12vw, 140px) 28px 4vw;
  align-items: start;
}
/* index's menu only ever shows the single About link (see markup), sitting
   in Gallery's old slot — bring it up a bit from the about.html value above,
   which was tuned to align with the two-row Gallery/About stack instead. */
body.page-index .menu-panel__row {
  padding-top: 44px;
}

.menu-panel__nav {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 18px;
  row-gap: 8px;
  justify-content: end;
}

.menu-panel__links {
  display: contents;
}

.menu-panel__social {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  gap: 14px;
  justify-self: start;
  align-self: center;
}
.menu-panel__social a {
  display: flex;
  color: var(--ink);
}
.menu-panel__social a:hover { color: var(--accent); }

.menu-panel__gallery-link { grid-column: 1; grid-row: 1; justify-self: start; }
.menu-panel__about-link { grid-column: 1; grid-row: 2; justify-self: start; }

.menu-panel__links a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.menu-panel__links a:hover { color: var(--accent); }

/* Deliberately no mobile override for .menu-panel__row/__nav — phones use
   the exact same right-aligned layout as desktop (logo left, Gallery/About
   + IG grouped on the right next to the close button). An earlier
   left-aligned mobile override caused the nav block to land on top of the
   logo since both sit at the left edge. */

/* ---------- Photo grid: 4 columns, uniform cropped tiles ---------- */
.gallery-grid {
  --grid-gap: 9px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
  /* top padding just clears the fixed header/logo; no intro title anymore */
  padding: clamp(90px, 10vw, 130px) var(--grid-gap) var(--grid-gap);
}
.grid-item {
  position: relative;
  margin: 0;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--ink);
}
.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: brightness(0.94);
  transition: transform 0.6s ease, filter 0.4s ease;
}
.grid-item:hover img {
  transform: scale(1.08);
  filter: brightness(1);
}

/* Location + year caption, hover-only. Only tiles with a .grid-item__caption
   child get the darkening scrim behind it (via the --captioned modifier) —
   plain tiles keep their existing hover behaviour untouched. */
.grid-item--captioned::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0) 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.grid-item--captioned:hover::after {
  opacity: 1;
}
.grid-item__caption {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 100;
  letter-spacing: -0.5px;
  color: var(--dark-ink);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.grid-item--captioned:hover .grid-item__caption {
  opacity: 1;
  transform: translateY(0);
}
.grid-item__caption-loc {
  font-size: 13px;
}
.grid-item__caption-year {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0;
  color: rgba(242,239,233,0.7);
}

@media (max-width: 1000px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .gallery-grid { --grid-gap: 5px; grid-template-columns: repeat(3, 1fr); padding-top: 84px; }
}

@media (max-width: 600px) {
  .site-header { top: 20px; left: 5vw; }
  .logo-mark { width: 36px; }
  .menu-toggle { top: 31px; right: 5vw; padding: 4px; }
  .menu-toggle__lines { width: 16px; gap: 4px; }
  .menu-toggle.is-open .menu-toggle__lines { width: 14px; }
  .menu-toggle.is-open .menu-toggle__lines span:first-child { transform: translateY(2.6px) rotate(45deg); }
  .menu-toggle.is-open .menu-toggle__lines span:last-child { transform: translateY(-2.6px) rotate(-45deg); }
  .menu-panel__links a { font-size: 9px; }
  .menu-panel__social svg { width: 10px; height: 10px; }
  .menu-panel__row { padding-top: 26px; }
  body.page-index .menu-panel__row { padding-top: 34px; }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 24px clamp(20px, 4vw, 56px) 32px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-footer__social {
  display: flex;
  color: var(--ink-soft);
}
.site-footer__social:hover { color: var(--accent); }

@media (max-width: 500px) {
  .site-footer { flex-direction: column; gap: 6px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  /* backdrop: the page's own background colour, just translucent, so the
     grid still reads faintly through it */
  background: rgba(var(--page-bg-rgb), 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vw, 22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.lightbox__stage {
  /* the "print + mat" card: solid page background, opaque, so it stands
     apart from the translucent backdrop behind it. Fixed width (not
     max-width) so the card is the same size for every photo regardless of
     its aspect ratio — otherwise a narrower image shrinks the whole flex
     row and the arrows visibly jump inward between photos. */
  background: var(--page-bg);
  box-shadow: 0 30px 80px rgba(20,20,20,0.28);
  padding: clamp(14px, 2.2vw, 24px) clamp(14px, 2.2vw, 24px) clamp(12px, 1.8vw, 18px);
  width: min(78vw, 1100px);
  max-height: 88vh;
  flex-shrink: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox__caption {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  align-self: flex-start;
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: -0.3px;
  font-size: 17px;
  color: var(--ink);
  min-height: 1em;
}
.lightbox__caption .lightbox__year {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0;
  color: var(--ink-soft);
}
.lightbox__arrow {
  /* sits in the flex row right next to the card, instead of pinned to the
     viewport edge, so it stays close to the frame at any image width */
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.lightbox__arrow:hover { opacity: 1; }
@media (max-width: 900px) {
  .lightbox__arrow { cursor: pointer; }
}

@media (max-width: 700px) {
  .lightbox__stage { width: 72vw; }
  .lightbox__img { max-height: 70vh; }
  .lightbox__arrow { padding: 6px; }
  .lightbox__arrow svg { width: 20px; height: 20px; }
  .lightbox__caption { font-size: 13px; margin-top: 12px; }
}

/* ---------- About page: hero, crossfading photo slides behind the title ---------- */
.about-hero {
  position: relative;
  height: 100vh;
  min-height: 480px;
  overflow: hidden;
  background: var(--ink);
}
.about-hero__slides { position: absolute; inset: 0; }
.about-hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.about-hero__slide.is-active { opacity: 1; }
.about-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.15) 55%, rgba(0,0,0,0.35));
}
.about-hero__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 clamp(20px, 4vw, 56px) clamp(44px, 7vw, 86px);
}
.about-hero__title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 100;
  letter-spacing: -1.5px;
  line-height: 1.02;
  font-size: clamp(24px, 4vw, 54px);
  color: var(--dark-ink);
}
.about-hero__subtitle {
  margin: 18px 0 0;
  max-width: 480px;
  font-size: clamp(13px, 1.4vw, 17px);
  font-weight: 300;
  line-height: 1.5;
  color: rgba(242,239,233,0.82);
}

@media (max-width: 700px) {
  .about-hero { height: 82vh; }
  .about-hero__title { letter-spacing: -1px; }
}

/* ---------- About page: intro paragraph ---------- */
.about-intro {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(110px, 16vw, 190px) clamp(20px, 4vw, 56px) clamp(60px, 9vw, 120px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.about-intro p {
  margin: 0;
  font-size: clamp(13px, 1.3vw, 16px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-soft);
}
.about-intro p strong {
  font-weight: 700;
  color: var(--ink);
}
.about-intro p.about-signature {
  margin-top: 12px;
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 300;
}

@media (max-width: 700px) {
  .about-intro p { font-size: 13px; line-height: 1.55; }
}

/* ---------- About page: philosophy blocks ---------- */
.about-block {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px clamp(20px, 4vw, 56px);
  border-bottom: 1px dashed var(--line);
}
.about-block--spaced { border-top: none; }
.about-block__row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.about-block__title {
  flex: 0 0 auto;
  width: clamp(140px, 22vw, 260px);
  margin: 0;
  font-family: var(--sans);
  font-weight: 100;
  letter-spacing: -0.5px;
  font-size: clamp(28px, 3vw, 40px);
  color: var(--ink-soft);
}
.about-block__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-block__body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.about-block__body strong { color: var(--ink); font-weight: 500; }

@media (max-width: 700px) {
  .about-block__row { flex-direction: column; gap: 16px; }
  .about-block__title { width: auto; }
}

/* ---------- About page: closing note about prints/downloads ---------- */
.about-cta {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px clamp(20px, 4vw, 56px) clamp(40px, 6vw, 72px);
  border-top: 1px dashed var(--line);
}
.about-cta p {
  margin: 0;
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-soft);
}
.about-cta a { color: var(--ink-soft); font-size: 0.85em; }
.about-cta a:hover { text-decoration: underline; }

/* ---------- About page: two full-screen sections. The down/up transition
   between them is driven by JS (see main.js) with its own scroll-distance
   threshold and eased animation — deliberately no CSS scroll-snap and no
   CSS scroll-behavior:smooth here. With smooth set globally, even the
   per-tick "auto" scrollTo calls in main.js were being intercepted and
   animated by the browser, and since wheel ticks fire faster than each of
   those mini-animations could finish, each one interrupted the last —
   that's what caused the stutter. Leaving scroll-behavior at its default
   (instant) here means per-tick tracking is truly 1:1, and only the
   explicit behavior:'smooth' passed for the final auto-complete jump
   actually animates. */
.about-screen2 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.about-screen2 .site-footer {
  margin-top: auto;
}
