/* =============================================================
   Uplevly — Design tokens + base styles
   Cool slate / sea-glass teal palette. Friendly local feel.
   ============================================================= */

:root,
[data-theme='light'] {
  /* Surfaces — cool, clean neutrals with far less brown */
  --color-bg: #f4f7f8;
  --color-surface: #fbfdfe;
  --color-surface-2: #ffffff;
  --color-surface-offset: #e9f0f2;
  --color-surface-sunk: #dfe8eb;
  --color-border: #ccd9dd;
  --color-divider: #d8e3e6;

  /* Text — deep slate, not pure black */
  --color-text: #1d2830;
  --color-text-strong: #101820;
  --color-text-muted: #5c6a72;
  --color-text-faint: #93a1a8;
  --color-text-inverse: #f6fbfc;

  /* Primary — clear sea-glass teal */
  --color-primary: #167985;
  --color-primary-hover: #0f5f69;
  --color-primary-soft: #d3ecef;
  --color-primary-tint: #edf7f8;

  /* Accent — soft blue instead of warm brown */
  --color-accent: #4f7fb5;
  --color-accent-soft: #dbe8f7;

  /* Semantic */
  --color-success: #3e7f62;
  --color-warning: #8a6a1f;
  --color-error: #a23955;

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

  /* Spacing */
  --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;

  /* Radius — rounded but specific. Cards have an organic asymmetric feel via
     mixed radii rather than uniform pill-rounding. */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-pill: 9999px;

  /* Shadows — cool, low-contrast */
  --shadow-sm: 0 1px 2px rgba(16, 32, 40, 0.05);
  --shadow-md: 0 6px 18px rgba(16, 32, 40, 0.08), 0 2px 4px rgba(16, 32, 40, 0.04);
  --shadow-lg: 0 18px 40px rgba(10, 24, 34, 0.12), 0 4px 12px rgba(10, 24, 34, 0.06);

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

  /* Layout */
  --content-narrow: 640px;
  --content-default: 1080px;
  --content-wide: 1240px;

  /* Fonts */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #08151b;
  --color-surface: #0e2028;
  --color-surface-2: #132a34;
  --color-surface-offset: #17323d;
  --color-surface-sunk: #061016;
  --color-border: #294653;
  --color-divider: #1d3641;

  --color-text: #dce8ec;
  --color-text-strong: #f4fbfd;
  --color-text-muted: #a0b2bb;
  --color-text-faint: #6f858f;
  --color-text-inverse: #08151b;

  --color-primary: #66c6cb;
  --color-primary-hover: #8edade;
  --color-primary-soft: #16434b;
  --color-primary-tint: #0f3038;

  --color-accent: #7aa7df;
  --color-accent-soft: #172b44;

  --color-success: #75c49a;
  --color-warning: #d5b45f;
  --color-error: #e07791;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #08151b;
    --color-surface: #0e2028;
    --color-surface-2: #132a34;
    --color-surface-offset: #17323d;
    --color-surface-sunk: #061016;
    --color-border: #294653;
    --color-divider: #1d3641;
    --color-text: #dce8ec;
    --color-text-strong: #f4fbfd;
    --color-text-muted: #a0b2bb;
    --color-text-faint: #6f858f;
    --color-text-inverse: #08151b;
    --color-primary: #66c6cb;
    --color-primary-hover: #8edade;
    --color-primary-soft: #16434b;
    --color-primary-tint: #0f3038;
    --color-accent: #7aa7df;
    --color-accent-soft: #172b44;
  }
}

/* ---------- Reset ---------- */
*,
*::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: 5rem;
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  font-feature-settings: 'ss01', 'cv11';
}

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

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

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

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

p,
li,
figcaption {
  text-wrap: pretty;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

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

::selection {
  background: var(--color-primary-soft);
  color: var(--color-text-strong);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  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;
  }
}

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

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  background: var(--color-text-strong);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 100;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 150ms ease-out;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
}
