/* Detail page, fourth pass: the AV1 structure in the Sunreef Preowned brand.
   Light pages broken by deep-sea bands, one accent (sky ink), photographs with square edges.
   Loaded after site.css on yacht.html only. */

:root { --bar-h: 56px; --sec: clamp(88px, 10vw, 140px); }

.y-sec { padding: var(--sec) 0 0; }
.y-sec h2, .y-band h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3.3rem); line-height: 1.04; max-width: 20ch; }
.y-lede { font-size: 1.15rem; color: var(--ink-2); max-width: 56ch; margin-top: 16px; }
.y-band { background: var(--sea); color: #f3f1ee; padding: var(--sec) 0; margin-top: var(--sec); }
.y-band h2 { color: #fff; }
.y-band .y-lede { color: #b9c6d1; }
.y-cap { font-size: 0.8125rem; color: var(--muted); margin-top: 10px; }
.y-band .y-cap { color: #8fa1ae; }
.y-photo { margin: 0; overflow: hidden; background: var(--line); }
.y-photo img { width: 100%; height: 100%; object-fit: cover; }
.y-zoom { cursor: zoom-in; }

/* ---------- hero: one photo, one line, one button ---------- */

.d-hero .claim { font-size: clamp(1.1rem, 0.9rem + 0.7vw, 1.45rem); color: rgb(255 255 255 / .92); max-width: 32ch; margin: 4px 0 14px; }
@media (prefers-reduced-motion: no-preference) {
  .d-hero > img { animation: settle 2.4s cubic-bezier(.16, 1, .3, 1) both; }
  .d-hero .d-hero-inner > * { animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) both .35s; }
}
@keyframes settle { from { transform: scale(1.07); } to { transform: none; } }

/* hull lettering (showcase yachts): her name as painted on the hull, drawn stroke by stroke, and the Sunreef badge above it */
.d-hero { --hull-gold: #dcbd7a; }
@media (min-width: 761px) {
  /* the lettering sits on the left of the photo, often over the hull: darken that side a little more */
  .d-hero.has-lettering::after {
    background:
      linear-gradient(90deg, rgb(6 16 25 / .62) 0%, rgb(6 16 25 / .3) 34%, rgb(6 16 25 / 0) 58%),
      linear-gradient(180deg, rgb(6 16 25 / .55) 0%, rgb(6 16 25 / 0) 22%),
      linear-gradient(0deg, rgb(6 16 25 / .8) 0%, rgb(6 16 25 / .2) 42%, rgb(6 16 25 / 0) 65%);
  }
}
.d-hero h1.has-lettering { margin: 14px 0 18px; line-height: 0; }
.lettering { display: block; width: clamp(260px, 36vw, 520px); color: var(--hull-gold); filter: drop-shadow(0 2px 14px rgb(6 16 25 / .5)); }
.lettering svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hull-badge { margin: 0; }
.hull-badge svg { display: block; height: clamp(34px, 2.2rem + 0.6vw, 48px); width: auto; overflow: visible; filter: drop-shadow(0 1px 8px rgb(6 16 25 / .45)); }
.hb-line { font: 500 40px var(--sans); fill: #8fd3ff; letter-spacing: 0.5px; }
@media (prefers-reduced-motion: no-preference) {
  .lettering path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .lettering.is-drawn path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s cubic-bezier(.65, 0, .35, 1) calc(0.6s + var(--i) * 0.14s); }
  .lettering.is-drawn .l-sub path { transition-duration: 0.5s; transition-delay: calc(1.5s + var(--i) * 0.06s); }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- section bar: chapters, price, enquiry, reading progress ---------- */

.ybar {
  position: sticky; top: var(--header-h); z-index: 25; height: var(--bar-h);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.ybar-inner { display: flex; align-items: center; gap: 22px; height: 100%; }
.ybar-name { font-family: var(--serif); font-size: 1.25rem; white-space: nowrap; }
.ybar nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; margin-right: auto; min-width: 0; }
.ybar nav::-webkit-scrollbar { display: none; }
.ybar nav a { font-size: 0.875rem; color: var(--ink-2); text-decoration: none; white-space: nowrap; padding: 6px 0; border-bottom: 2px solid transparent; }
.ybar nav a:hover { color: var(--ink); }
.ybar nav a.is-here { color: var(--ink); border-bottom-color: var(--sky); }
.ybar-price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ybar .btn { min-height: 40px; }
.ybar-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--sky-ink); transform-origin: left; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .ybar-progress { animation: progress linear both; animation-timeline: scroll(root); }
}
@keyframes progress { to { transform: scaleX(1); } }
main [id] { scroll-margin-top: calc(var(--header-h) + var(--bar-h) + 12px); }
@media (max-width: 900px) {
  .ybar-name, .ybar-price { display: none; }
  .ybar-inner { gap: 12px; }
  .ybar .btn { padding: 0 14px; font-size: 0.875rem; }
}

/* ---------- story: headline, text and the facts that carry it ---------- */

.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.story-copy { display: grid; gap: 22px; }
.story-copy p { color: var(--ink-2); max-width: 60ch; }
.facts-list { margin: 8px 0 0; display: grid; }
.facts-list div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); align-items: baseline; }
.facts-list dt { font-size: 0.875rem; color: var(--muted); }
.facts-list dd { margin: 0; font-family: var(--serif); font-size: clamp(1.4rem, 1.1rem + 0.9vw, 1.9rem); line-height: 1.15; }
.facts-list dd small { display: block; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin-top: 4px; }
.story-photo { position: sticky; top: calc(var(--header-h) + var(--bar-h) + 24px); }
.story-photo .y-photo { aspect-ratio: 4 / 5; }
@media (max-width: 900px) {
  .story-grid { grid-template-columns: minmax(0, 1fr); }
  .story-photo { position: static; }
  .story-photo .y-photo { aspect-ratio: 4 / 3; }
  .facts-list div { grid-template-columns: 120px 1fr; }
}

/* ---------- places she opens up (showcase): plan with markers, a photo per place ---------- */

.places { position: relative; }
.places-stage { background: var(--sea); position: sticky; top: calc(var(--header-h) + var(--bar-h)); height: calc(100dvh - var(--header-h) - var(--bar-h)); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 20px; padding: 28px 0 28px; }
.places-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 560px); gap: 28px; align-items: center; }
.places-plan { position: relative; margin: 0; background: var(--sea); }
.places-plan img { width: 100%; height: auto; filter: grayscale(1) invert(1) brightness(1.5) contrast(1.15); mix-blend-mode: screen; opacity: .85; }
.pin { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid #fff; background: rgb(11 26 36 / .7); color: #fff; font-weight: 700; font-size: 0.8125rem; display: grid; place-items: center; transition: background-color .3s ease, border-color .3s ease, transform .4s cubic-bezier(.16, 1, .3, 1); }
.pin.is-on { background: var(--sky); border-color: var(--sky); transform: scale(1.22); }
.places-body { position: relative; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 32px; align-items: end; }
.places-photos { position: relative; height: 100%; min-height: 0; overflow: hidden; background: #0e2230; }
.places-photos figure { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .8s ease; }
.places-photos figure.is-on { opacity: 1; }
.places-photos img { width: 100%; height: 100%; object-fit: cover; }
.places-text { position: relative; min-height: 240px; }
.places-text article { position: absolute; inset: auto 0 0 0; opacity: 0; transform: translateY(14px); transition: opacity .25s ease, transform .5s cubic-bezier(.16, 1, .3, 1); display: grid; gap: 10px; }
/* the outgoing text leaves before the next one arrives, so the two never overlap */
.places-text article.is-on { opacity: 1; transform: none; transition-delay: .28s; }
.places-text .k, .places-list .k { font-size: 0.875rem; color: #8fbfe0; font-weight: 600; }
.places-text h3 { font-size: clamp(1.8rem, 1.3rem + 1.4vw, 2.6rem); color: #fff; }
.places-text p, .places-list p { color: #c9d3db; }
.places-steps span { display: block; height: 70dvh; }
.places-list { display: none; gap: 40px; margin-top: 28px; }
.places-list article { display: grid; gap: 12px; }
.places-list .y-photo { aspect-ratio: 4 / 3; }
.places-list h3 { color: #fff; font-size: 1.8rem; }
@media (max-width: 900px), (max-height: 640px), (prefers-reduced-motion: reduce) {
  .places-stage { position: static; height: auto; display: block; padding: 0; }
  .places-top { grid-template-columns: minmax(0, 1fr); }
  .places-body, .places-steps { display: none; }
  .places-list { display: grid; }
}

/* ---------- deck by deck: the plans as a lift ---------- */

.decks-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: 36px; }
.lift { display: grid; gap: 6px; }
.lift button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 48px; padding: 0 16px; border-radius: var(--radius); border: 1px solid #2a4458;
  background: transparent; color: #c9d3db; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-align: left;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.lift button:hover { border-color: #5d7d94; color: #fff; }
.lift button[aria-selected="true"] { background: #fff; color: var(--sea); border-color: #fff; }
.shaft { position: relative; overflow: hidden; aspect-ratio: 1754 / 1241; }
/* the moving track is its own layer, so the whole track is screened onto the sea, not each plan */
.shaft-track { position: absolute; inset: 0; mix-blend-mode: screen; transition: transform .9s cubic-bezier(.65, 0, .35, 1); }
.shaft-track button { position: absolute; left: 0; right: 0; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shaft-track img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) invert(1) brightness(1.5) contrast(1.15); opacity: .9; }
@media (prefers-reduced-motion: reduce) { .shaft-track { transition: none; } }
@media (max-width: 760px) {
  .decks-grid { grid-template-columns: minmax(0, 1fr); }
  .lift { grid-auto-flow: column; grid-auto-columns: 1fr; overflow-x: auto; }
  .lift button { justify-content: center; padding: 0 10px; font-size: 0.8125rem; white-space: nowrap; }
}

/* ---------- inside: a grid of rooms ---------- */

.inside-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: clamp(140px, 15vw, 230px); gap: 12px; margin-top: 36px; }
.inside-grid button { padding: 0; border: 0; background: var(--line); overflow: hidden; cursor: zoom-in; }
.inside-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.16, 1, .3, 1); }
.inside-grid button:hover img { transform: scale(1.04); }
.inside-grid button:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.inside-grid button:nth-child(n + 2) { grid-column: span 2; }
@media (max-width: 760px) {
  .inside-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; }
  .inside-grid button:nth-child(n) { grid-column: span 1; grid-row: span 1; }
  .inside-grid button:nth-child(1) { grid-column: span 2; grid-row: span 2; }
}

/* ---------- showcase chapter ---------- */

.chapter-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.chapter-copy { display: grid; gap: 18px; }
.chapter-copy p { color: var(--ink-2); max-width: 60ch; }
.chapter-photos { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; aspect-ratio: 1 / 1; }
.chapter-photos button { padding: 0; border: 0; overflow: hidden; background: var(--line); cursor: zoom-in; }
.chapter-photos button:first-child { grid-row: span 2; }
.chapter-photos img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .chapter-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- who she suits ---------- */

.suits { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px); margin-top: 36px; }
.suits.single { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.suits article { display: grid; gap: 12px; align-content: start; padding-top: 22px; border-top: 2px solid var(--ink); }
.suits article.not { border-top-color: var(--line-strong); }
.suits h3 { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; }
.suits p { font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.75rem); line-height: 1.3; }
.suits article.not p { color: var(--ink-2); }
@media (max-width: 760px) { .suits { grid-template-columns: minmax(0, 1fr); } }

/* ---------- what sets her apart: card rail ---------- */

.apart { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(270px, 30vw, 400px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-top: 36px; padding-bottom: 4px; }
.apart::-webkit-scrollbar { display: none; }
.apart article { scroll-snap-align: start; display: grid; grid-template-rows: auto 1fr; background: var(--paper-raised); border: 1px solid var(--line); }
.apart .y-photo { aspect-ratio: 4 / 3; }
.apart p { padding: 18px 20px 22px; font-size: 1.05rem; }

/* ---------- particulars: drawing and key figures, full list folded away ---------- */

.parts-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; margin-top: 36px; }
.parts-grid.no-drawing { grid-template-columns: minmax(0, 1fr); }
.dimfig { position: relative; margin: 0; }
.dimfig img { width: 100%; height: auto; opacity: .9; }
@media (prefers-color-scheme: dark) { .dimfig img { filter: invert(1) hue-rotate(180deg) brightness(1.1); } }
.dimfig svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dimfig .dl { stroke: var(--sky-ink); stroke-width: 2.4; fill: none; vector-effect: non-scaling-stroke; }
.dimfig .lab { position: absolute; font-weight: 700; color: var(--sky-ink); font-size: 0.875rem; background: var(--paper); padding: 0 6px; white-space: nowrap; transform: translate(-50%, -50%); opacity: 0; transition: opacity .6s ease 1.2s; }
.dimfig.is-on .lab { opacity: 1; }
/* the beam label sits inside the drawing, left of its line, so it never runs off the screen */
.dimfig .lab-beam { transform: translate(-100%, -50%); }
@media (prefers-reduced-motion: no-preference) {
  .dimfig .dl { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s cubic-bezier(.65, 0, .35, 1) .2s; }
  .dimfig.is-on .dl { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) { .dimfig .lab { opacity: 1; } }
.keyfigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 24px; margin: 0; }
.parts-grid.no-drawing .keyfigs { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.keyfigs div { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.keyfigs dt { font-size: 0.8125rem; color: var(--muted); order: 2; }
.keyfigs dd { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 0.8vw, 2rem); line-height: 1.1; overflow-wrap: anywhere; }
details.allparts { margin-top: 40px; border-top: 1px solid var(--line); }
details.allparts summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.allparts summary::-webkit-details-marker { display: none; }
details.allparts summary::after { content: "+"; font-size: 1.3rem; line-height: 1; }
details.allparts[open] summary::after { content: "\2212"; }
details.allparts .spec-groups { padding: 12px 0 0; }
@media (max-width: 900px) { .parts-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- full-width photo before the enquiry ---------- */

.wide-photo { margin: var(--sec) 0 0; height: min(78vh, 760px); }
.wide-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .wide-photo { height: 56vh; } }

.market-band { margin-top: var(--sec); }
.y-sec .strip-head { margin-bottom: 0; }

/* ---------- will she fit your berth? ---------- */

.berth-grid { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.berth-copy { display: grid; gap: 18px; }
.berth-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.berth-verdict { font-size: 1.1rem; padding: 14px 16px; border-left: 3px solid var(--sky-ink); background: var(--wash); }
.berth-verdict.is-tight { border-left-color: var(--power); background: color-mix(in srgb, var(--power) 10%, var(--paper)); }
.berth-fig { margin: 0; }
.berth-svg { width: 100%; height: auto; display: block; }
.berth-water { fill: color-mix(in srgb, var(--sail) 12%, var(--paper)); }
.berth-quay { fill: var(--line-strong); }
.berth-pier { fill: var(--line-strong); }
.berth-slot { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 6 5; }
.berth-hull { fill: color-mix(in srgb, var(--sky-ink) 18%, transparent); stroke: var(--sky-ink); stroke-width: 2.5; }
.berth-deck { fill: color-mix(in srgb, var(--sky-ink) 12%, transparent); stroke: var(--sky-ink); stroke-width: 1.5; }
.is-tight .berth-hull, .is-tight .berth-deck { stroke: var(--power); fill: color-mix(in srgb, var(--power) 16%, transparent); }
.berth-label { font: 600 18px var(--sans); fill: var(--ink-2); }
.berth-label.on-yacht { fill: var(--ink); }
.berth-yacht { transition: opacity .3s ease; }
@media (prefers-reduced-motion: no-preference) {
  .berth-fig:not(.is-in) .berth-yacht { transform: translateX(60%); opacity: 0; }
  .berth-fig.is-in .berth-yacht { transition: transform 1.6s cubic-bezier(.22, 1, .36, 1), opacity .6s ease; }
}
@media (max-width: 900px) { .berth-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .berth-label { font-size: 34px; } }
