/* ============================================================
   VISSOO DESIGN TOKENS
   Version 1.0 · 2026
   
   Drop this file into your project and @import it at the root
   of your stylesheet. All other CSS can reference these tokens.
   
   Surface system: add data-surface="white|martinique|coral"
   to any container to rotate the colour roles automatically.
   ============================================================ */

/* ---------- Licensed brand faces ---------- */
@font-face {
  font-family: "Cera Pro";
  src: url("fonts/Cera_Pro_Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cera Pro";
  src: url("fonts/Cera_Pro_Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cera Pro";
  src: url("fonts/Cera_Pro_Black.otf") format("opentype");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Fraktion Mono";
  src: url("fonts/PPFraktionMono-Bold-BF675904a6c4c6e.otf") format("opentype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ITC Galliard Std";
  src: url("fonts/ITC Galliard Black Italic.otf") format("opentype");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

/* ============================================================
   CORE TOKENS
   ============================================================ */

:root {
  /* === COLOURS — three only, no fourth ever === */
  --color-white: #FFFFFF;
  --color-martinique: #2E2C44;
  --color-coral: #EF513D;

  /* Body greys — surface-aware derivatives of Martinique */
  --color-body-on-white: #6A6877;
  --color-body-on-dark: #BFBFC5;
  --color-body-on-coral: #2E2C44;

  /* Subtle UI greys */
  --color-surface-tint: #F7F6F3;       /* Card backgrounds on white */
  --color-border-subtle: rgba(46, 44, 68, 0.08);

  /* === TYPE FAMILIES === */
  --font-sans: "Cera Pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "PP Fraktion Mono", ui-monospace, "SF Mono", monospace;
  --font-italic: "ITC Galliard Std", "ITC Galliard", Georgia, serif;

  /* === TYPE SCALE — responsive (clamps mobile→desktop) === */
  --text-display: clamp(2.5rem, 6vw, 4.5rem);     /* 40 → 72 */
  --text-h1:      clamp(2rem,   4vw, 3rem);        /* 32 → 48 */
  --text-h2:      clamp(1.5rem, 2.5vw, 1.75rem);   /* 24 → 28 */
  --text-h3:      1.25rem;                          /* 20 */
  --text-body:    0.875rem;                         /* 14 */
  --text-caption: 0.6875rem;                        /* 11 */

  /* Letter-spacing tokens */
  --tracking-tight-display: -0.045em;
  --tracking-tight-h1: -0.04em;
  --tracking-tight-h2: -0.035em;
  --tracking-tight-wordmark: -0.03em;
  --tracking-mono-tight: 0.04em;
  --tracking-mono-default: 0.08em;
  --tracking-mono-loose: 0.12em;

  /* Line-heights */
  --leading-display: 1.0;
  --leading-headline: 1.05;
  --leading-body: 1.6;
  --leading-caption: 1.4;

  /* === SPACING — 4pt base === */
  --space-1: 0.25rem;     /*  4 */
  --space-2: 0.5rem;      /*  8 */
  --space-3: 0.75rem;     /* 12 */
  --space-4: 1rem;        /* 16 */
  --space-6: 1.5rem;      /* 24 */
  --space-8: 2rem;        /* 32 */
  --space-12: 3rem;       /* 48 */
  --space-16: 4rem;       /* 64 */
  --space-24: 6rem;       /* 96 */
  --space-32: 8rem;       /* 128 */

  /* === LAYOUT === */
  --container-narrow: 640px;
  --container-default: 1024px;
  --container-wide: 1280px;
  --container-full: 1440px;

  --margin-x: clamp(1.5rem, 5vw, 5rem);   /* 24 → 80 */
  --grid-gutter: 1rem;                     /* 16 */
  --grid-columns: 12;

  /* === BREAKPOINTS (for use in @media queries) === */
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --bp-2xl: 1440px;

  /* === RADII === */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --radius-card: 12px;
  --radius-button: 22px;     /* matches 44px height */

  /* === MOTION === */
  --duration-snappy: 150ms;
  --duration-default: 250ms;
  --duration-considered: 400ms;
  --duration-cinematic: 600ms;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-linear: linear;

  /* === SURFACE TOKENS (default = White / A·01) === */
  --surface-bg: var(--color-white);
  --surface-structural: var(--color-martinique);
  --surface-body: var(--color-body-on-white);
  --surface-accent: var(--color-coral);
  --surface-cta-bg: var(--color-coral);
  --surface-cta-text: var(--color-white);
  --surface-card-bg: var(--color-surface-tint);
}

/* ============================================================
   SURFACE VARIANTS
   Apply data-surface on any container to swap colour roles.
   ============================================================ */

[data-surface="white"] {
  --surface-bg: var(--color-white);
  --surface-structural: var(--color-martinique);
  --surface-body: var(--color-body-on-white);
  --surface-accent: var(--color-coral);
  --surface-cta-bg: var(--color-coral);
  --surface-cta-text: var(--color-white);
  --surface-card-bg: var(--color-surface-tint);
}

[data-surface="martinique"] {
  --surface-bg: var(--color-martinique);
  --surface-structural: var(--color-white);
  --surface-body: var(--color-body-on-dark);
  --surface-accent: var(--color-coral);
  --surface-cta-bg: var(--color-coral);
  --surface-cta-text: var(--color-white);
  --surface-card-bg: rgba(255, 255, 255, 0.06);
}

[data-surface="coral"] {
  --surface-bg: var(--color-coral);
  --surface-structural: var(--color-martinique);
  --surface-body: var(--color-body-on-coral);
  --surface-accent: var(--color-white);
  --surface-cta-bg: var(--color-martinique);
  --surface-cta-text: var(--color-white);
  --surface-card-bg: rgba(46, 44, 68, 0.08);
}

/* ============================================================
   BASE RESET & DEFAULTS
   ============================================================ */

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--surface-bg);
  color: var(--surface-structural);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 800;
  margin: 0;
  color: var(--surface-structural);
}

p {
  margin: 0;
  color: var(--surface-body);
  line-height: var(--leading-body);
}

a {
  color: var(--surface-accent);
  text-decoration: none;
  transition: opacity var(--duration-snappy) var(--ease-out);
}

a:hover {
  opacity: 0.7;
}

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

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */

.display {
  font-size: var(--text-display);
  font-weight: 800;
  letter-spacing: var(--tracking-tight-display);
  line-height: var(--leading-display);
}

.h1 {
  font-size: var(--text-h1);
  font-weight: 800;
  letter-spacing: var(--tracking-tight-h1);
  line-height: var(--leading-headline);
}

.h2 {
  font-size: var(--text-h2);
  font-weight: 800;
  letter-spacing: var(--tracking-tight-h2);
  line-height: var(--leading-headline);
}

.h3 {
  font-size: var(--text-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.body {
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-body);
}

.caption {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: var(--tracking-mono-default);
  text-transform: uppercase;
}

/* The italic emphasis rule */
.accent,
em.accent {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--surface-accent);
}

/* Eyebrow tag */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: var(--tracking-mono-loose);
  text-transform: uppercase;
  color: var(--surface-accent);
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-button);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--duration-default) var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--surface-cta-bg);
  color: var(--surface-cta-text);
  border: none;
}

.btn-secondary {
  background: transparent;
  color: var(--surface-structural);
  border: 1.5px solid var(--surface-structural);
}

.btn-tertiary {
  background: transparent;
  color: var(--surface-accent);
  border: none;
  height: auto;
  padding: 0;
}

.btn:hover {
  opacity: 0.85;
}

/* === Wordmark === */
.wordmark {
  position: relative;
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: var(--tracking-tight-wordmark);
  color: var(--surface-structural);
  line-height: 1;
}

.wordmark-dot {
  position: absolute;
  width: 0.15em;
  height: 0.15em;
  border-radius: 50%;
  background: var(--surface-accent);
  top: 0.06em;
  left: 0.27em;
}

/* === Card === */
.card {
  background: var(--surface-card-bg);
  border-radius: var(--radius-card);
  padding: var(--space-6);
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

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

.container-narrow { max-width: var(--container-narrow); }
.container-wide { max-width: var(--container-wide); }
.container-full { max-width: var(--container-full); }

section {
  background: var(--surface-bg);
  color: var(--surface-structural);
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--color-coral);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect reduced motion */
@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;
  }
}

/* Screen-reader-only utility */
.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;
}
