@font-face {
  font-family: "Lora";
  src: url("assets/fonts/Lora.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Cal Sans";
  src: url("assets/fonts/CalSans.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink-title: #3b5761;
  --white: #ffffff;
  --sea-top: #caeaf1;
  --sea-mid: #5f8b9b;
  --sea-bottom: #0e1e23;
  /* Brand colours, revealed on hover */
  --covership: #002486;   /* Covership blue, from the brand SVG logos (covership/brief/Logos) */
  --compliance: #f51111;  /* Compliance4Yachts red, from the brand SVG logo (compliance4yachts/brief/Assets/Logo) */
  --standards: #c8f932;   /* Yacht Standards lime, from yacht-standards.org */
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bp: 900px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--sea-top) 0%, var(--sea-mid) 50%, var(--sea-bottom) 100%);
  color: var(--white);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ---------- Hero shell ---------- */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.bg__video,
.bg__mobile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.bg__mobile { display: none; }

/* ---------- Title ---------- */

.title {
  position: absolute;
  z-index: 2;
  /* 36% = top of the Covership / Yacht Standards logos; 3.84em = 3 title lines; 0.7em = breathing room */
  top: min(24.5%, calc(36% - 3.84em - 0.7em));
  left: 0;
  right: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 50px);
  line-height: 1.28;
  letter-spacing: 0.34em;
  text-indent: 0.34em; /* visually re-centres a letter-spaced line */
  text-transform: uppercase;
  color: var(--ink-title);
}

/* ---------- Brands (desktop: anchored on the ripple) ---------- */

.brands {
  position: absolute;
  z-index: 3;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.brand {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 320px;
  transform: translateX(-50%);
  pointer-events: auto;
}
/* Anchor the brands to the video frame (16:9, object-fit: cover) rather than
   the viewport, so they always sit on the same spot of the ripple. Clamped so
   they never leave the viewport on narrow desktops. */
.brands {
  --stage-w: max(100vw, calc(100vh * 16 / 9));
  --stage-h: max(100vh, calc(100vw * 9 / 16));
  --stage-x: calc((100vw - var(--stage-w)) / 2);
  --stage-y: calc((100vh - var(--stage-h)) / 2);
}
.brand--covership {
  left: clamp(175px, calc(var(--stage-x) + var(--stage-w) * 0.135), calc(100vw - 175px));
  top: calc(var(--stage-y) + var(--stage-h) * 0.36);
}
.brand--compliance {
  left: 50%;
  top: calc(var(--stage-y) + var(--stage-h) * 0.455);
}
.brand--standards {
  left: clamp(175px, calc(var(--stage-x) + var(--stage-w) * 0.865), calc(100vw - 175px));
  top: calc(var(--stage-y) + var(--stage-h) * 0.36);
}

.brand__head {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.brand__head:focus-visible { outline: 2px solid var(--white); outline-offset: 10px; border-radius: 4px; }

.brand__logo {
  display: block;
  width: auto;
  height: clamp(72px, 10.6vh, 108px);
  color: var(--white);
  filter: drop-shadow(0 2px 10px rgba(5, 20, 26, 0.25));
  transition: color 380ms ease, filter 380ms ease;
}
.brand--covership  { --brand: var(--covership); }
.brand--compliance { --brand: var(--compliance); }
.brand--standards  { --brand: var(--standards); }

.brand__logo .logo__mark { transition: color 380ms ease; }
.brand.is-open .brand__logo .logo__mark { color: var(--brand); }
.brand.is-open .brand__logo {
  filter: drop-shadow(0 2px 10px rgba(5, 20, 26, 0.25)) drop-shadow(0 0 14px color-mix(in srgb, var(--brand) 28%, transparent));
}
.brand.is-open .brand__dot { border-color: var(--brand); }
.brand.is-open .brand__dot::after { background: var(--brand); }
.brand--compliance .brand__logo { height: clamp(72px, 10.5vh, 106px); }
.brand--standards  .brand__logo { height: clamp(78px, 11.3vh, 114px); }

/* The ring button */
.brand__dot {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--white);
  border-radius: 50%;
  transition: transform 300ms ease, border-color 380ms ease;
}
.brand__dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%) scale(1);
  transition: transform 300ms cubic-bezier(.2,.8,.2,1), background-color 380ms ease;
}
.brand.is-open .brand__dot::after { transform: translate(-50%, -50%) scale(2.3); }

/* Description panel (whole panel links to the site) */
.brand__panel {
  display: block;
  margin-top: 18px;
  text-decoration: none;
  pointer-events: none;
  max-width: 272px;
  text-align: center;
  font-size: clamp(13px, 1.05vw, 15.5px);
  line-height: 1.32;
  color: var(--white);
  text-shadow: 0 1px 12px rgba(5, 20, 26, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  /* closing: slower, eased-out fade so nothing jumps when the mouse leaves */
  transition: opacity 480ms ease, transform 480ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 480ms;
}
.brand.is-open .brand__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: opacity 360ms ease 40ms, transform 360ms cubic-bezier(.2,.8,.2,1) 40ms, visibility 0s;
}
.brand__panel p { margin: 0; }
.brand__panel strong { font-weight: 700; }

.brand__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 16px 9px 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-shadow: none;
  background: rgba(14, 30, 35, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
.brand__link svg { width: 11px; height: 11px; }
.brand.is-open .brand__link {
  background: var(--white);
  color: var(--sea-bottom);
  border-color: var(--white);
}
/* Desktop-sized touch screens get no hover: show the panels permanently */
@media (min-width: 900px) and (min-height: 501px) and (hover: none) {
  .brand__panel { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
}

/* ---------- Pager (mobile only) ---------- */

.pager { display: none; }

/* ---------- Legal ---------- */

.legal {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 3%;
  text-align: center;
  color: var(--white);
  text-shadow: 0 1px 10px rgba(5, 20, 26, 0.3);
}
.legal p { margin: 0; }
.legal__line {
  font-size: clamp(11px, 0.95vw, 14px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.legal__note {
  margin-top: 6px !important;
  font-size: clamp(9px, 0.72vw, 11px);
  font-style: italic;
  letter-spacing: 0.02em;
  opacity: 0.85;
}
.legal__links {
  margin-top: 8px !important;
  font-size: clamp(9px, 0.7vw, 10.5px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.legal__links a {
  color: var(--white);
  text-decoration: none;
  opacity: 0.7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 2px;
  transition: opacity 200ms ease, border-color 200ms ease;
}
.legal__links a:hover,
.legal__links a:focus-visible { opacity: 1; border-bottom-color: var(--white); outline: none; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .brand__dot, .brand__dot::after, .brand__panel, .brand__logo, .brand__logo .logo__mark { transition: none; }
}

/* =====================================================================
   Mobile: static background + swipe carousel
   ===================================================================== */

@media (max-width: 899px), (max-height: 500px) {
  .bg__mobile { display: block; transition: opacity 700ms ease; }
  .hero.has-video .bg__mobile { opacity: 0; }

  .title {
    top: 10%;
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.3;
    letter-spacing: 0.32em;
    text-indent: 0.32em;
  }

  /* carousel track */
  .brands {
    inset: auto 0 18% 0;
    top: 32%;
    display: flex;
    gap: 4%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 15%, #000 85%, transparent 100%);
  }
  .brands::before,
  .brands::after { content: ""; flex: 0 0 10%; }
  .brands::-webkit-scrollbar { display: none; }

  .brand {
    position: static;
    flex: 0 0 72%;
    width: 72%;
    transform: none;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    padding: 0 4px;
    opacity: 0.45;
    transform: scale(0.94);
    transition: opacity 320ms ease, transform 320ms ease;
  }
  .brand.is-active { opacity: 1; transform: none; }
  .brand--covership, .brand--compliance, .brand--standards { left: auto; top: auto; }

  .brand__head { gap: 16px; }
  .brand.is-open .brand__logo { filter: drop-shadow(0 2px 10px rgba(5, 20, 26, 0.25)); }
  .brand.is-open .brand__logo .logo__mark { color: var(--white); }
  .brand.is-open .brand__dot { border-color: var(--white); }
  .brand.is-open .brand__dot::after { background: var(--white); }
  .brand__logo,
  .brand--compliance .brand__logo,
  .brand--standards .brand__logo { height: 92px; }
  .brand--compliance .brand__logo { height: 88px; }

  .brand__dot { width: 24px; height: 24px; }
  .brand__dot::after { transform: translate(-50%, -50%) scale(2.3); }

  .brand__panel {
    margin-top: 18px;
    max-width: 250px;
    font-size: 14px;
    line-height: 1.38;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: none;
  }
  .brand__link,
  .brand.is-open .brand__link { margin-top: 16px; background: rgba(14, 30, 35, 0.18); color: var(--white); border-color: rgba(255, 255, 255, 0.85); }

  .pager {
    position: absolute;
    z-index: 4;
    left: 0;
    right: 0;
    bottom: 3.5%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
  }
  .pager__hint {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin: 0 0 2px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
  }
  .pager [role="tab"] {
    appearance: none;
    border: 0;
    padding: 0;
    width: 44px;
    height: 44px;
    background: none;
    cursor: pointer;
    display: grid;
    place-items: center;
  }
  .pager [role="tab"]::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 300ms ease, background-color 300ms ease;
  }
  .pager [role="tab"][aria-selected="true"]::before {
    width: 30px;
    background: var(--white);
  }
  .pager__arrow {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: none;
    width: 40px;
    height: 40px;
    margin: 0 10px;
    color: var(--white);
    cursor: pointer;
    display: grid;
    place-items: center;
  }
  .pager__arrow svg { width: 14px; height: 14px; }
  .pager__arrow:disabled { opacity: 0.3; }

  /* Monaco lines above the pager, legal link tucked under it */
  .legal { left: 20px; right: 20px; bottom: calc(3.5% + 72px); z-index: 5; }
  .legal__line { font-size: 11px; letter-spacing: 0.18em; }
  .legal__note { margin-top: 4px !important; font-size: 9.5px; line-height: 1.3; }
  .legal__links { position: fixed; left: 0; right: 0; bottom: 6px; margin: 0 !important; font-size: 9px; }
}


@media (max-width: 899px) and (max-height: 640px), (max-height: 500px) {
  .title { top: 11%; }
  .brands { top: 38%; bottom: 17%; }
  .legal { bottom: calc(3.5% + 64px); }
  .legal__line { font-size: 10px; }
  .legal__note { font-size: 9px; }
  .brand__head { gap: 12px; }
  .brand__logo,
  .brand--compliance .brand__logo,
  .brand--standards .brand__logo { height: 76px; }
  .brand__panel { margin-top: 12px; font-size: 13px; }
  .brand__link,
  .brand.is-open .brand__link { margin-top: 12px; padding: 7px 14px 7px 16px; }
}

/* =====================================================================
   Phones in landscape: title on the left, carousel on the right
   ===================================================================== */

@media (max-height: 500px) and (orientation: landscape) {
  .bg__mobile { display: none; }

  .title {
    top: 7%;
    left: 0;
    right: auto;
    width: 40%;
    font-size: clamp(20px, 5.4vh, 26px);
    line-height: 1.3;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
  }

  .brands {
    inset: 2% 0 auto 40%;
    top: 2%;
    bottom: 60px;
    gap: 6%;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
  }
  .brands::before,
  .brands::after { flex: 0 0 8%; }
  .brand {
    flex: 0 0 76%;
    width: 76%;
    padding: 0 2px;
    justify-content: center;
  }
  .brand__head { gap: 8px; }
  .brand__logo,
  .brand--compliance .brand__logo,
  .brand--standards .brand__logo { height: clamp(48px, 15vh, 64px); }
  .brand__dot { width: 18px; height: 18px; }
  .brand__dot::after { transform: translate(-50%, -50%) scale(1.8); }
  .brand__panel { margin-top: 8px; max-width: 300px; font-size: 12px; line-height: 1.3; }
  .brand__link,
  .brand.is-open .brand__link { margin-top: 8px; padding: 6px 12px 6px 14px; font-size: 11px; }

  .pager {
    left: 40%;
    right: 0;
    bottom: 10px;
    gap: 0;
  }
  .pager__hint { display: none; }
  .pager [role="tab"] { width: 36px; height: 36px; }
  .pager__arrow { width: 34px; height: 34px; margin: 0 6px; }

  .legal {
    left: 12px;
    right: auto;
    width: calc(40% - 12px);
    bottom: 26px;
    padding: 0 4px;
  }
  .legal__line { font-size: 9.5px; letter-spacing: 0.14em; }
  .legal__note { margin-top: 3px !important; font-size: 8.5px; line-height: 1.25; }
  .legal__links { left: 0; right: auto; width: 40%; bottom: 8px; font-size: 8.5px; }
}
