/* ============================================
   MADAM CLINIK — Design Tokens
   Authoritative source: CLAUDE.md §3
   ============================================ */

/* ─── Migra — full family (8 pesi × 2) ─────── */
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migra-extralight.otf') format('opentype');
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migraitalic-extralightitalic.otf') format('opentype');
  font-weight: 200; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migra-light.otf') format('opentype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migraitalic-lightitalic.otf') format('opentype');
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migra-regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migraitalic-italic.otf') format('opentype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migra-medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migraitalic-mediumitalic.otf') format('opentype');
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migra-semibold.otf') format('opentype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migraitalic-semibolditalic.otf') format('opentype');
  font-weight: 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migra-bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migraitalic-bolditalic.otf') format('opentype');
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migra-extrabold.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migraitalic-extrabolditalic.otf') format('opentype');
  font-weight: 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migra-black.otf') format('opentype');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Migra';
  src: url('../fonts/migraitalic-blackitalic.otf') format('opentype');
  font-weight: 900; font-style: italic; font-display: swap;
}

/* ─── Codec Pro — UI weights ─────────────────── */
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-ExtraLight.ttf') format('truetype');
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-ExtraLightItalic.ttf') format('truetype');
  font-weight: 200; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-Light.ttf') format('truetype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-LightItalic.ttf') format('truetype');
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-News.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-NewsItalic.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-Regular.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-Italic.ttf') format('truetype');
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-BoldItalic.ttf') format('truetype');
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-ExtraBold.ttf') format('truetype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/CodecPro-ExtraBoldItalic.ttf') format('truetype');
  font-weight: 800; font-style: italic; font-display: swap;
}

:root {
  /* Primary palette */
  --bone:       #F4EFE7;
  --bone-deep:  #EDE5D7;
  --ink:        #1A1712;
  --ink-soft:   #2B2620;
  --muted:      #7A6F5E;
  --line:       #D9CFBE;
  --accent:     #D68531;
  --accent-warm:#B8936A;
  --gold:       #9A7B4F;

  /* Warm white — mai bianco netto */
  --white:      #F9F4E5;

  /* Semantic aliases */
  --bg: var(--bone);
  --fg: var(--ink);

  /* Fonts */
  --serif: 'Migra', 'Bodoni Moda', 'Didot', serif;
  --sans:  'Codec Pro', -apple-system, system-ui, sans-serif;
  --mono:  'Codec Pro', ui-monospace, monospace;

  /* Motion */
  --ease-smooth: cubic-bezier(0.7, 0, 0.25, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back:   cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1360px;
  --container-pad: clamp(24px, 4vw, 64px);
}

/* ─── Reset ───────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--accent); color: var(--bone); }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html { scroll-behavior: smooth; }
body.no-scroll { overflow: hidden; }

@media (hover: hover) and (pointer: fine) {
  body.custom-cursor, body.custom-cursor * { cursor: none !important; }
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }

/* ─── Typography utilities ────────────────────── */

/* Codec Pro ExtraLight (200) — etichette editoriali, step-num */
.mono {
  font-family: var(--mono);
  font-weight: 200;
  letter-spacing: 0.08em;
}

/* Codec Pro Light (300) — didascalie, meta */
.sans { font-family: var(--sans); }

/* Eyebrow — Migra Light Italic, tutto maiuscolo, tracking ampio */
.eyebrow {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ── Serif utilities (Migra) ───────────────────── */

/* Migra Light (300) — corpo serif, intro, blockquote */
.serif {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.01em;
}

/* Migra Extralight (200) — display atmosferico */
.display {
  font-family: var(--serif);
  font-weight: 200;
  font-style: normal;
  line-height: 0.92;
  letter-spacing: -0.02em;
}

/* Migra Extralight Italic (200 italic) — parola accento decorativa */
.display-italic {
  font-family: var(--serif);
  font-weight: 200;
  font-style: italic;
  line-height: 0.92;
  letter-spacing: -0.01em;
}

/* Migra Extrabold (800) — titoli di sezione, Standard: tutto maiuscolo */
.display-bold {
  font-family: var(--serif);
  font-weight: 800;
  font-style: normal;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* Migra Extrabold Italic (800 italic) */
.display-bold-italic {
  font-family: var(--serif);
  font-weight: 800;
  font-style: italic;
  line-height: 0.92;
  letter-spacing: -0.01em;
}

/* Migra Semibold (600) — "Headline" da brand guidelines */
.headline {
  font-family: var(--serif);
  font-weight: 600;
  font-style: normal;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* Codec Pro Bold (700) — "Kicker" Standard: bold upright, più grande del body */
.kicker {
  font-family: var(--sans);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.35;
  letter-spacing: 0;
}

/* Codec Pro Bold (700) — "Sottotitolo" Standard: bold upright, sentence case */
.sottotitolo {
  font-family: var(--sans);
  font-weight: 700;
  font-style: normal;
  line-height: 1.3;
}

/* ─── Layout ──────────────────────────────────── */
section { position: relative; }

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

.section-pad { padding: clamp(80px, 10vw, 140px) 0; }

/* ─── Custom cursor ───────────────────────────── */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: opacity 0.2s;
}

.cursor-dot {
  width: 6px; height: 6px;
  background: var(--bone);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid var(--bone);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              background 0.3s, border-color 0.3s, transform 0.15s linear;
  transform-origin: center;
}

.cursor-ring.hover {
  width: 72px; height: 72px;
  background: rgba(244, 239, 231, 0.1);
}

.cursor-ring.drag {
  width: 96px; height: 96px;
  background: var(--accent);
  border-color: var(--accent);
  mix-blend-mode: normal;
}

.cursor-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bone);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s;
}

.cursor-ring.drag .cursor-label { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ─── Grain overlay ───────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.8'/></svg>");
}

/* ─── Reveal animation ────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-clip {
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition: opacity 0.05s, clip-path 1.4s var(--ease-smooth);
}
.reveal-clip.in {
  opacity: 1;
  clip-path: inset(0 0 0 0);
}

/* ─── Split-text character animation ──────────── */
.split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.15em);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.in .split-char {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-clip {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }
  .cursor-dot, .cursor-ring { display: none; }
  .grain { animation: none; }
}
