/* ═══════════════════════════════════════════════════════════
   KHONG Design System
   Premium bamboo architecture & products
   Light/cream theme with warm organic accents
   ═══════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ─── CSS Custom Properties ────────────────────────────── */
:root {
  /* Primary Palette — Warm Cream & Bamboo */
  --color-bg:             #faf8f4;
  --color-bg-alt:         #f3efe8;
  --color-bg-card:        #ffffff;
  --color-bg-elevated:    #ffffff;
  --color-surface:        #f7f4ee;

  /* Text Colors */
  --color-text-primary:   #1a1714;
  --color-text-secondary: #5c564d;
  --color-text-tertiary:  #8a8279;
  --color-text-muted:     #b0a89d;
  --color-text-inverse:   #faf8f4;

  /* Accent Colors */
  --color-bamboo:         #b8943f;
  --color-bamboo-light:   #d4b96a;
  --color-bamboo-dark:    #96782e;
  --color-bamboo-subtle:  #f5eed9;
  --color-sage:           #7a8b6f;
  --color-sage-light:     #e8ede5;
  --color-terra:          #a0735a;

  /* Functional Colors */
  --color-success:        #4a7c59;
  --color-warning:        #c49032;
  --color-error:          #b5473a;
  --color-info:           #4a6f8b;

  /* Borders */
  --color-border:         #e8e3db;
  --color-border-light:   #f0ece5;
  --color-border-strong:  #d4cdc2;

  /* Overlay */
  --overlay-light:        rgba(26, 23, 20, 0.04);
  --overlay-medium:       rgba(26, 23, 20, 0.5);
  --overlay-heavy:        rgba(26, 23, 20, 0.75);

  /* Typography */
  --font-display:         'Outfit', sans-serif;
  --font-body:            'Inter', sans-serif;

  /* Font Sizes — Fluid Scale */
  --text-xs:    0.75rem;     /* 12px */
  --text-sm:    0.8125rem;   /* 13px */
  --text-base:  0.9375rem;   /* 15px */
  --text-md:    1rem;        /* 16px */
  --text-lg:    1.125rem;    /* 18px */
  --text-xl:    1.25rem;     /* 20px */
  --text-2xl:   1.5rem;      /* 24px */
  --text-3xl:   1.875rem;    /* 30px */
  --text-4xl:   2.25rem;     /* 36px */
  --text-5xl:   3rem;        /* 48px */
  --text-6xl:   3.75rem;     /* 60px */
  --text-7xl:   4.5rem;      /* 72px */

  /* Font Weights */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Line Heights */
  --leading-tight:   1.15;
  --leading-snug:    1.3;
  --leading-normal:  1.6;
  --leading-relaxed: 1.8;

  /* Letter Spacing */
  --tracking-tight:    -0.02em;
  --tracking-normal:   0;
  --tracking-wide:     0.04em;
  --tracking-wider:    0.08em;
  --tracking-widest:   0.14em;

  /* Spacing — 8px Grid */
  --space-1:   0.25rem;    /* 4px */
  --space-2:   0.5rem;     /* 8px */
  --space-3:   0.75rem;    /* 12px */
  --space-4:   1rem;       /* 16px */
  --space-5:   1.25rem;    /* 20px */
  --space-6:   1.5rem;     /* 24px */
  --space-8:   2rem;       /* 32px */
  --space-10:  2.5rem;     /* 40px */
  --space-12:  3rem;       /* 48px */
  --space-16:  4rem;       /* 64px */
  --space-20:  5rem;       /* 80px */
  --space-24:  6rem;       /* 96px */
  --space-32:  8rem;       /* 128px */

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:    0 1px 2px rgba(26, 23, 20, 0.04);
  --shadow-sm:    0 2px 4px rgba(26, 23, 20, 0.06);
  --shadow-md:    0 4px 12px rgba(26, 23, 20, 0.08);
  --shadow-lg:    0 8px 24px rgba(26, 23, 20, 0.1);
  --shadow-xl:    0 16px 48px rgba(26, 23, 20, 0.12);
  --shadow-2xl:   0 24px 64px rgba(26, 23, 20, 0.16);
  --shadow-gold:  0 4px 20px rgba(184, 148, 63, 0.15);
  --shadow-inner: inset 0 2px 4px rgba(26, 23, 20, 0.04);

  /* Transitions */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --duration-slower: 600ms;

  /* Z-Index Scale */
  --z-base:      1;
  --z-dropdown:  10;
  --z-sticky:    20;
  --z-overlay:   30;
  --z-modal:     40;
  --z-toast:     50;

  /* Container */
  --container-sm:   640px;
  --container-md:   768px;
  --container-lg:   1024px;
  --container-xl:   1200px;
  --container-2xl:  1400px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* ─── Typography Classes ───────────────────────────────── */
.heading-1 {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.heading-2 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.heading-3 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
}

.heading-4 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

.heading-5 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

.subtitle {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
}

.body-large {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.body-small {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.caption {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.price {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.price-original {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  text-decoration: line-through;
  font-weight: var(--weight-regular);
}

/* ─── Selection ────────────────────────────────────────── */
::selection {
  background: var(--color-bamboo-subtle);
  color: var(--color-text-primary);
}

/* ─── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ─── Focus Styles ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-bamboo);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ─── Utility Classes ──────────────────────────────────── */
.text-bamboo { color: var(--color-bamboo); }
.text-sage { color: var(--color-sage); }
.text-muted { color: var(--color-text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Responsive Typography ────────────────────────────── */
@media (max-width: 768px) {
  .heading-1 { font-size: var(--text-4xl); }
  .heading-2 { font-size: var(--text-3xl); }
  .heading-3 { font-size: var(--text-2xl); }
  .heading-4 { font-size: var(--text-xl); }
  .price { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
  .heading-1 { font-size: var(--text-3xl); }
  .heading-2 { font-size: var(--text-2xl); }
}
