/* ============================================
   DESIGN TOKENS — Davis Building & Development
   Palette: deep navy charcoal + warm steel/amber accent
   ============================================ */

:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #f5f3ef;
  --color-surface: #ffffff;
  --color-surface-2: #faf8f3;
  --color-surface-offset: #ece8e0;
  --color-surface-offset-2: #e0dbd1;
  --color-surface-dynamic: #d6d1c5;
  --color-divider: #cfc9bd;
  --color-border: #c4beb1;

  /* Text */
  --color-text: #15171c;
  --color-text-muted: #565a63;
  --color-text-faint: #8b8e96;
  --color-text-inverse: #faf8f3;

  /* Primary — deep navy/steel */
  --color-primary: #15233a;
  --color-primary-hover: #0f1a2c;
  --color-primary-active: #0a1220;
  --color-primary-highlight: #cdd4e0;

  /* Accent — warm amber/steel */
  --color-accent: #c2540a;
  --color-accent-hover: #a14507;
  --color-accent-active: #813705;
  --color-accent-highlight: #f1d6bc;

  --shadow-sm: 0 1px 2px rgba(20, 25, 40, 0.06);
  --shadow-md: 0 6px 18px rgba(20, 25, 40, 0.08);
  --shadow-lg: 0 18px 40px rgba(20, 25, 40, 0.14);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 720px;
  --content-default: 1100px;
  --content-wide: 1280px;

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0c0e13;
  --color-surface: #14171e;
  --color-surface-2: #181c25;
  --color-surface-offset: #1d212b;
  --color-surface-offset-2: #232733;
  --color-surface-dynamic: #2b2f3b;
  --color-divider: #262b36;
  --color-border: #353a46;

  --color-text: #ecebe6;
  --color-text-muted: #9a9da6;
  --color-text-faint: #5e616b;
  --color-text-inverse: #14171e;

  --color-primary: #c8d3e8;
  --color-primary-hover: #ffffff;
  --color-primary-active: #a7b3cc;
  --color-primary-highlight: #2a3144;

  --color-accent: #e88439;
  --color-accent-hover: #ffa460;
  --color-accent-active: #c66b22;
  --color-accent-highlight: #3a2a1c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.65);
}

/* Type scale */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.2vw, 0.95rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1.5rem + 4vw, 4.75rem);

  --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;
}

/* ============================================
   BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--color-accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a,
button,
[role='button'],
input,
textarea,
select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-5);
  z-index: 100;
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}
