/* ============================================================
   Whimsilogical — shared stylesheet
   Brand palette, typography, layout for all pages.
   Edit colors/fonts here once; every page updates.
   ============================================================ */

/* ---- Fonts ----
   Tinkbelle isn't on Google Fonts, so we load close stand-ins
   and keep a --font-display variable. When you have Tinkbelle
   as a webfont file, drop it in /fonts and update --font-display.
   Iceberg IS on Google Fonts. */
@import url('https://fonts.googleapis.com/css2?family=Iceberg&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Josefin+Sans:wght@300;400;500;600&display=swap');

:root {
  /* ---- Brand palette ---- */
  --void-forest:   #0D2318;
  --deep-malachite:#1A4A2E;
  --true-emerald:  #2A7A48;
  --vivid-emerald: #3DAD68;
  --crystal-glow:  #5EDDA0;

  --deep-fuchsia:  #CC2D96;
  --antique-brass: #7A5C20;
  --warm-brass:    #C9973A;
  --burnished-gold:#E0C070;
  --parchment:     #F0EBD8;

  /* darker base for layered sections */
  --deeper-base:   #0A1B12;

  /* ---- Typography ---- */
  --font-display: 'Iceberg', system-ui, sans-serif; /* swap to Tinkbelle when ready */
  --font-ui:      'Josefin Sans', system-ui, sans-serif;
  --font-body:    'Cormorant Garamond', Georgia, serif;

  /* ---- Layout ---- */
  --max-width: 1000px;
  --radius:    12px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--void-forest);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 1.25rem;       /* serif body reads larger comfortably */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Skip link (accessibility) ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--vivid-emerald);
  color: var(--void-forest);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  z-index: 100;
  font-family: var(--font-ui);
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---- Wordmark ---- */
.wordmark {
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}
.wordmark .whimsi  { color: var(--deep-fuchsia); }
.wordmark .logical { color: var(--warm-brass); }

/* ---- Header / nav ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(94, 221, 160, 0.2);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.site-header .wordmark { font-size: 1.5rem; }

.nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--font-ui);
  font-size: 1.05rem;
}
.nav a {
  color: var(--crystal-glow);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav a:hover, .nav a:focus { border-bottom-color: var(--vivid-emerald); }
.nav a[aria-current="page"] { color: var(--burnished-gold); border-bottom-color: var(--warm-brass); }

/* ---- Main container ---- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  flex: 1;
}

/* ---- Headings ---- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
h1 { font-size: 2.75rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; color: var(--burnished-gold); margin-bottom: 1.25rem; }
h3 { font-size: 1.4rem; color: var(--parchment); }

.section-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.25rem;
}
.section-label.live  { color: var(--crystal-glow); }
.section-label.horizon { color: var(--warm-brass); }

/* ---- Links in body ---- */
a { color: var(--crystal-glow); }
a:hover { color: var(--vivid-emerald); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 1rem;
  letter-spacing: 0.5px;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--true-emerald); color: var(--parchment); }
.btn-primary:hover { background: var(--vivid-emerald); color: var(--void-forest); }
.btn-ghost { background: transparent; color: var(--crystal-glow); border: 1px solid var(--true-emerald); }
.btn-ghost:hover { background: rgba(42, 122, 72, 0.25); color: var(--crystal-glow); }

/* ---- Hero ---- */
.hero {
  position: relative;
  text-align: center;
  padding: 5rem 1rem 4rem;
}
.hero .wordmark {
  font-size: clamp(2.5rem, 8vw, 4rem);
  margin-bottom: 1.5rem;
  display: block;
}
.hero .ethos {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--parchment);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.5;
}
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Vesper reserved corner ---- */
.vesper-spot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 64px;
  height: 64px;
  border: 1px dashed rgba(94, 221, 160, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: rgba(94, 221, 160, 0.6);
  text-align: center;
  line-height: 1.3;
}

/* ---- App card grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.app-card {
  background: var(--deep-malachite);
  border: 1px solid rgba(94, 221, 160, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.18s ease, border-color 0.2s ease;
}
.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--vivid-emerald);
}
.app-card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.app-card .name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--parchment);
}
.app-card .desc {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--crystal-glow);
  line-height: 1.4;
}

/* ---- Badges ---- */
.badge {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.badge-live { background: var(--vivid-emerald); color: var(--void-forest); }
.badge-soon { background: rgba(201, 151, 58, 0.2); color: var(--burnished-gold); border: 1px solid rgba(201,151,58,0.4); }

/* ---- Horizon cards (quieter) ---- */
.horizon-card {
  background: rgba(122, 92, 32, 0.12);
  border: 1px dashed rgba(201, 151, 58, 0.4);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
}
.horizon-card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.horizon-card .name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--burnished-gold);
}
.horizon-card .working {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--warm-brass);
  font-style: italic;
  margin-top: 2px;
}
.horizon-card .desc {
  font-size: 1.02rem;
  color: var(--parchment);
  opacity: 0.85;
  margin-top: 6px;
  line-height: 1.4;
}

/* ---- Writing / essay list ---- */
.essay-list { list-style: none; }
.essay-item {
  background: var(--deep-malachite);
  border: 1px solid rgba(94, 221, 160, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.essay-item .essay-num {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--warm-brass);
}
.essay-item h3 { margin: 6px 0 10px; font-size: 1.5rem; color: var(--burnished-gold); }
.essay-item .essay-links { margin-top: 12px; display: flex; gap: 1.25rem; font-family: var(--font-ui); font-size: 0.95rem; }
.essay-item.upcoming { opacity: 0.7; border-style: dashed; }

/* ---- Prose (essay pages, about) ---- */
.prose { max-width: 680px; margin: 0 auto; padding: 1rem 0 3rem; }
.prose p { margin-bottom: 1.3rem; }
.prose h2 { margin-top: 2.5rem; }
.prose .lead { font-size: 1.4rem; color: var(--burnished-gold); font-style: italic; }
.prose blockquote {
  border-left: 3px solid var(--warm-brass);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--crystal-glow);
  font-style: italic;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid rgba(94, 221, 160, 0.2);
  margin-top: 3rem;
  padding: 1.5rem 2rem;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.site-footer .copyright { color: rgba(240, 235, 216, 0.5); }
.site-footer a { color: var(--crystal-glow); text-decoration: none; }
.site-footer a:hover { color: var(--vivid-emerald); }

/* ---- Page intro block ---- */
.page-intro { padding: 2.5rem 0 1.5rem; }
.page-intro p { color: var(--parchment); opacity: 0.9; max-width: 640px; }

/* ---- FAQ page ---- */
.faq-group { margin-bottom: 2.5rem; }
.faq-group > .section-label { margin-bottom: 1rem; }

details.faq-item {
  background: var(--deep-malachite);
  border: 1px solid rgba(94, 221, 160, 0.2);
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
details.faq-item summary {
  cursor: pointer;
  padding: 1.1rem 1.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--burnished-gold);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
/* hide default marker */
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+";
  font-family: var(--font-ui);
  font-size: 1.4rem;
  color: var(--crystal-glow);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
details.faq-item[open] summary::after { content: "\2013"; } /* en dash when open */
details.faq-item summary:hover { color: var(--vivid-emerald); }
details.faq-item .faq-answer {
  padding: 0 1.4rem 1.3rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--parchment);
}
details.faq-item .faq-answer p { margin-bottom: 0.85rem; }
details.faq-item .faq-answer p:last-child { margin-bottom: 0; }

/* ---- Reduced motion respect ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Mobile niceties ---- */
@media (max-width: 600px) {
  .site-header { padding: 1rem 1.25rem; }
  main { padding: 0 1.25rem; }
  .nav { gap: 1.25rem; }
  body { font-size: 1.15rem; }
}
