/* ===== DESIGN TOKENS ===== */
:root,
[data-theme="light"] {
  --color-bg: #F9F6EE;
  --color-surface: #FFFFFF;
  --color-surface-2: #F5F2EA;
  --color-surface-offset: #F0EDE5;
  --color-divider: #E0DDD5;
  --color-border: #D4D1C9;

  --color-text: #1A1A1A;
  --color-text-muted: #5C5C5C;
  --color-text-faint: #9A9A94;
  --color-text-inverse: #F9F6EE;

  --color-teal: #0D4F5C;
  --color-teal-light: #14687A;
  --color-teal-dark: #093842;
  --color-teal-darker: #062A32;
  --color-gold: #C9A84C;
  --color-gold-light: #D4B96A;
  --color-gold-dark: #A88B3A;

  --color-primary: #0D4F5C;
  --color-primary-hover: #14687A;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --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.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  --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-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 3px rgba(13,79,92,0.06);
  --shadow-md: 0 4px 16px rgba(13,79,92,0.08);
  --shadow-lg: 0 12px 40px rgba(13,79,92,0.12);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

[data-theme="dark"] {
  --color-bg: #0C1A1E;
  --color-surface: #112228;
  --color-surface-2: #152B32;
  --color-surface-offset: #0F2027;
  --color-divider: #1E3A42;
  --color-border: #264850;

  --color-text: #D8D5CD;
  --color-text-muted: #97A3A7;
  --color-text-faint: #5E6F74;
  --color-text-inverse: #0C1A1E;

  --color-teal: #3AA5B4;
  --color-teal-light: #4EC0CF;
  --color-teal-dark: #2A8A98;
  --color-teal-darker: #1E6F7C;
  --color-gold: #D4B96A;
  --color-gold-light: #E0CB85;
  --color-gold-dark: #C9A84C;

  --color-primary: #3AA5B4;
  --color-primary-hover: #4EC0CF;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

/* ===== 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: 80px;
}

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, svg { display: block; max-width: 100%; height: auto; }
ul[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.15; }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

::selection {
  background: rgba(13,79,92,0.2);
  color: var(--color-text);
}

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

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

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

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--content-default);
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249,246,238,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s var(--ease-out);
}

[data-theme="dark"] .header {
  background: rgba(12,26,30,0.92);
}

.header--scrolled {
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.logo__icon {
  flex-shrink: 0;
}

.logo__text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-teal);
}

[data-theme="dark"] .logo__text {
  color: var(--color-gold);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-teal);
  transition: width 0.3s var(--ease-out);
}

.nav__link:hover {
  color: var(--color-teal);
}

.nav__link:hover::after {
  width: 100%;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  background: transparent;
}

.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-teal);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  padding: 8px 0;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 99;
  padding: var(--space-8) var(--space-6);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.mobile-nav.open {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav__link {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
}

.mobile-nav__link:hover {
  color: var(--color-teal);
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: block; }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-teal-darker);
  color: rgba(255,255,255,0.7);
  padding-block: var(--space-12);
}

[data-theme="dark"] .footer {
  background: #060E11;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-6);
  }
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  margin-bottom: var(--space-4);
}

@media (max-width: 768px) {
  .footer__logo { justify-content: center; }
}

.footer__logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

.footer__tagline {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.45);
  max-width: 300px;
}

@media (max-width: 768px) {
  .footer__tagline { margin-inline: auto; }
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
}

.footer__link {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}

.footer__link:hover {
  color: var(--color-gold);
}

.footer__social {
  display: flex;
  gap: var(--space-4);
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .footer__social { justify-content: center; }
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}

.footer__social-link:hover {
  background: rgba(255,255,255,0.15);
  color: var(--color-gold);
}

.footer__bottom {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.footer__copyright {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
}

.footer__legal {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.3);
  max-width: 500px;
}

@media (max-width: 768px) {
  .footer__legal { text-align: center; }
}

.footer__address {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.3);
  font-style: normal;
  margin-top: var(--space-2);
}

.footer__legal-links {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-3);
}

@media (max-width: 768px) {
  .footer__legal-links { justify-content: center; }
}

.footer__legal-links a {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.footer__legal-links a:hover {
  color: var(--color-gold);
}

.footer__legal-links span {
  color: rgba(255,255,255,0.2);
  font-size: var(--text-xs);
}

/* ===== LEGAL PAGES ===== */
.legal-page {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
}

.legal-page__header {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-divider);
}

.legal-page__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
}

.legal-page__date {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}

.legal-page__content h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.legal-page__content h2:first-child {
  margin-top: 0;
}

.legal-page__content p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: var(--space-4);
  max-width: 72ch;
}

.legal-page__content ul,
.legal-page__content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.legal-page__content li {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: var(--space-2);
  max-width: 72ch;
}

.legal-page__content a {
  color: var(--color-teal);
  text-decoration: underline;
  text-decoration-color: rgba(13,79,92,0.3);
  text-underline-offset: 3px;
}

.legal-page__content a:hover {
  text-decoration-color: var(--color-teal);
}

.legal-page__content strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-teal);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  z-index: 200;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
}
