/* ==========================================
   GlowAtlas — Design System v2
   One source of truth for all pages
   ========================================== */

/* -------- RESET -------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* -------- VIEW TRANSITIONS (native) -------- */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------- TOKENS -------- */
:root {
  /* Colors */
  --bg: #FDFBF7;
  --bg-alt: #F5F0EA;
  --bg-dark: #1A1A1A;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-2: #5C5C5C;
  --text-3: #9A9A9A;
  --accent: #C4A882;
  --accent-hover: #B8977E;
  --accent-soft: #F0E6DA;
  --border: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.04);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --nav-h: 68px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(64px, 10vw, 120px);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------- BASE -------- */
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--text);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p { color: var(--text-2); line-height: 1.7; }

::selection { background: var(--accent-soft); color: var(--text); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* -------- LAYOUT HELPERS -------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--bg-dark); color: rgba(255,255,255,0.85); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: rgba(255,255,255,0.7); }

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 16px;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-2);
  max-width: 640px;
  line-height: 1.7;
}

/* -------- NAV -------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(253, 251, 247, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: border-color 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.nav__links {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav__links a {
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.05em;
  color: var(--text-2);
  position: relative;
  padding: 8px 0;
  transition: color 0.2s var(--ease);
}

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

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.nav__links a:hover::after,
.nav__links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__burger {
  display: none;
  width: 28px; height: 28px;
  position: relative;
  background: none;
}
.nav__burger span {
  position: absolute;
  left: 4px; right: 4px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav__burger span:nth-child(1) { top: 9px; }
.nav__burger span:nth-child(2) { top: 13px; }
.nav__burger span:nth-child(3) { top: 17px; }
.nav__burger.open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav__links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(253, 251, 247, 0.98);
    backdrop-filter: blur(20px);
    padding: 24px var(--gutter) 32px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-110%);
    transition: transform 0.35s var(--ease);
    align-items: stretch;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a {
    padding: 18px 0;
    font-size: 18px;
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .nav__links a::after { display: none; }
  .nav__burger { display: block; }
}

/* -------- BUTTONS -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--text);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent);
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.btn--secondary:hover {
  background: var(--text);
  color: #fff;
}

.btn--link {
  padding: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
}
.btn--link:hover { color: var(--text); border-color: var(--text); }

/* -------- HERO -------- */
.hero {
  min-height: min(88vh, 820px);
  padding-top: var(--nav-h);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero--centered { text-align: center; }
.hero--centered .hero__content { margin-inline: auto; }

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero--light .hero__content { color: #fff; }
.hero--light .hero__content h1 { color: #fff; }
.hero--light .hero__content p { color: rgba(255,255,255,0.85); }
.hero--light .eyebrow { color: rgba(255,255,255,0.9); }

.hero__content h1 {
  margin-bottom: 24px;
}
.hero__content p {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  margin-bottom: 32px;
}
.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero--compact {
  min-height: auto;
  padding: calc(var(--nav-h) + 80px) 0 80px;
  background: var(--bg-alt);
}
.hero--compact::after { display: none; }

/* -------- CARDS -------- */
.card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s var(--ease), box-shadow 0.35s var(--ease);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.card__img {
  aspect-ratio: 4 / 5;
  background: var(--bg-alt);
  overflow: hidden;
  position: relative;
}
.card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.card:hover .card__img img { transform: scale(1.04); }

.card__body { padding: 24px; flex: 1; }
.card__eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.card__title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.card__text {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* -------- GRID -------- */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* -------- SECTION HEADER -------- */
.section-head {
  max-width: 700px;
  margin-bottom: 48px;
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head h2 { margin-bottom: 16px; }

/* -------- FOOTER -------- */
.footer {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 80px 0 32px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.footer__brand h3 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer__brand p {
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  max-width: 320px;
}
.footer__col h4 {
  color: rgba(255,255,255,0.9);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.footer__col ul li { margin-bottom: 12px; }
.footer__col a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s var(--ease);
}
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
}

@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* -------- REVEAL ON SCROLL -------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal-stagger.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.00s; }
.reveal-stagger.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.06s; }
.reveal-stagger.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.18s; }
.reveal-stagger.visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 0.24s; }
.reveal-stagger.visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 0.30s; }
.reveal-stagger.visible > *:nth-child(7) { opacity: 1; transform: none; transition-delay: 0.36s; }
.reveal-stagger.visible > *:nth-child(8) { opacity: 1; transform: none; transition-delay: 0.42s; }
.reveal-stagger.visible > *:nth-child(9) { opacity: 1; transform: none; transition-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
}

/* -------- ARTICLE / PROSE -------- */
.prose {
  max-width: 680px;
  margin-inline: auto;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
}
.prose > * + * { margin-top: 1.25em; }
.prose h2 { margin-top: 2em; margin-bottom: 0.5em; }
.prose h3 { margin-top: 1.75em; margin-bottom: 0.4em; }
.prose p { color: var(--text); }
.prose a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color 0.2s var(--ease); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { font-weight: 600; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.5em; margin-top: 1em; }
.prose ul li, .prose ol li { margin-bottom: 0.5em; color: var(--text); }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 24px;
  margin: 2em 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text);
}

/* -------- UTILITIES -------- */
.mt-sm { margin-top: 16px; } .mt-md { margin-top: 32px; } .mt-lg { margin-top: 64px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-2); }


/* -------- SEARCH -------- */
.nav__search-btn {
  background: none; border: none; padding: 8px;
  cursor: pointer; color: var(--text-2);
  transition: color 0.2s var(--ease);
  display: flex; align-items: center;
  margin-right: 8px;
}
.nav__search-btn:hover { color: var(--text); }
.nav__search-btn svg { width: 18px; height: 18px; }

.search-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(253, 251, 247, 0.98);
  backdrop-filter: blur(20px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 80px 20px 20px;
  overflow-y: auto;
}
.search-modal.open { opacity: 1; visibility: visible; }

.search-modal__container {
  width: 100%; max-width: 680px;
  transform: translateY(-8px);
  transition: transform 0.3s var(--ease);
}
.search-modal.open .search-modal__container { transform: translateY(0); }

.search-modal__close {
  position: absolute; top: 20px; right: 20px;
  background: none; border: none; padding: 12px;
  cursor: pointer; color: var(--text-2);
  font-size: 24px; line-height: 1;
}
.search-modal__close:hover { color: var(--text); }

.search-input {
  width: 100%;
  padding: 20px 24px;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.search-input::placeholder { color: var(--text-3); font-style: italic; }
.search-input:focus { border-color: var(--accent); }

.search-hint {
  margin-top: 12px; font-size: 12px;
  color: var(--text-3); letter-spacing: 0.05em;
  text-align: center;
}

.search-results {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  max-height: 60vh;
  overflow-y: auto;
}
.search-results:empty { display: none; }

.search-result {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  transition: background 0.15s var(--ease);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-alt); }

.search-result__text {
  flex: 1; min-width: 0;
}
.search-result__title {
  font-family: var(--font-serif); font-size: 1.0625rem;
  margin-bottom: 4px; color: var(--text);
}
.search-result__subtitle {
  font-size: 0.85rem; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-result__type {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  flex-shrink: 0; margin-left: 16px;
}

.search-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-2);
}
.search-empty strong { display: block; color: var(--text); margin-bottom: 8px; }

.search-categories {
  margin-bottom: 8px; padding: 16px 24px;
  background: var(--bg-alt);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 500;
}