/* The World of Qualin - Site Styles */

@import url('https://fonts.googleapis.com/css2?family=Macondo&family=Elsie+Swash+Caps:wght@400;900&family=Delius+Swash+Caps&family=Gabriela&family=Fuzzy+Bubbles:wght@400;700&display=swap');

:root {
  --ink: #1f140a;
  --ink-soft: #3a2a18;
  --parchment: #f3e6c4;
  --parchment-dark: #e6d3a3;
  --parchment-shadow: rgba(60, 35, 10, 0.35);
  --night: #14122a;
  --night-deep: #0a0a1a;
  --gold: #d4a64a;
  --gold-bright: #f0c463;
  --violet: #7a4dbb;
  --violet-glow: #b07cf0;
  --forest: #2c5a3a;
  --ember: #d35a2c;
  --rule: #8a6b3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Gabriela', 'Georgia', serif;
  color: var(--ink);
  background: var(--night-deep);
  line-height: 1.65;
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* Universally responsive media */
img, picture, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(176,124,240,0.18), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(212,166,74,0.12), transparent 55%),
    linear-gradient(180deg, #0a0a1a 0%, #14122a 40%, #1a1430 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(10,10,26,0.95), rgba(20,18,42,0.9));
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  gap: 1rem;
}

.brand {
  font-family: 'Elsie Swash Caps', 'Macondo', serif;
  font-weight: 900;
  font-size: 1.55rem;
  color: var(--gold-bright);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(176,124,240,0.5);
}

.brand small {
  display: block;
  font-family: 'Macondo', serif;
  font-size: 0.7rem;
  color: var(--parchment);
  letter-spacing: 0.25em;
  font-weight: normal;
  margin-top: -2px;
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold-bright);
  width: 44px;
  height: 44px;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--violet-glow);
  outline-offset: 2px;
}

.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold-bright);
  position: relative;
  transition: transform 0.25s ease, top 0.25s ease, bottom 0.25s ease, opacity 0.2s ease;
}

.nav-toggle .bars::before,
.nav-toggle .bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle .bars::before { top: -7px; }
.nav-toggle .bars::after  { bottom: -7px; top: auto; }

.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after  { bottom: 0; transform: rotate(-45deg); }

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: 'Macondo', serif;
  font-size: 1.05rem;
  color: var(--parchment);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 10px rgba(240,196,99,0.6);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 4rem 1.5rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,26,0.25) 0%, rgba(10,10,26,0.65) 75%, var(--night-deep) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.hero h1 {
  font-family: 'Elsie Swash Caps', serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  margin: 0 0 1rem;
  color: var(--gold-bright);
  text-shadow:
    0 2px 0 #000,
    0 0 24px rgba(176,124,240,0.7),
    0 0 48px rgba(176,124,240,0.35);
  letter-spacing: 0.04em;
  line-height: 1;
}

.hero .subtitle {
  font-family: 'Macondo', serif;
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  color: var(--parchment);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  text-shadow: 0 0 14px rgba(0,0,0,0.85);
}

.hero p.lede {
  font-size: 1.2rem;
  color: var(--parchment);
  max-width: 700px;
  margin: 0 auto 2.2rem;
  text-shadow: 0 0 10px rgba(0,0,0,0.9);
}

.cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  font-family: 'Macondo', serif;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--gold);
  color: var(--gold-bright);
  background: var(--night-deep);
  border-radius: 4px;
  transition: all 0.25s ease;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}

.btn:hover {
  background: var(--gold);
  color: var(--night-deep);
  box-shadow: 0 0 20px rgba(240,196,99,0.55);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--violet) 0%, #5a3399 100%);
  border-color: var(--violet-glow);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--violet-glow), var(--violet));
  color: #fff;
  box-shadow: 0 0 28px rgba(176,124,240,0.7);
}

/* ---------- Page sections ---------- */
.page-title {
  text-align: center;
  padding: 3.5rem 1.5rem 1.5rem;
  position: relative;
}

.page-title h1 {
  font-family: 'Elsie Swash Caps', serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: var(--gold-bright);
  margin: 0;
  text-shadow: 0 0 22px rgba(176,124,240,0.5), 0 2px 0 #000;
  letter-spacing: 0.04em;
}

.page-title .eyebrow {
  display: inline-block;
  font-family: 'Macondo', serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--violet-glow);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.divider-rune {
  display: block;
  width: 220px;
  height: 30px;
  margin: 1rem auto;
  background:
    linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent) center/100% 1px no-repeat,
    radial-gradient(circle, var(--gold-bright) 4px, transparent 5px) center / 14px 14px no-repeat;
  opacity: 0.85;
}

.scroll {
  max-width: 1100px;
  margin: 2rem auto 4rem;
  padding: 3rem clamp(1.5rem, 4vw, 4rem);
  background:
    linear-gradient(180deg, rgba(243,230,196,0.97), rgba(230,211,163,0.97));
  color: var(--ink);
  border-radius: 6px;
  border: 1px solid rgba(138,107,58,0.5);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.55),
    inset 0 0 80px rgba(138,107,58,0.18);
  position: relative;
}

.scroll::before, .scroll::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 14px;
  background: linear-gradient(180deg, rgba(60,35,10,0.35), transparent);
  pointer-events: none;
}

.scroll::before { top: 0; }
.scroll::after { bottom: 0; transform: scaleY(-1); }

.scroll h2 {
  font-family: 'Elsie Swash Caps', serif;
  font-weight: 900;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--ink-soft);
  margin: 2.5rem 0 0.75rem;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 0.4rem;
}

.scroll h2:first-child { margin-top: 0; }

.scroll h3 {
  font-family: 'Macondo', serif;
  font-size: 1.4rem;
  color: var(--ember);
  margin: 1.5rem 0 0.4rem;
  letter-spacing: 0.03em;
}

.scroll p { margin: 0 0 1rem; }

.scroll a {
  color: #6b3fa0;
  text-decoration: underline;
  text-decoration-color: rgba(122,77,187,0.4);
}

.scroll a:hover { color: var(--ember); }

.scroll ul { padding-left: 1.4rem; }
.scroll li { margin-bottom: 0.4rem; }

.lead-quote {
  font-family: 'Macondo', serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  border-left: 4px solid var(--violet);
  border-right: 4px solid var(--violet);
  padding: 1rem 1.5rem;
  margin: 2rem auto;
  max-width: 720px;
  background: rgba(176,124,240,0.07);
}

/* ---------- Feature grid ---------- */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature {
  background: linear-gradient(180deg, rgba(243,230,196,0.95), rgba(230,211,163,0.95));
  border: 1px solid rgba(138,107,58,0.55);
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(176,124,240,0.35), 0 12px 28px rgba(0,0,0,0.5);
}

.feature h3 {
  font-family: 'Elsie Swash Caps', serif;
  font-weight: 900;
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
  font-size: 1.4rem;
}

.feature .icon-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid rgba(138,107,58,0.5);
}

.feature p { margin: 0; color: var(--ink); }

/* ---------- Inline image ---------- */
.inline-img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  border: 1px solid rgba(138,107,58,0.55);
}

.figure {
  margin: 2rem 0;
  text-align: center;
}

.figure img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(138,107,58,0.55);
  background: rgba(10,10,26,0.35);
}

.figure figcaption {
  font-family: 'Macondo', serif;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.image-grid figure { margin: 0; }

.image-grid img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  height: auto;
  max-height: none;
}

/* ---------- Region cards (World page) ---------- */
.regions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.region-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 32px rgba(0,0,0,0.55);
  border: 1px solid rgba(138,107,58,0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.region-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px rgba(176,124,240,0.4), 0 14px 32px rgba(0,0,0,0.6);
}

.region-card .region-body {
  width: 100%;
  padding: 1rem 1.25rem;
  background: linear-gradient(0deg, rgba(10,10,26,0.92) 0%, rgba(10,10,26,0.6) 70%, transparent 100%);
  color: var(--parchment);
}

.region-card h3 {
  font-family: 'Elsie Swash Caps', serif;
  margin: 0 0 0.35rem;
  color: var(--gold-bright);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(176,124,240,0.6);
}

.region-card p { margin: 0; font-size: 0.95rem; }

/* ---------- Footer ---------- */
footer {
  background: linear-gradient(180deg, transparent, rgba(10,10,26,0.9));
  color: var(--parchment);
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-top: 2px solid var(--gold);
  font-family: 'Macondo', serif;
  letter-spacing: 0.05em;
}

footer .foot-rune {
  font-size: 1.2rem;
  color: var(--violet-glow);
  margin: 0 0.5rem;
}

footer p { margin: 0.4rem 0; }

footer a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-decoration-color: rgba(212,166,74,0.5);
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--violet-glow);
  text-decoration-color: var(--violet-glow);
}

footer .small { font-size: 0.85rem; opacity: 0.75; }

/* ---------- Highlights / pull-quote panels ---------- */
.panel {
  background: linear-gradient(180deg, rgba(20,18,42,0.85), rgba(10,10,26,0.95));
  color: var(--parchment);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--violet);
  box-shadow: 0 0 32px rgba(176,124,240,0.25), inset 0 0 40px rgba(176,124,240,0.08);
  margin: 2rem 0;
}

.panel h2, .panel h3 { color: var(--gold-bright); }

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

/* Tablet */
@media (max-width: 960px) {
  html, body { font-size: 17px; }
  .hero { min-height: 60vh; padding: 3rem 1rem; }
  .scroll { padding: 2.25rem clamp(1rem, 3vw, 2.5rem); margin: 1.5rem auto 3rem; }
  .features { padding: 1rem 1rem 2rem; }
  .panel { padding: 1.5rem; }
}

/* Mobile */
@media (max-width: 720px) {
  html, body { font-size: 16px; }

  /* Collapsible nav */
  .nav-inner {
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
  }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    flex-basis: 100%;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(212,166,74,0.35);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .site-nav.is-open .nav-links {
    max-height: 60vh;
  }
  .nav-links a {
    display: block;
    padding: 0.7rem 0.25rem;
    border-bottom: 1px solid rgba(212,166,74,0.15);
    font-size: 1rem;
  }
  .nav-links a:hover, .nav-links a.active {
    border-bottom-color: var(--gold);
  }

  .brand { font-size: 1.2rem; }
  .brand small { font-size: 0.6rem; letter-spacing: 0.2em; }

  .hero { min-height: 56vh; padding: 2.5rem 1rem; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3.4rem); }
  .hero .subtitle { font-size: 0.95rem; letter-spacing: 0.14em; margin-bottom: 1.5rem; }
  .hero p.lede { font-size: 1.05rem; margin-bottom: 1.6rem; }

  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .btn { width: 100%; text-align: center; }

  .scroll {
    padding: 1.75rem 1.1rem;
    margin: 1.25rem 0.75rem 2.5rem;
    border-radius: 4px;
  }
  .scroll h2 { font-size: 1.5rem; }
  .scroll h3 { font-size: 1.2rem; }

  .lead-quote { font-size: 1.05rem; padding: 0.85rem 1rem; }

  .features {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem 1rem 2rem;
  }
  .feature { padding: 1.1rem; }
  .feature .icon-img { aspect-ratio: 16 / 10; }

  .image-grid { grid-template-columns: 1fr; }

  .regions { grid-template-columns: 1fr; gap: 1rem; }
  .region-card { min-height: 220px; }

  .figure img { max-height: 60vh; }

  .panel {
    padding: 1.25rem;
    margin: 1.5rem 0.5rem;
    border-radius: 6px;
  }

  /* Buttons inside scroll/panel center blocks stack nicely */
  .panel .btn,
  .scroll p .btn {
    margin: 0.4rem 0.25rem;
  }
}

/* Very small */
@media (max-width: 380px) {
  .hero h1 { font-size: 2rem; }
  .scroll { padding: 1.4rem 0.9rem; margin: 1rem 0.5rem 2rem; }
  .nav-toggle { width: 40px; height: 40px; }
}

/* Disable fixed background on touch devices (iOS performance) */
@media (hover: none) and (pointer: coarse) {
  body { background-attachment: scroll; }
  .hero-bg { transform: none !important; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .hero-bg { transform: none !important; }
}

/* Subtle parchment texture using SVG noise */
.scroll {
  background-image:
    linear-gradient(180deg, rgba(243,230,196,0.97), rgba(230,211,163,0.97)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.25  0 0 0 0 0.1  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-blend-mode: multiply;
}
