/* ============================================================
   Ferrari Design System — Tokens & Semantic Styles
   FerrariSans is licensed; Inter weight 500 is the substitute.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ---- BRAND & ACCENT ---- */
  --color-primary: #da291c;            /* Rosso Corsa */
  --color-primary-active: #b01e0a;
  --color-primary-hover: #9d2211;       /* documented, not used (no-hover policy) */
  --color-accent-yellow-hypersail: #fff200;
  --color-accent-yellow: #f6e500;

  /* ---- SURFACE ---- */
  --color-canvas: #181818;             /* near-black, slight warmth — never pure black */
  --color-canvas-elevated: #303030;
  --color-canvas-light: #ffffff;
  --color-surface-card: #303030;
  --color-surface-soft-light: #f7f7f7;
  --color-surface-strong-light: #ebebeb;

  /* ---- HAIRLINES ---- */
  --color-hairline: #303030;
  --color-hairline-on-light: #d2d2d2;
  --color-hairline-soft: #ebebeb;

  /* ---- TEXT ---- */
  --color-ink: #ffffff;
  --color-body: #969696;
  --color-body-strong: #ffffff;
  --color-body-on-light: #181818;
  --color-muted: #666666;
  --color-muted-soft: #8f8f8f;
  --color-on-primary: #ffffff;

  /* ---- SEMANTIC ---- */
  --color-semantic-info: #4c98b9;
  --color-semantic-success: #03904a;
  --color-semantic-warning: #f13a2c;

  /* ---- TYPOGRAPHY: FAMILY ---- */
  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  /* FerrariSans (licensed) — Inter weight 500 with -1% tracking is the open-source substitute. */

  /* ---- TYPOGRAPHY: SCALE ---- */
  --type-display-mega-size: 80px;
  --type-display-mega-line: 1.05;
  --type-display-mega-track: -1.6px;

  --type-display-xl-size: 56px;
  --type-display-xl-line: 1.1;
  --type-display-xl-track: -1.12px;

  --type-display-lg-size: 36px;
  --type-display-lg-line: 1.2;
  --type-display-lg-track: -0.36px;

  --type-display-md-size: 26px;
  --type-display-md-line: 1.5;
  --type-display-md-track: 0.195px;

  --type-title-md-size: 18px;
  --type-title-md-line: 1.2;
  --type-title-md-track: 0px;

  --type-title-sm-size: 16px;
  --type-title-sm-line: 1.4;
  --type-title-sm-track: 0.08px;

  --type-body-md-size: 14px;
  --type-body-md-line: 1.5;

  --type-body-sm-size: 13px;
  --type-body-sm-line: 1.5;

  --type-caption-size: 12px;
  --type-caption-line: 1.4;

  --type-caption-uppercase-size: 11px;
  --type-caption-uppercase-line: 1.4;
  --type-caption-uppercase-track: 1.1px;

  --type-button-size: 14px;
  --type-button-track: 1.4px;

  --type-nav-link-size: 13px;
  --type-nav-link-track: 0.65px;

  --type-number-display-size: 80px;
  --type-number-display-line: 1.0;
  --type-number-display-track: -1.6px;

  /* ---- SPACING ---- */
  --space-xxxs: 4px;
  --space-xxs: 8px;
  --space-xs: 16px;
  --space-sm: 24px;
  --space-md: 32px;
  --space-lg: 48px;
  --space-xl: 64px;
  --space-xxl: 96px;
  --space-super: 128px;

  /* ---- RADIUS ---- */
  --radius-none: 0px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* ---- ELEVATION ---- */
  --shadow-small: 0 4px 8px rgba(0,0,0,0.1);

  /* ---- DECORATIVE GRADIENTS ---- */
  --gradient-rosso: linear-gradient(180deg, #a00c01, #da291c 64%);
  --gradient-atmospheric: linear-gradient(180deg, #3c3c3c, #030303 64%);
  --gradient-hero-protect: linear-gradient(0deg, rgba(0,0,0,0.8), transparent 60%);

  /* ---- LAYOUT ---- */
  --container-max: 1280px;
  --nav-height: 64px;
}

/* ============================================================
   SEMANTIC STYLES — apply directly to elements
   ============================================================ */

html, body {
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* Display headings — weight 500, never bold */
h1, .t-display-mega {
  font-size: var(--type-display-mega-size);
  font-weight: 500;
  line-height: var(--type-display-mega-line);
  letter-spacing: var(--type-display-mega-track);
  margin: 0;
}
h2, .t-display-xl {
  font-size: var(--type-display-xl-size);
  font-weight: 500;
  line-height: var(--type-display-xl-line);
  letter-spacing: var(--type-display-xl-track);
  margin: 0;
}
h3, .t-display-lg {
  font-size: var(--type-display-lg-size);
  font-weight: 500;
  line-height: var(--type-display-lg-line);
  letter-spacing: var(--type-display-lg-track);
  margin: 0;
}
h4, .t-display-md {
  font-size: var(--type-display-md-size);
  font-weight: 500;
  line-height: var(--type-display-md-line);
  letter-spacing: var(--type-display-md-track);
  margin: 0;
}

.t-title-md  { font-size: var(--type-title-md-size); font-weight: 700; line-height: var(--type-title-md-line); }
.t-title-sm  { font-size: var(--type-title-sm-size); font-weight: 500; line-height: var(--type-title-sm-line); letter-spacing: var(--type-title-sm-track); }
.t-body-md   { font-size: var(--type-body-md-size); font-weight: 400; line-height: var(--type-body-md-line); }
.t-body-sm   { font-size: var(--type-body-sm-size); font-weight: 400; line-height: var(--type-body-sm-line); }
.t-caption   { font-size: var(--type-caption-size); font-weight: 400; line-height: var(--type-caption-line); }
.t-caption-uppercase {
  font-size: var(--type-caption-uppercase-size);
  font-weight: 600;
  line-height: var(--type-caption-uppercase-line);
  letter-spacing: var(--type-caption-uppercase-track);
  text-transform: uppercase;
}
.t-button {
  font-size: var(--type-button-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--type-button-track);
  text-transform: uppercase;
}
.t-nav-link {
  font-size: var(--type-nav-link-size);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: var(--type-nav-link-track);
  text-transform: uppercase;
}
.t-number-display {
  font-size: var(--type-number-display-size);
  font-weight: 700;
  line-height: var(--type-number-display-line);
  letter-spacing: var(--type-number-display-track);
  font-variant-numeric: tabular-nums;
}

/* Default body paragraph on dark canvas */
p {
  color: var(--color-body);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line);
  margin: 0;
}

/* On light editorial bands */
.on-light {
  background: var(--color-canvas-light);
  color: var(--color-body-on-light);
}
.on-light p { color: var(--color-body-on-light); }

/* Hairline dividers */
hr, .hairline {
  border: none;
  border-top: 1px solid var(--color-hairline);
  margin: 0;
}
.on-light hr, .hairline-on-light {
  border-top: 1px solid var(--color-hairline-on-light);
}

/* ============================================================
   COMPONENT PRIMITIVES
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxs);
  padding: 14px 32px;
  height: 48px;
  border: none;
  border-radius: var(--radius-none);
  font-family: var(--font-sans);
  font-size: var(--type-button-size);
  font-weight: 700;
  letter-spacing: var(--type-button-track);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.btn-primary-active {
  background: var(--color-primary-active);
  color: var(--color-on-primary);
}
.btn-outline-on-dark {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-ink);
}
.btn-outline-on-light {
  background: transparent;
  color: var(--color-body-on-light);
  border: 1px solid var(--color-body-on-light);
}
.btn-tertiary-text {
  background: transparent;
  color: var(--color-ink);
  padding: 0;
  height: auto;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xxxs) var(--space-xs);
  background: var(--color-canvas-elevated);
  color: var(--color-ink);
  font-size: var(--type-caption-uppercase-size);
  font-weight: 600;
  letter-spacing: var(--type-caption-uppercase-track);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 14px 16px;
  background: var(--color-canvas);
  color: var(--color-ink);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--type-body-md-size);
  box-sizing: border-box;
  outline: none;
}
.input:focus {
  border-color: var(--color-accent-yellow);
  outline: 2px solid var(--color-accent-yellow);
  outline-offset: -2px;
}
.input.on-light {
  background: var(--color-canvas-light);
  color: var(--color-body-on-light);
  border-color: var(--color-hairline-on-light);
}

.card {
  background: var(--color-canvas);
  color: var(--color-ink);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-none);
}
.card-elevated {
  background: var(--color-canvas-elevated);
}
.card-light {
  background: var(--color-canvas-light);
  color: var(--color-body-on-light);
  border-color: var(--color-hairline-on-light);
}

/* Focus ring is the global yellow */
*:focus-visible {
  outline: 2px solid var(--color-accent-yellow);
  outline-offset: 2px;
}
