/* -----------------------------------------------------------
   The Gnostic Code
   Palette:  #02040f (void)      #071450 (deep blue)
             #0c2fce (royal blue glow)   #f4c94e (gold)
             #f8dfa0 (pale gold / body text)
   Type:     Cinzel Decorative (hero), Cinzel (nav/headings),
             Cormorant Garamond (body)
------------------------------------------------------------ */

:root {
  --center-blue: #0000ff;
  --edge-black: #000000;
  --void: #02040f;
  --deep: #061238;
  --royal: #0d33d6;
  --royal-bright: #1c4dff;
  --gold: #f4c94e;
  --gold-bright: #ffd873;
  --gold-dim: #c9a44a;
  --parchment: #f2e2b6;
  --hairline: rgba(244, 201, 78, 0.35);
  --max-width: 980px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 50%, var(--center-blue) 0%, #001a80 30%, #00061f 62%, var(--edge-black) 100%);
  background-attachment: fixed;
  color: var(--parchment);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* faint ambient star field, purely decorative */
.skyfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 15%, rgba(255,255,255,.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 25% 85%, rgba(255,255,255,.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 40%, rgba(255,255,255,.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 90%, rgba(255,255,255,.3) 50%, transparent 51%);
  opacity: .8;
}

a { color: var(--gold); text-decoration: none; }
a:hover, a:focus-visible { color: var(--gold-bright); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }

h1, h2, h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: .02em;
  margin: 0 0 .5em;
}

/* ---------------- Header / Nav ---------------- */

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem .5rem;
}

.site-nav {
  width: 100%;
  display: flex;
  justify-content: center;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-family: 'Cinzel', serif;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--parchment);
  padding: .3rem .1rem;
  border-bottom: 1px solid transparent;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-dim);
}

.site-nav a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  width: 42px;
  height: 36px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--gold);
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: .75rem 1.5rem .25rem;
  text-align: center;
}

.hero h1 {
  font-family: 'IM Fell DW Pica', 'Cinzel Decorative', serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4rem);
  color: var(--gold);
  text-shadow: 0 0 22px rgba(244,201,78,.35);
  margin-bottom: 0;
}

.hero .tagline {
  font-family: 'IM Fell DW Pica', 'Cinzel', serif;
  font-style: italic;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 400;
  color: var(--gold);
  letter-spacing: .01em;
  margin-top: 0;
  margin-bottom: .6rem;
}

/* Hero emblem: the supplied image, sitting directly on the page's
   own blue-to-black gradient background. */

.hero-emblem {
  position: relative;
  width: min(200px, 42vw);
  aspect-ratio: 1 / 1;
  margin: .25rem auto .75rem;
  display: grid;
  place-items: center;
}

.hero-emblem .hero-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 26px rgba(120, 170, 255, .35));
}

/* ---------------- Sections ---------------- */

.content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.panel {
  padding: .5rem 0 0;
}

.panel h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: .5rem;
  margin-bottom: 1rem;
}

.panel p {
  color: var(--gold);
  font-weight: 600;
  font-size: 1.08rem;
  max-width: 68ch;
}

.panel p + p { margin-top: .8rem; }

/* generic page hero (non-home pages) */
.page-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.2rem 1.5rem .5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
.page-hero h1 {
  font-family: 'IM Fell DW Pica', 'Cinzel Decorative', serif;
  font-weight: 400;
  font-size: clamp(2rem, 4.8vw, 2.8rem);
}
.page-hero p.sub {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--parchment);
  opacity: .85;
}

/* ---------------- Link directory (links.php) ---------------- */

.link-groups {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

.link-group {
  background: rgba(2, 6, 22, 0.55);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 1.4rem 1.6rem 1.6rem;
}

.link-group h2 {
  font-size: 1.35rem;
  border-bottom-color: rgba(244,201,78,.3);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: .35rem 2rem;
}

.link-list li {
  border-bottom: 1px dotted rgba(244,201,78,.22);
  padding: .55rem .6rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  border-radius: 4px;
}

.link-list li:hover {
  background: rgba(244, 201, 78, 0.06);
}

.link-list .lname {
  color: var(--parchment);
  font-weight: 600;
}

.link-list a {
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- Cards (amazon / contact) ---------------- */

.card {
  background: linear-gradient(180deg, rgba(13,51,214,.18), rgba(2,4,15,.35));
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 2rem;
  max-width: 620px;
  margin: 1.5rem auto 0;
  text-align: center;
}

.card .glyph {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: .6rem;
}

.btn {
  display: inline-block;
  margin-top: 1.2rem;
  padding: .75rem 1.8rem;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  color: var(--gold-bright);
  font-family: 'Cinzel', serif;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.btn:hover, .btn:focus-visible {
  background: var(--gold);
  color: var(--void);
  text-decoration: none;
}

/* Book grid on the Amazon page */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.6rem;
  max-width: 780px;
  margin: 2rem auto 0;
}

.book-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(2, 6, 22, 0.5);
  transition: transform .18s ease, box-shadow .18s ease;
}

.book-card:hover,
.book-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  text-decoration: none;
}

.book-card img {
  display: block;
  width: 100%;
  aspect-ratio: 500 / 750;
  object-fit: cover;
}

.book-card .book-label {
  display: block;
  text-align: center;
  padding: .7rem .6rem;
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

/* contact form */
.contact-form {
  max-width: 520px;
  margin: 1.8rem auto 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form label {
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .35rem;
  display: block;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(2,4,15,.55);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  color: var(--parchment);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  padding: .65rem .8rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--gold-bright);
  outline-offset: 1px;
}

.contact-form button {
  align-self: flex-start;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  background: var(--gold);
  color: var(--void);
  border: none;
  border-radius: 999px;
  padding: .75rem 1.9rem;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.contact-form button:hover { background: var(--gold-bright); }

.form-note {
  margin-top: 1rem;
  font-size: .95rem;
  color: var(--parchment);
  opacity: .85;
}
.form-note.success { color: var(--gold-bright); opacity: 1; }
.form-note.error { color: #ff8f8f; opacity: 1; }

/* ---------------- Footer ---------------- */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.2rem 1.5rem 3rem;
  border-top: 1px solid var(--hairline);
  color: var(--parchment);
  opacity: .85;
  font-size: .92rem;
}
.footer-glyph {
  color: var(--gold);
  font-size: 1.3rem;
  margin-bottom: .4rem;
}
.footer-contact a { opacity: .95; }

/* ---------------- Responsive ---------------- */

@media (max-width: 700px) {
  .site-nav ul {
    position: absolute;
    right: 1.5rem;
    top: 4.2rem;
    flex-direction: column;
    background: rgba(2,4,15,.96);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: .8rem 1.2rem;
    gap: .9rem;
    display: none;
    min-width: 180px;
  }
  .site-nav ul.open { display: flex; }
  .nav-toggle { display: flex; }
  .link-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
