/*
 * VIVLA Foundations — tokens Web (Fase 1)
 * Fuente: Figma "Foundations" (k6g2ouYffkdxaGatajN4sz)
 * Los nombres de variable coinciden con las variables de Figma (var(--…)).
 */

/* ───────────── Primitivos de marca ───────────── */
:root {
  /* Terracota */
  --color-brand-terracota-base: #C14F21; /* manual de marca */
  --color-brand-terracota-120:  #A9461E; /* hover de marca */
  --color-brand-terracota-60:   #DA957A;
  --color-brand-terracota-30:   #ECCABC;

  /* Blue */
  --color-brand-blue-base: #0249DB; /* manual de marca */
  --color-brand-blue-60:   #6792E9;
  --color-brand-blue-30:   #B3C8F4;

  /* Black de marca */
  --color-brand-black-50:  #918885; /* tinte 50 % del negro: texto sobre fondo oscuro, uso puntual */

  /* Grey */
  --color-neutral-grey-base:  #E8E8E8; /* manual de marca */
  --color-neutral-grey-soft:  #EEEEEE; /* derivado · fondos, entre pure y base */
  --color-neutral-grey-dark:  #CCCCCC;
  --color-neutral-grey-pure:  #FFFFFF; /* derivado · texto sobre terracota */

  /* Black (negro cálido) */
  --color-neutral-black-base: #23100B; /* manual de marca */
  --color-neutral-black-80:   #463632; /* derivado · desactivado en oscuro (solo en la lámina, sin variable en Figma) */
  --color-neutral-black-60:   #706460; /* texto secundario */
  --color-neutral-black-30:   #867C79; /* bordes y separadores */

  /* Feedback */
  --color-feedback-red-base:   #DD2117; /* error */
  --color-feedback-red-60:     #EB7A74;
  --color-feedback-red-30:     #F5BCB9;
  --color-feedback-green-base: #047643; /* confirmación */
  --color-feedback-green-60:   #68AD8E;
  --color-feedback-green-30:   #B4D6C7;
}

/* ───────────── Semánticos · LIGHT (por defecto) ───────────── */
:root,
[data-theme="light"] {
  /* Surface (igual en los dos modos) */
  --surface-01: var(--color-neutral-black-base);     /* fondo oscuro de sección */
  --surface-02: var(--color-neutral-grey-pure);      /* fondo claro de sección y de tarjeta */
  --surface-03: var(--color-neutral-grey-base);      /* fondo hundido: campos, bloques en tarjeta */
  --surface-04: var(--color-neutral-grey-soft);      /* fondo claro de sección, entre 02 y 03 */
  --surface-05: var(--color-brand-terracota-base);   /* acento de marca: bandas y destacados */
  --surface-06: var(--color-brand-blue-base);        /* contexto informativo o técnico: datos financieros, uso puntual */

  /* Content */
  --content-primary:   var(--color-neutral-black-base);
  --content-secondary: var(--color-neutral-black-60);
  --content-tertiary:  var(--color-neutral-black-30);
  --content-inverse:   var(--color-neutral-grey-pure);
  --content-error:     var(--color-feedback-red-base);
  --content-brand:     var(--color-brand-terracota-base);
  --content-financial: var(--color-brand-blue-base);     /* dato financiero sobre gris claro, no cuerpo */
  --content-success:   var(--color-feedback-green-base);

  /* Border */
  --border-default: var(--color-neutral-black-30);
  --border-strong:  var(--color-neutral-black-base);
  --border-focus:   var(--color-brand-blue-base);
  --border-error:   var(--color-feedback-red-base);
  --border-subtle:  var(--color-neutral-grey-dark);

  /* Action */
  --action-primary-bg:         var(--color-neutral-black-base);
  --action-primary-bg-hover:   var(--color-neutral-black-60);
  --action-primary-text-hover: var(--color-neutral-grey-pure);
  --action-disabled-bg:        var(--color-neutral-grey-dark);
  --action-disabled-border:    var(--color-neutral-black-30);
  --action-disabled-text:      var(--color-neutral-black-30);
  --action-accent-bg:          var(--color-brand-terracota-base);
  --action-accent-bg-hover:    var(--color-brand-terracota-120);
  --action-accent-text:        var(--color-neutral-grey-pure);
  --action-accent-border-focus: var(--color-neutral-black-base);
}

/* ───────────── Semánticos · DARK (secciones sobre surface/01) ───────────── */
[data-theme="dark"] {
  --content-primary:   var(--color-neutral-grey-pure);
  --content-secondary: var(--color-neutral-grey-dark);
  --content-tertiary:  var(--color-neutral-black-60);
  --content-inverse:   var(--color-neutral-black-base);
  --content-error:     var(--color-feedback-red-60);
  --content-brand:     var(--color-brand-terracota-60);
  --content-financial: var(--color-brand-blue-60);
  --content-success:   var(--color-feedback-green-60);

  --border-default: var(--color-neutral-black-30);
  --border-strong:  var(--color-neutral-grey-pure);
  --border-focus:   var(--color-neutral-grey-pure);
  --border-error:   var(--color-feedback-red-60);
  --border-subtle:  var(--color-neutral-black-60);

  --action-primary-bg:         var(--color-neutral-grey-pure);
  --action-primary-bg-hover:   var(--color-neutral-black-60);
  --action-primary-text-hover: var(--color-neutral-grey-pure);
  --action-disabled-bg:        var(--color-neutral-grey-dark);
  --action-disabled-border:    var(--color-neutral-black-30);
  --action-disabled-text:      var(--color-neutral-black-60);
  --action-accent-bg:          var(--color-brand-terracota-base);
  --action-accent-bg-hover:    var(--color-brand-terracota-120);
  --action-accent-text:        var(--color-neutral-grey-pure);
  --action-accent-border-focus: var(--color-neutral-grey-pure);
}

/* ───────────── Tipografía ───────────── */
/* Archivos en assets/fonts/ del repo vivla-design. Las rutas asumen que esa carpeta
   se sirve en /fonts/; ajústalas a tu proyecto. */
@font-face {
  font-family: "PP Right Serif";
  src: url("/fonts/pp-right-serif/PPRightSerif-Medium.woff2") format("woff2"),
       url("/fonts/pp-right-serif/PPRightSerif-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans/InstrumentSans-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans/InstrumentSans-Italic-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Morning Memories Script";
  src: url("/fonts/morning-memories-script/MorningMemoriesScript.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-serif:  "PP Right Serif", Georgia, serif;          /* typography-01 · siempre 500 */
  --font-sans:   "Instrument Sans", system-ui, sans-serif;  /* typography-02 · 400 / 500 */
  --font-script: "Morning Memories Script", cursive;        /* typography-03 · 400 */

  /* typography-01 · PP Right Serif Medium */
  --typography-01-7xl-size: 124px; --typography-01-7xl-line-height: 110px;
  --typography-01-6xl-size: 72px;  --typography-01-6xl-line-height: 68px;
  --typography-01-5xl-size: 62px;  --typography-01-5xl-line-height: 60px;
  --typography-01-4xl-size: 56px;  --typography-01-4xl-line-height: 55px;
  --typography-01-3xl-size: 48px;  --typography-01-3xl-line-height: 48px;
  --typography-01-2xl-size: 40px;  --typography-01-2xl-line-height: 42px;
  --typography-01-xl-size:  32px;  --typography-01-xl-line-height:  34px;
  --typography-01-l-size:   24px;  --typography-01-l-line-height:   28px;

  /* typography-02 · Instrument Sans */
  --typography-02-xl-size: 24px; --typography-02-xl-line-height: 30px;
  --typography-02-l-size:  20px; --typography-02-l-line-height:  26px;
  --typography-02-m-size:  16px; --typography-02-m-line-height:  22px;
  --typography-02-s-size:  14px; --typography-02-s-line-height:  20px;
  --typography-02-xs-size: 12px; --typography-02-xs-line-height: 18px;

  /* typography-03 · Morning Memories Script */
  --typography-03-xl-size: 90px; /* line-height: normal */
  --typography-03-l-size:  56px; /* line-height: normal */
}

/* ───────────── Radios ───────────── */
:root {
  --radius-none: 0;      /* por defecto en todo: botones, campos, casillas, tags, tarjetas */
  --radius-full: 9999px; /* círculos y pastillas: icon button, radio, pill, chip, flecha del link arrow */
}

/* ───────────── Espaciado · base 4 ───────────── */
:root {
  --space-4xs: 4px;   /* padding de chip y tag */
  --space-3xs: 8px;   /* separación corta entre elementos */
  --space-2xs: 12px;  /* separación dentro de una ficha */
  --space-xs:  16px;  /* el más usado: padding de barra, separaciones generales, margen móvil */
  --space-s:   24px;  /* entre bloques dentro de una tarjeta */
  --space-m:   32px;  /* padding lateral del botón */
  --space-l:   40px;  /* margen de retícula escritorio, inset de tarjeta */
  --space-xl:  56px;  /* separación de contenido */
  --space-2xl: 64px;  /* respiración de sección en móvil */
  --space-3xl: 72px;  /* separación de contenido */
  --space-4xl: 80px;  /* separación de contenido */
  --space-5xl: 104px; /* respiración de sección en escritorio */
  --space-6xl: 208px; /* respiración ampliada (a sangre con imagen) */
}

/* ───────────── Retícula ───────────── */
:root {
  --grid-columns: 4;
  --grid-gutter: 20px;
  --grid-margin: var(--space-xs);   /* 16 */
  --section-padding: var(--space-2xl);        /* 64 */
  --section-padding-bleed: 128px;             /* 2× en móvil, a sangre */
}
@media (min-width: 1024px) {
  :root {
    --grid-columns: 12;
    --grid-margin: var(--space-l);  /* 40 */
    --section-padding: var(--space-5xl);       /* 104 */
    --section-padding-bleed: var(--space-6xl); /* 208 */
  }
}
