/* ==========================================================================
   Sailing Kairos — Design tokens & base styles
   Dark, animated-water aesthetic per brief: "Wind. Water. Freedom."
   ========================================================================== */

:root {
  /* Colour — dark water at every depth, brass hardware, sail-white type */
  --navy-950: #060f16;
  --navy-900: #0a1c27;
  --navy-850: #0e2733;
  --navy-800: #123342;
  --navy-700: #1a4457;
  --teal-600: #1f7d8c;
  --teal-500: #2fa0a8;
  --teal-400: #5fc4c2;
  --teal-300: #9be0da;
  --sand-100: #f7f2e7;
  --brass-500: #c99a45;
  --brass-400: #ddb567;
  --ink-900: #0a1015;

  --color-bg: var(--navy-950);
  --color-surface: var(--navy-850);
  --color-surface-raised: var(--navy-800);
  --color-text: var(--sand-100);
  --color-text-muted: rgba(247, 242, 231, 0.68);
  --color-primary: var(--sand-100);
  --color-accent: var(--brass-500);
  --color-border: rgba(247, 242, 231, 0.14);

  /* Typography — bold, clear, adventurous (not an elegant-brochure serif) */
  --font-display: "Archivo", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;

  --fs-100: 0.8125rem;
  --fs-200: 0.9375rem;
  --fs-300: 1rem;
  --fs-400: 1.125rem;
  --fs-500: 1.375rem;
  --fs-600: 1.75rem;
  --fs-700: 2.25rem;
  --fs-800: 3rem;
  --fs-900: 4rem;
  --fs-950: 5rem;

  /* Spacing (4/8pt scale) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 8rem;

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 34px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-med: 320ms;
  --dur-slow: 600ms;

  --container-max: 1240px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-300);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }

input, textarea, select {
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, .font-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: var(--sand-100);
  text-transform: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-100);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-400);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.7;
}

h1 { font-size: clamp(2.75rem, 6vw, var(--fs-950)); }
h2 { font-size: clamp(2rem, 4vw, var(--fs-800)); }
h3 { font-size: var(--fs-600); }

.lede {
  font-size: var(--fs-400);
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (max-width: 640px) {
  .container { padding-inline: var(--sp-4); }
}

.section {
  padding-block: var(--sp-9);
  position: relative;
}
@media (max-width: 780px) {
  .section { padding-block: var(--sp-8); }
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--sp-7);
}
.section-head.center { margin-inline: auto; text-align: center; }

.stack { display: flex; flex-direction: column; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Section surface variants — depth, not light/dark alternation */
.surface-raised { background: var(--navy-900); }
.surface-deep { background: var(--navy-950); }

/* ==========================================================================
   Animated water motif — layered, slow-drifting glow, GPU-cheap (transform only)
   ========================================================================== */

.water-glow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.water-glow::before,
.water-glow::after {
  content: "";
  position: absolute;
  width: 140%;
  height: 140%;
  left: -20%;
  top: -20%;
  background:
    radial-gradient(circle at 30% 30%, rgba(47, 160, 168, 0.22), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(201, 154, 69, 0.10), transparent 40%);
  animation: waterDrift1 34s ease-in-out infinite;
  will-change: transform;
}
.water-glow::after {
  background:
    radial-gradient(circle at 65% 25%, rgba(95, 196, 194, 0.16), transparent 42%),
    radial-gradient(circle at 25% 75%, rgba(26, 68, 87, 0.4), transparent 50%);
  animation: waterDrift2 46s ease-in-out infinite;
}
@keyframes waterDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, -4%) scale(1.06); }
}
@keyframes waterDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-4%, 3%) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .water-glow::before, .water-glow::after { animation: none; }
}
.section > .container, .hero-content { position: relative; z-index: 1; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--fs-200);
  border: 1.5px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
  min-height: 44px;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brass-500);
  color: var(--navy-950);
}
.btn-primary:hover { background: var(--brass-400); }

.btn-outline {
  background: transparent;
  border-color: rgba(247, 242, 231, 0.55);
  color: var(--sand-100);
}
.btn-outline:hover { background: rgba(247, 242, 231, 0.1); border-color: var(--sand-100); }

.btn-ghost {
  background: transparent;
  color: var(--sand-100);
  padding-inline: var(--sp-2);
}
.btn-ghost:hover { color: var(--teal-400); }

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding-block: var(--sp-4);
  transition: background-color var(--dur-med) var(--ease-out), padding-block var(--dur-med) var(--ease-out), box-shadow var(--dur-med);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); }

.site-header.is-scrolled {
  background: rgba(6, 15, 22, 0.88);
  backdrop-filter: blur(10px);
  padding-block: var(--sp-3);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--color-border);
}

.brand { display: flex; align-items: center; gap: var(--sp-3); }
.brand img { height: 68px; width: auto; }

.main-nav { display: flex; align-items: center; gap: var(--sp-6); }
.main-nav ul { display: flex; gap: var(--sp-5); }
.main-nav a {
  font-size: var(--fs-200);
  font-weight: 600;
  color: var(--sand-100);
  position: relative;
  padding-block: var(--sp-1);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--brass-500);
  transition: right var(--dur-med) var(--ease-out);
}
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { right: 0; }
.main-nav a[aria-current="page"] { color: var(--brass-400); }

.lang-switch { display: flex; gap: var(--sp-1); font-size: var(--fs-100); font-weight: 700; }
.lang-switch a {
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  color: rgba(247, 242, 231, 0.55);
  letter-spacing: 0.04em;
}
.lang-switch a[aria-current="true"] { color: var(--sand-100); background: rgba(247, 242, 231, 0.12); }
.lang-switch a:hover { color: var(--sand-100); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--sand-100);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    inset: 0;
    top: 0;
    background: var(--navy-950);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--sp-7);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-med);
    pointer-events: none;
  }
  .main-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav ul { flex-direction: column; text-align: center; gap: var(--sp-6); }
  .main-nav a { font-size: var(--fs-600); }
  .nav-toggle { display: inline-flex; z-index: 101; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--sand-100);
  background: var(--navy-950);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,15,22,0.45) 0%, rgba(6,15,22,0.4) 40%, rgba(6,15,22,0.94) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding-block: var(--sp-9) var(--sp-8);
  width: 100%;
}
.hero .eyebrow { color: var(--brass-400); }
.hero h1 { color: var(--sand-100); max-width: 18ch; }
.hero-scroll-cue {
  position: absolute;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: rgba(247,242,231,0.7);
  font-size: var(--fs-100);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.hero-scroll-cue .line {
  width: 1.5px;
  height: 36px;
  background: rgba(247,242,231,0.4);
  overflow: hidden;
  position: relative;
}
.hero-scroll-cue .line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brass-400);
  transform: translateY(-100%);
  animation: scrollcue 1.8s var(--ease-in-out) infinite;
}
@keyframes scrollcue {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue .line::after { animation: none; transform: translateY(0); }
}

.page-hero {
  min-height: 62vh;
  align-items: center;
}
.page-hero .hero-content { padding-block: var(--sp-9); }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-med);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: rgba(95, 196, 194, 0.35); }

.card-media { aspect-ratio: 4 / 3; overflow: hidden; position: relative; background: var(--navy-950); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.card:hover .card-media img { transform: scale(1.06); }

.card-body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.card-tag {
  position: absolute;
  top: var(--sp-3); left: var(--sp-3);
  background: rgba(6,15,22,0.82);
  border: 1px solid rgba(247,242,231,0.2);
  color: var(--sand-100);
  font-size: var(--fs-100);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.card-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-100); color: var(--color-text-muted); }
.card-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }

/* Yacht spec cards */
.yacht-card .card-body { gap: var(--sp-4); }
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2) var(--sp-4);
  font-size: var(--fs-100);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: var(--sp-3);
}
.spec-grid dt { font-weight: 700; color: var(--sand-100); }
.spec-grid dd { margin: 0; }

/* ==========================================================================
   Wave divider
   ========================================================================== */

.wave-divider { display: block; width: 100%; height: auto; line-height: 0; position: relative; z-index: 1; }
.wave-divider svg { width: 100%; height: 60px; display: block; }
.wave-divider path { fill: var(--navy-900); }
.wave-divider.deep path { fill: var(--navy-950); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: var(--fs-100); font-weight: 700; color: var(--sand-100); }
.form-field input, .form-field select, .form-field textarea {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  background: var(--navy-950);
  color: var(--sand-100);
  min-height: 44px;
  transition: border-color var(--dur-fast);
}
.form-field select option { background: var(--navy-900); color: var(--sand-100); }
.form-field input::placeholder, .form-field textarea::placeholder { color: rgba(247,242,231,0.4); }
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 3px solid var(--teal-500);
  outline-offset: 1px;
  border-color: var(--teal-400);
}
.form-hint { font-size: var(--fs-100); color: var(--color-text-muted); }
.form-note { font-size: var(--fs-100); color: var(--color-text-muted); margin-top: var(--sp-3); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--navy-950); color: rgba(247,242,231,0.7); padding-block: var(--sp-8) var(--sp-6); border-top: 1px solid var(--color-border); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-7); }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: var(--sand-100); font-family: var(--font-body); font-size: var(--fs-200); margin-bottom: var(--sp-3); }
.footer-grid ul { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-grid a:hover { color: var(--sand-100); }
.footer-bottom {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid rgba(247,242,231,0.14);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3);
  font-size: var(--fs-100);
}

/* ==========================================================================
   Scroll reveal (JS toggles .is-visible)
   ========================================================================== */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.js [data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal-group] > * { transition-delay: calc(var(--stagger-i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Misc components
   ========================================================================== */

.tag-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(95, 196, 194, 0.12); color: var(--teal-300);
  border: 1px solid rgba(95, 196, 194, 0.3);
  font-size: var(--fs-100); font-weight: 700;
  padding: 0.4rem 0.85rem; border-radius: 999px;
}

.stat-row { display: flex; gap: var(--sp-8); flex-wrap: wrap; }
.stat-row .stat-num { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-700); color: var(--sand-100); }
.stat-row .stat-label { font-size: var(--fs-100); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: center;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: var(--sp-6); } }
.split.reverse .split-media { order: 2; }
.split-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

.badge-anchor { position: relative; }
.badge-circle {
  position: absolute;
  width: 108px; height: 108px;
  border-radius: 50%;
  background: var(--brass-500);
  color: var(--navy-950);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-100);
  font-weight: 700;
  line-height: 1.15;
  box-shadow: var(--shadow-md);
  bottom: -20px; right: -20px;
}

/* Waypoint / itinerary list (tour narratives) */
.waypoint-list { position: relative; }
.waypoint {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: var(--sp-5);
  padding-bottom: var(--sp-7);
  position: relative;
}
.waypoint:last-child { padding-bottom: 0; }
.waypoint::before {
  content: "";
  position: absolute;
  left: 41px;
  top: 60px;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}
.waypoint:last-child::before { display: none; }
.waypoint-km {
  display: flex; align-items: center; justify-content: center;
  width: 84px; height: 44px;
  border-radius: 999px;
  background: rgba(201, 154, 69, 0.12);
  border: 1px solid rgba(201, 154, 69, 0.35);
  color: var(--brass-400);
  font-size: var(--fs-100);
  font-weight: 700;
  white-space: nowrap;
  z-index: 1;
}
.waypoint-title { color: var(--sand-100); font-weight: 700; font-size: var(--fs-400); margin-bottom: 0.25rem; }
.waypoint-kicker { color: var(--teal-400); font-size: var(--fs-100); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.35rem; }
.waypoint-photo-credit { font-size: var(--fs-100); color: var(--color-text-muted); font-style: italic; margin-top: 0.5rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--sand-100);
  color: var(--navy-900);
  padding: var(--sp-3) var(--sp-5);
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
