/* ============ Presets page ============ */
.pr-wrap { max-width: 1200px; margin-inline: auto; padding-inline: var(--pad-x); }
.pr-eyebrow {
  font-family: var(--f-mono); font-size: var(--size-mono); letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--amber); display: inline-block; margin: 0 0 1.2rem;
}
.pr-section { padding-block: clamp(4rem, 9vw, 8rem); }
.pr-section-head { max-width: 46rem; margin: 0 0 clamp(2.5rem, 5vw, 4rem); }
.pr-section-head h2 {
  font-family: var(--f-display); font-weight: 480; font-size: var(--size-h2);
  line-height: 1.02; color: var(--text-bright); margin: 0 0 1rem; letter-spacing: -0.01em;
}
.pr-section-head p { font-size: 1.1rem; color: var(--text-dim); margin: 0; max-width: 40rem; }
.pr-section-head em { font-style: italic; color: var(--amber); }

/* ---- Hero ---- */
.pr-hero { padding-block: clamp(7rem, 15vw, 12rem) clamp(3rem, 6vw, 5rem); position: relative; }
.pr-hero h1 {
  font-family: var(--f-display); font-weight: 460; font-size: var(--size-hero);
  line-height: 0.98; letter-spacing: -0.02em; color: var(--text-bright); margin: 0 0 1.6rem;
}
.pr-hero h1 em { font-style: italic; }
.pr-hero h1 .warm { color: var(--amber); font-style: italic; }
.pr-hero h1 .cool { color: var(--teal); font-style: italic; }
.pr-lead { font-size: clamp(1.1rem, 1.6vw, 1.35rem); color: var(--text); max-width: 38rem; margin: 0 0 2.2rem; line-height: 1.5; }
.pr-hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.pr-hero-meta { font-family: var(--f-mono); font-size: var(--size-mono); letter-spacing: 0.16em; color: var(--text-dim); text-transform: uppercase; }

.pr-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--f-body);
  font-weight: 600; font-size: 0.98rem; padding: 0.85rem 1.6rem; border-radius: 2px;
  background: var(--amber); color: #1a1206; text-decoration: none; border: 1px solid var(--amber);
  transition: background .2s var(--ease-out), transform .2s var(--ease-out);
}
.pr-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.pr-btn-ghost { background: transparent; color: var(--text-bright); border-color: var(--line); }
.pr-btn-ghost:hover { background: var(--carbon-2); border-color: var(--amber); }

/* ---- Intro feature row ---- */
.pr-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.pr-feature { border-top: 1px solid var(--line); padding-top: 1.3rem; }
.pr-feature h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.4rem; color: var(--text-bright); margin: 0 0 0.5rem; }
.pr-feature p { font-size: 1rem; color: var(--text-dim); margin: 0; line-height: 1.55; }
@media (max-width: 780px) { .pr-features { grid-template-columns: 1fr; } }

/* ---- Before / After sliders ---- */
.pr-demos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 860px) { .pr-demos-grid { grid-template-columns: 1fr; } }

.ba { margin: 0; }
.ba-stage {
  --pos: 50%;
  position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 3px;
  border: 1px solid var(--line); background: var(--carbon-2); cursor: ew-resize; touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-after { clip-path: inset(0 calc(100% - var(--pos)) 0 0); will-change: clip-path; }
.ba-divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px;
  background: var(--highlight); transform: translateX(-1px); pointer-events: none; box-shadow: 0 0 12px rgba(0,0,0,.5);
}
.ba-knob {
  position: absolute; top: 50%; left: var(--pos); width: 40px; height: 40px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--highlight); color: #1a1206; display: grid; place-items: center;
  font-size: 15px; pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.ba-tag {
  position: absolute; top: 0.75rem; font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.18em;
  padding: 0.25rem 0.5rem; border-radius: 2px; background: rgba(13,11,8,0.6); color: var(--silver);
  backdrop-filter: blur(2px); pointer-events: none;
}
.ba-tag-before { left: 0.75rem; }
.ba-tag-after  { right: 0.75rem; color: var(--amber); }
/* accessible native control, kept usable but visually minimal at the base */
.ba-range {
  position: absolute; left: 0; bottom: 0; width: 100%; margin: 0; height: 44px; opacity: 0; cursor: ew-resize;
}
.ba-range:focus-visible { opacity: 1; }

.ba figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 0.9rem; flex-wrap: wrap; }
.ba-pack { font-family: var(--f-mono); font-size: var(--size-mono); letter-spacing: 0.16em; color: var(--teal); text-transform: uppercase; }
.ba-preset { font-size: 0.95rem; color: var(--text-dim); }
.ba-preset em { font-style: normal; color: var(--text-bright); }

/* ---- Packs ---- */
.pr-packs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, 2.5vw, 2rem); }
@media (max-width: 780px) { .pr-packs-grid { grid-template-columns: 1fr; } }
.pr-pack {
  border: 1px solid var(--line); border-radius: 3px; padding: clamp(1.5rem, 3vw, 2.2rem);
  background: linear-gradient(180deg, var(--carbon-2), var(--carbon));
}
.pr-pack-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.pr-pack h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.7rem; color: var(--text-bright); margin: 0; }
.pr-pack-count { font-family: var(--f-mono); font-size: var(--size-mono); letter-spacing: 0.14em; color: var(--amber); }
.pr-pack > p { font-size: 1rem; color: var(--text-dim); margin: 0 0 1.2rem; line-height: 1.5; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pr-chip {
  font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.04em; color: var(--silver);
  padding: 0.28rem 0.55rem; border: 1px solid var(--line-soft); border-radius: 2px; background: var(--carbon-3);
}

/* ---- One frame, eight ways: 3x3 collage with the raw in the centre ---- */
.pr-collage {
  display: grid;
  /* uneven tracks lift the centre; corner + centre cells stay exactly 2:3, only
     the four edge cells crop (~13% on one axis) - invisible on portrait frames */
  /* minmax(0,..) is load-bearing: a bare 1fr row takes its min-content height from
     the image inside it, which blows the tracks out to equal heights */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3px; aspect-ratio: 2 / 3; max-width: 34rem; margin-inline: auto;
  background: var(--carbon-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
}
.pr-collage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pr-collage-raw { position: relative; }
.pr-collage-tag {                 /* rides on .ba-tag; silver, because amber means "graded" here */
  top: auto; bottom: 0.6rem; left: 50%; right: auto;
  transform: translateX(-50%); color: var(--highlight);
}

/* hover a look to fade it back to the raw: the raw sits behind as a background layer
   (same file the centre uses, so it costs no extra request) and the graded img fades out */
.pr-collage-look {
  position: relative; cursor: crosshair;
  background: url(/presets/demos/collage-9.jpg) center / cover no-repeat;
}
.pr-collage-look::after {         /* tells you what you are looking at once it has faded */
  content: "RAW"; position: absolute; left: 50%; bottom: 0.5rem; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: 0.56rem; letter-spacing: 0.18em;
  padding: 0.2rem 0.4rem; border-radius: 2px;
  background: rgba(13,11,8,0.6); color: var(--highlight); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
}
.pr-collage-look:hover img    { opacity: 0; }
.pr-collage-look:hover::after { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .pr-collage-look img,
  .pr-collage-look::after { transition: opacity .4s var(--ease-out); }
}
@media (max-width: 600px) { .pr-collage { gap: 2px; } }

/* ---- Get / gift CTA ---- */
.pr-get { text-align: center; }
.pr-get .pr-section-head { margin-inline: auto; }
.pr-get-card {
  max-width: 40rem; margin: 0 auto; border: 1px solid var(--line); border-radius: 4px;
  padding: clamp(2rem, 5vw, 3.5rem); background: radial-gradient(120% 140% at 70% 0%, rgba(232,163,61,.10), transparent 60%), var(--carbon-2);
}
.pr-get-card h2 { font-family: var(--f-display); font-weight: 480; font-size: var(--size-h3); color: var(--text-bright); margin: 0 0 0.8rem; }
.pr-get-card p { color: var(--text-dim); margin: 0 0 1.6rem; }
.pr-get-card .pr-get-packs {
  font-size: var(--size-mono); letter-spacing: 0.1em; color: var(--amber);
  opacity: .75; line-height: 1.9;
}
.pr-note { font-family: var(--f-mono); font-size: var(--size-mono); letter-spacing: 0.12em; color: var(--text-dim); text-transform: uppercase; margin-top: 1.2rem; }

/* ---- Credit: the photographers whose free RAWs are all over this page ---- */
.pr-credit { padding-block: clamp(3rem, 6vw, 5rem) clamp(4rem, 8vw, 7rem); }
.pr-credit-card {
  max-width: 46rem; margin-inline: auto; padding: clamp(1.75rem, 4vw, 2.75rem);
  border: 1px solid var(--line); border-left: 2px solid var(--teal); border-radius: 3px;
  background: var(--carbon-2);
}
.pr-credit-card h2 {
  font-family: var(--f-display); font-weight: 480; font-size: var(--size-h3);
  color: var(--text-bright); margin: 0 0 1rem; line-height: 1.1;
}
.pr-credit-card h2 em { font-style: italic; color: var(--teal); }
.pr-credit-card p { color: var(--text-dim); margin: 0 0 1rem; line-height: 1.6; }
.pr-credit-card p:last-of-type { margin-bottom: 1.6rem; }
.pr-credit-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pr-credit-card a.pr-btn-ghost:hover { border-color: var(--teal); }
.pr-placeholder { outline: 1px dashed rgba(232,163,61,.4); }

/* ---- Alternate before/after stage ratios ---- */
.ba-stage.portrait { aspect-ratio: 2 / 3; }
/* .tall evens out a 3:4 + 1:1 pair into one row - both crop only slightly */
.ba-stage.tall     { aspect-ratio: 4 / 5; }
/* .square evens out a 3:2 + 2:3 pair - the midpoint, so each loses the same amount */
.ba-stage.square   { aspect-ratio: 1 / 1; }

/* ---- Look chapters (per-look accent theming) ---- */
.pr-look { --look-accent: var(--amber); background: radial-gradient(90% 55% at 50% 0%, rgba(232,163,61,.05), transparent 60%); }
.pr-look--storm { --look-accent: var(--teal); background: radial-gradient(90% 55% at 50% 0%, rgba(111,194,178,.05), transparent 60%); }
.pr-look--golden { --look-accent: var(--amber-deep); background: radial-gradient(90% 55% at 50% 0%, rgba(199,127,40,.06), transparent 60%); }
/* the orange-and-teal grade: let the chapter itself run both accents */
.pr-look--blockbuster {
  --look-accent: var(--teal);
  background: radial-gradient(70% 55% at 15% 0%, rgba(232,163,61,.06), transparent 55%),
              radial-gradient(70% 55% at 85% 0%, rgba(111,194,178,.06), transparent 55%);
}
.pr-look--blockbuster .pr-section-head em { color: var(--amber); }
.pr-look .pr-eyebrow,
.pr-look .pr-section-head em,
.pr-look .ba-tag-after,
.pr-look .ba-pack { color: var(--look-accent); }

/* chapter marker: index + hairline + pack name */
.pr-look-marker {
  display: flex; align-items: center; gap: 1rem; margin: 0 0 2.5rem;
  font-family: var(--f-mono); font-size: var(--size-mono); letter-spacing: 0.2em; text-transform: uppercase;
}
.pr-look-marker span:first-child { color: var(--look-accent); }
.pr-look-marker span:last-child { color: var(--text-dim); }
.pr-look-marker .rule { flex: 1; height: 1px; background: var(--line); }

/* note under a before/after pair */
.pr-ba-note {
  display: flex; gap: 0.9rem; align-items: baseline;
  margin: 1.8rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--line);
  font-size: 0.98rem; color: var(--text-dim); line-height: 1.55;
}
.pr-ba-note b {
  flex: none; font-family: var(--f-mono); font-size: var(--size-mono); font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--look-accent, var(--amber));
}
.pr-ba-note p { margin: 0; max-width: 46rem; }
.pr-ba-note em { font-style: normal; color: var(--text-bright); }
@media (max-width: 560px) { .pr-ba-note { display: block; } .pr-ba-note b { display: block; margin-bottom: 0.5rem; } }

/* "there are more where these came from" line */
.pr-more {
  margin: 1.5rem 0 0; font-size: 1rem; color: var(--text-dim);
}
.pr-more em { font-style: normal; color: var(--look-accent, var(--amber)); }

/* grid sub-head (secondary head inside a look chapter) */
.pr-grid-sub { max-width: 46rem; margin: clamp(3rem, 6vw, 4.5rem) 0 1.5rem; }
.pr-grid-sub p { font-size: 1.1rem; color: var(--text-dim); margin: 0; max-width: 40rem; }

/* ---- Consistency grid: a 2-row contact sheet that drifts left -> right ---- */
.pr-grid {
  --tile: clamp(76px, 9vw, 128px);
  /* full-bleed out of .pr-wrap */
  width: 100vw; margin-left: calc(50% - 50vw);
  overflow: hidden; padding-block: 8px;
  background: var(--carbon-2); border-block: 1px solid var(--line);
  /* fade the ribbon out at both edges so it drifts in from nowhere */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.pr-grid-track {
  display: flex; width: max-content;
  /* --sets / --drift are set by presets.js once it knows how many clones the viewport needs */
  animation: pr-drift var(--drift, 60s) linear infinite;
}
/* each set is its own box, so an odd tile count can't spill into the next set's column */
.pr-grid-set {
  display: grid; grid-template-rows: repeat(2, var(--tile));
  grid-auto-flow: column; grid-auto-columns: var(--tile);
}
/* gutters via padding, NOT gap: keeps the track an exact multiple of --tile so
   translateX(-50%) lands on a tile boundary and the loop is seamless */
.pr-grid-img {
  width: var(--tile); height: var(--tile); padding: 1.5px; box-sizing: border-box;
  object-fit: cover; display: block; border-radius: 1px;
}
/* shift by exactly one set, so the loop point is invisible */
@keyframes pr-drift {
  from { transform: translateX(calc(-100% / var(--sets, 2))); }
  to   { transform: translateX(0); }
}

/* pause on hover, and on keyboard focus (the track is the pause mechanism - WCAG 2.2.2) */
.pr-grid:hover .pr-grid-track,
.pr-grid:focus-within .pr-grid-track { animation-play-state: paused; }
.pr-grid:focus-visible { outline: 2px solid var(--look-accent, var(--amber)); outline-offset: -2px; }

@media (prefers-reduced-motion: no-preference) {
  .pr-grid-img { transition: filter .2s var(--ease-out); }
  .pr-grid:hover .pr-grid-img:hover { filter: brightness(1.15); }
}
/* no motion: a plain scrollable strip */
@media (prefers-reduced-motion: reduce) {
  .pr-grid { overflow-x: auto; }
  .pr-grid-track { animation: none; }
}
