/* ==========================================================================
   Fluid Palette - Art Studio | Material Design 3 (M3) Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Material 3 Light Color Roles (Art / Watercolor Palette Theme) */
  --md-sys-color-primary: #a85d36;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #ffdbcd;
  --md-sys-color-on-primary-container: #360f00;
  
  --md-sys-color-secondary: #77574b;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #ffdbcd;
  --md-sys-color-on-secondary-container: #2c160d;

  --md-sys-color-tertiary: #2563eb;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #dbeafe;
  --md-sys-color-on-tertiary-container: #1e3a8a;

  --md-sys-color-background: #fdf8f6;
  --md-sys-color-on-background: #231915;
  --md-sys-color-surface: #fdf8f6;
  --md-sys-color-on-surface: #231915;
  --md-sys-color-surface-variant: #f5ded5;
  --md-sys-color-on-surface-variant: #53433e;
  
  --md-sys-color-surface-container-low: #faf2ef;
  --md-sys-color-surface-container: #f4ece8;
  --md-sys-color-surface-container-high: #efe6e2;
  --md-sys-color-surface-container-highest: #e9e0dc;

  --md-sys-color-outline: #85736d;
  --md-sys-color-outline-variant: #d8c2bb;
  --md-sys-color-scrim: rgba(0, 0, 0, 0.45);

  /* Legacy Mapping for Perfect Compatibility */
  --bg-primary: var(--md-sys-color-background);
  --bg-secondary: var(--md-sys-color-surface-container);
  --bg-card: var(--md-sys-color-surface-container-low);
  --bg-header: rgba(253, 248, 246, 0.92);
  --text-main: var(--md-sys-color-on-surface);
  --text-muted: var(--md-sys-color-on-surface-variant);
  --text-light: #85736d;
  --accent-primary: var(--md-sys-color-primary);
  --accent-secondary: var(--md-sys-color-tertiary);
  --border-subtle: var(--md-sys-color-outline-variant);

  /* Typography Scale */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Material 3 Elevations */
  --md-elevation-0: none;
  --md-elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.12);
  --md-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.10), 0 1px 2px 0 rgba(0, 0, 0, 0.14);
  --md-elevation-3: 0 4px 12px 3px rgba(0, 0, 0, 0.12), 0 1px 3px 0 rgba(0, 0, 0, 0.16);
  --md-elevation-4: 0 6px 16px 4px rgba(0, 0, 0, 0.14), 0 2px 4px 0 rgba(0, 0, 0, 0.18);
  --md-elevation-5: 0 8px 24px 6px rgba(0, 0, 0, 0.16), 0 4px 8px 0 rgba(0, 0, 0, 0.20);

  /* Material 3 Shapes */
  --md-shape-xs: 4px;
  --md-shape-sm: 8px;
  --md-shape-md: 12px;
  --md-shape-lg: 16px;
  --md-shape-xl: 28px;
  --md-shape-full: 9999px;

  --radius-sm: var(--md-shape-sm);
  --radius-md: var(--md-shape-md);
  --radius-lg: var(--md-shape-lg);
  --radius-full: var(--md-shape-full);

  --transition-smooth: all 0.25s cubic-bezier(0.2, 0, 0, 1);
  --container-max: 1200px;
}

[data-theme="dark"] {
  --md-sys-color-primary: #ffb59b;
  --md-sys-color-on-primary: #5f1b00;
  --md-sys-color-primary-container: #833718;
  --md-sys-color-on-primary-container: #ffdbcd;

  --md-sys-color-secondary: #e7bdb0;
  --md-sys-color-on-secondary: #442a20;
  --md-sys-color-secondary-container: #5d3f35;
  --md-sys-color-on-secondary-container: #ffdbcd;

  --md-sys-color-tertiary: #93c5fd;
  --md-sys-color-on-tertiary: #1e3a8a;
  --md-sys-color-tertiary-container: #1d4ed8;
  --md-sys-color-on-tertiary-container: #dbeafe;

  --md-sys-color-background: #1a110e;
  --md-sys-color-on-background: #f1dfda;
  --md-sys-color-surface: #1a110e;
  --md-sys-color-on-surface: #f1dfda;
  --md-sys-color-surface-variant: #53433e;
  --md-sys-color-on-surface-variant: #d8c2bb;

  --md-sys-color-surface-container-low: #231915;
  --md-sys-color-surface-container: #271d19;
  --md-sys-color-surface-container-high: #322823;
  --md-sys-color-surface-container-highest: #3e322d;

  --md-sys-color-outline: #a08c85;
  --md-sys-color-outline-variant: #53433e;
  --md-sys-color-scrim: rgba(0, 0, 0, 0.7);

  --bg-primary: var(--md-sys-color-background);
  --bg-secondary: var(--md-sys-color-surface-container);
  --bg-card: var(--md-sys-color-surface-container-low);
  --bg-header: rgba(26, 17, 14, 0.92);
  --text-main: var(--md-sys-color-on-surface);
  --text-muted: var(--md-sys-color-on-surface-variant);
  --text-light: #a08c85;
  --border-subtle: var(--md-sys-color-outline-variant);

  --md-elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --md-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.35), 0 1px 2px 0 rgba(0, 0, 0, 0.45);
  --md-elevation-3: 0 4px 12px 3px rgba(0, 0, 0, 0.4), 0 1px 3px 0 rgba(0, 0, 0, 0.5);
}

/* Reset & Base Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  color: var(--md-sys-color-on-surface);
  line-height: 1.25;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.8vw, 2.5rem); font-weight: 600; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }

p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1rem;
}

a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header & Clean Navigation (No Badges/Logos) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  transition: var(--transition-smooth);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.brand-title {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.brand-title .brand-main {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.01em;
}

.brand-title .brand-sub {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--md-sys-color-primary);
  font-weight: 600;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  padding: 8px 14px;
  border-radius: var(--md-shape-sm);
  transition: var(--transition-smooth);
}

.nav-link:hover {
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container-high);
}

.nav-link.active {
  color: var(--md-sys-color-primary);
  font-weight: 600;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Material 3 Buttons */
.btn, .md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--md-shape-full);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  text-decoration: none;
  line-height: 1;
}

.btn-primary, .md-btn-filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-elevation-1);
}

.btn-primary:hover, .md-btn-filled:hover {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: var(--md-elevation-2);
  transform: translateY(-1px);
}

.btn-secondary, .md-btn-outlined {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-outline);
}

.btn-secondary:hover, .md-btn-outlined:hover {
  background-color: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
}

.btn-tonal, .md-btn-tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.btn-tonal:hover, .md-btn-tonal:hover {
  box-shadow: var(--md-elevation-1);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.82rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  width: 40px;
  height: 40px;
  border-radius: var(--md-shape-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--md-sys-color-on-surface);
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-outline);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
}

@media (max-width: 860px) {
  .mobile-nav-toggle {
    display: block;
  }
  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--md-sys-color-surface-container-high);
    flex-direction: column;
    padding: 24px;
    box-shadow: var(--md-elevation-3);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
}

/* Material 3 Outlined Inputs & Form Controls */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--md-shape-sm);
  border: 1px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(168, 93, 54, 0.2);
  background-color: var(--md-sys-color-surface);
}

/* Material Chips / Filter Pills */
.filter-pill, .filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: var(--md-shape-full);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-pill:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-primary);
}

.filter-pill.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--md-elevation-1);
}

/* Footer (Compact & Minimal) */
.site-footer {
  background: var(--md-sys-color-surface-container-low);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding: 24px 0;
  margin-top: 50px;
}

.footer-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.footer-nav {
  display: flex;
  gap: 16px;
  list-style: none;
  align-items: center;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.footer-nav a:hover {
  color: var(--md-sys-color-primary);
}

.footer-copy {
  font-size: 0.80rem;
  color: var(--md-sys-color-outline);
}

@media (max-width: 768px) {
  .footer-compact {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .footer-nav {
    justify-content: center;
    gap: 12px;
  }
}
