/* ============================================================
   Atlas Advisors NW — Appointment Preparation Pages
   Shared stylesheet
   ============================================================ */

/* ---- Design tokens ---- */
:root,
[data-theme='light'] {
  /* Brand palette */
  --color-crater-blue: #1b4b7a;
  --color-crater-blue-deep: #123a60;
  --color-fir-green: #2c4a32;
  --color-maple-amber: #b85a1f;
  --color-maple-amber-hover: #9a4a17;
  --color-warm-neutral: #f3f1ec;
  --color-neutral-deep: #e8e4da;
  --color-blue-tint: #d8e0e8;
  --color-body-dark: #1f2933;
  --color-supporting-gray: #6b7280;

  /* Semantic roles */
  --color-bg: var(--color-warm-neutral);
  --color-surface: #ffffff;
  --color-surface-2: var(--color-blue-tint);
  --color-border: var(--color-neutral-deep);
  --color-text: var(--color-body-dark);
  --color-text-muted: var(--color-supporting-gray);
  --color-text-inverse: #ffffff;
  --color-primary: var(--color-crater-blue);
  --color-primary-hover: var(--color-crater-blue-deep);
  --color-accent: var(--color-maple-amber);
  --color-accent-hover: var(--color-maple-amber-hover);
  --color-header-bg: var(--color-crater-blue);

  --shadow-sm: 0 1px 2px rgba(27, 32, 41, 0.06);
  --shadow-md: 0 6px 20px rgba(27, 75, 122, 0.12);
  --shadow-lg: 0 16px 40px rgba(27, 75, 122, 0.16);

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

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

[data-theme='dark'] {
  --color-bg: #14202b;
  --color-surface: #1b2b38;
  --color-surface-2: #22384a;
  --color-border: #2e4356;
  --color-text: #e9edf1;
  --color-text-muted: #9fb0bd;
  --color-text-inverse: #ffffff;
  --color-primary: #6f9fc7;
  --color-primary-hover: #8fb4d6;
  --color-accent: #d98a4f;
  --color-accent-hover: #e39c66;
  --color-header-bg: #0f1c28;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* ---- Type scale ---- */
:root {
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  --text-xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  --text-2xl: clamp(1.875rem, 1.5rem + 1.9vw, 2.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;
}

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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-interactive), color var(--transition-interactive);
}

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

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.2;
  color: var(--color-primary);
  overflow-wrap: break-word;
  hyphens: none;
}

p {
  text-wrap: pretty;
  overflow-wrap: break-word;
  hyphens: none;
}

: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;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.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 shell
   ============================================================ */

.page-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-inline: var(--space-6);
}

/* ---- Header ---- */
.site-header {
  background: var(--color-header-bg);
  padding-block: var(--space-6);
  transition: background-color var(--transition-interactive);
}

.site-header__inner {
  max-width: 680px;
  margin: 0 auto;
  padding-inline: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.site-header__logo {
  height: 40px;
  width: auto;
}

.theme-toggle {
  position: absolute;
  right: var(--space-6);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-text-inverse);
  opacity: 0.75;
  transition: opacity var(--transition-interactive), background-color var(--transition-interactive);
}

.theme-toggle:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ---- Hero ---- */
.hero {
  padding-block: clamp(var(--space-12), 8vw, var(--space-20)) var(--space-8);
  text-align: center;
}

.hero__mark {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-5);
  color: var(--color-accent);
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.hero h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  max-width: 30ch;
  margin-inline: auto;
}

.hero p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-inline: auto;
}

/* ---- Section shell ---- */
.section {
  padding-block: var(--space-8);
}

.section__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 11px;
  font-weight: 700;
}

.section h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-3);
}

.section > .section-copy {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 52ch;
  margin: 0 auto var(--space-6);
}

/* ---- Video ---- */
.video-frame {
  max-width: 600px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #000;
  aspect-ratio: 16 / 9;
  position: relative;
}

.video-frame iframe,
.video-frame > div {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-fallback-link {
  text-align: center;
  margin: var(--space-3) auto 0;
  font-size: var(--text-sm);
}

.video-fallback-link a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.video-fallback-link a:hover {
  color: var(--color-primary);
  text-decoration-color: currentColor;
}

.button.button--outline {
  background: transparent;
  color: #ffffff;
  border: 1.5px solid #ffffff;
  box-shadow: none;
}

.button.button--outline:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: none;
}

/* ---- CTA ---- */
.cta-block {
  text-align: center;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive), background-color var(--transition-interactive);
}

.button:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button svg {
  width: 16px;
  height: 16px;
}

.secondary-link {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 3px;
}

.secondary-link:hover {
  text-decoration-color: currentColor;
}

.micro-note {
  margin-top: var(--space-5);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---- Reassurance block ---- */
.reassurance {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.reassurance__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: var(--color-fir-green);
  margin-top: 2px;
}

[data-theme='dark'] .reassurance__icon {
  color: #7fb08a;
}

.reassurance p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* ---- Why this matters ---- */
.why-matters {
  background: var(--color-surface-2);
}

.why-matters__inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.why-matters .star-divider {
  width: 28px;
  height: 28px;
  margin: 0 auto var(--space-4);
  color: var(--color-primary);
}

.why-matters h2 {
  margin-bottom: var(--space-3);
}

.why-matters p {
  color: var(--color-text-muted);
}

/* ---- Footer ---- */
.site-footer {
  margin-top: auto;
  padding-block: var(--space-10) var(--space-8);
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.site-footer__logo {
  height: 30px;
  width: auto;
  margin: 0 auto var(--space-4);
  opacity: 0.9;
}

.site-footer__logo--dark {
  display: none;
}

[data-theme='dark'] .site-footer__logo--light {
  display: none;
}

[data-theme='dark'] .site-footer__logo--dark {
  display: block;
}

.site-footer p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  max-width: 46ch;
  margin: 0 auto;
}

.site-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .video-frame iframe {
    height: auto;
  }
  .reassurance {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-6);
  }
  .button {
    width: 100%;
    justify-content: center;
    padding: var(--space-4) var(--space-6);
  }
}
