/* =========================================================================
   LIOS | base.css
   Fonts, design tokens, reset, typography, layout primitives
   ========================================================================= */

/* ---------- Fonts ---------- */
/* NOTE: Agatho is a commercial font (andfonts.com). Confirm the client's licence covers web use. */
@font-face {
  font-family: 'Agatho';
  src: url('../assets/fonts/agatho-light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/poppins-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/poppins-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/poppins-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand palette (LIOS Brand Guidelines). Brand blue LEADS. */
  --blue: #5a7792;          /* Primary: lead colour */
  --blue-deep: #4a6680;     /* hover / pressed */
  --blue-mist: #dde4ea;     /* pale tint for light sections */
  --blue-soft: #9fb6cc;     /* accents on dark */
  --sand: #e5ddcc;          /* Secondary: warm base */
  --sand-light: #eee8dc;
  --sand-pale: #f5f1e9;
  --grey: #6d6e71;          /* Tertiary */
  --navy: #13273f;          /* Quaternary: text + depth */
  --navy-deep: #0c1a2c;
  --navy-soft: #1b3350;
  --blush: #e5ddcc;         /* accent on blue/navy: brand sand (pink removed) */
  --blush-deep: #9fb6cc;

  --ink: var(--navy);
  --ink-soft: #33465c;      /* body on sand: 8:1 */
  --ink-mute: #56657a;      /* meta on sand: 4.9:1 */
  --on-dark: var(--sand-pale);
  --on-dark-soft: rgba(245, 241, 233, .78);
  --on-dark-mute: rgba(245, 241, 233, .56);
  --line: rgba(19, 39, 63, .14);
  --line-dark: rgba(245, 241, 233, .18);

  /* Type: Agatho for headlines only, Poppins for everything else */
  --f-display: 'Agatho', 'Cormorant Garamond', 'Times New Roman', serif;
  --f-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fs-display: clamp(2.1rem, 1.35rem + 2.5vw, 3.9rem);
  --fs-display-sm: clamp(1.75rem, 1.2rem + 1.7vw, 2.8rem);
  --fs-h3: clamp(1.35rem, 1.1rem + .8vw, 1.9rem);
  --fs-lead: clamp(1.02rem, .95rem + .3vw, 1.2rem);
  --fs-body: clamp(.92rem, .88rem + .12vw, 1rem);
  --fs-label: .6875rem;

  /* Space: one system */
  --gutter: clamp(1.1rem, 4.5vw, 5rem);
  --section: clamp(3.5rem, 2.6rem + 2.8vw, 5.5rem);
  --gap-lg: clamp(2.2rem, 1.6rem + 2vw, 3.6rem);
  --gap-md: clamp(1.5rem, 1.2rem + 1.2vw, 2.5rem);
  --gap-sm: clamp(.9rem, .8rem + .4vw, 1.25rem);
  --maxw: 1360px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --header-h: 80px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
body {
  background: var(--sand);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, picture, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Subtle film grain */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9000; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(46rem + var(--gutter) * 2); }
.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: calc(var(--section) * .7); }

/* Section surfaces: sand / mist / blue / navy rhythm */
.bg-sand { background: var(--sand); }
.bg-pale { background: var(--sand-pale); }
.bg-mist { background: var(--blue-mist); }
.bg-blue { background: var(--blue); color: #fff; }
.bg-navy { background: var(--navy); color: var(--on-dark); }
.bg-deep { background: var(--navy-deep); color: var(--on-dark); }
.is-dark { color: var(--on-dark); }

/* ---------- Typography ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: var(--fs-display);
  line-height: 1.08;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.display--sm { font-size: var(--fs-display-sm); }
.h3 { font-family: var(--f-display); font-weight: 300; font-size: var(--fs-h3); line-height: 1.15; }
.amp { font-family: var(--f-body); font-weight: 300; font-size: .62em; vertical-align: .18em; margin-inline: .08em; }

.lead { font-size: var(--fs-lead); line-height: 1.75; color: var(--ink-soft); text-wrap: pretty; }
.text { color: var(--ink-soft); text-wrap: pretty; max-width: 38rem; }
p + p { margin-top: 1em; }

.bg-navy .lead, .bg-navy .text, .bg-deep .lead, .bg-deep .text, .is-dark .lead, .is-dark .text { color: var(--on-dark-soft); }
.bg-blue .lead, .bg-blue .text { color: rgba(255, 255, 255, .9); }

/* Section label: small blue caps with a blossom mark */
.label {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: var(--fs-label); font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--blue);
  margin-bottom: var(--gap-sm);
}
.label::before {
  content: ''; width: 13px; height: 13px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cg%3E%3Cpath id='p' d='M0 0C-5.5-2-5.9-8.3-1.4-9L0-7.6 1.4-9C5.9-8.3 5.5-2 0 0Z'/%3E%3Cuse href='%23p' transform='rotate(72)'/%3E%3Cuse href='%23p' transform='rotate(144)'/%3E%3Cuse href='%23p' transform='rotate(216)'/%3E%3Cuse href='%23p' transform='rotate(288)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cg%3E%3Cpath id='p' d='M0 0C-5.5-2-5.9-8.3-1.4-9L0-7.6 1.4-9C5.9-8.3 5.5-2 0 0Z'/%3E%3Cuse href='%23p' transform='rotate(72)'/%3E%3Cuse href='%23p' transform='rotate(144)'/%3E%3Cuse href='%23p' transform='rotate(216)'/%3E%3Cuse href='%23p' transform='rotate(288)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .85;
}
.bg-navy .label, .bg-deep .label, .is-dark .label { color: var(--blue-soft); }
.bg-blue .label { color: #fff; }
.bg-blue .label::before { background: var(--blush); opacity: 1; }

.head { margin-bottom: var(--gap-lg); }
.head--center { text-align: center; display: flex; flex-direction: column; align-items: center; margin-inline: auto; max-width: 48rem; }
.head .display + .lead, .head .display + .text { margin-top: var(--gap-sm); }
.head .sub { margin-top: .9rem; font-family: var(--f-display); font-size: clamp(1.15rem, 1rem + .5vw, 1.5rem); line-height: 1.3; color: var(--blue); }
.bg-navy .head .sub, .bg-deep .head .sub { color: var(--blue-soft); }
.bg-blue .head .sub { color: var(--sand-pale); }

.ico { width: 1.1em; height: 1.1em; flex: none; }

/* SplitText helpers */
.split-line-mask { padding-bottom: .16em; margin-bottom: -.16em; }
.js [data-reveal] { opacity: 0; }
.js [data-split] { visibility: hidden; }
.js.reduced [data-reveal] { opacity: 1; }
.js.reduced [data-split] { visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
