/* Sunreef Charter, sister site of sunreefpreowned.com
   Brand shared with the sister site: star logo, sky blue #049AF1, near-black ink, warm grey text and lines,
   DM Serif Display + Manrope, 4px radius, buttons in #0670B4 (white on #049AF1 is only 2.9:1).
   One deep-sea colour block per page. Charter objects (sea chart, toy tags, preference sheet, boarding pass)
   bring their own material colours inside their own component files. */

:root {
  --paper: #fcfcfb;
  --paper-raised: #ffffff;
  --wash: #eaf5fe;
  --ink: #0a0a09;
  --ink-2: #3b3732;
  --muted: #645c53;
  --line: #e6e1da;
  --line-strong: #c1b9ae;
  --sky: #049af1;
  --sky-ink: #0670b4;
  --sky-ink-hover: #055c94;
  --on-sky: #ffffff;
  --sail: #068cdb;
  --power: #d0742a;
  --faded: #d9d4cd;
  --sea: #0b1a24;
  --sea-2: #12263a;
  --shadow: 0 10px 30px rgb(60 50 40 / 0.12);
  --radius: 4px;
  --max: 1320px;
  --gutter: 24px;
  --header-h: 68px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14171a;
    --paper-raised: #1b1f23;
    --wash: #172633;
    --ink: #f1efec;
    --ink-2: #d3cec7;
    --muted: #a59d93;
    --line: #2a2f34;
    --line-strong: #474d54;
    --sky: #3aa8ec;
    --sky-ink: #3aa8ec;
    --sky-ink-hover: #69bdf1;
    --on-sky: #0a0a09;
    --sail: #1e96dd;
    --power: #d47a35;
    --faded: #2f353b;
    --sea: #0a1620;
    --sea-2: #11222f;
    --shadow: 0 10px 30px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

/* deep-sea block: same tokens, dark values, used once per page */
.sea {
  --paper: #0b1a24;
  --paper-raised: #12263a;
  --wash: #12263a;
  --ink: #f3f1ee;
  --ink-2: #c9d3db;
  --muted: #8fa1ae;
  --line: #1f3446;
  --line-strong: #345067;
  --sky: #3aa8ec;
  --sky-ink: #3aa8ec;
  --sky-ink-hover: #69bdf1;
  --on-sky: #061019;
  --sail: #1e96dd;
  --power: #d47a35;
  --faded: #24394a;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.45);
  background: var(--paper);
  color: var(--ink);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; margin: 0; }
h1 { font-size: clamp(2.4rem, 1.6rem + 2.4vw, 3.4rem); line-height: 1.04; }
h2 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.8rem); line-height: 1.08; }
h3 { font-size: 1.4rem; line-height: 1.15; }
p { margin: 0; }

.lede { font-size: 1.125rem; color: var(--ink-2); max-width: 48ch; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons and controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sky-ink); color: var(--on-sky); }
.btn-primary:hover { background: var(--sky-ink-hover); }
.btn-primary[aria-disabled="true"] { background: var(--line-strong); color: var(--paper); cursor: not-allowed; }
.btn-ghost { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: #0a0a09; }
.btn-light:hover { background: #e9f5fe; }
.btn-link {
  background: none; border: 0; padding: 0; min-height: 0; color: var(--sky-ink);
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

.field-label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 8px; }

.segmented {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden;
  background: var(--paper-raised);
}
.segmented button {
  min-height: 38px; padding: 0 14px; border: 0; background: transparent;
  font-size: 0.875rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.select, .input, .textarea {
  width: 100%; min-height: 46px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--paper-raised);
}
.select { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 120px; padding: 10px 12px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select:focus-visible, .input:focus-visible, .textarea:focus-visible { outline: 2px solid var(--sky); outline-offset: 0; border-color: var(--sky); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--sky-ink); flex: none; }

.form-note { margin-top: 12px; font-size: 0.875rem; color: var(--ink-2); }
.form-note[hidden] { display: none; }
.field-error { margin-top: 6px; font-size: 0.8125rem; color: #b42318; }
@media (prefers-color-scheme: dark) { .field-error { color: #ff8a7a; } }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 100%; }
.logo { display: block; flex: none; }
.logo img { height: 22px; width: auto; transition: filter .3s ease; }
@media (prefers-color-scheme: dark) { .logo img { filter: invert(1) hue-rotate(180deg) brightness(1.15); } }

.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; font-size: 0.9rem; color: var(--ink-2); white-space: nowrap; transition: color .2s ease; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--sky); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.menu-btn { display: none; margin-left: auto; }
.nav a.nav-cta { padding: 8px 14px; border-radius: var(--radius); background: var(--sky-ink); color: var(--on-sky); font-weight: 600; }
.nav a.nav-cta:hover { background: var(--sky-ink-hover); color: var(--on-sky); }
.nav a.nav-cta[aria-current="page"] { text-decoration: none; }
.site-header.is-over .nav a.nav-cta { background: #fff; color: #0a0a09; }

/* transparent header over a full-bleed photo */
.has-hero main { margin-top: calc(var(--header-h) * -1); }
.site-header.is-over { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-header.is-over .logo img { filter: invert(1) hue-rotate(180deg) brightness(1.2); }
.site-header.is-over .nav a { color: rgb(255 255 255 / .86); }
.site-header.is-over .nav a:hover, .site-header.is-over .nav a[aria-current="page"] { color: #fff; }
.site-header.is-over .menu-btn { color: #fff; border-color: rgb(255 255 255 / .6); }

@media (max-width: 1100px) {
  .menu-btn { display: inline-flex; min-height: 40px; }
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px;
  }
  .nav.is-open { display: flex; }
  .nav a, .site-header.is-over .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1rem; color: var(--ink-2); }
  .nav a[aria-current="page"] { text-decoration: none; color: var(--sky-ink); }
  .nav a.nav-cta, .site-header.is-over .nav a.nav-cta { margin-top: 12px; text-align: center; border-bottom: 0; background: var(--sky-ink); color: var(--on-sky); padding: 12px 14px; }
}

/* ---------- footer ---------- */

.site-footer { margin-top: 112px; border-top: 1px solid var(--line); padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-logo { height: 20px; width: auto; }
@media (prefers-color-scheme: dark) { .footer-logo { filter: invert(1) hue-rotate(180deg) brightness(1.15); } }
.footer-h { font-size: 0.8125rem; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.9rem; }
.footer-grid a { text-decoration: none; color: var(--ink-2); }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); max-width: 90ch; display: grid; gap: 8px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- home: hero slideshow ---------- */

.hero {
  position: relative; min-height: 100dvh; display: grid; align-items: end;
  color: #fff; background: #0b1a24; overflow: hidden; isolation: isolate;
}
.hero-slides { position: absolute; inset: 0; z-index: -2; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.is-current { opacity: 1; }
.hero-slide picture { display: block; width: 100%; height: 100%; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .hero-slide img { transform: scale(1.06); transition: transform 8s linear; }
  .hero-slide.is-current img { transform: scale(1); }
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgb(6 16 25 / .55) 0%, rgb(6 16 25 / 0) 22%),
    linear-gradient(0deg, rgb(6 16 25 / .78) 0%, rgb(6 16 25 / .25) 45%, rgb(6 16 25 / 0) 70%);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; padding-bottom: 56px; padding-top: 140px; }
.hero h1 { font-size: clamp(3rem, 1.6rem + 5.2vw, 6.2rem); line-height: .98; letter-spacing: -0.01em; }
.hero .lede { color: rgb(255 255 255 / .88); margin-top: 18px; font-size: 1.2rem; max-width: 44ch; }
.hero-cta { margin-top: 28px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }

.slide-card {
  display: grid; gap: 4px; width: 300px; padding: 16px 18px 14px;
  background: rgb(8 18 27 / .55); border: 1px solid rgb(255 255 255 / .18); border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: #fff; text-decoration: none;
}
.slide-card:hover { border-color: rgb(255 255 255 / .45); }
.slide-card .k { font-size: 0.8125rem; color: rgb(255 255 255 / .75); }
.slide-card .n { font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; }
.slide-card .p { font-weight: 700; }
.slide-bars { display: grid; grid-auto-flow: column; gap: 6px; margin-top: 10px; align-items: center; }
.slide-bars button { height: 18px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; align-items: center; }
.slide-bars button span { display: block; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .3); overflow: hidden; }
.slide-bars button span i { display: block; height: 100%; width: 0; background: #fff; }
.slide-bars button[aria-current="true"] span i { width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .hero.is-playing .slide-bars button[aria-current="true"] span i { width: 0; animation: fill var(--slide-ms, 6500ms) linear forwards; }
}
@keyframes fill { to { width: 100%; } }
.slide-pause { justify-self: end; min-height: 18px; border: 0; background: none; color: rgb(255 255 255 / .8); font-size: 0.75rem; font-weight: 600; cursor: pointer; padding: 0 0 0 6px; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding-bottom: 32px; }
  .slide-card { width: 100%; }
}
@media (max-width: 760px) {
  .hero { min-height: 0; display: block; }
  .hero-slides { position: relative; inset: auto; height: 60svh; min-height: 360px; z-index: 0; }
  .hero-slide img { object-position: var(--pos-m, 50% 50%); }
  .hero::after { inset: 0 0 auto 0; height: 60svh; min-height: 360px; background: linear-gradient(180deg, rgb(6 16 25 / .55) 0%, rgb(6 16 25 / 0) 26%), linear-gradient(0deg, rgb(11 26 36 / 1) 0%, rgb(11 26 36 / 0) 22%); }
  .hero-inner { position: relative; z-index: 1; padding-top: 4px; gap: 24px; }
  .hero h1 { font-size: clamp(2.6rem, 1.6rem + 6vw, 3.4rem); }
  .hero .lede { font-size: 1.05rem; }
  .slide-card { background: rgb(255 255 255 / .06); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- sections ---------- */

.section { padding: 112px 0 0; }
.section-head { display: grid; gap: 12px; margin-bottom: 36px; max-width: 62ch; }
.section-head .lede { max-width: 54ch; }
@media (max-width: 600px) { .section { padding-top: 72px; } }

/* ---------- rails ---------- */

.rail-wrap { position: relative; min-width: 0; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 30%); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 12px; }
.rail-arrows { display: flex; gap: 8px; }
.rail-arrows button { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; font-size: 1.1rem; }
.rail-arrows button:hover { border-color: var(--ink); }
.rail-arrows button:disabled { opacity: .35; cursor: default; }
@media (max-width: 960px) { .rail { grid-auto-columns: minmax(240px, 72%); } }

/* photo card used in rails */
.pcard { display: grid; gap: 10px; text-decoration: none; color: inherit; }
.pcard-media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--line); }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.16, 1, .3, 1); }
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard-name { font-family: var(--serif); font-size: 1.35rem; line-height: 1.1; }
.pcard-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 0.875rem; color: var(--ink-2); }
.pcard-meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- home: type tiles ---------- */

.tiles { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px; height: min(78vh, 720px); min-height: 520px; }
.tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; color: #fff; text-decoration: none; isolation: isolate; background: #0b1a24; }
.tile:first-child { grid-row: 1 / 3; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .9s cubic-bezier(.16, 1, .3, 1); }
.tile:hover img { transform: scale(1.04); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgb(6 16 25 / .72) 0%, rgb(6 16 25 / 0) 55%); }
.tile-body { position: absolute; left: 28px; right: 28px; bottom: 24px; display: grid; gap: 4px; }
.tile-title { font-family: var(--serif); font-size: clamp(2rem, 1.4rem + 2vw, 3.4rem); line-height: 1; }
.tile-meta { font-size: 0.95rem; color: rgb(255 255 255 / .86); }
@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr; grid-template-rows: none; height: auto; min-height: 0; }
  .tile, .tile:first-child { grid-row: auto; aspect-ratio: 4 / 3; }
}

/* ---------- list page ---------- */

.page-head { padding-top: 48px; padding-bottom: 12px; display: grid; gap: 10px; }
.filters { position: sticky; top: var(--header-h); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); padding: 14px 0; }
.filters-row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: end; }
.filters-row .f { display: grid; gap: 4px; }
.filters-row .f label { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.filters-row .select { min-height: 38px; width: auto; min-width: 128px; font-size: 0.875rem; background-position: calc(100% - 18px) 16px, calc(100% - 13px) 16px; }
.filters-row .spacer { flex: 1 1 auto; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0; font-size: 0.9rem; color: var(--ink-2); }
.filters-toggle { display: none; }
@media (max-width: 760px) {
  .filters { position: static; }
  .filters-toggle { display: inline-flex; }
  .filters-row.is-collapsed .f, .filters-row.is-collapsed .spacer { display: none; }
  .filters-row .f { flex: 1 1 140px; }
  .filters-row .select { width: 100%; }
}

/* magazine grid: every seventh card is wide */
.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 28px; }
.grid-cards .card.is-wide { grid-column: span 2; }
.grid-cards .card.is-wide .card-media { aspect-ratio: 16 / 9.3; }
@media (max-width: 1000px) { .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-cards .card.is-wide-b { grid-column: auto; } .grid-cards .card.is-wide-b .card-media { aspect-ratio: 3 / 2; } .grid-cards .card.is-wide-b .card-name { font-size: 1.6rem; } }
@media (max-width: 620px) { .grid-cards { grid-template-columns: minmax(0, 1fr); } .grid-cards .card.is-wide { grid-column: auto; } .grid-cards .card.is-wide .card-media { aspect-ratio: 3 / 2; } }

.card { display: grid; gap: 14px; align-content: start; position: relative; }
.card-media { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--line); aspect-ratio: 3 / 2; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease, transform .9s cubic-bezier(.16, 1, .3, 1); }
.card-media img.alt { opacity: 0; }
.card:hover .card-media img.alt { opacity: 1; }
.card:hover .card-media img { transform: scale(1.03); }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.card-name { font-family: var(--serif); font-size: 1.6rem; line-height: 1.05; text-decoration: none; }
.card-name::after { content: ""; position: absolute; inset: 0; }
.card.is-wide .card-name { font-size: 2.2rem; }
.card-price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-model { font-size: 0.8125rem; color: var(--muted); }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.875rem; color: var(--ink-2); }
.card-overview { color: var(--ink-2); max-width: 60ch; }
.card-actions { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.compare-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper-raised);
  font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.compare-toggle[aria-pressed="true"] { border-color: var(--sky-ink); color: var(--sky-ink); background: var(--wash); }
.empty { padding: 56px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); display: grid; gap: 12px; justify-items: center; }
.load-more { display: flex; justify-content: center; margin-top: 48px; }

/* compare tray + dialog */
.tray {
  position: fixed; left: 50%; bottom: 16px; z-index: 40; transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 14px;
  background: var(--paper-raised); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tray[hidden] { display: none; }
.tray-items { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; }
.tray-item { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; padding-right: 8px; }
.tray-item img { width: 44px; height: 32px; object-fit: cover; border-radius: 2px; }
.tray-item button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 4px; }
@media (max-width: 600px) { .tray-name { display: none; } .tray-item { padding-right: 0; gap: 2px; } }

dialog.compare {
  width: min(1040px, calc(100% - 24px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
}
dialog.compare::backdrop { background: rgb(10 10 9 / .45); }
.compare-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); }
.compare-body { padding: 8px 22px 24px; overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 0.9rem; }
.compare-table th, .compare-table td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; }
.compare-table thead th { padding-top: 16px; }
.compare-table thead img { width: 100%; max-width: 260px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; }
.compare-table thead a { font-family: var(--serif); font-size: 1.3rem; font-weight: 400; text-decoration: none; }
.compare-table tbody th { color: var(--muted); font-weight: 600; font-size: 0.8125rem; width: 140px; }
.compare-table tbody tr + tr th, .compare-table tbody tr + tr td { border-top: 1px solid var(--line); }

dialog.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(8 8 8 / .96); color: #fff; }
dialog.lightbox::backdrop { background: transparent; }
.lightbox-inner { position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 0.875rem; }
.lightbox-stage { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; min-height: 0; padding-bottom: 18px; }
.lightbox-stage img { max-width: 100%; max-height: calc(100dvh - 90px); margin: 0 auto; object-fit: contain; }
.lb-btn { width: 48px; height: 48px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .35); background: transparent; color: #fff; font-size: 1.25rem; cursor: pointer; justify-self: center; }
.lb-close { border: 1px solid rgb(255 255 255 / .35); background: transparent; color: #fff; min-height: 36px; padding: 0 14px; border-radius: var(--radius); cursor: pointer; }

.skeleton { background: linear-gradient(90deg, var(--line) 0%, var(--paper-raised) 50%, var(--line) 100%); background-size: 200% 100%; border-radius: var(--radius); }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.4s ease-in-out infinite; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.load-error { padding: 40px 0; display: grid; gap: 12px; }

@media (max-width: 600px) { :root { --gutter: 16px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

/* ---------- quick search (header button, "/" or Ctrl+K) ---------- */

.qs-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px 0 12px; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--ink-2);
  font-size: 0.875rem; cursor: pointer;
}
.qs-btn:hover { border-color: var(--ink); color: var(--ink); }
.qs-btn kbd, .qs-foot kbd { font: 600 0.75rem var(--sans); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 6px; line-height: 1.5; color: var(--muted); }
.site-header.is-over .qs-btn { color: #fff; border-color: rgb(255 255 255 / .55); }
.site-header.is-over .qs-btn kbd { color: rgb(255 255 255 / .8); border-color: rgb(255 255 255 / .45); }
@media (max-width: 1100px) { .qs-btn { order: 2; margin-left: auto; } .menu-btn { order: 3; margin-left: 0; } .qs-btn kbd { display: none; } }
/* small phones: logo, Search and Menu have to fit in 320 to 420 px */
@media (max-width: 440px) {
  .site-header .wrap { gap: 10px; padding-inline: 16px; }
  .logo img { height: 18px; }
  .qs-btn { padding: 0 10px; min-height: 40px; }
  .menu-btn { padding: 0 14px; }
}

.qs { width: min(680px, calc(100% - 32px)); max-height: min(640px, calc(100dvh - 96px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-raised); color: var(--ink); box-shadow: 0 30px 80px rgb(10 20 30 / .35); }
.qs::backdrop { background: rgb(8 18 27 / .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.qs-box { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: inherit; }
.qs-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 20px 22px; font-size: 1.15rem; background: transparent; outline: none; }
.qs-input::placeholder { color: var(--muted); }
.qs-list { overflow-y: auto; padding: 6px 8px 10px; overscroll-behavior: contain; }
.qs-group { padding: 12px 14px 4px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.qs-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; padding: 8px 14px; border-radius: 6px; text-decoration: none; color: inherit; }
.qs-row.is-active { background: var(--wash); }
.qs-row img { width: 64px; height: 48px; object-fit: cover; border-radius: 3px; background: var(--line); }
.qs-glyph { width: 64px; height: 48px; display: grid; place-items: center; border-radius: 3px; background: var(--sea); color: #fff; font-family: var(--serif); font-size: 1.25rem; }
.qs-row .qs-glyph:empty { background: var(--wash); }
.qs-text { display: grid; min-width: 0; }
.qs-label { font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; }
.qs-sub { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-empty { padding: 28px 22px; color: var(--muted); }
.qs-foot { padding: 10px 22px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); }
@media (max-width: 600px) { .qs { margin-top: 12px; } .qs-foot { display: none; } }

/* ---------- page transitions: the clicked photo becomes the next page's photo ---------- */

@view-transition { navigation: auto; }
.d-hero > img { view-transition-name: yacht-photo; }
::view-transition-group(yacht-photo) { animation-duration: .6s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(yacht-photo), ::view-transition-new(yacht-photo) { height: 100%; object-fit: cover; }
::view-transition-old(root) { animation: .28s ease both vtOut; }
::view-transition-new(root) { animation: .38s ease both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* form trap field: off screen for people, still in the form for bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
