/* ============================================================
   UNMASK & ALIGN — Shared Stylesheet
   Source of truth for all pages.
   Page-specific styles live in each page's own <style> block.

   Sections:
   1. Design Tokens
   2. Reset & Body
   3. Navigation
   4. Footer
   5. Shared Helpers
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
  /* Colours — light mode */
  --color-bg:            #f7f6f2;
  --color-surface:       #f1f0ec;
  --color-surface-2:     #e9e7e2;
  --color-border:        rgba(40,37,29,0.13);
  --color-text:          #1c1a14;
  --color-text-muted:    #5c5a53;
  --color-text-faint:    #9a9890;
  --color-primary:       #01696f;
  --color-primary-hover: #0c4e54;
  --color-accent-warm:   #8b3a00;

  /* Typography */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'Work Sans', 'Helvetica Neue', sans-serif;

  /* Radii */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   14px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07);
  --shadow-md:   0 4px 14px rgba(0,0,0,.09);
  --shadow-lg:   0 12px 36px rgba(0,0,0,.12);

  /* Motion */
  --transition:  180ms cubic-bezier(.16,1,.3,1);

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
}

/* Dark mode — Premium Editorial palette
   Gold (#c4a882) replaces teal as primary.
   Warm dark backgrounds, cream text.
   text-faint raised to #6b6258 for legibility. */
[data-theme="dark"] {
  --color-bg:            #1a1814;
  --color-surface:       #251f1b;
  --color-surface-2:     #2f2822;
  --color-border:        rgba(245,240,232,0.10);
  --color-text:          #f5f0e8;
  --color-text-muted:    #9a8f80;
  --color-text-faint:    #6b6258;
  --color-primary:       #c9a84c;
  --color-primary-hover: #d9bb60;
  --color-accent-warm:   #c9a84c;
}


/* ============================================================
   2. RESET & BODY
   ============================================================ */

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

html {
  color-scheme: light dark;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}


/* ============================================================
   3. NAVIGATION
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-6);
}

.nav__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* Logo — SVG stars either side */
.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav__logo svg {
  flex-shrink: 0;
}

/* Nav links — hidden on mobile, shown on desktop */
.nav__links {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.nav__links a:hover {
  color: var(--color-text);
}

/* Theme toggle + hamburger — shared sizing */
.nav__theme-toggle,
.nav__hamburger {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--transition);
  flex-shrink: 0;
  padding: 0;
}

.nav__theme-toggle:hover,
.nav__hamburger:hover {
  color: var(--color-text);
}

.nav__theme-toggle svg,
.nav__icon-sun,
.nav__icon-moon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  pointer-events: none;
}

/* Hamburger bars */
.nav__hamburger {
  flex-direction: column;
  gap: 5px;
}

.nav__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: all var(--transition);
}

/* Hamburger open state */
.nav__hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav__hamburger.active span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile dropdown */
.nav__mobile-menu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  flex-direction: column;
  gap: var(--space-4);
  z-index: 99;
}

.nav__mobile-menu.active {
  display: flex;
}

.nav__mobile-menu a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.nav__mobile-menu a:hover {
  color: var(--color-text);
}

/* Desktop: show links, hide hamburger */
@media (min-width: 640px) {
  .nav__links    { display: flex !important; }
  .nav__hamburger { display: none !important; }
}


/* ============================================================
   4. FOOTER
   ============================================================ */

.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-10) 0 var(--space-5);
  margin-top: auto;
}

.footer .container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-bottom: var(--space-5);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer__brand span {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 400;
}

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

.footer__links a {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--color-primary);
}

.footer__copy {
  text-align: center;
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.footer__copy span {
  font-size: 12px;
  color: var(--color-text-faint);
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }
}


/* ============================================================
   5. SHARED HELPERS
   ============================================================ */

/* Layout container */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Eyebrow label */
.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

/* Primary button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Tag pills (used on blog posts) */
.tag {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.tag:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* Pull quote / key insight frame
   Used inside article content to highlight a standout idea.
   Class: <blockquote class="story__pullquote"> */
.story__pullquote {
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: rgba(1, 105, 111, 0.08);
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin: var(--space-8) 0;
  width: fit-content;
  max-width: 100%;
}

[data-theme="dark"] .story__pullquote {
  background: rgba(196, 168, 130, 0.10);
}
