/* ==========================================================
   Jakob Biehler — main stylesheet (index)
   Header: components/site-header.css
   ========================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* colour */
  --bg: #ffffff;
  --text: #1a1a1a;
  --heading: #111111;
  --muted: #555555;
  --accent: #888888;
  --line: #d9d9d9;

  /* type */
  --font-ui: 'Jost', sans-serif;
  --font-body: var(--font-ui);

  /* layout */
  --max-width: 1440px;
  --reading-width: 640px;
  --hero-inset: 8%;
  --header-height: 120px;
  --header-height-mobile: 70px;
  --layout-breakpoint: 960px; /* mobile layout below this width */
  --ph-stripe: repeating-linear-gradient(45deg, #f0ece5, #f0ece5 12px, #eae5dc 12px, #eae5dc 24px);
}

/* ---------- 2. Reset & base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* language switching relies on [hidden]; make sure no display rule can defeat it */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

/* browser :target ring on full-viewport #top hero reads as a blue overlay on mobile */
#top:target,
.hero:target { outline: none; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 19px;
  line-height: 1.85;
  letter-spacing: 0.2px;
}

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

/* ---------- 3. Shared elements ---------- */
.container { width: min(92%, var(--max-width)); margin: 0 auto; }

/* image placeholder — used as a fallback background behind every photo slot */
.ph {
  width: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--ph-stripe);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: #9a9184;
}

/* ---------- photo frame ----------
   Photos keep their own aspect ratio and are never cropped.
   A .photo box wraps each image; the striped placeholder + label show only until
   the file loads. Photos are grouped into .photo-row rows with a fixed height —
   within a row every image matches that height and keeps its natural width, so a
   row of mixed-width photos lines up along a common top/bottom edge (no cropping).
   To add a picture in Cursor, drop the file into /images with the filename already
   written in the <img src>. If a file is missing the box shows the placeholder. */

/* a row of photos. Each row divides the column into a fixed number of equal-width
   cells (--cols), so exactly that many photos sit side by side and never wrap.
   Photos keep their natural ratio (no cropping); a taller photo simply makes its
   cell taller, and cells in a row align to the top. */
.photo-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  align-items: start;
  justify-items: center;
  margin-bottom: 12px;
}
.photo-row:last-child { margin-bottom: 0; }

.photo {
  position: relative;
  width: 100%;
  border-radius: 2px;
  background: var(--ph-stripe);
}
.photo-row .photo > img,
.contempo-split .photo > img {
  display: block;
  width: 100%; height: auto;
  object-fit: contain;
  border-radius: 2px;
}
/* Keep imgs in layout (width/height attrs reserve space) so lazy-loading can
   detect viewport intersection; hide with opacity until decode completes. */
.photo-row .photo > img:not(.is-loaded),
.contempo-split .photo > img:not(.is-loaded) {
  opacity: 0;
}
.photo-row .photo > img.is-loaded,
.contempo-split .photo > img.is-loaded {
  opacity: 1;
}
/* placeholder needs a visible height before the image loads (no natural height yet) */
.photo-row .photo:not(:has(img.is-loaded)) { min-height: var(--ph-h, 220px); }

.photo .photo-label {                 /* shown only while no image has loaded */
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: #9a9184;
  pointer-events: none;
}
.photo > img.is-loaded + .photo-label { display: none; }

/* a single standalone photo (Guitars, Approach, Portrait, Sound) — natural ratio,
   fills the column width, never cropped */
.photo-single { width: 100%; border-radius: 2px; overflow: hidden;
  background: var(--ph-stripe); }
.photo-single { position: relative; }
.photo-single > img { display: block; width: 100%; height: auto; }
.photo-single > img:not(.is-loaded) { opacity: 0; }
.photo-single > img.is-loaded { opacity: 1; }
.photo-single .photo-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  min-height: 180px;
  font-family: var(--font-ui); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: #9a9184; pointer-events: none;
}
.photo-single > img.is-loaded + .photo-label { display: none; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: none; align-items: center; justify-content: center;
  background: rgba(20, 18, 16, 0.92);
  padding: 4vw;
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox:focus { outline: none; }
.lightbox img {
  position: relative;
  z-index: 1;
  max-width: 92vw; max-height: 90vh;
  width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  touch-action: pan-y pinch-zoom;
  -webkit-user-drag: none;
  user-select: none;
}
.lightbox-close {
  position: absolute; top: 22px; right: 26px;
  z-index: 10;
  width: 40px; height: 40px;
  background: transparent; border: 0; cursor: pointer;
  color: #fff; opacity: .8;
  font-family: var(--font-ui); font-size: 30px; line-height: 1;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-close:focus,
.lightbox-close:focus-visible { outline: none; }
.lightbox-nav {
  position: absolute; top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  display: none; /* hidden by default; desktop gallery only */
  align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  cursor: pointer;
  color: #fff; opacity: 0.85;
  transition: opacity .2s, background .2s;
  pointer-events: auto;
}
@media (min-width: 960px) {
  .lightbox.is-open.has-gallery-nav .lightbox-nav { display: flex; }
}
.lightbox-nav:hover { opacity: 1; background: rgba(255, 255, 255, 0.14); }
.lightbox-nav:focus,
.lightbox-nav:focus-visible { outline: none; }
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.is-zoomable { cursor: zoom-in; }

/* ---------- Sound videos ---------- */
.sound-videos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.sound-video {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--ph-stripe);
  cursor: pointer;
}

.sound-video img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sound-video img:not(.is-loaded) { opacity: 0; }
.sound-video img.is-loaded { opacity: 1; }

.sound-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 16, 0.18);
  transition: background .25s;
  pointer-events: none;
}

.sound-video-play::after {
  content: "";
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a1a1a'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 56% center;
  background-size: 22px 22px;
  cursor: pointer;
}

.sound-video:hover .sound-video-play,
.sound-video:focus-visible .sound-video-play {
  background: rgba(20, 18, 16, 0.28);
}

.sound-video:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ---------- video lightbox ---------- */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 16, 0.92);
  padding: 4vw;
}

.video-lightbox.is-open { display: flex; }

.video-lightbox-frame {
  position: relative;
  width: min(92vw, 960px);
  aspect-ratio: 16 / 9;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.video-lightbox-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-lightbox-close {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #fff;
  opacity: .8;
  font-family: var(--font-ui);
  font-size: 30px;
  line-height: 1;
}

.video-lightbox-close:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero-frame img {
    transition: none;
  }
}

/* ---------- 4. Hero ---------- */
.hero {
  padding-top: 0;
  height: calc(100vh - 160px);
  width: 100%;
}

/* hero — natural ratio, never cropped, fills the inset width */
.hero-frame {
  position: relative; overflow: hidden;
  margin-inline: var(--hero-inset);
  min-height: 120px;
  height: 100%;
  background: var(--ph-stripe);
}
.hero-frame picture {
  display: block;
  width: 100%;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero-frame img {
  display: block;
  width: 100%; height: auto;
  max-width: var(--max-width);
  height: 100%;
  object-fit: contain;
  margin: 0 auto;
}
.hero-frame:has(img.is-loaded) { background: transparent; }

/* ---------- 7. Sections (text left · visual right) ---------- */
main { padding-bottom: 60px; }
section {
  min-height: calc(100vh - var(--header-height));
  padding: 64px 0;
}

/* offsets so anchor links land below the sticky header */
section[id] { scroll-margin-top: 107px; }
#top { scroll-margin-top: 154px; }

/* .section-split { padding: 72px 0; } */
.section-split > .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.col-text { text-align: left; }
.col-text p { margin-bottom: 14px; max-width: 44ch; font-size: 17.7px; }
.col-visual { width: 100%; }

/* Background: wider text column, narrower portrait */
#background.section-split > .container { grid-template-columns: 3fr 2fr; }
#background .col-text { grid-column: 1; grid-row: 1; }
#background .col-visual { grid-column: 2; grid-row: 1; }
#background .col-text p { max-width: none; }

#sound.section-split > .container {
  grid-template-columns: 1fr;
}

#sound .col-text {
  width: 100%;
}

#sound .section-title {
  margin-bottom: 24px;
}

@media (min-width: 960px) {
  #sound.section-split > .container {
    min-height: calc(100vh - var(--header-height) - 128px);
    align-items: start;
  }

  #sound .col-text {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: calc(100vh - var(--header-height) - 128px);
  }

  #sound .sound-videos {
    align-self: center;
  }
}

.section-title,
.model-title {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  letter-spacing: .08em;
  text-align: left;
  color: var(--text);
}

.section-title {
  margin-bottom: 20px;
}

/* ---------- 8. Models ---------- */
/* each model is a text-left / photo-right row, like the other split sections */
.model-row {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  scroll-margin-top: calc(var(--header-height) - 120px);
  /* INTENTIONAL: one screen-height of space after each model so that jumping to a
     model from the nav dropdown lands on that model alone, with the next one pushed
     off-screen ("one screen = one model"). Do not remove — this is the desired behaviour. */
  padding-top: 120px;
}
.model-title {
  margin: 0 0 20px;
}
.model-row .col-text p { max-width: 44ch; }

/* Photo rows: --cols sets how many photos share the row (they never wrap).
   --ph-h is only the placeholder height shown before images load. */
.photo-row.cols-3 { --cols: 3; --ph-h: 280px; }
.photo-row.cols-2 { --cols: 2; --ph-h: 180px; }
.photo-row.cols-1 { --cols: 1; --ph-h: 180px; }
/* a single-photo row shouldn't stretch full width — cap it like one cell of a 2-col row */
.photo-row.cols-1 .photo { max-width: 60%; }

/* Contempo row 1: full body left, detail 2 + 3 stacked in a column on the right */
.contempo-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.contempo-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contempo-split .photo:not(:has(img.is-loaded)) { min-height: 180px; }
.photo .contempo-photo.is-loaded { width: 80%; }
.photo .contempo-photo.is-loaded.contempo-photo-left { margin-left: auto; }
.photo:has(> img.is-loaded) { background: transparent; }

/* ---------- 9. Contact form ---------- */
form.card { max-width: var(--reading-width); margin: 0 auto; text-align: left; }

.contact-label {
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 6px;
}
.input-field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 17px;
}
.btn {
  margin-top: 18px;
  padding: 12px 28px;
  border: 1px solid var(--text);
  border-radius: 2px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.contact-status {
  margin-top: 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: .04em;
  line-height: 1.5;
}
.contact-status.is-success { color: #2f6b3f; }
.contact-status.is-error { color: #8b3a3a; }

.contact-honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 10. Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-note {
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: .06em;
  text-align: center;
  color: var(--muted);
}

/* ---------- 11. Responsive ---------- */
@media (max-width: 959px) {
  .hero {
    padding: 0;
    min-height: calc(100vh - var(--header-height-mobile, 70px));
    height: calc(100vh - var(--header-height-mobile, 70px));
  }

  .hero-frame {
    margin-inline: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: var(--bg);
  }

  .hero-frame picture,
  .hero-frame img {
    max-width: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  section {
    padding: 120px 0 0 0;
    min-height: calc(100vh - var(--header-height-mobile));
  }

  section[id] {
    scroll-margin-top: calc(var(--header-height-mobile) - 120px);
  }

  #top {
    scroll-margin-top: calc(var(--header-height-mobile) - 120px);
  }

  /* .section-split { padding: 48px 0; } */
  .section-split > .container { grid-template-columns: 1fr; gap: 26px; }
  .col-text { text-align: center; }
  .col-text p { max-width: none; margin-left: auto; margin-right: auto; }
  .col-text .section-title,
  .col-text .model-title { text-align: center; }

  /* models: single column, centred */
  .model-row {
    grid-template-columns: 1fr;
    scroll-margin-top: calc(var(--header-height-mobile) - 120px);
    padding-top: 120px;
    min-height: calc(100vh - var(--header-height-mobile));
  }
  .model-row .col-text { text-align: center; }
  .model-row .col-text p { max-width: none; margin-left: auto; margin-right: auto; }

  /* photo rows keep their column count on mobile too; placeholder heights shrink */
  .photo-row.cols-3 { --ph-h: 150px; }
  .photo-row.cols-2 { --ph-h: 120px; }
  .photo-row.cols-1 { --ph-h: 150px; }

  /* Contempo: mobile-only — Madrid-scale photos, centred */
  #model-contempo .col-visual {
    display: flex;
    justify-content: center;
  }

  #model-contempo .contempo-grid {
    width: 100%;
    margin-inline: auto;
  }

  #model-contempo .contempo-split {
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    align-items: start;
  }

  #model-contempo .contempo-stack {
    align-items: center;
    width: 100%;
  }

  #model-contempo .photo {
    width: 100%;
  }

  #model-contempo .photo .contempo-photo.is-loaded,
  #model-contempo .photo .contempo-photo.is-loaded.contempo-photo-left,
  #model-contempo .photo .contempo-photo.is-loaded.contempo-photo-right {
    width: 100%;
    margin-inline: auto;
  }

  #model-contempo .contempo-split .photo:not(:has(img.is-loaded)) {
    min-height: 120px;
  }

  #model-contempo .photo-row.cols-2 {
    --ph-h: 120px;
    justify-items: center;
  }

  .sound-videos {
    grid-template-columns: 1fr;
  }

  /* Background: newspaper-style text wrap around portrait */
  #background.section-split > .container {
    display: block;
  }

  #background .col-visual {
    float: right;
    width: min(44vw, 172px);
    margin: 0.15rem 0 0.85rem 1.1rem;
    shape-outside: margin-box;
    shape-margin: 8px;
  }

  #background .col-text {
    text-align: left;
  }

  #background .col-text .section-title {
    text-align: left;
  }

  #background .col-text p {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
  }

  #background.section-split > .container::after {
    content: "";
    display: table;
    clear: both;
  }
}