/* style.css — Petra Brookland Design System */

/* ─── TYPE SCALE ─── */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);
}

/* ─── SPACING (4px base) ─── */
:root {
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

/* ─── FONTS ─── */
:root {
  --font-display: 'Sentient', 'Georgia', serif;
  --font-body: 'Plus Jakarta Sans', 'Helvetica Neue', sans-serif;
}

/* ─── CUSTOM PALETTE: Warm Teal + Cream ─── */
:root, [data-theme="light"] {
  /* Surfaces — warm cream/off-white */
  --color-bg:               #faf9f6;
  --color-surface:          #f5f3ef;
  --color-surface-2:        #f0ede8;
  --color-surface-offset:   #eae7e1;
  --color-surface-offset-2: #e4e0da;
  --color-surface-dynamic:  #ddd9d2;
  --color-divider:          #d5d1ca;
  --color-border:           #cbc7bf;

  /* Text */
  --color-text:           #2a2722;
  --color-text-muted:     #6b6860;
  --color-text-faint:     #a5a29b;
  --color-text-inverse:   #faf9f6;

  /* Primary Accent — Warm Teal */
  --color-primary:          #2a7f7f;
  --color-primary-hover:    #1f6565;
  --color-primary-active:   #184e4e;
  --color-primary-highlight: #d1e6e4;
  --color-primary-soft:     #e8f3f1;

  /* Error */
  --color-error:          #a13544;
  --color-error-hover:    #7f2a36;
  --color-error-active:   #5c1f28;
  --color-error-highlight: #f0dde0;

  /* Success */
  --color-success:        #3d7a28;
  --color-success-hover:  #2e5c10;
  --color-success-active: #1e3f0a;
  --color-success-highlight: #dde8d4;

  /* Warning */
  --color-warning:        #96611a;
  --color-warning-hover:  #714a14;
  --color-warning-active: #4b340e;
  --color-warning-highlight: #ede3d4;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows (warm-tinted) */
  --shadow-sm: 0 1px 2px oklch(0.25 0.01 70 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.25 0.01 70 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.25 0.01 70 / 0.1);
  --shadow-xl: 0 20px 48px oklch(0.25 0.01 70 / 0.14);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ─── DARK MODE ─── */
[data-theme="dark"] {
  --color-bg:               #1a1916;
  --color-surface:          #201f1c;
  --color-surface-2:        #272520;
  --color-surface-offset:   #2d2b26;
  --color-surface-offset-2: #333029;
  --color-surface-dynamic:  #3a3730;
  --color-divider:          #3e3b34;
  --color-border:           #4a473f;

  --color-text:           #e0ded9;
  --color-text-muted:     #9a9790;
  --color-text-faint:     #6b685f;
  --color-text-inverse:   #1a1916;

  --color-primary:          #5aadad;
  --color-primary-hover:    #3d9494;
  --color-primary-active:   #2d7a7a;
  --color-primary-highlight: #2a3b3a;
  --color-primary-soft:     #243332;

  --color-error:          #dd6974;
  --color-error-hover:    #c24a59;
  --color-error-active:   #a53142;
  --color-error-highlight: #3e2c30;

  --color-success:        #6daa45;
  --color-success-hover:  #4d8f25;
  --color-success-active: #387015;
  --color-success-highlight: #2e3828;

  --color-warning:        #bb8340;
  --color-warning-hover:  #a56e2a;
  --color-warning-active: #8a5a1a;
  --color-warning-highlight: #3a3326;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  --shadow-xl: 0 20px 48px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #1a1916;
    --color-surface:          #201f1c;
    --color-surface-2:        #272520;
    --color-surface-offset:   #2d2b26;
    --color-surface-offset-2: #333029;
    --color-surface-dynamic:  #3a3730;
    --color-divider:          #3e3b34;
    --color-border:           #4a473f;
    --color-text:           #e0ded9;
    --color-text-muted:     #9a9790;
    --color-text-faint:     #6b685f;
    --color-text-inverse:   #1a1916;
    --color-primary:          #5aadad;
    --color-primary-hover:    #3d9494;
    --color-primary-active:   #2d7a7a;
    --color-primary-highlight: #2a3b3a;
    --color-primary-soft:     #243332;
    --color-error:          #dd6974;
    --color-error-hover:    #c24a59;
    --color-error-active:   #a53142;
    --color-error-highlight: #3e2c30;
    --color-success:        #6daa45;
    --color-success-hover:  #4d8f25;
    --color-success-active: #387015;
    --color-success-highlight: #2e3828;
    --color-warning:        #bb8340;
    --color-warning-hover:  #a56e2a;
    --color-warning-active: #8a5a1a;
    --color-warning-highlight: #3a3326;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
    --shadow-xl: 0 20px 48px oklch(0 0 0 / 0.5);
  }
}

/* ─── GLOBAL TYPOGRAPHY ─── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
}

body {
  font-family: var(--font-body);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

a:hover {
  color: var(--color-primary-hover);
}
