/* ==========================================================================
   ARK Marketing — Design System Foundation
   Tokens · Reset · Typography · Utilities
   ========================================================================== */

/* ---------- 1. Design Tokens ---------- */
/* Palette derived from the ARK Marketing emblem: a deep petrol teal,
   expressed as a scale of shades over a predominantly white canvas. */
:root {
  /* Ink — deep petrol (the emblem's field colour) */
  --ink-950: 194 58% 6%;
  --ink-900: 193 54% 9%;
  --ink-850: 192 50% 12%;
  --ink-800: 191 44% 16%;
  --ink-700: 190 36% 23%;
  --ink-600: 188 28% 32%;

  /* Teal — mid shades, used for positive/functional icons */
  --emerald-700: 190 46% 20%;
  --emerald-600: 188 42% 28%;
  --emerald-500: 186 38% 38%;
  --emerald-400: 184 32% 50%;
  --emerald-200: 182 30% 78%;

  /* Accent — the brand teal at usable contrast levels */
  --gold-600: 189 68% 24%;
  --gold-500: 187 60% 32%;
  --gold-400: 184 52% 46%;
  --gold-300: 181 48% 62%;
  --gold-100: 183 46% 94%;

  /* Canvas — cool near-whites */
  --cream-50: 200 40% 99%;
  --cream-100: 196 30% 97%;
  --cream-200: 194 24% 93%;
  --cream-300: 192 18% 86%;
  --stone-400: 196 10% 56%;
  --stone-500: 196 12% 43%;
  --stone-600: 196 14% 31%;

  /* Semantic roles */
  --bg: hsl(var(--cream-50));
  --bg-alt: hsl(var(--cream-100));
  --bg-sunken: hsl(var(--cream-200));
  --surface: hsl(0 0% 100%);
  --surface-dark: hsl(var(--ink-900));
  --border: hsl(var(--cream-300));
  --border-strong: hsl(37 18% 74%);
  --border-dark: hsl(var(--ink-700));

  --text: hsl(var(--ink-900));
  --text-muted: hsl(var(--stone-500));
  --text-subtle: hsl(var(--stone-400));
  --text-on-dark: hsl(var(--cream-100));
  --text-on-dark-muted: hsl(40 12% 72%);
  --text-inverse: hsl(var(--cream-50));

  --accent: hsl(var(--gold-500));
  --accent-strong: hsl(var(--gold-600));
  --accent-soft: hsl(var(--gold-100));
  --brand: hsl(var(--emerald-600));
  --brand-deep: hsl(var(--emerald-700));

  --success: 148 52% 34%;
  --danger: 4 62% 48%;

  /* Gradients */
  --grad-gold: linear-gradient(
    132deg,
    hsl(var(--gold-400)) 0%,
    hsl(var(--gold-500)) 46%,
    hsl(var(--ink-800)) 100%
  );
  --grad-aqua: linear-gradient(
    118deg,
    hsl(181 62% 70%) 0%,
    hsl(184 56% 54%) 48%,
    hsl(187 52% 42%) 100%
  );
  --grad-ink: linear-gradient(
    175deg,
    hsl(var(--ink-800)) 0%,
    hsl(var(--ink-900)) 55%,
    hsl(var(--ink-950)) 100%
  );
  --grad-emerald: linear-gradient(
    140deg,
    hsl(var(--emerald-600)) 0%,
    hsl(var(--emerald-700)) 58%,
    hsl(var(--ink-900)) 100%
  );
  --grad-hero: linear-gradient(
    100deg,
    hsl(var(--ink-950) / 0.92) 0%,
    hsl(var(--ink-950) / 0.74) 38%,
    hsl(var(--ink-950) / 0.28) 72%,
    hsl(var(--ink-950) / 0.5) 100%
  );
  --grad-hero-bottom: linear-gradient(
    to top,
    hsl(var(--ink-950) / 0.9) 0%,
    hsl(var(--ink-950) / 0) 55%
  );
  --grad-sheen: linear-gradient(
    115deg,
    transparent 28%,
    hsl(45 80% 88% / 0.22) 48%,
    hsl(45 80% 88% / 0.06) 55%,
    transparent 72%
  );
  --grad-fade-down: linear-gradient(
    to bottom,
    hsl(var(--ink-950) / 0.55),
    transparent
  );

  /* Shadows */
  --sh-xs: 0 1px 2px hsl(var(--ink-950) / 0.06);
  --sh-sm: 0 2px 6px hsl(var(--ink-950) / 0.06), 0 1px 2px hsl(var(--ink-950) / 0.05);
  --sh-md: 0 8px 24px -8px hsl(var(--ink-950) / 0.14), 0 2px 6px hsl(var(--ink-950) / 0.05);
  --sh-lg: 0 24px 48px -20px hsl(var(--ink-950) / 0.24), 0 6px 16px -8px hsl(var(--ink-950) / 0.1);
  --sh-xl: 0 40px 80px -32px hsl(var(--ink-950) / 0.34), 0 12px 28px -12px hsl(var(--ink-950) / 0.14);
  --sh-gold: 0 16px 36px -14px hsl(var(--gold-500) / 0.55);
  --sh-emerald: 0 16px 36px -14px hsl(var(--emerald-600) / 0.45);
  --sh-inset: inset 0 1px 0 hsl(0 0% 100% / 0.7);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 40px;
  --r-pill: 999px;

  /* Spacing scale (8pt rhythm) */
  --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;

  /* Layout */
  --shell: 1280px;
  --shell-wide: 1480px;
  --shell-narrow: 900px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 84px;
  --topbar-h: 40px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.18s;
  --t-base: 0.36s;
  --t-slow: 0.7s;
  --t-reveal: 0.9s;

  /* Type */
  --font-display: "Playfair Display", "Georgia", "Times New Roman", serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;

  --fs-display-1: clamp(2.5rem, 5.4vw, 4.9rem);
  --fs-display-2: clamp(2.1rem, 4.6vw, 3.85rem);
  --fs-display-3: clamp(1.7rem, 3.1vw, 2.6rem);
  --fs-h3: clamp(1.3rem, 1.9vw, 1.7rem);
  --fs-h4: clamp(1.075rem, 1.3vw, 1.25rem);
  --fs-lead: clamp(1.02rem, 1.25vw, 1.2rem);
  --fs-body: 0.975rem;
  --fs-small: 0.85rem;
  --fs-xs: 0.75rem;
  --fs-micro: 0.6875rem;

  --lh-tight: 1.06;
  --lh-snug: 1.22;
  --lh-normal: 1.62;
  --lh-loose: 1.78;

  --tracking-tight: -0.022em;
  --tracking-wide: 0.09em;
  --tracking-wider: 0.18em;
  --tracking-widest: 0.26em;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--topbar-h) + 1rem);
  /* Clip on html too: clipping only on body lets wide content expand the
     layout viewport (innerWidth) on mobile. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* `clip` rather than `hidden` — hidden would make body a scroll container
     and break `position: sticky` on the header. */
  overflow-x: hidden;
  overflow-x: clip;
}

body.is-locked {
  overflow: hidden;
}

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

img {
  background: hsl(var(--cream-200));
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
}

::selection {
  background: hsl(var(--gold-300) / 0.42);
  color: hsl(var(--ink-950));
}

:focus-visible {
  outline: 2px solid hsl(var(--gold-500));
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: hsl(var(--cream-200));
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--ink-700) / 0.45);
  border-radius: var(--r-pill);
  border: 3px solid hsl(var(--cream-200));
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--emerald-600) / 0.7);
}

/* ---------- 3. Typography ---------- */
h1,
h2,
h3,
h4,
h5,
.display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: hsl(var(--ink-950));
  text-wrap: balance;
}

h1,
.fs-display-1 {
  font-size: var(--fs-display-1);
  line-height: var(--lh-tight);
}
h2,
.fs-display-2 {
  font-size: var(--fs-display-2);
  line-height: var(--lh-tight);
}
h3,
.fs-display-3 {
  font-size: var(--fs-display-3);
}
h4 {
  font-size: var(--fs-h3);
}
h5 {
  font-size: var(--fs-h4);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-loose);
  color: var(--text-muted);
  font-weight: 400;
}

.small {
  font-size: var(--fs-small);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: hsl(var(--gold-600));
  line-height: 1;
}

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: var(--grad-gold);
  flex: none;
}

.eyebrow--center {
  justify-content: center;
}
.eyebrow--center::after {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: var(--grad-gold);
  flex: none;
}

.eyebrow--on-dark {
  color: hsl(var(--gold-400));
}

.text-accent {
  color: hsl(var(--gold-600));
}
.text-italic-serif {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
}

/* On-dark surfaces flip text roles */
.on-dark,
.section--dark {
  color: var(--text-on-dark-muted);
}
.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4,
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--emerald h1,
.section--emerald h2,
.section--emerald h3,
.section--emerald h4 {
  color: hsl(var(--cream-50));
}
.on-dark strong,
.section--dark strong,
.section--emerald strong {
  color: hsl(var(--cream-50));
}

/* ---------- 4. Layout utilities ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--wide {
  max-width: var(--shell-wide);
}
.shell--narrow {
  max-width: var(--shell-narrow);
}

.section {
  position: relative;
  padding-block: clamp(var(--sp-8), 9vw, var(--sp-10));
}
.section--tight {
  padding-block: clamp(var(--sp-7), 6vw, var(--sp-8));
}
.section--dark {
  background: var(--grad-ink);
  color: var(--text-on-dark-muted);
}
.section--cream {
  background: var(--bg-alt);
}
.section--emerald {
  background: var(--grad-emerald);
  color: hsl(var(--cream-200) / 0.82);
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(var(--sp-6), 5vw, var(--sp-8));
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head > * + * {
  margin-top: var(--sp-4);
}
.section-head h2 + .lead {
  margin-top: var(--sp-4);
}

.section-head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  max-width: none;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--sp-5);
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid--gap-lg {
  gap: var(--sp-6);
}
.grid--gap-xl {
  gap: clamp(var(--sp-5), 3.4vw, var(--sp-7));
}

/* Flex helpers */
.row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.row--between {
  justify-content: space-between;
}
.row--wrap {
  flex-wrap: wrap;
}
.stack > * + * {
  margin-top: var(--sp-4);
}
.stack--sm > * + * {
  margin-top: var(--sp-2);
}
.stack--lg > * + * {
  margin-top: var(--sp-6);
}

/* Misc */
/* Icon sprite default sizing — component rules override this */
.ic {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
}

.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: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: hsl(var(--ink-950));
  color: hsl(var(--cream-50));
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: var(--fs-small);
  transform: translateY(-160%);
  transition: transform var(--t-base) var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
}

.divider {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-strong),
    transparent
  );
}
.divider--gold {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    hsl(var(--gold-500) / 0.6),
    transparent
  );
}

/* ---------- 5. Responsive ---------- */
@media (max-width: 1100px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 68px;
    --topbar-h: 36px;
  }
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .section-head--split {
    align-items: flex-start;
  }
}
