/* ==========================================================================
   Total Marine Services Limited — Base
   Design tokens, reset, typography, utilities
   ========================================================================== */

:root {
  /* Colour */
  --c-navy-900: #060f1c;
  --c-navy-800: #0a1a2f;
  --c-navy-700: #10243f;
  --c-navy-600: #1a3352;
  --c-ivory: #f5f1ea;
  --c-ivory-200: #ece6db;
  --c-white: #ffffff;
  --c-gold: #c8a96a;
  --c-gold-light: #dcc595;
  --c-gold-dark: #a88a4f;
  --c-ink: #14202e;
  --c-muted: #5f6b78;
  --c-muted-light: rgba(245, 241, 234, 0.66);
  --c-line: rgba(20, 32, 46, 0.12);
  --c-line-light: rgba(245, 241, 234, 0.14);
  --c-success: #3f8f6b;
  --c-error: #b5473a;

  /* Typography */
  --ff-display: "Cormorant Garamond", "Noto Serif TC", "Songti TC", serif;
  --ff-serif-tc: "Noto Serif TC", "Cormorant Garamond", serif;
  --ff-body: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  --fs-2xl: clamp(2.1rem, 1.6rem + 2.2vw, 3.4rem);
  --fs-3xl: clamp(2.6rem, 1.8rem + 3.8vw, 5.2rem);

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.8;

  --ls-wide: 0.18em;
  --ls-wider: 0.32em;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --section-y: clamp(4.5rem, 3rem + 6vw, 9rem);

  /* Layout */
  --container: 1280px;
  --container-narrow: 880px;
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --header-h: 88px;
  --header-h-scrolled: 70px;

  /* Effects */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow-sm: 0 2px 10px rgba(6, 15, 28, 0.06);
  --shadow: 0 18px 40px -18px rgba(6, 15, 28, 0.28);
  --shadow-lg: 0 40px 80px -30px rgba(6, 15, 28, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 0.2s;
  --t: 0.45s;
  --t-slow: 0.9s;

  --z-header: 120;
  --z-menu: 110;
  --z-toast: 200;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background: var(--c-ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

main {
  display: block;
  overflow-x: clip;
}

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

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

.list-reset {
  list-style: none;
  padding: 0;
}

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

img {
  height: auto;
}

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

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

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

::selection {
  background: var(--c-gold);
  color: var(--c-navy-900);
}

:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

/* Typography -------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: -0.005em;
  color: inherit;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

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

.serif-tc {
  font-family: var(--ff-serif-tc);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--c-gold-dark);
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
}

.on-dark .eyebrow,
.eyebrow--light {
  color: var(--c-gold);
}

.lead {
  font-size: var(--fs-md);
  color: var(--c-muted);
  max-width: 62ch;
}

.on-dark .lead {
  color: var(--c-muted-light);
}

.italic-accent {
  white-space: nowrap;
  color: var(--c-gold-dark);
}

.on-dark .italic-accent {
  color: var(--c-gold);
}

/* Utilities --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

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

.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.on-dark {
  background: var(--c-navy-800);
  color: var(--c-ivory);
}

.bg-white {
  background: var(--c-white);
}

.bg-ivory-200 {
  background: var(--c-ivory-200);
}

.text-center {
  text-align: center;
}

.visually-hidden {
  position: absolute !important;
  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;
  left: var(--space-4);
  top: -100px;
  z-index: 999;
  padding: var(--space-3) var(--space-5);
  background: var(--c-gold);
  color: var(--c-navy-900);
  font-weight: 600;
  transition: top var(--t-fast) ease;
}

.skip-link:focus {
  top: var(--space-4);
}

.gold-rule {
  width: 64px;
  height: 1px;
  background: var(--c-gold);
  border: 0;
  margin: var(--space-5) 0;
}

/* Scroll reveal ----------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal="left"] { transform: translate3d(-48px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(48px, 0, 0); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="zoom"] { transform: scale(0.96); }

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@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;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
