/* One stylesheet request for every Google family the app uses (DM Sans body,
   Cormorant Garamond display, Jost for the proposal's small caps) — three chained
   @imports here used to hold up the first paint. */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Jost:wght@300;400;500&display=swap');

@font-face {
  font-family: 'Eyesome Script';
  src: url('/assets/fonts/Eyesome-Script.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Eyesome Script';
  src: url('/assets/fonts/Eyesome-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: #D1C7BB;
  --foreground: #252620;
  --card: #E8E3DB;
  --card-foreground: #252620;
  --popover: #E8E3DB;
  --popover-foreground: #252620;
  --primary: #252620;
  --primary-foreground: #F5F3EF;
  --secondary: #D8D0C5;
  --secondary-foreground: #876553;
  --muted: #D1C7BB;
  --muted-foreground: #876553;
  --accent: #D8D0C5;
  --accent-foreground: #252620;
  --destructive: oklch(0.55 0.19 25);
  --destructive-foreground: oklch(0.98 0.01 80);
  --border: #9D978D;
  --input: #9D978D;
  --ring: #746553;
  --success: oklch(0.56 0.1 145);
  --warning: oklch(0.72 0.13 75);
  --chart-1: #746553;
  --chart-2: #876553;
  --chart-3: #252620;
  --chart-4: oklch(0.68 0.08 70);
  --chart-5: oklch(0.85 0.04 40);
  --sidebar: #E8E3DB;
  --sidebar-foreground: #252620;
  --sidebar-primary: #252620;
  --sidebar-primary-foreground: #F5F3EF;
  --sidebar-accent: #D8D0C5;
  --sidebar-accent-foreground: #252620;
  --sidebar-border: #9D978D;
  --sidebar-ring: #746553;

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: #F2ECE4;
  --surface-hover:   color-mix(in srgb, var(--foreground) 5%,  var(--background));
  --surface-active:  color-mix(in srgb, var(--foreground) 9%, var(--background));
  --surface-elevated: #FFFFFF;

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: #B7AFA4;
  --border-muted: #ABA499;
  --border-strong: #847F75;

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: #42392F;

  /* ── primary depth (hover/tint states for brand colour) ─────── */
  --primary-hover: color-mix(in srgb, var(--primary) 88%, var(--foreground));
  --primary-muted: color-mix(in srgb, var(--primary) 16%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 9%,  var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 5%,  var(--background));

  /* ── focus ring (alpha-blended, for soft ring style) ────────── */
  --focus-ring: oklch(0.516 0.033 72.1 / 0.35);

  /* ── error (form validation — distinct from destructive) ─────── */
  --error: oklch(0.55 0.19 25);
  --error-foreground: oklch(0.98 0.01 80);

  /* ── radius ───────────────────────────────────────────────────── */
  --radius: 0.25rem;
  --radius-none: 0rem;
  --radius-sm: 0.125rem;
  --radius-lg: 0.375rem;
  --radius-xl: 0.5rem;
  --radius-full: 9999px;

  /* ── typography ───────────────────────────────────────────────── */
  --font-display: Fraunces, 'Iowan Old Style', Georgia, ui-serif, serif;
  --font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --font-weight-display: 400;
  --line-height-display: 1.1;
  --tracking-display: -0.015em;
  --font-weight-body: 400;
  --line-height-body: 1.55;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── shadows ──────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 1px rgba(60, 40, 20, 0.04);
  --shadow-md: 0 2px 8px rgba(60, 40, 20, 0.06);
  --shadow-lg: 0 8px 24px rgba(60, 40, 20, 0.08);

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 120ms;
  --duration-normal: 220ms;
  --duration-slow: 360ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ──────────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}

.dark {
  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: oklch(0.19 0.012 50);
  --foreground: oklch(0.95 0.012 80);
  --card: oklch(0.225 0.014 50);
  --card-foreground: oklch(0.95 0.012 80);
  --popover: oklch(0.225 0.014 50);
  --popover-foreground: oklch(0.95 0.012 80);
  --primary: oklch(0.72 0.1 38);
  --primary-foreground: oklch(0.18 0.02 45);
  --secondary: oklch(0.28 0.015 50);
  --secondary-foreground: oklch(0.95 0.012 80);
  --muted: oklch(0.28 0.015 50);
  --muted-foreground: oklch(0.68 0.02 60);
  --accent: oklch(0.29 0.018 45);
  --accent-foreground: oklch(0.95 0.012 80);
  --destructive: oklch(0.68 0.16 25);
  --destructive-foreground: oklch(0.98 0.01 80);
  --border: oklch(1 0.01 80 / 11%);
  --input: oklch(1 0.01 80 / 15%);
  --ring: oklch(0.72 0.1 38);
  --success: oklch(0.7 0.1 145);
  --warning: oklch(0.8 0.12 75);
  --chart-1: oklch(0.72 0.1 38);
  --chart-2: oklch(0.8 0.07 20);
  --chart-3: oklch(0.6 0.05 45);
  --chart-4: oklch(0.75 0.08 70);
  --chart-5: oklch(0.45 0.04 40);
  --sidebar: oklch(0.17 0.012 50);
  --sidebar-foreground: oklch(0.95 0.012 80);
  --sidebar-primary: oklch(0.72 0.1 38);
  --sidebar-primary-foreground: oklch(0.18 0.02 45);
  --sidebar-accent: oklch(0.27 0.015 50);
  --sidebar-accent-foreground: oklch(0.95 0.012 80);
  --sidebar-border: oklch(1 0.01 80 / 11%);
  --sidebar-ring: oklch(0.72 0.1 38);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.215 0.013 50);
  --surface-elevated: oklch(0.27 0.015 50);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(1 0.01 80 / 6%);
  --border-muted: oklch(1 0.01 80 / 8%);
  --border-strong: oklch(1 0.01 80 / 22%);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.78 0.015 70);

  /* ── primary depth ────────────────────────────────────────────── */
  --primary-tint: color-mix(in srgb, var(--primary) 8%, var(--background));

  /* ── focus ring ───────────────────────────────────────────────── */
  --focus-ring: oklch(0.72 0.1 38 / 0.45);

  /* ── error ────────────────────────────────────────────────────── */
  --error: oklch(0.68 0.16 25);
  --error-foreground: oklch(0.98 0.01 80);
}

/* Stencil Tweaks — editorial luxury, LIGHT-dominant: a warm-taupe canvas is the
   dominant read, and near-black (#252620) is kept as a sparing accent — buttons,
   DarkPanel insets, and opt-in .section-dark bands — rather than the backdrop.
   This is the canvas the design primitives in design.tsx were built for (DarkPanel
   is "the one dark surface, inset on the taupe canvas"). The base :root above
   already defines the warm-taupe light palette; this block only layers the
   editorial identity on top — Cormorant display, olive-brown accent, flat planes —
   and sets near-black as --primary so every accent reads near-black while the
   taupe canvas stays dominant.
   The client-facing proposal presentation is pinned to its own light canvas in
   proposal-presentation.tsx and is unaffected. */
:root {
  /* near-black primary — buttons, DarkPanel insets, deliberate dark accents. The
     taupe canvas (base --background) stays the dominant read; near-black is the
     punctuation, not the page. The primary-tint/soft/muted ladder in the base
     :root is defined as color-mix against --primary, so it follows this near-black
     automatically (faint warm-grey tints on taupe). */
  --primary: #252620;
  --primary-foreground: #F5F3EF;
  --primary-hover: #4C4D48;

  /* olive-brown accent — micro-labels, stars, script flourishes; deep enough
     to stay legible against the taupe canvas. */
  --gold: #746553;

  /* focus */
  --ring: #746553;
  --focus-ring: oklch(0.516 0.033 72.1 / 0.35);

  /* editorial type + flat planes */
  --radius: 0.125rem;
  --font-display: 'Cormorant Garamond', serif;
  --font-script: 'Eyesome Script', cursive;
  --font-weight-display: 300;
}

/* Contrasting light band — the deliberate breaks in an otherwise dark app.
   Re-declares the semantic tokens to the warm-ivory palette *within its own
   subtree only*, so any screen or section that opts in flips to charcoal ink on
   ivory without touching a single component. Charcoal stays the dominant read;
   this is the exception used sparingly for rhythm. */
.section-light {
  --background: #FAF8F4;
  --background-secondary: #F2ECE4;
  --card: #E8E3DB;
  --card-foreground: #252620;
  --popover: #E8E3DB;
  --popover-foreground: #252620;
  --surface-elevated: #FFFFFF;
  --muted: #D1C7BB;
  --secondary: #D8D0C5;
  --secondary-foreground: #876553;
  --accent: #D8D0C5;
  --accent-foreground: #252620;

  --foreground: #252620;
  --foreground-secondary: #42392F;
  --muted-foreground: #876553;

  --border: #9D978D;
  --border-subtle: #B7AFA4;
  --border-muted: #ABA499;
  --border-strong: #847F75;
  --input: #9D978D;

  /* olive-brown accent, legible on the taupe canvas */
  --gold: #746553;
  color: var(--foreground);
}

/* Contrasting warm band — the deliberate #3A3534 breaks. Mirrors .section-light
   but stays dark: re-declares the surface tokens to the warm charcoal-brown family
   within its own subtree only, so any full-width section that opts in reads as a
   lifted warm band against the deeper canvas — cream text and champagne accent
   kept, no component changes. Reuse this for a warm band; don't hand-roll one. */
.section-dark {
  --background: #252620;
  --background-secondary: #32332D;
  --card: #3B3C36;                              /* cards lift inside the warm band */
  --card-foreground: #F5F3EF;
  --popover: #3B3C36;
  --popover-foreground: #F5F3EF;
  --surface-elevated: #44443F;
  --muted: #32332D;
  --secondary: #363732;
  --secondary-foreground: #F5F3EF;
  --accent: #363732;
  --accent-foreground: #F5F3EF;

  /* off-white text + light-alpha borders, self-contained so the band reads
     correctly against the light default canvas (it no longer inherits a dark
     foreground). */
  --foreground: #F5F3EF;
  --foreground-secondary: #DAD0C8;
  --muted-foreground: #CFC1B8;
  --border: oklch(0.965 0.006 84.6 / 0.14);
  --border-subtle: oklch(0.965 0.006 84.6 / 0.08);
  --border-muted: oklch(0.965 0.006 84.6 / 0.10);
  --border-strong: oklch(0.965 0.006 84.6 / 0.26);
  --input: oklch(0.965 0.006 84.6 / 0.16);

  /* lightened olive-brown accent, legible on near-black */
  --gold: #9D9285;
  color: var(--foreground);
}

/* /Stencil Tweaks */

/* Charcoal panel — a self-contained dark fill for a handful of dashboard boxes
   (recent proposals / packages / testimonials) that the app builder asked to
   stand out from the near-white canvas. Layers on top of .section-light,
   mirroring .section-dark's full token re-declaration (not just the card
   fill) so the row text, icons, dividers and the gold accent all read
   correctly against charcoal rather than inheriting the light-canvas shades.
   #252620 is the one true charcoal this app already uses everywhere else —
   LIGHT_CANVAS in editorial.tsx (shared by the public proposal page and the
   marketing landing page's charcoal bands). #2C3027 was a different,
   more green-tinted value and is not used anywhere else in the app. */
.panel-charcoal {
  --card: #252620;
  --card-foreground: #F7F4F0;
  --popover: #252620;
  --popover-foreground: #F7F4F0;

  --foreground: #F7F4F0;
  --foreground-secondary: #D8D3C8;
  --muted-foreground: #B4AD9F;

  --border: oklch(0.92 0.02 95 / 0.16);
  --border-subtle: oklch(0.92 0.02 95 / 0.08);
  --border-muted: oklch(0.92 0.02 95 / 0.1);
  --border-strong: oklch(0.92 0.02 95 / 0.28);

  /* lightened champagne accent, legible on charcoal */
  --gold: #C7B89C;
  color: var(--foreground);
}

/* Stencil Tweaks */
:root:not(.dark) {
  --background: #FAF8F4;
  --primary: #2C3027;
}
:root {
  --font-weight-display: 600;
  --radius: 0.5rem;
}
/* /Stencil Tweaks */