/* ============================================================
   HETERODOX PREHISTORY — Design System
   Palette: deep lapis, aged stone, ochre accent, bone white
   Type: Cinzel (display), Lora (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Lora:ital,wght@0,400;0,600;1,400&family=Source+Code+Pro:wght@400&display=swap');

:root {
  --lapis:      #1a2744;
  --lapis-mid:  #253560;
  --lapis-deep: #0f1828;
  --ochre:      #c8891f;
  --ochre-warm: #e8a535;
  --stone:      #8b8070;
  --stone-pale: #c4b8a8;
  --bone:       #f5f0e8;
  --bone-dark:  #ece4d4;
  --text:       #2a2018;
  --text-mid:   #5a4f40;
  --white:      #ffffff;
  --serif-display: 'Cinzel', Georgia, serif;
  --serif-body:    'Lora', 'Georgia', serif;
  --mono:          'Source Code Pro', monospace;
  --radius:     4px;
  --shadow:     0 2px 16px rgba(15,24,40,0.12);
  --shadow-deep: 0 8px 40px rgba(15,24,40,0.22);
}

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

html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: var(--serif-body);
  color: var(--text);
  background: var(--bone);
  line-height: 1.75;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ochre); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--ochre-warm); }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5 {
  font-family: var(--serif-display);
  color: var(--lapis);
  line-height: 1.2;
  letter-spacing: 0.03em;
}
h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 600; margin-bottom: 0.6em; }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.4em; }
p { margin-bottom: 1.2em; }
blockquote {
  border-left: 3px solid var(--ochre);
  padding: 0.6em 1.4em;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text-mid);
  background: var(--bone-dark);
}

/* ---- LAYOUT ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- SITE HEADER / NAV ---- */
.site-header {
  background: var(--lapis-deep);
  border-bottom: 2px solid var(--ochre);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.site-logo {
  font-family: var(--serif-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bone);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-logo span { color: var(--ochre); }
.site-logo:hover { color: var(--stone-pale); }

.site-nav { display: flex; gap: 0.25rem; list-style: none; }
.site-nav a {
  color: var(--stone-pale);
  font-family: var(--serif-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}
.site-nav a:hover { background: var(--lapis-mid); color: var(--ochre); }
.site-nav a.active { color: var(--ochre); }

/* Hamburger — mobile only */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--stone-pale); margin: 5px 0;
  transition: all 0.25s;
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(160deg, var(--lapis-deep) 0%, var(--lapis) 60%, #2a3f70 100%);
  color: var(--bone);
  padding: 5rem 1.5rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c8891f' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.4;
}
.hero__eyebrow {
  font-family: var(--serif-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 1.2rem;
}
.hero h1 {
  color: var(--bone);
  font-size: clamp(2rem, 5vw, 3.6rem);
  margin-bottom: 1rem;
  position: relative;
}
.hero__tagline {
  font-size: 1.15rem;
  color: var(--stone-pale);
  font-style: italic;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-block;
  font-family: var(--serif-display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 1.8rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.btn--primary { background: var(--ochre); color: var(--lapis-deep); border-color: var(--ochre); }
.btn--primary:hover { background: var(--ochre-warm); border-color: var(--ochre-warm); color: var(--lapis-deep); }
.btn--outline { background: transparent; color: var(--bone); border-color: var(--stone-pale); }
.btn--outline:hover { background: var(--lapis-mid); border-color: var(--ochre); color: var(--ochre); }
.btn--dark { background: var(--lapis); color: var(--bone); border-color: var(--lapis); }
.btn--dark:hover { background: var(--lapis-mid); color: var(--ochre); }

/* ---- SECTION CHROME ---- */
.section { padding: 4rem 1.5rem; }
.section--dark { background: var(--lapis); color: var(--bone); }
.section--dark h2, .section--dark h3 { color: var(--bone); }
.section--stone { background: var(--bone-dark); }

.section__header { text-align: center; margin-bottom: 2.5rem; }
.section__eyebrow {
  font-family: var(--serif-display);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 0.5rem;
  display: block;
}

/* ---- CARDS ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-deep); }
.card__body { padding: 1.4rem; flex: 1; }
.card__tag {
  font-family: var(--serif-display);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ochre);
  display: block;
  margin-bottom: 0.4rem;
}
.card__title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.card__excerpt { font-size: 0.9rem; color: var(--text-mid); margin-bottom: 0; }
.card__footer {
  padding: 0.8rem 1.4rem;
  border-top: 1px solid var(--bone-dark);
  font-size: 0.8rem;
  color: var(--stone);
}
.card--dark { background: var(--lapis-mid); }
.card--dark .card__title { color: var(--bone); }
.card--dark .card__excerpt { color: var(--stone-pale); }
.card--dark .card__footer { border-color: var(--lapis); color: var(--stone-pale); }

/* ---- TOPIC TILES ---- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}
.topic-tile {
  background: var(--lapis-mid);
  border-radius: var(--radius);
  padding: 1.5rem 1.2rem;
  text-align: center;
  color: var(--bone);
  border: 1px solid rgba(200,137,31,0.2);
  transition: border-color 0.2s, background 0.2s;
}
.topic-tile:hover { border-color: var(--ochre); background: var(--lapis); color: var(--bone); }
.topic-tile__icon { font-size: 2rem; margin-bottom: 0.6rem; }
.topic-tile__name {
  font-family: var(--serif-display);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--bone);
}
.topic-tile:hover .topic-tile__name { color: var(--ochre); }

/* ---- SITE FOOTER ---- */
.site-footer {
  background: var(--lapis-deep);
  color: var(--stone-pale);
  padding: 3rem 1.5rem 1.5rem;
  border-top: 2px solid var(--ochre);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto 2rem;
}
.footer-brand__name {
  font-family: var(--serif-display);
  font-size: 1rem;
  color: var(--bone);
  margin-bottom: 0.5rem;
}
.footer-brand__desc { font-size: 0.85rem; line-height: 1.6; }
.footer-col h4 {
  font-family: var(--serif-display);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 0.8rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--stone-pale); font-size: 0.88rem; }
.footer-col a:hover { color: var(--ochre); }
.site-footer__bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 1.2rem;
  border-top: 1px solid var(--lapis-mid);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- BLOG ARTICLE ---- */
.article-header { padding: 3rem 1.5rem 2rem; background: var(--lapis); color: var(--bone); text-align: center; }
.article-header h1 { color: var(--bone); font-size: clamp(1.6rem, 3vw, 2.6rem); }
.article-meta { font-size: 0.8rem; color: var(--stone-pale); margin-top: 0.8rem; }
.article-meta span::after { content: ' · '; }
.article-meta span:last-child::after { content: ''; }
.article-body { padding: 3rem 1.5rem; }
.article-body p, .article-body li { max-width: 680px; margin-left: auto; margin-right: auto; }
.article-body h2, .article-body h3 { max-width: 680px; margin-left: auto; margin-right: auto; margin-top: 2rem; }

/* ---- ABOUT / CONTACT PAGE ---- */
.page-hero { background: var(--lapis); color: var(--bone); padding: 3.5rem 1.5rem 2.5rem; text-align: center; }
.page-hero h1 { color: var(--bone); }
.page-hero p { color: var(--stone-pale); max-width: 600px; margin: 0.8rem auto 0; }
.page-body { padding: 3rem 1.5rem; }

/* ---- CONTACT FORM ---- */
.contact-form { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-family: var(--serif-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lapis);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--stone-pale);
  border-radius: var(--radius);
  font-family: var(--serif-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ochre);
  box-shadow: 0 0 0 3px rgba(200,137,31,0.15);
}
.form-group textarea { resize: vertical; min-height: 140px; }
.form-error {
  background: #fdecea;
  border: 1px solid #e4a3a3;
  color: #9a2f2f;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1.2rem;
}

/* ---- DIVIDER ---- */
.divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 2.5rem auto; max-width: 1100px;
  color: var(--stone); font-size: 0.75rem;
  font-family: var(--serif-display); letter-spacing: 0.1em;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--stone-pale); }

/* ---- MOBILE ---- */
@media (max-width: 768px) {
  .site-header__inner { flex-wrap: wrap; gap: 0.5rem; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; flex-direction: column; width: 100%;
    padding-bottom: 0.5rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.5rem 0.5rem; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-footer__bottom { flex-direction: column; gap: 0.4rem; text-align: center; }
  .hero { padding: 3rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
