/* =====================================================================
   VLAMIS YACHTS - main.css
   Foundation: design tokens, reset, typography, layout primitives
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------------ */
:root {
  /* Brand palette */
  --color-white: #ffffff;
  --color-ocean: #0a2342;
  --color-ocean-700: #0f2e58;
  --color-ocean-500: #1d4373;
  --color-gold: #1B52AE;
  --color-gold-600: #1444A0;
  --color-gold-300: #7EB3E8;
  --color-grey-50: #fafbfc;
  --color-grey-100: #f5f6f8;
  --color-grey-200: #e7eaee;
  --color-grey-300: #d2d7df;
  --color-grey-500: #8a92a0;
  --color-grey-700: #4a5260;
  --color-ink: #14213d;

  /* Semantic */
  --color-bg: var(--color-white);
  --color-bg-alt: var(--color-grey-100);
  --color-text: var(--color-ink);
  --color-text-muted: var(--color-grey-700);
  --color-heading: var(--color-ocean);
  --color-accent: var(--color-gold);
  --color-border: var(--color-grey-200);

  /* Typography */
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.125rem;    /* 18 */
  --fs-lg: 1.375rem;    /* 22 */
  --fs-xl: 1.75rem;     /* 28 */
  --fs-2xl: 2.25rem;    /* 36 */
  --fs-3xl: 3rem;       /* 48 */
  --fs-4xl: 3.75rem;    /* 60 */
  --fs-5xl: 4.5rem;     /* 72 */

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-normal: 1.55;
  --lh-loose: 1.75;

  --tracking-tight: -0.015em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.18em;

  /* Spacing scale (8pt-ish) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;
  --space-12: 6rem;
  --space-14: 8rem;
  --space-16: 10rem;

  /* Layout */
  --container-max: 1280px;
  --container-narrow: 920px;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);

  /* Section rhythm */
  --section-y: clamp(4rem, 8vw, 7.5rem);
  --section-y-sm: clamp(2.5rem, 5vw, 4.5rem);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows - soft, premium */
  --shadow-xs: 0 1px 2px rgba(10, 35, 66, 0.06);
  --shadow-sm: 0 4px 14px rgba(10, 35, 66, 0.06);
  --shadow-md: 0 12px 32px rgba(10, 35, 66, 0.08);
  --shadow-lg: 0 24px 56px rgba(10, 35, 66, 0.12);
  --shadow-gold: 0 12px 28px rgba(27, 82, 174, 0.28);

  /* Motion */
  --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-base: 320ms;
  --dur-slow: 600ms;

  /* Z-layers */
  --z-base: 1;
  --z-sticky: 50;
  --z-nav: 100;
  --z-overlay: 200;
  --z-modal: 300;
}

/* ---------------------------------------------------------------------
   2. RESET / NORMALIZE
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--color-gold);
  color: var(--color-ocean);
}

/* ---------------------------------------------------------------------
   3. TYPOGRAPHY
   ------------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-heading);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, var(--fs-5xl));
  font-weight: 500;
}

h2 {
  font-size: clamp(2rem, 3.6vw, var(--fs-3xl));
  font-weight: 500;
}

h3 {
  font-size: clamp(1.375rem, 2vw, var(--fs-xl));
  font-weight: 500;
}

h4 {
  font-size: var(--fs-lg);
  font-weight: 500;
}

h5, h6 {
  font-family: var(--font-body);
  color: var(--color-heading);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

h5 { font-size: var(--fs-sm); }
h6 { font-size: var(--fs-xs); }

p {
  color: var(--color-text);
  line-height: var(--lh-normal);
}

p + p { margin-top: var(--space-4); }

.lead {
  font-size: clamp(1.075rem, 1.3vw, var(--fs-md));
  line-height: var(--lh-loose);
  color: var(--color-text-muted);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-4);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--color-gold);
  vertical-align: middle;
  margin-right: var(--space-3);
  transform: translateY(-2px);
}

.display-serif {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-gold { color: var(--color-gold); }
.text-ocean { color: var(--color-ocean); }
.text-white { color: var(--color-white); }

a:hover {
  color: var(--color-gold);
}

/* ---------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   ------------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

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

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--sm { padding-block: var(--section-y-sm); }

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--ocean {
  background-color: var(--color-ocean);
  color: var(--color-white);
}

.section--ocean h1,
.section--ocean h2,
.section--ocean h3,
.section--ocean h4 {
  color: var(--color-white);
}

.section--ocean p {
  color: rgba(255, 255, 255, 0.82);
}

.section-header {
  max-width: 760px;
  margin: 0 auto var(--space-10);
  text-align: center;
}

.section-header--left {
  margin-inline: 0;
  text-align: left;
}

.section-header p {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
}

/* Grid + Flex helpers */
.grid {
  display: grid;
  gap: var(--space-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); }
.grid--6 { grid-template-columns: repeat(3, 1fr); }

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

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

.flex {
  display: flex;
  gap: var(--space-4);
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  align-items: center;
  justify-content: space-between;
}

.flex--wrap { flex-wrap: wrap; }
.flex--col { flex-direction: column; }

/* Divider - gold hairline */
.divider-gold {
  width: 64px;
  height: 2px;
  background-color: var(--color-gold);
  border: 0;
  margin: var(--space-5) auto;
}

.divider-gold--left { margin-inline: 0; }

/* ---------------------------------------------------------------------
   5. UTILITY HELPERS
   ------------------------------------------------------------------ */
.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--z-modal);
  background: var(--color-ocean);
  color: var(--color-white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--dur-base) var(--ease-out);
}

.skip-link:focus-visible {
  top: var(--space-4);
  outline: 2px solid var(--color-gold);
}

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* ---------------------------------------------------------------------
   6. SCROLL ANIMATIONS (paired with main.js IntersectionObserver)
   ------------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }
.reveal[data-delay="6"] { transition-delay: 480ms; }

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------
   7. RESPONSIVE BASELINE TWEAKS
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
  :root {
    --section-y: clamp(2.5rem, 8vw, 4.5rem);
    --section-y-sm: clamp(1.75rem, 5vw, 3rem);
  }
}

@media (max-width: 480px) {
  :root {
    --section-y: clamp(2rem, 8vw, 3.5rem);
    --section-y-sm: clamp(1.25rem, 5vw, 2.5rem);
    --container-pad: 1rem;
  }

  /* Tighten heading sizes on very small screens */
  h1 { font-size: clamp(1.75rem, 8vw, 2.5rem); }
  h2 { font-size: clamp(1.4rem, 6vw, 2rem); }
  h3 { font-size: clamp(1.1rem, 5vw, 1.5rem); }

  /* Ensure nothing bleeds horizontally */
  body { overflow-x: hidden; }

  /* Reduce grid gap on tiny screens */
  .grid { gap: var(--space-4); }
}

/* Prevent long URLs / emails / strings from breaking layout */
body {
  overflow-wrap: anywhere;
  word-break: break-word;
}
