/* Balo Shipping — glass themes.
   Loaded after style.css. Nothing here changes layout: it swaps colours and turns the
   solid panels into frosted glass over a soft colour backdrop.
   Active theme: Golden Hour, set with <html data-theme="golden"> on every page. */

/* ---------- Palette: Golden Hour (matches the sunset in the opening video) ---------- */

:root[data-theme="golden"] {
  --bg-base: linear-gradient(170deg, #062227 0%, #0B3A40 55%, #12262B 100%);
  --bg-glow-1: rgba(245, 185, 74, .28);    /* kept low enough for 4.5:1 text contrast at its brightest point */
  --bg-glow-2: rgba(46, 196, 182, .30);
  --bg-glow-3: rgba(226, 120, 60, .22);
  --glass: rgba(255, 248, 235, .07);
  --glass-strong: rgba(6, 34, 39, .62);
  --glass-border: rgba(255, 236, 200, .16);
  --glass-shine: rgba(255, 240, 210, .10);
  --glass-shadow: 0 18px 40px -24px rgba(0, 0, 0, .7);
  --text: #F6F1E7;
  --text-soft: rgba(246, 241, 231, .86);
  --accent: #F5B94A;
  --accent-ink: #1E1606;
  --link: #FAD38A;
  --band: rgba(8, 46, 52, .55);
  --foot: rgba(4, 20, 24, .74);
  --signal: #F5B94A;
  --deck: #2EC4B6;
  --blend: #072A2F;          /* backdrop colour just below the opening video */
  color-scheme: dark;
}

/* ---------- Shared glass treatment ---------- */

:root[data-theme] {
  --ink: var(--text);
  --ink-soft: var(--text-soft);
  --rule: var(--glass-border);
  --steel: var(--glass);
  --blur: blur(18px) saturate(140%);
}

:root[data-theme] body { background: transparent; color: var(--text); }

/* The colour backdrop sits behind everything and stays put while the page scrolls. */
:root[data-theme] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70vw 60vh at 8% 6%, var(--bg-glow-1), transparent 62%),
    radial-gradient(60vw 55vh at 94% 28%, var(--bg-glow-2), transparent 62%),
    radial-gradient(70vw 60vh at 50% 104%, var(--bg-glow-3), transparent 62%),
    var(--bg-base);
}

:root[data-theme] a { color: var(--link); }
:root[data-theme] a:hover { color: var(--text); }
/* Components with their own link colour keep it. */
:root[data-theme] :is(.site-footer a, .amo-parent a), :root[data-theme] :is(.site-footer a, .amo-parent a):hover { color: #fff; }
:root[data-theme] .roster a, :root[data-theme] .roster a:hover { color: var(--text); }
/* Dark text wherever the gold highlight is the background. */
:root[data-theme] :is(.status, .pin[aria-pressed="true"], .skip) { color: var(--accent-ink); }
:root[data-theme] :is(.brand, .nav a) { color: var(--text); }
:root[data-theme] .hero { background: transparent; }

/* Panels that were solid white become frosted glass. */
:root[data-theme] :is(.tree-node:not(.parent), .roster a, .form, .duties li, .facts, .contact-card, .particulars > div:last-child) {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-shine), var(--glass-shadow);
  border-radius: 14px;
}
/* :nth-child(n) lifts this to the shared glass rule's specificity so the gold top border wins (it comes later) */
:root[data-theme] .duties li:nth-child(n) { padding: 20px 22px 22px; border-top: 3px solid var(--accent); }
:root[data-theme] .facts { padding: 6px 22px; border-top: 1px solid var(--glass-border); }
:root[data-theme] .facts div:nth-last-child(-n+2) { border-bottom: 0; }
:root[data-theme] .contact-card { padding: clamp(22px, 3vw, 32px); }
:root[data-theme] .legal {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: inset 0 1px 0 var(--glass-shine), var(--glass-shadow);
  padding: clamp(22px, 4vw, 44px);
}
:root[data-theme] .particulars > div:last-child { padding: clamp(18px, 3vw, 28px); }
:root[data-theme] .roster a:hover, :root[data-theme] .tree-node:not(.parent):hover { border-color: var(--accent); }

/* White sections let the backdrop show through. */
:root[data-theme] :is(.section-white, .profile) { background: transparent; }
:root[data-theme] .profile { border-bottom-color: var(--glass-border); }
:root[data-theme] .profile > .wrap:last-child {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 18px;
  box-shadow: inset 0 1px 0 var(--glass-shine), var(--glass-shadow);
  padding-block: clamp(18px, 3vw, 32px);
}
:root[data-theme] .ship-scale { border-top-color: var(--text-soft); }
:root[data-theme] .panel dl { border-top-color: var(--text); }

/* Header and mobile menu: frosted bar. */
:root[data-theme] .site-header {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom-color: var(--glass-border);
}
@media (max-width: 900px) {
  /* Near-solid: a blur nested inside the blurred header can't see the page behind it, so the menu must hide it itself. */
  :root[data-theme] .nav { background: #06191D; box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .7); }
  :root[data-theme] .nav a { border-bottom-color: var(--glass-border); }
}
:root[data-theme] .nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
:root[data-theme] :is(.nav a.nav-cta, .lang button[aria-pressed="true"]) { background: var(--accent); color: var(--accent-ink); }
:root[data-theme] .nav a.nav-cta:hover { background: var(--text); color: var(--accent-ink); }
:root[data-theme] :is(.lang, .menu-toggle) { border-color: var(--glass-border); }
:root[data-theme] .lang button { color: var(--text-soft); }
:root[data-theme] .lang button + button { border-inline-start-color: var(--glass-border); }

/* Buttons */
:root[data-theme] .btn-solid { background: var(--accent); color: var(--accent-ink); }
:root[data-theme] .btn-solid:hover { background: var(--text); color: var(--accent-ink); }
:root[data-theme] .btn-primary { background: rgba(255, 255, 255, .92); color: #0F1D3A; }
:root[data-theme] .btn-primary:hover { background: #fff; }
:root[data-theme] .btn-ghost { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); background: rgba(6, 34, 39, .35); color: #fff; }
:root[data-theme] .btn-ghost:hover { background: rgba(6, 34, 39, .55); color: #fff; }

/* Coloured bands become tinted glass over the backdrop. */
:root[data-theme] :is(.cta-band, .page-head.plain, .amo-hero, .tree-node.parent) {
  background: var(--band);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
:root[data-theme] .tree-node.parent { border: 1px solid var(--glass-border); border-radius: 14px; }

/* ---------- Opening: one continuous scene ----------
   The video fills the whole screen (as it always did); the captions, headline and closing title all sit
   on it in one frame, so nothing slides over the video and it scrolls away as a single piece. */
:root[data-theme] .voyage { background: transparent; }
:root[data-theme] .voyage-stage { background: var(--blend); container-type: size; }

@supports (width: 1cqw) {
  :root[data-theme] .voyage:not(.static) .voyage-frame {
    inset: 0;
    /* headline at the top, closing title at the bottom; they share the height and can't overlap */
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 6cqh 0 6.5cqh;
  }
  :root[data-theme] .voyage:not(.static) :is(.voyage-copy, .voyage-title) { position: relative; inset: auto; z-index: 1; }
  :root[data-theme] .voyage:not(.static) .voyage-copy h1 { font-size: clamp(1.25rem, min(9cqw, 7.2cqh), 3.6rem); }
  /* keeps the headline readable over bright patches of the sunset sky */
  :root[data-theme] .voyage-copy :is(h1, p) { text-shadow: 0 1px 2px rgba(6, 34, 39, .55), 0 2px 18px rgba(6, 34, 39, .55); }
  :root[data-theme] .voyage:not(.static) .voyage-copy p { font-size: clamp(.85rem, min(3.6cqw, 2.9cqh), 1.15rem); margin: 1.8cqh 0 2.6cqh; }
  /* closing title, sized to the picture; only once the script has the animation running */
  :root[data-theme] .hero.is-animated .voyage-title {
    display: block; text-align: center; pointer-events: none;
    opacity: var(--copy, 0);
    transform: translateY(calc((1 - var(--copy, 0)) * 18px));
  }
  :root[data-theme] .voyage-name {
    display: block; white-space: nowrap; direction: ltr;
    font: 800 min(7.4cqw, 14cqh)/1 "Archivo", sans-serif; font-stretch: 125%;
    letter-spacing: calc(.07em + (1 - var(--copy, 0)) * .08em);
    color: rgba(255, 255, 255, .95); text-shadow: 0 0 40px rgba(245, 185, 74, .3), 0 2px 18px rgba(6, 34, 39, .5);
  }
  :root[data-theme] .voyage-sub {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .4em 2.4em; margin-top: 1.4cqh;
    font-size: clamp(.78rem, min(1.2cqw, 2.4cqh), 1rem); color: rgba(246, 241, 231, .82);
  }
  :root[data-theme] .voyage:not(.static) .voyage-copy { padding-bottom: 0; }
  :root[data-theme] .voyage:not(.static) .voyage-copy .wrap { max-width: none; }
}

/* top darkening for the headline, bottom darkening for the closing title; both fade in with them */
:root[data-theme] .voyage:not(.static) .voyage-shade {
  background: linear-gradient(to bottom,
    rgba(6, 34, 39, .76) 0%, rgba(6, 34, 39, .3) 34%, rgba(6, 34, 39, 0) 50%,
    rgba(6, 34, 39, 0) 58%, rgba(6, 34, 39, .45) 82%, rgba(6, 34, 39, .55) 100%);
}

/* More sea below the last frame: the same picture carries on under the video (main.js lines it up
   with however the video is cropped), keeps the shade's tint at the join, then sinks into the page. */
.voyage-more { display: none; }
:root[data-theme] .hero.is-animated .voyage-more.on {
  display: block; position: relative; pointer-events: none;
  container-type: inline-size;   /* title sizes follow this strip's width */
  --copy: 1;                     /* the title here is always fully shown */
}
/* the picture (and its darkening) fades out; the title on top of it does not */
:root[data-theme] .hero.is-animated .voyage-more.on::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(6, 34, 39, .55) 0%, rgba(4, 22, 24, .75) 50%, rgba(3, 16, 15, .95) 100%),
    var(--more-img) var(--more-pos) / var(--more-size) no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
}
/* closing title, in the darker water lower down */
:root[data-theme] .hero.is-animated .voyage-more .voyage-title {
  position: absolute; z-index: 1; inset-inline: 0; top: 60%; transform: translateY(-50%);
}
:root[data-theme] .hero.is-animated .voyage-more:not(.on) .voyage-title { display: none; }

/* Once the script confirms the animation is running, the closing title replaces the band. Until then
   (and with no script, motion turned off, or a failed load) the band stays. */
:root[data-theme] .hero.is-animated :is(.deck-edge, .hull, .waterline) { display: none; }

/* Still version (motion turned off / no script): the band below the photo, transparent over the backdrop. */
:root[data-theme] .hull { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-theme] .hero .deck-edge { display: none; }
:root[data-theme] .hero .waterline {
  height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 25%, var(--accent) 75%, transparent); opacity: .55;
}
:root[data-theme] .hull-name { color: rgba(255, 255, 255, .94); text-shadow: 0 0 48px rgba(245, 185, 74, .28); animation: none; }
:root[data-theme] .hull-sub { color: var(--text-soft); }
:root[data-theme] .draft { color: rgba(255, 255, 255, .35); }
:root[data-theme] .cta-band { border-block: 1px solid var(--glass-border); }
:root[data-theme] .cta-band .btn-primary { color: #0F1D3A; }
:root[data-theme] .site-footer {
  background: var(--foot);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-top: 1px solid var(--glass-border);
}
:root[data-theme] .voyage-cap span { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-inline-start: 4px solid var(--accent); color: var(--text); }

/* Small parts */
:root[data-theme] :is(.parts .num, .amo-badge) { background: var(--accent); color: var(--accent-ink); }
:root[data-theme] .parts button[aria-pressed="true"] { border-inline-start-color: var(--accent); }
:root[data-theme] .badge-live { background: var(--accent); color: var(--accent-ink); }
:root[data-theme] .badge-sold { border-color: var(--glass-border); }
:root[data-theme] .tree-link { background: var(--glass-border); }
:root[data-theme] .reel-btn { border-radius: 14px; box-shadow: var(--glass-shadow); }
:root[data-theme] .gallery button { border-radius: 12px; }

/* Form fields */
:root[data-theme] .field :is(input, select, textarea) {
  background: var(--glass-strong); color: var(--text); border-color: var(--glass-border); border-radius: 10px;
}
:root[data-theme] .field select option { color: #0F1D3A; }
:root[data-theme] .field :is(input, select, textarea):focus { border-color: var(--accent); }

/* Browsers without backdrop blur get a more solid panel so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme] :is(.tree-node:not(.parent), .roster a, .form, .duties li, .facts, .contact-card, .particulars > div:last-child, .profile > .wrap:last-child) { background: var(--glass-strong); }
}

