/* Enigmas Series landing page. Brand values copied from earthlyenigmas.org (Cinzel display,
   EB Garamond captions, Inter body, gold on deep space). Body text stays white for legibility. */
:root {
  --nav-h: 77px;
  --page: #05080f;
  --bg: #0a0e1a;
  --gold: #ffd700;
  --gold-soft: #f3c44e;
  --gold-pale: #f3d488;
  --gold-back: #e0b256;
  --bronze: rgba(120, 90, 35, 0.8);
  --display: "Cinzel", serif;
  --caption: "EB Garamond", serif;
  --body: "Inter", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: var(--nav-h); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--page);
  color: #fff;
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, p, ol, ul { margin: 0; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 8, 15, 0.8);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.nav__inner {
  max-width: 72rem; margin: 0 auto; padding: 1rem 1.5rem; min-height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.nav__brand {
  font-family: var(--display); color: var(--gold); text-decoration: none;
  letter-spacing: 0.1em; white-space: nowrap; font-size: 1rem;
}
@media (min-width: 360px) { .nav__brand { font-size: 1.125rem; } }
@media (min-width: 640px) { .nav__brand { font-size: 1.5rem; } }
.nav__links { display: none; list-style: none; padding: 0; gap: 1.5rem; font-size: 0.875rem; white-space: nowrap; }
.nav__links a { text-decoration: none; }
.nav__links a:hover { color: var(--gold); }
@media (min-width: 1024px) { .nav__links { display: flex; } }

/* Buttons */
.btn {
  display: inline-block; border-radius: 0.375rem; padding: 0.75rem 1.5rem;
  font-family: var(--display); letter-spacing: 0.04em; text-decoration: none; cursor: pointer;
  border: 0; font-size: 1rem; line-height: 1.5;
}
.btn--gold {
  background: linear-gradient(180deg, #ffe9a6, #f3c44e, #d49a2a); color: #1a1206;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.4);
}
.btn--outline {
  border: 1px solid var(--bronze); color: var(--gold-pale);
  background: linear-gradient(160deg, rgba(26, 21, 14, 0.9), rgba(10, 8, 5, 0.95));
}
.btn--glow { background: var(--gold); color: var(--page); box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); transition: transform 0.15s; }
.btn--glow:hover { transform: scale(1.03); }
.btn--small { padding: 0.5rem 1rem; font-size: 0.875rem; white-space: nowrap; }
.btn--caps { text-transform: uppercase; font-size: 0.875rem; }
.btn:focus-visible, .flip:focus-visible, .arrow:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.actions--center { justify-content: center; margin-top: 2.5rem; }

/* Full-height panels with a backdrop image and scrim */
.panel { position: relative; overflow: hidden; isolation: isolate; padding: 6rem 1.5rem; }
.panel--center {
  min-height: calc(100svh - var(--nav-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.panel--tail { padding-bottom: 7rem; }
.panel__bg { position: absolute; inset: 0; z-index: -2; background: center / cover no-repeat; opacity: 0.9; }
.panel__bg--blur { opacity: 1; filter: blur(12px); transform: scale(1.1); }
.panel__bg--dim { opacity: 0.8; }
.panel__scrim {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 50% 45%, rgba(6, 8, 16, 0.25), rgba(6, 8, 16, 0.72) 85%);
}
.panel__scrim--hero { background: radial-gradient(circle at 50% 45%, rgba(6, 8, 16, 0.35), rgba(6, 8, 16, 0.85) 85%); }
.panel__scrim--flat { background: rgba(6, 8, 16, 0.55); }
.panel__scrim--deep { background: rgba(6, 8, 16, 0.65); }

.wrap { width: 100%; max-width: 64rem; margin: 0 auto; }
.wrap--narrow { max-width: 56rem; text-align: center; }
.wrap--form { max-width: 36rem; }
.center { text-align: center; }
.shadow { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65); }

/* Type */
.eyebrow { font-family: var(--caption); font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.22em; }
.title {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.04em; line-height: 1.15;
  font-size: 2.25rem; max-width: 48rem; margin-left: auto; margin-right: auto;
}
@media (min-width: 768px) { .title { font-size: 3rem; } }
.title--hero { margin-top: 1rem; font-size: 3rem; }
@media (min-width: 768px) { .title--hero { font-size: 4.5rem; } }
.subtitle { font-family: var(--display); color: var(--gold-soft); letter-spacing: 0.04em; font-size: 1.875rem; margin-top: 6rem; }
@media (min-width: 768px) { .subtitle { font-size: 2.25rem; } }
.byline { margin-top: 1rem; font-family: var(--caption); font-style: italic; font-size: 1.5rem; }
@media (min-width: 768px) { .byline { font-size: 1.875rem; } }
.lead { max-width: 42rem; margin: 1.5rem auto 0; font-size: 1.125rem; line-height: 1.65; }
.body { font-size: 1.125rem; line-height: 1.65; margin-top: 1.25rem; }
.format { font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; }
.note { margin-top: 0.25rem; text-align: center; font-size: 0.75rem; }
.pullquote { max-width: 48rem; margin: 3rem auto 0; font-family: var(--caption); font-style: italic; font-size: 1.5rem; color: var(--gold-soft); }
@media (min-width: 768px) { .pullquote { font-size: 1.875rem; } }

/* Carved gold lettering, as on earthlyenigmas.org */
.gold-metallic {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("/assets/img/title-gold-texture.png");
  background-size: 160px 160px, 100% 100%;
  background-repeat: repeat, no-repeat;
  background-blend-mode: soft-light, normal;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 0.5px rgba(35, 20, 3, 0.85)) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

/* Book section */
.book { display: grid; gap: 2.5rem; align-items: center; margin-top: 3rem; }
@media (min-width: 768px) { .book { grid-template-columns: minmax(0, 340px) 1fr; gap: 3.5rem; } }
.book .btn { margin-top: 2rem; }
.book__cover { width: min(70vw, 320px); margin: 0 auto; }

/* Flip card: hover (desktop), focus (keyboard) and tap (touch) show the back */
.flip { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1400px; border-radius: 0.375rem; }
.flip__inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.7s; }
.flip:hover .flip__inner, .flip[aria-pressed="true"] .flip__inner { transform: rotateY(180deg); }
@media (prefers-reduced-motion: reduce) { .flip__inner { transition: none; } }
.flip__face {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0.375rem;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); outline: 1px solid rgba(120, 90, 35, 0.5);
}
.flip__face--back { transform: rotateY(180deg); }
.flip__hint { margin-top: 0.75rem; text-align: center; font-family: var(--caption); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.16em; color: #c9b88f; }

/* Live-text back cover over the Milky Way; type scales with the card width */
.back { display: block; overflow: hidden; container-type: inline-size; background: url(/assets/img/milky-way.jpg) center / cover; }
.back::before { content: ""; position: absolute; inset: 0; background: rgba(4, 6, 16, 0.62); }
.back__text {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5cqw; padding: 0 9cqw; text-align: center; font-size: 3.7cqw; line-height: 1.45; color: #fff; text-shadow: none;
}
.back__gold { font-family: var(--caption); font-style: italic; font-size: 4.3cqw; color: var(--gold-back); }
.back__series { margin-top: 2cqw; font-family: var(--display); font-size: 2.6cqw; text-transform: uppercase; letter-spacing: 0.2em; color: #c9922c; }

/* Questions */
.asks { list-style: none; padding: 0; margin-top: 2.5rem; display: grid; gap: 1.5rem; text-align: left; }
@media (min-width: 768px) { .asks { grid-template-columns: repeat(3, 1fr); } }
.asks li { border: 1px solid rgba(243, 196, 78, 0.35); background: rgba(10, 8, 5, 0.7); border-radius: 0.375rem; padding: 1.5rem; }
.asks__n { font-family: var(--display); font-size: 1.875rem; color: var(--gold-soft); }
.asks p { margin-top: 0.75rem; font-size: 1.125rem; line-height: 1.65; }

/* Signup form */
.signup { margin-top: 2rem; text-align: left; }
.signup__fields { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .signup__fields { grid-template-columns: 1fr 1fr; } }
.signup__label { display: block; margin-bottom: 0.25rem; font-family: var(--display); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold-soft); }
.signup input[type="email"], .signup input[type="text"] {
  width: 100%; border-radius: 0.375rem; border: 1px solid rgba(120, 90, 35, 0.6); background: rgba(10, 8, 5, 0.6);
  padding: 0.75rem 1rem; font: inherit; font-size: 0.875rem; color: #fff; outline: none;
}
.signup input:focus { border-color: var(--gold-soft); }
.signup__done {
  margin-top: 2rem; border: 1px solid rgba(120, 90, 35, 0.6); background: rgba(20, 14, 6, 0.5); border-radius: 0.5rem;
  padding: 1.5rem; font-family: var(--caption); font-style: italic; font-size: 1.125rem; color: var(--gold-pale);
}
.hp { position: absolute; left: -9999px; width: 0; height: 0; overflow: hidden; }

/* Series */
.origin { display: grid; gap: 2.5rem; align-items: center; margin-top: 3rem; }
@media (min-width: 768px) { .origin { grid-template-columns: 0.8fr 1.2fr; } }
.origin .body { margin-top: 0; }
.others { list-style: none; padding: 0; margin-top: 2rem; display: grid; gap: 2rem; }
@media (min-width: 640px) { .others { grid-template-columns: repeat(3, 1fr); } }
.others a { display: block; text-align: center; text-decoration: none; }
.others img { width: 100%; height: auto; border-radius: 0.125rem; outline: 1px solid rgba(243, 196, 78, 0.25); transition: outline-color 0.2s; }
.others a:hover img, .others a:focus-visible img { outline-color: rgba(243, 196, 78, 0.7); }
.others__name { display: block; margin-top: 0.75rem; font-family: var(--display); font-size: 1.125rem; }
.others a:hover .others__name { color: var(--gold-soft); }
.others__by { display: block; font-family: var(--caption); font-style: italic; }

/* Photo credit and scroll arrow, pinned to each panel's bottom */
.credit {
  position: absolute; left: 0; right: 0; bottom: 0.75rem; z-index: 2; max-width: 78%; margin: 0 auto; padding: 0 1rem;
  text-align: center; font-family: var(--caption); font-size: 10px; line-height: 1.35; letter-spacing: 0.1em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85); pointer-events: none;
}
.credit__title { font-size: 15px; }
.arrow {
  position: absolute; right: 1.5rem; bottom: 1.5rem; z-index: 3; width: 3rem; height: 3rem;
  display: flex; align-items: center; justify-content: center; border-radius: 999px;
  border: 1px solid rgba(120, 90, 35, 0.85); color: var(--gold-soft);
  background: linear-gradient(160deg, rgba(26, 21, 14, 0.85), rgba(10, 8, 5, 0.92));
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.18); transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.arrow:hover { border-color: var(--gold-soft); color: #ffe487; box-shadow: 0 0 28px rgba(255, 215, 0, 0.38); }
.arrow svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 640px) { .arrow { right: 2rem; bottom: 2rem; } }
@media (prefers-reduced-motion: no-preference) {
  .arrow svg { animation: bounce 1.8s ease-in-out infinite; }
  .arrow--up svg { animation-name: bounce-up; }
}
@keyframes bounce { 50% { transform: translateY(3px); } }
@keyframes bounce-up { 50% { transform: translateY(-3px); } }

/* Footer */
.footer { border-top: 1px solid rgba(255, 255, 255, 0.1); background: rgba(10, 14, 26, 0.6); padding: 2.5rem 1.5rem; font-size: 0.875rem; }
.footer__inner { max-width: 64rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 768px) { .footer__inner { flex-direction: row; align-items: center; justify-content: space-between; } }
.footer__brand { font-family: var(--display); letter-spacing: 0.04em; color: rgba(255, 215, 0, 0.8); text-decoration: none; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer a:hover { color: var(--gold); }
