/* ═══════════════════════════════════════════
   SeenArc Lens — shared site styles
   Design system: Quiet Authority
   (brand/design-philosophy.md)

   Shared across all public pages: tokens, base,
   navigation, footer, buttons, section headers,
   reveal animation, reduced-motion, print.
   Page-specific styles live inline on each page.
   ═══════════════════════════════════════════ */

/* ── Design tokens ───────────────────────── */

:root {
  --navy: #1B3A5C;
  --deep: #0F2440;
  --copper: #B87333;
  --copper-text: #9A5A24;
  --copper-lt: #D4956A;
  --ivory: #FAF7F2;
  --cream: #F0EBE3;
  --charcoal: #2D2D2D;
  --mid: #6B6B6B;
  --warm: #6B6B6B;
  --rule: #D4CFC8;
  --white: #FFFFFF;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', 'SF Mono', 'Fira Code', monospace;

  --max-w: 1120px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-gap: clamp(5rem, 12vh, 9rem);
}

/* ── Reset & base ────────────────────────── */

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

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

body {
  font-family: var(--sans);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.65;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  overflow-x: hidden;
}

::selection {
  background: var(--navy);
  color: var(--white);
}

a {
  color: var(--copper-text);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
a:hover { color: var(--navy); }
a:focus-visible {
  outline: 2px solid var(--copper-text);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

/* ── Skip link ───────────────────────────── */

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--navy);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}
.skip-link:focus { top: 0; }

#main:focus { outline: none; }

/* ── Layout ──────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { padding: var(--section-gap) 0; }
section[id] { scroll-margin-top: 64px; }

/* ── Reveal animation ────────────────────── */

/* No-JS fallback: show all content if JS is disabled or fails to load */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Navigation ──────────────────────────── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
  border-bottom-color: var(--rule);
  box-shadow: 0 1px 3px rgba(15, 36, 64, 0.04);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.1vw, 1.7rem);
  list-style: none;
}

.nav-links a {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--mid);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover { color: var(--navy); }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--copper);
  transition: width 0.25s ease;
}

.nav-links a:hover::after { width: 100%; }

.nav-links a.nav-cta {
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--copper-text);
  border: 1px solid var(--copper-text);
  padding: 0.4rem 1rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-links a.nav-cta:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.nav-cta::after { display: none; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 24px;
  position: relative;
}

/* Without JS the toggle can do nothing; hide it. Footer links carry
   cross-page navigation in that state. */
.no-js .nav-toggle { display: none !important; }

.nav-toggle span {
  position: absolute;
  left: 6px;
  width: 20px;
  height: 1.5px;
  background: var(--navy);
  transition: top 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle span:nth-child(1) { top: 7px; }
.nav-toggle span:nth-child(2) { top: 12px; }
.nav-toggle span:nth-child(3) { top: 17px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 12px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 12px;
  transform: rotate(-45deg);
}

/* Backdrop dim when mobile nav is open.
   Two quirks forced by the nav's backdrop-filter:
   - No z-index. A negative z-index breaks stacking with backdrop-filter on
     an ancestor; the pseudo relies on document order (paints before
     .nav-links, which then paints over it).
   - Explicit height, not bottom: 0. Because the nav has backdrop-filter,
     it becomes the containing block for position:fixed descendants — so
     bottom: 0 resolves against the 64px-tall nav and collapses the pseudo
     to zero height. calc(100dvh - 64px) sizes from the viewport instead. */
nav.menu-open::before {
  content: '';
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  height: calc(100dvh - 64px);
  background: rgba(15, 36, 64, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
  animation: nav-backdrop-fade 0.2s ease-out;
}

@keyframes nav-backdrop-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    padding: 1.5rem var(--gutter);
    gap: 1.25rem;
  }
  .nav-links.open { display: flex; }
  .nav-cta { text-align: center; }
}

/* ── Copper rule divider ─────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.divider::before {
  content: '';
  width: 48px;
  height: 2px;
  background: var(--copper);
  flex-shrink: 0;
}

.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ── Section headers ─────────────────────── */

.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--warm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 400;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--mid);
  max-width: 620px;
  line-height: 1.7;
}

.section-action {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--copper-text);
}

.section-action svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.section-action:hover svg { transform: translateX(3px); }

/* ── Hero label (shared kicker treatment) ── */

.hero-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--copper-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-label::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: var(--copper-text);
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 46px;
  padding: 0.8rem 1.7rem;
  border: 2px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.button:hover {
  background: transparent;
  color: var(--navy);
}

.button.secondary {
  background: transparent;
  color: var(--navy);
}

.button.secondary:hover {
  background: var(--navy);
  color: var(--white);
}

.button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.button:hover svg { transform: translateX(3px); }

/* ── Footer ──────────────────────────────── */

footer {
  background: var(--white);
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--navy);
}

.footer-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--copper-text);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
}

.footer-nav a {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--mid);
}

.footer-nav a:hover { color: var(--navy); }

.footer-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--warm);
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .footer-nav { justify-content: center; }
}

/* ── Reduced motion ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  nav,
  .nav-links a::after,
  .nav-toggle span,
  .button,
  .button svg,
  .section-action svg {
    transition: none;
  }
  .button:hover svg,
  .section-action:hover svg { transform: none; }
  nav.menu-open::before { animation: none; }
}

/* ── Print ───────────────────────────────── */

@media print {
  nav { position: static; }
  .nav-toggle, .skip-link { display: none; }
  .reveal { opacity: 1; transform: none; }
}
