/* ═══════════════════════════════════════════════════════════════
   SIENA DESIGN SYSTEM — Colors & Type
   Inspired by the Italian city of Siena: bougainvillea cascading
   down ancient walls, Renaissance elegance, and timeless beauty.
   Lifted from: my-prototype/src/app/globals.css
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   FONTS — PP Editorial New (self-hosted) + Funnel Sans (Google)
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: "PP Editorial New";
  src: url("./fonts/PPEditorialNew-Ultralight.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Editorial New";
  src: url("./fonts/PPEditorialNew-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Editorial New";
  src: url("./fonts/PPEditorialNew-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "PP Editorial New";
  src: url("./fonts/PPEditorialNew-Ultrabold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Funnel Sans — body sans, loaded from Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Funnel+Sans:wght@300;400;500;600;700;800&display=swap");

:root {
  /* ─────────────────────────────────────────────────────────────
     FONT STACKS
     ───────────────────────────────────────────────────────────── */
  --font-display: "PP Editorial New", "EB Garamond", Georgia, serif;
  --font-sans: "Funnel Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ─────────────────────────────────────────────────────────────
     SEMANTIC COLORS — Light (Warm Cream)
     ───────────────────────────────────────────────────────────── */
  --background: #FAF8F5;    /* cream page bg */
  --foreground: #1A1A1A;    /* primary text (charcoal) */
  --card: #FFFFFF;
  --card-foreground: #1A1A1A;
  --popover: #FFFFFF;
  --popover-foreground: #1A1A1A;
  --primary: #9B4DAF;       /* bougainvillea purple — CTAs, links */
  --primary-foreground: #FFFFFF;
  --secondary: #F5F3F0;
  --secondary-foreground: #1A1A1A;
  --muted: #F5F3F0;
  --muted-foreground: #6B6560;  /* secondary text */
  --accent: #F0EDE8;
  --accent-foreground: #1A1A1A;
  --destructive: #B91C1C;
  --border: #E8E4DF;
  --input: #E8E4DF;
  --ring: #A8A29E;

  /* ─────────────────────────────────────────────────────────────
     SIENA BRAND PALETTE
     ───────────────────────────────────────────────────────────── */
  --siena-bougainvillea: #9B4DAF;       /* the primary */
  --siena-bougainvillea-dark: #7A3D8A;
  --siena-bougainvillea-light: #C77DDB;

  --siena-sage: #3D5A3F;                /* deep foliage green */
  --siena-sage-dark: #2D4530;
  --siena-sage-light: #5D7A5F;

  --siena-ochre: #B8860B;                /* warm gold */
  --siena-ochre-dark: #8B6508;
  --siena-ochre-light: #D4A84B;

  --siena-terracotta: #C45D35;           /* warm brick — enabled/active accents */
  --siena-terracotta-dark: #A44A28;
  --siena-terracotta-light: #E07A54;

  --siena-sky: #4A90C4;                  /* Tuscan sky — binary ON states */
  --siena-sky-dark: #3875A0;
  --siena-sky-light: #70B2D8;

  --siena-chocolate: #7B5115;            /* earthy */
  --siena-chocolate-dark: #5C3D10;
  --siena-chocolate-light: #A67B3D;

  --siena-tuscan-stone: #C4B5A0;         /* warm beige — data viz neutral */
  --siena-tuscan-stone-dark: #A89A86;
  --siena-tuscan-stone-light: #D4C8B8;

  --siena-stone: #8B8680;
  --siena-cream: #FAF8F5;
  --siena-charcoal: #1A1A1A;
  --siena-beige: #EFE5D0;
  --siena-off-white: #F3F0EB;

  /* CSAT star — App Store style warm gold */
  --csat-star: #F5C842;

  /* ─────────────────────────────────────────────────────────────
     CHARTS — Mediterranean Palette
     ───────────────────────────────────────────────────────────── */
  --chart-1: #9B4DAF;   /* bougainvillea */
  --chart-2: #3D5A3F;   /* sage */
  --chart-3: #4A90C4;   /* sky */
  --chart-4: #C4B5A0;   /* stone */
  --chart-5: #C77DDB;   /* bougainvillea light */

  /* ─────────────────────────────────────────────────────────────
     RADII
     ───────────────────────────────────────────────────────────── */
  --radius-sm: 0.375rem;   /* 6px  */
  --radius-md: 0.5rem;     /* 8px  */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.25rem;   /* 20px */

  /* ─────────────────────────────────────────────────────────────
     SHADOWS — Warm tinted, soft, never harsh
     ───────────────────────────────────────────────────────────── */
  --shadow-color: 30 20% 20%;
  --shadow-soft:
    0 1px 2px hsl(var(--shadow-color) / 0.04),
    0 2px 4px hsl(var(--shadow-color) / 0.04),
    0 4px 8px hsl(var(--shadow-color) / 0.04);
  --shadow-medium:
    0 2px 4px hsl(var(--shadow-color) / 0.04),
    0 4px 8px hsl(var(--shadow-color) / 0.04),
    0 8px 16px hsl(var(--shadow-color) / 0.04),
    0 16px 32px hsl(var(--shadow-color) / 0.04);
  --shadow-large:
    0 4px 8px hsl(var(--shadow-color) / 0.04),
    0 8px 16px hsl(var(--shadow-color) / 0.04),
    0 16px 32px hsl(var(--shadow-color) / 0.04),
    0 32px 64px hsl(var(--shadow-color) / 0.06);

  /* ─────────────────────────────────────────────────────────────
     SPACING — 4px-based scale (Tailwind defaults)
     ───────────────────────────────────────────────────────────── */
  --space-1: 0.25rem;   /* 4px  */
  --space-2: 0.5rem;    /* 8px  */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
}

/* ─────────────────────────────────────────────────────────────
   DARK MODE — Warm charcoal (Siena at twilight)
   ───────────────────────────────────────────────────────────── */
.dark {
  --background: #1C1917;
  --foreground: #DDDCDB;
  --card: #302D2A;
  --card-foreground: #DDDCDB;
  --popover: #292524;
  --popover-foreground: #DDDCDB;
  --primary: #D4C5B5;               /* Tuscan stone — premium feel on dark */
  --primary-foreground: #1C1917;
  --secondary: #292524;
  --secondary-foreground: #DDDCDB;
  --muted: #44403C;
  --muted-foreground: #A8A29E;
  --accent: #44403C;
  --accent-foreground: #DDDCDB;
  --destructive: #EF4444;
  --border: #44403C;
  --input: #44403C;
  --ring: #78716C;

  --siena-bougainvillea: #C77DDB;
  --siena-sage: #6B9F6F;
  --siena-ochre: #D4A017;
  --siena-terracotta: #E07A54;
  --siena-sky: #6BB0D8;
}

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════ */

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "ss02", "cv01";
  font-size: 15px;
  line-height: 1.5;
}

::selection {
  background-color: var(--siena-bougainvillea);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY — Type is the hero
   h1/h2 = serif (Editorial New); h3–h6 = sans; body = sans.
   Letter-spacing tightens as size grows.
   ═══════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 4.5rem);  /* 40→72px */
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 3.5vw, 3rem);    /* 32→48px */
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.5rem;                       /* 24px */
  line-height: 1.25;
}

h4 {
  font-family: var(--font-sans);
  font-size: 1.25rem;                      /* 20px */
  line-height: 1.3;
}

h5, h6 {
  font-family: var(--font-sans);
  font-size: 1.125rem;                     /* 18px */
  line-height: 1.35;
}

p {
  margin: 0;
  line-height: 1.5;
  text-wrap: pretty;
}

/* Intro / lead paragraphs */
.text-large {
  font-size: 1.125rem;                     /* 18px */
  line-height: 1.6;
  color: var(--muted-foreground);
}

/* Small-caps label */
.label {
  font-size: 0.75rem;                      /* 12px */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
}

/* Accent text */
.text-siena { color: var(--siena-bougainvillea); }
.text-terracotta { color: var(--siena-terracotta); }

/* Inline code */
code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.8125rem;                    /* 13px */
  background: var(--muted);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  background: var(--muted);
  padding: 1rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
}

strong, b { font-weight: 600; }
em, i { font-style: italic; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES — the common ones
   ═══════════════════════════════════════════════════════════════ */

.font-serif { font-family: var(--font-display); }
.font-sans  { font-family: var(--font-sans); }

.shadow-soft   { box-shadow: var(--shadow-soft); }
.shadow-medium { box-shadow: var(--shadow-medium); }
.shadow-large  { box-shadow: var(--shadow-large); }

.hover-lift { transition: transform 300ms ease-out, box-shadow 300ms ease-out; }
.hover-lift:hover { transform: translateY(-2px); }

.container-tight { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }
.container-wide  { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

.card-elevated {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 300ms ease;
}
.card-elevated:hover { box-shadow: var(--shadow-medium); }

/* Animated underline for links */
.link-underline { position: relative; }
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 300ms;
}
.link-underline:hover::after { width: 100%; }
