:root {
  --ink: #1c1214;
  --muted: #5b4040;
  --cream: #fff8f7;
  --paper: #fffaf5;
  --hairline: rgba(107, 87, 92, 0.15);
  --berry: #c81e3a;
  --berry-deep: #a20027;
  --nav-bg: rgba(255, 248, 247, 0.85);
  --nav-border: #f2dee0;
  --footer-bg: #ffffff;
  --card-bg: #ffffff;
  --principles-bg: #fff0f1;
  --selection: #c81e3a;
}

html.dark {
  --ink: #ffecee;
  --muted: #e3bdbd;
  --cream: #120e10;
  --paper: #1a1416;
  --hairline: #23191b;
  --berry: #f0435d;
  --berry-deep: #f0435d;
  --nav-bg: rgba(18, 14, 16, 0.8);
  --nav-border: #23191b;
  --footer-bg: #120e10;
  --card-bg: #120e10;
  --principles-bg: #1a1416;
  --selection: #f0435d;
}

body {
  background-color: var(--cream);
  color: var(--ink);
}

.bg-surface-custom {
  background-color: var(--principles-bg);
}

.text-berry { color: var(--berry); }
.bg-berry { background-color: var(--berry); }
.border-berry { border-color: var(--berry); }

.hairline {
  border: 1px solid var(--hairline);
}

.paper-shadow {
  box-shadow: 0 16px 32px rgba(28, 18, 20, 0.04);
}

html.dark .paper-shadow {
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.shadow-ambient-dark {
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.site-header {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(12px);
}

.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--nav-border);
}

.card-surface {
  background: var(--card-bg);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 10px 14px;
  background: #ffecee;
  color: #120e10;
  border-radius: 999px;
  z-index: 100;
}
.skip:focus { left: 8px; }

@media (max-width: 768px) {
  .font-display-lg.text-display-lg {
    font-size: 32px;
    line-height: 1.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: 3px;
}

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

/* Dark-mode remaps for Stitch tokens used as light-first utilities */
html.dark .text-on-surface { color: #ffecee; }
html.dark .text-on-surface-variant { color: #e3bdbd; }
html.dark .text-primary { color: #ffb3b3; }
html.dark .text-primary-container { color: #f0435d; }
html.dark .hover\:text-primary:hover { color: #ffb3b3; }
html.dark .hover\:text-primary-container:hover { color: #f0435d; }
html.dark .border-primary { border-color: #f0435d; }
html.dark .border-surface-variant { border-color: #23191b; }
html.dark .bg-primary-container { background-color: #f0435d; }
html.dark .bg-surface-variant { background-color: #2a2224; color: #e3bdbd; }
html.dark .decoration-primary\/30 { text-decoration-color: rgba(240, 67, 93, 0.3); }
