:root {
  --at-night: #0A0A0A;
  --at-ink: #1A1A1A;
  --at-red: #C41230;
  --at-red-dark: #8B0D22;
  --at-gold: #B8962E;
  --at-gold-light: #D4AF5A;
  --at-ivory: #FAFAF8;
  --at-cream: #F8F6F2;
  --at-paper: #FFFFFF;
  --at-muted: #625F58;
  --at-line: #E2DACB;
  --at-display: 'Playfair Display', Georgia, serif;
  --at-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.at-page {
  margin: 0;
  overflow-x: hidden;
  background: var(--at-ivory);
  color: var(--at-ink);
  font-family: var(--at-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body.at-page img { display: block; max-width: 100%; }

body.at-page a {
  color: var(--at-red-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.at-page a:hover { color: var(--at-red); }

body.at-page a:focus-visible,
body.at-page button:focus-visible,
body.at-page input:focus-visible,
body.at-page summary:focus-visible {
  outline: 3px solid var(--at-gold);
  outline-offset: 3px;
}

.at-skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 1000;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--at-paper);
  color: var(--at-night);
  font-weight: 800;
}

.at-skip-link:focus { top: 12px; }

body.at-page .at-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(10, 10, 10, 0.98);
  border-bottom: 1px solid rgba(184, 150, 46, 0.42);
}

body.at-page .at-nav {
  position: static;
  top: auto;
  z-index: auto;
  width: min(1180px, calc(100% - 32px));
  min-height: 78px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: transparent;
  box-shadow: none;
}

body.at-page .at-breadcrumb {
  position: static;
  top: auto;
  z-index: auto;
  width: auto;
  padding: 18px 0 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  transition: none;
}

body.at-page .at-footer nav {
  position: static;
  top: auto;
  z-index: auto;
  width: auto;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  transition: none;
}

.at-brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--at-ivory) !important;
  font-family: var(--at-display);
  font-size: 1.12rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.at-brand span { color: var(--at-gold-light); }

.at-menu-button {
  display: none;
  width: 48px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid rgba(250, 250, 248, 0.65);
  border-radius: 4px;
  background: transparent;
  color: var(--at-ivory);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.at-menu-button span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.at-nav-list {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.at-nav-list a {
  min-height: 44px;
  padding: 10px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--at-ivory) !important;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.at-nav-list a:hover { color: var(--at-gold-light) !important; }

.at-nav-list .at-nav-cta {
  border: 1px solid var(--at-red);
  border-radius: 4px;
  background: var(--at-red);
}

.at-nav-list .at-nav-cta:hover {
  color: var(--at-ivory) !important;
  background: var(--at-red-dark);
}

.at-nav-list .at-language {
  border: 1px solid rgba(250, 250, 248, 0.55);
  border-radius: 999px;
}

.at-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 18%, rgba(184, 150, 46, 0.2), transparent 30%),
    linear-gradient(135deg, var(--at-night), var(--at-ink));
  color: var(--at-ivory);
  border-bottom: 1px solid rgba(184, 150, 46, 0.38);
}

.at-hero-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(70px, 9vw, 124px) 0 clamp(62px, 8vw, 98px);
}

.at-eyebrow {
  margin: 0 0 18px;
  color: var(--at-gold-light);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.at-content .at-eyebrow,
.at-fallback-card .at-eyebrow { color: var(--at-red-dark); }

.at-hero .at-eyebrow { color: var(--at-gold-light); }

body.at-page h1,
body.at-page h2,
body.at-page h3 {
  font-family: var(--at-display);
  line-height: 1.15;
}

body.at-page h1 {
  max-width: 920px;
  margin: 0;
  color: var(--at-ivory);
  font-size: clamp(2.45rem, 6vw, 5.05rem);
  letter-spacing: -0.025em;
}

.at-hero-deck {
  max-width: 790px;
  margin: 24px 0 0;
  color: rgba(250, 250, 248, 0.86);
  font-size: clamp(1.04rem, 2vw, 1.27rem);
}

.at-hero-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: rgba(250, 250, 248, 0.72);
  font-size: 0.88rem;
}

.at-hero-meta span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.at-shell { width: min(1040px, calc(100% - 40px)); margin: 0 auto; }

.at-breadcrumb { padding: 18px 0 0; color: var(--at-muted); font-size: 0.86rem; }

.at-breadcrumb ol {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.at-breadcrumb a { min-height: 44px; display: inline-flex; align-items: center; }

.at-content { padding: 30px 0 82px; }

.at-lede {
  margin: 0 0 34px;
  padding: 24px 26px;
  background: var(--at-paper);
  border-left: 4px solid var(--at-gold);
  box-shadow: 0 12px 32px rgba(26, 26, 26, 0.07);
  font-size: 1.07rem;
}

.at-notice {
  margin: 24px 0;
  padding: 18px 20px;
  background: #FFF8E4;
  border: 1px solid #D8C48B;
  border-left: 4px solid var(--at-gold);
}

.at-section { margin-top: 58px; }

.at-section > h2 {
  margin: 0 0 16px;
  color: var(--at-ink);
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  letter-spacing: -0.015em;
}

.at-section-intro { max-width: 790px; margin: 0 0 26px; color: var(--at-muted); }

.at-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.at-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.at-card,
.at-source-card,
.at-calculator,
.at-result {
  background: var(--at-paper);
  border: 1px solid var(--at-line);
  box-shadow: 0 12px 28px rgba(26, 26, 26, 0.055);
}

.at-card { padding: 25px; }

.at-card h3 { margin: 0 0 10px; color: var(--at-ink); font-size: 1.32rem; }

.at-card p:last-child,
.at-card ul:last-child { margin-bottom: 0; }

.at-card ul { padding-left: 1.25rem; }

.at-button-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

.at-button {
  min-height: 48px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--at-red);
  border-radius: 4px;
  font-weight: 800;
  text-decoration: none;
}

.at-button.primary { background: var(--at-red); color: var(--at-ivory) !important; }
.at-button.primary:hover { background: var(--at-red-dark); }
.at-button.secondary { background: transparent; color: var(--at-red-dark) !important; }
.at-button.secondary:hover { background: #FFF1F3; }

.at-calculator { padding: clamp(22px, 4vw, 36px); }

.at-calculator label { display: block; margin-bottom: 8px; font-weight: 800; }

.at-field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }

.at-money-field { position: relative; }

.at-money-field span {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--at-muted);
  font-weight: 800;
}

.at-money-field input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px 11px 34px;
  border: 1px solid #AFA89B;
  border-radius: 4px;
  background: var(--at-paper);
  color: var(--at-ink);
  font: inherit;
}

.at-calculate {
  min-height: 50px;
  padding: 11px 20px;
  border: 1px solid var(--at-red);
  border-radius: 4px;
  background: var(--at-red);
  color: var(--at-ivory);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.at-calculate:hover { background: var(--at-red-dark); }

.at-help { margin: 8px 0 0; color: var(--at-muted); font-size: 0.88rem; }

.at-results { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.at-result { padding: 18px; }

.at-result span { display: block; color: var(--at-muted); font-size: 0.82rem; }

.at-result strong {
  display: block;
  margin-top: 4px;
  color: var(--at-red-dark);
  font-family: var(--at-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.at-result-note { margin: 16px 0 0; color: var(--at-muted); font-size: 0.9rem; }

.at-error { min-height: 24px; margin: 8px 0 0; color: var(--at-red-dark); font-weight: 700; }

.at-table-wrap { overflow-x: auto; border: 1px solid var(--at-line); background: var(--at-paper); }

.at-table { width: 100%; min-width: 620px; border-collapse: collapse; }

.at-table caption {
  padding: 12px 14px;
  color: var(--at-ink);
  font-family: var(--at-display);
  font-size: 1.08rem;
  font-weight: 700;
  text-align: left;
}

.at-table th,
.at-table td { padding: 12px 14px; border-bottom: 1px solid var(--at-line); text-align: left; }

.at-table th { background: var(--at-ink); color: var(--at-ivory); font-size: 0.86rem; }

.at-table tr:last-child td { border-bottom: 0; }

.at-faq { display: grid; gap: 12px; }

.at-faq details { background: var(--at-paper); border: 1px solid var(--at-line); }

.at-faq summary {
  min-height: 52px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  color: var(--at-ink);
  font-family: var(--at-display);
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
}

.at-faq details p { margin: 0; padding: 0 18px 18px; }

.at-sources { display: grid; gap: 12px; }

.at-source-card { padding: 18px 20px; }

.at-source-card a { font-weight: 800; }

.at-source-card p { margin: 6px 0 0; color: var(--at-muted); font-size: 0.92rem; }

.at-footer { background: var(--at-night); color: rgba(250, 250, 248, 0.78); }

.at-footer-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0 24px;
  display: grid;
  grid-template-columns: 1.35fr repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.at-footer h2,
.at-footer h3 { margin: 0 0 12px; color: var(--at-ivory); }

.at-footer h2 { font-size: 1.55rem; }
.at-footer h3 { font-size: 1.04rem; }
.at-footer p { margin: 8px 0; }

.at-footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--at-ivory) !important; }

.at-footer-links { margin: 0; padding: 0; list-style: none; }

.at-footer-bottom {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid rgba(250, 250, 248, 0.18);
  color: rgba(250, 250, 248, 0.62);
  font-size: 0.84rem;
}

.at-fallback {
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 48px 20px;
  background:
    radial-gradient(circle at 80% 20%, rgba(184, 150, 46, 0.18), transparent 28%),
    linear-gradient(145deg, var(--at-night), var(--at-ink));
}

.at-fallback-card {
  width: min(680px, 100%);
  padding: clamp(28px, 6vw, 52px);
  background: var(--at-ivory);
  border-top: 5px solid var(--at-red);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.at-fallback-card h1 {
  color: var(--at-ink) !important;
  font-size: clamp(2.1rem, 6vw, 3.8rem) !important;
}

.at-fallback-card p { color: var(--at-muted); }

@media (max-width: 900px) {
  .at-menu-button { display: block; }

  .at-nav-list {
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    display: none;
    padding: 12px 18px 20px;
    background: var(--at-night);
    border-bottom: 1px solid rgba(184, 150, 46, 0.42);
  }

  .at-nav-list.is-open { display: grid; }
  .at-nav-list a { width: 100%; justify-content: flex-start; }
  .at-grid.three { grid-template-columns: 1fr 1fr; }
  .at-footer-inner { grid-template-columns: 1fr 1fr; }
  .at-footer-about { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .at-brand { max-width: 245px; white-space: normal; line-height: 1.15; }
  .at-shell, .at-hero-inner, .at-footer-inner, .at-footer-bottom { width: min(100% - 28px, 1040px); }
  .at-grid, .at-grid.three, .at-results, .at-footer-inner { grid-template-columns: 1fr; }
  .at-footer-about { grid-column: auto; }
  .at-field-row { grid-template-columns: 1fr; }
  .at-calculate { width: 100%; }
  .at-content { padding-bottom: 62px; }
  .at-section { margin-top: 46px; }
  .at-card, .at-calculator { padding: 20px; }
}

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