/* ============================================================
   CORONEL DESIGN — DESIGN TOKENS
   Mirrors the Figma collections: Theme, Typography, Space, Layout.
   Color values resolved from the Theme collection (Light / Dark modes),
   which alias the primitive ramps: teal, terracotta, orange, neutral, blue.
   Single source of truth. Change a value here, not in a component.
   ============================================================ */

:root {
  /* ---------- THEME / LIGHT ----------
     Resolved straight from the Figma Theme collection. */
  --bg-primary:             #f4efe7;
  --bg-secondary:           #faf8f4;
  --bg-tertiary:            #e5d8c8;
  --bg-inverse:             #13201f;

  --surface-default:        #ffffff;
  --surface-elevated:       #faf8f4;
  --surface-overlay:        #f4efe7;
  --surface-card1:          #faf8f4;
  --surface-card2:          #ddeae7;
  --surface-card3:          #f1e5c6;

  --content-primary:        #33231e;
  --content-secondary:      #5b4339;
  --content-tertiary:       #895e48;
  --content-subtle:         #b28662;
  --content-inverse:        #faf8f4;
  --content-link:           #b6654c;
  --content-accent:         #ce5028;

  --border-default:         #e5d8c8;
  --border-subtle:          #f4efe7;
  --border-strong:          #c4a587;

  --brand-primary:          #b6654c;
  --brand-secondary:        #cb7f68;
  --brand-accent:           #ce5028;

  --interactive-default:    #b6654c;
  --interactive-hover:      #98523d;
  --interactive-active:     #7f4635;
  --interactive-disabled:   #cb7f68;
  /* The disabled variants paint this at 50%. Kept as a token so
     the three hierarchies cannot drift apart. */
  --interactive-disabled-50: color-mix(in srgb, var(--interactive-disabled) 50%, transparent);

  --status-success:         #3d645f;
  --status-success-subtle:  #ddeae7;
  --status-warning:         #bb7c35;
  --status-warning-subtle:  #f1e5c6;
  --status-info:            #415e88;
  --status-info-subtle:     #eaedf4;
  --status-error:           #ce2222;
  --status-error-subtle:    #fecaca;

  --shadow-color:          38 20 10;   /* #26140a as RGB channels */
  --shadow-sm: 2px 2px 24px rgb(var(--shadow-color) / 0.06);
  --shadow-md: 4px 4px 32px rgb(var(--shadow-color) / 0.08);

  /* ---------- TYPOGRAPHY / FAMILIES ---------- */
  --font-mono:  "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;

  /* Tracking — Figma uses 0 on every text style; the only overrides
     in the design are 6% on section labels and 8% on index numerals. */
  --ls-none:  0;
  --ls-label: 0.06em;
  --ls-num:   0.08em;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* ---------- TYPOGRAPHY / MOBILE (default) ----------
     Every size and line-height lands on the 4pt grid.        */
  --fs-display:  40px;  --lh-display:  48px;
  --fs-title-1:  32px;  --lh-title-1:  40px;
  --fs-title-2:  24px;  --lh-title-2:  32px;
  --fs-title-3:  20px;  --lh-title-3:  28px;
  --fs-body:     16px;  --lh-body:     24px;
  --fs-callout:  14px;  --lh-callout:  20px;
  --fs-caption:  12px;  --lh-caption:  20px;
  --fs-footnote: 10px;  --lh-footnote: 16px;
  --fs-map:       8px;  --lh-map:      12px;

  /* ---------- SPACE ---------- */
  --space-4:   4px;   --space-8:   8px;   --space-12: 12px;
  --space-16: 16px;   --space-20: 20px;   --space-24: 24px;
  --space-32: 32px;   --space-40: 40px;   --space-56: 56px;
  --space-64: 64px;   --space-80: 80px;   --space-120: 120px;

  /* Steps with the breakpoint in Figma: 16 on mobile, 24 on tablet, 32 on
     desktop. Pinned at 32 it made every mobile card twice as round. */
  --radius-default: 32px;
  --radius-card:     8px;
  --radius-sm:       8px;

  /* ---------- LAYOUT ----------
     Imported from the Figma "Layout" collection (modes Mobile / Tablet /
     Desktop). Names map 1:1 to the variables there.

     Two deliberate departures, both documented below:
     layout/content and layout/bleed are used as CAPS rather than fixed
     widths, and margin/page is interpolated between its pinned values
     instead of stepped. */

  /* margin/page — 20 / 40 / 120.
     Interpolated 20 -> 40 across 375 -> 768 rather than stepped, because a
     step makes the column NARROWER as the viewport gets WIDER: at 767 the
     inset would be 20 and the column 727, at 768 the inset 40 and the
     column 688. The slope hits both of Figma's pinned values exactly. */
  --margin-page:         clamp(20px, 4vw, 40px);

  /* layout/content and layout/bleed are 335 / 375 at Mobile mode, but those
     are DERIVED from margin/page on a 375 canvas (375 - 40 = 335), not
     independent widths — the tablet pair proves it, where the collection
     still says 704 while every tablet frame in the file draws 688 (768 - 80).
     Used literally as max-widths they freeze the column: at a 600px viewport
     the text stayed 335 wide with 132px of dead margin a side. So below the
     desktop mode there is no cap and the margin alone decides. */
  --layout-content:     335px;
  --layout-bleed:       375px;
  --layout-col-narrow:  335px;
  --layout-col-wide:    335px;
  --layout-measure:     335px;
  --layout-gutter:        0px;
  --layout-gutter-pair:  16px;

  /* padding/section and padding/section-lg — the home and the case study
     respectively. */
  --padding-section:     40px;
  --padding-section-lg:  32px;

  /* The padding and gap ramps, straight from the collection. */
  --padding-sm:           8px;
  --padding-md:          16px;
  --padding-lg:          20px;
  --padding-xl:          24px;
  --padding-xxl:         40px;
  --gap-sm:               8px;
  --gap-md:              16px;
  --gap-lg:              20px;
  --gap-xl:              24px;
  --card-padding:        12px;
  --card-relates:       240px;
  --card-testimonials:  280px;

  /* Background grid module. 120 in the design; on small screens a
     120px cell leaves barely three columns, so it halves. */
  --grid-module:         60px;
  /* The field draws its rules in border/default behind a layer at 80%.
     The nav and the open panel are opaque, so they cannot use layer
     opacity without fading their own contents — they bake the same result
     into the line colour instead. One token, so the two can never drift
     out of step. */
  --grid-line: color-mix(in srgb, var(--border-default) 80%, var(--bg-primary));

  /* The header is fixed, so its height is what the page is offset by
     and what every sticky element and anchor measures from. */
  --nav-h:               56px;
  /* The header insets only on the left; the control cells run to the
     right edge. Not the same as --margin-page at tablet. */
  --nav-pad:             20px;

  /* ---------- MOTION ----------
     Values from Spec_Animaciones_Build.md §0. */
  --dur-fast:   180ms;   /* hover, focus, tap */
  --dur-base:   420ms;   /* element entrances */
  --dur-slow:   700ms;   /* section entrances */
  --ease-out:   cubic-bezier(.22, .61, .36, 1);   /* almost everything */
  --ease-snap:  cubic-bezier(.16, .84, .44, 1);   /* dealing the cards */
  --stagger:     80ms;   /* between siblings */
}

/* ---------- TABLET ---------- */
@media (min-width: 768px) {
  :root {
    --fs-display:  56px;  --lh-display:  64px;
    --fs-title-1:  40px;  --lh-title-1:  48px;
    --fs-title-2:  32px;  --lh-title-2:  40px;
    --fs-title-3:  24px;  --lh-title-3:  32px;
    --fs-body:     16px;  --lh-body:     28px;
    --fs-callout:  14px;  --lh-callout:  24px;
    --fs-caption:  12px;  --lh-caption:  20px;
    --fs-footnote: 10px;  --lh-footnote: 20px;
    --lh-map:      16px;

    /* Still uncapped — the 40px inset gives Figma's 688 at 768 exactly,
       and keeps growing from there instead of freezing at 704. */
    --layout-measure:     640px;
    --layout-gutter:       40px;
    --layout-gutter-pair:  24px;
    --layout-content:     704px;
    --layout-col-narrow:  704px;
    --layout-col-wide:    704px;
    --layout-bleed:       768px;
    --padding-section:     56px;
    --padding-section-lg:  64px;
    --padding-sm:          12px;
    --padding-md:          24px;
    --padding-lg:          32px;
    --padding-xl:          36px;
    --padding-xxl:         56px;
    --gap-sm:              12px;
    --gap-md:              24px;
    --gap-lg:              32px;
    --gap-xl:              36px;
    --card-padding:        16px;
    --card-relates:       280px;
    --card-testimonials:  320px;
    --radius-card:         16px;
    --grid-module:        120px;
    --nav-h:               80px;
    --nav-pad:             40px;
  }
}

/* ---------- DESKTOP ---------- */
@media (min-width: 1024px) {
  :root {
    --fs-display:  64px;  --lh-display:  72px;
    --fs-title-1:  44px;  --lh-title-1:  52px;
    --fs-title-2:  36px;  --lh-title-2:  44px;
    --fs-title-3:  28px;  --lh-title-3:  36px;
    --fs-body:     16px;  --lh-body:     28px;
    --fs-callout:  16px;  --lh-callout:  24px;
    --fs-caption:  14px;  --lh-caption:  20px;
    --fs-footnote: 12px;  --lh-footnote: 20px;

    /* The two caps Figma pins at 1440: the case study's column is 1024
       (leaving 208 a side) and the home's is 1200 (leaving 120). The old
       clamp(880px, 66vw, 1024px) only reached 1024 at a 1552px viewport,
       so at 1440 — the width the file is drawn at — the case study came
       out 950 wide instead of 1024. */
    --layout-content:    clamp(880px, 66vw, 1024px);
    --layout-bleed:      1200px;
    --padding-section-lg:  64px;
    --padding-sm:          16px;
    --padding-md:          32px;
    --padding-lg:          40px;
    --padding-xl:          64px;
    --padding-xxl:         64px;
    --gap-sm:              16px;
    --gap-md:              32px;
    --gap-lg:              40px;
    --gap-xl:              64px;
    --card-padding:        20px;
    --card-relates:       360px;
    --card-testimonials:  360px;
    --layout-col-narrow:  304px;
    --layout-col-wide:    640px;
    --layout-measure:     640px;
    --layout-gutter:       80px;
    --layout-gutter-pair:  40px;
    --padding-section:     80px;
    --radius-card:         24px;
    --nav-h:               96px;
    --nav-pad:              0px;
  }
}

/* ---------- THEME / DARK ----------
   Navy base with warm terracotta accents — not a desaturated
   inversion of the light theme. Values resolved from Figma. */
/* Dark palette. Applied by the OS preference OR by the manual
   toggle (data-theme on <html>), which wins over the OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary:             #2b394f;
    --bg-secondary:           #1d2534;
    --bg-tertiary:            #2f415d;
    --bg-inverse:             #faf8f4;

    --surface-default:        #2f415d;
    --surface-elevated:       #354b6f;
    --surface-overlay:        #415e88;
    --surface-card1:          #354b6f;
    --surface-card2:          #2f415d;
    --surface-card3:          #34514e;

    --content-primary:        #faf8f4;
    --content-secondary:      #f4efe7;
    --content-tertiary:       #a5b9d4;
    --content-subtle:         #5477a3;
    --content-inverse:        #33231e;
    --content-link:           #dc9f8d;
    --content-accent:         #e28655;

    --border-default:         #415e88;
    --border-subtle:          #354b6f;
    --border-strong:          #7392ba;

    --brand-primary:          #cb7f68;
    --brand-secondary:        #dc9f8d;
    --brand-accent:           #e28655;

    --interactive-default:    #cb7f68;
    --interactive-hover:      #dc9f8d;
    --interactive-active:     #b6654c;
    --interactive-disabled:   #5477a3;
    --interactive-disabled-50: color-mix(in srgb, var(--interactive-disabled) 50%, transparent);

    --status-success:         #90b8b1;
    --status-success-subtle:  #283937;
    --status-warning:         #ebb086;
    --status-warning-subtle:  #6e2c20;
    --status-info:            #a5b9d4;
    --status-info-subtle:     #2b394f;
    --status-error:           #fca5a5;
    --status-error-subtle:    #7f1d1d;

    --shadow-color:          0 0 0;
    --shadow-sm: 2px 2px 24px rgb(var(--shadow-color) / 0.35);
    --shadow-md: 4px 4px 32px rgb(var(--shadow-color) / 0.45);
  }
}

:root[data-theme="dark"] {
    --bg-primary:             #2b394f;
    --bg-secondary:           #1d2534;
    --bg-tertiary:            #2f415d;
    --bg-inverse:             #faf8f4;

    --surface-default:        #2f415d;
    --surface-elevated:       #354b6f;
    --surface-overlay:        #415e88;
    --surface-card1:          #354b6f;
    --surface-card2:          #2f415d;
    --surface-card3:          #34514e;

    --content-primary:        #faf8f4;
    --content-secondary:      #f4efe7;
    --content-tertiary:       #a5b9d4;
    --content-subtle:         #5477a3;
    --content-inverse:        #33231e;
    --content-link:           #dc9f8d;
    --content-accent:         #e28655;

    --border-default:         #415e88;
    --border-subtle:          #354b6f;
    --border-strong:          #7392ba;

    --brand-primary:          #cb7f68;
    --brand-secondary:        #dc9f8d;
    --brand-accent:           #e28655;

    --interactive-default:    #cb7f68;
    --interactive-hover:      #dc9f8d;
    --interactive-active:     #b6654c;
    --interactive-disabled:   #5477a3;
    --interactive-disabled-50: color-mix(in srgb, var(--interactive-disabled) 50%, transparent);

    --status-success:         #90b8b1;
    --status-success-subtle:  #283937;
    --status-warning:         #ebb086;
    --status-warning-subtle:  #6e2c20;
    --status-info:            #a5b9d4;
    --status-info-subtle:     #2b394f;
    --status-error:           #fca5a5;
    --status-error-subtle:    #7f1d1d;

    --shadow-color:          0 0 0;
    --shadow-sm: 2px 2px 24px rgb(var(--shadow-color) / 0.35);
    --shadow-md: 4px 4px 32px rgb(var(--shadow-color) / 0.45);
  }

/* ============================================================
   PROPUESTA DE CONTRASTE — no está en Figma
   ------------------------------------------------------------
   Mueve solo la rampa interactive. Tus valores dejan el label de
   los botones por debajo del mínimo sobre las superficies de card:

     claro   4.00 / 3.43 / 3.38  →  necesita 4.5
     oscuro  2.84 / 3.33 / 2.78  →  ni llega al 3.0 de texto grande

   Conserva el tono y sube la saturación a la par que la
   luminosidad, para que el terracota no se vuelva pastel al
   aclararlo. El orden de la rampa se mantiene: hover y active
   siguen separándose del default en la misma dirección.

   BORRA ESTE BLOQUE ENTERO para volver a Figma.
   ============================================================ */
:root {
  --interactive-default:  #9c523b;   /* era #b6654c — 5.37 / 4.61 / 4.55 */
  --interactive-hover:    #874734;   /* era #98523d */
  --interactive-active:   #703d2d;   /* era #7f4635 */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --interactive-default: #e8b09f;  /* era #cb7f68 — 4.67 / 5.48 / 4.58 */
    --interactive-hover:   #f0c8bc;  /* era #dc9f8d */
    --interactive-active:  #d7927d;  /* era #b6654c */
  }
}
:root[data-theme="dark"] {
  --interactive-default: #e8b09f;
  --interactive-hover:   #f0c8bc;
  --interactive-active:  #d7927d;
}
