@import "tailwindcss";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300;1,9..40,400&family=Bebas+Neue&display=swap');

@custom-variant dark (&:is(.dark *));

@theme inline {
  --font-display: "Cormorant Garamond", ui-serif, Georgia, serif;
  --font-impact: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);

  /* Brand tokens */
  --color-bone: #F2EDE4;
  --color-ink: #1C1C1A;
  --color-dust-yellow: #D4A843;
  --color-clay: #C4714A;
  --color-sage: #7A8C72;
  --color-denim: #6B7FA3;
  --color-cream: #FAF7F2;
  --color-warm-gray: #9C9589;
}

:root {
  --radius: 0.25rem;
  --background: #F2EDE4;
  --foreground: #1C1C1A;
  --card: #FAF7F2;
  --card-foreground: #1C1C1A;
  --popover: #FAF7F2;
  --popover-foreground: #1C1C1A;
  --primary: #1C1C1A;
  --primary-foreground: #F2EDE4;
  --secondary: #FAF7F2;
  --secondary-foreground: #1C1C1A;
  --muted: #EDE8DF;
  --muted-foreground: #9C9589;
  --accent: #D4A843;
  --accent-foreground: #1C1C1A;
  --destructive: oklch(0.577 0.245 27.325);
  --border: rgba(28, 28, 26, 0.12);
  --input: rgba(28, 28, 26, 0.12);
  --ring: #D4A843;
  --chart-1: #D4A843;
  --chart-2: #C4714A;
  --chart-3: #7A8C72;
  --chart-4: #6B7FA3;
  --chart-5: #9C9589;
  --sidebar: #FAF7F2;
  --sidebar-foreground: #1C1C1A;
  --sidebar-primary: #1C1C1A;
  --sidebar-primary-foreground: #F2EDE4;
  --sidebar-accent: #EDE8DF;
  --sidebar-accent-foreground: #1C1C1A;
  --sidebar-border: rgba(28, 28, 26, 0.12);
  --sidebar-ring: #D4A843;
}

.dark {
  --background: #1C1C1A;
  --foreground: #F2EDE4;
  --card: #242421;
  --card-foreground: #F2EDE4;
  --popover: #242421;
  --popover-foreground: #F2EDE4;
  --primary: #F2EDE4;
  --primary-foreground: #1C1C1A;
  --secondary: #2A2A27;
  --secondary-foreground: #F2EDE4;
  --muted: #2A2A27;
  --muted-foreground: #9C9589;
  --accent: #D4A843;
  --accent-foreground: #1C1C1A;
  --destructive: oklch(0.704 0.191 22.216);
  --border: rgba(242, 237, 228, 0.1);
  --input: rgba(242, 237, 228, 0.12);
  --ring: #D4A843;
  --chart-1: #D4A843;
  --chart-2: #C4714A;
  --chart-3: #7A8C72;
  --chart-4: #6B7FA3;
  --chart-5: #9C9589;
  --sidebar: #242421;
  --sidebar-foreground: #F2EDE4;
  --sidebar-primary: #D4A843;
  --sidebar-primary-foreground: #1C1C1A;
  --sidebar-accent: #2A2A27;
  --sidebar-accent-foreground: #F2EDE4;
  --sidebar-border: rgba(242, 237, 228, 0.1);
  --sidebar-ring: #D4A843;
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
    font-family: var(--font-body);
  }
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
  }
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* Marquee animation */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.333%); }
}
.animate-marquee {
  animation: marquee 20s linear infinite;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #9C9589; border-radius: 2px; }

/* Selection */
::selection { background: #D4A843; color: #1C1C1A; }
