:root {
  --ink: #061124;
  --navy: #001c34;
  --navy-2: #022744;
  --gold: #d5a153;
  --gold-2: #f1c06d;
  --paper: #f5f0e8;
  --paper-2: #fffaf3;
  --line: rgba(42, 33, 24, .18);
  --muted: #5c6270;
  --shadow: 0 18px 45px rgba(32, 25, 18, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(217, 170, 91, .12), transparent 28rem),
    linear-gradient(180deg, #f7f2eb 0%, #fffaf3 72%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.site-header {
  height: 84px;
  padding: 0 clamp(18px, 3.6vw, 56px);
  display: flex;
  align-items: center;
  gap: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 0%, rgba(24, 104, 139, .48), transparent 34%),
    linear-gradient(90deg, #001b33 0%, #00152b 60%, #001120 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 300px;
}

.brand-mark {
  width: 56px;
  height: 50px;
  color: var(--gold-2);
  display: grid;
  place-items: center;
}

.brand-name {
  display: block;
  font: 600 35px/1 Cinzel, Georgia, serif;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.brand-tagline {
  display: block;
  color: var(--gold-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  margin-top: 3px;
}

.nav-links {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: clamp(18px, 2.2vw, 36px);
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 700;
  padding: 30px 0 22px;
  border-bottom: 3px solid transparent;
}

.nav-links a.active { border-color: var(--gold-2); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.button,
.icon-button,
.send-button {
  border: 0;
  cursor: pointer;
}

.button {
  min-height: 38px;
  padding: 0 22px;
  border-radius: 7px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 13px;
  font-weight: 800;
}

.button.ghost {
  color: var(--gold-2);
  background: transparent;
  border: 1px solid var(--gold-2);
}

.button.gold {
  color: #20150a;
  background: linear-gradient(180deg, #f1c36e, #c99145);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
}

.button.outline {
  color: #8a5515;
  background: #fffaf3;
  border: 1px solid #b9853d;
  min-width: 214px;
}

.icon-button {
  width: 34px;
  height: 34px;
  color: white;
  background: transparent;
}

svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  min-height: 308px;
  position: relative;
  background-image: url("assets/hero-ruins.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 250, 243, .98) 0%, rgba(255, 250, 243, .82) 33%, rgba(255, 250, 243, .2) 66%, rgba(255, 250, 243, 0) 100%),
    linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,250,243,.7));
}

.hero-content {
  position: relative;
  z-index: 1;
  min-height: 308px;
  padding: 26px clamp(20px, 3.6vw, 56px) 30px;
  display: grid;
  grid-template-columns: minmax(360px, 610px) minmax(260px, 310px);
  align-items: center;
  gap: clamp(24px, 10vw, 270px);
}

h1, h2, h3, h4, p { margin-top: 0; }

.hero h1 {
  margin-bottom: 12px;
  font: 600 clamp(42px, 4.8vw, 64px)/.96 Cinzel, Georgia, serif;
  letter-spacing: 0;
}

.hero h1 span { color: #9b722d; }

.hero-copy > p {
  max-width: 590px;
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.55;
}

.proof-points {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.proof-points div {
  display: grid;
  grid-template-columns: 30px auto;
  column-gap: 10px;
  align-items: center;
}

.proof-points svg {
  grid-row: span 2;
  width: 30px;
  height: 30px;
}

.proof-points strong { font-size: 14px; }
.proof-points small { color: #111827; font-size: 12px; }

.quote-card {
  padding: 24px 28px;
  border: 1px solid rgba(27, 31, 42, .18);
  border-radius: 10px;
  background: rgba(255, 250, 243, .38);
  backdrop-filter: blur(7px);
  box-shadow: 0 18px 40px rgba(54, 35, 14, .08);
}

.quote-card p {
  margin-bottom: 14px;
  font-size: 15px;
  line-height: 1.55;
}

.quote-card span { color: #8b5b1d; }

.ask-panel {
  position: relative;
  z-index: 3;
  width: min(1235px, calc(100% - 40px));
  margin: 48px auto 18px;
  padding: 14px 22px 15px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.ask-row {
  display: grid;
  grid-template-columns: 32px 1fr 60px;
  align-items: center;
  gap: 12px;
}

.spark {
  color: #bd883e;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.ask-row input {
  min-width: 0;
  height: 43px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #40434b;
  font-size: 17px;
}

.send-button {
  width: 58px;
  height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  color: white;
  background: #001d35;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 18px rgba(0, 24, 45, .25);
}

.prompt-chips {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.prompt-chips button,
.verse-card button {
  min-height: 32px;
  padding: 0 16px;
  border: 1px solid #cfc7bb;
  border-radius: 6px;
  color: #171b25;
  background: linear-gradient(180deg, #fffaf4, #f1ebe3);
  cursor: pointer;
  font-size: 13px;
}

.topics-section,
.content-grid {
  padding-inline: clamp(20px, 3.4vw, 54px);
}

.topics-section h2 {
  margin: 0 0 9px;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  font-size: 13px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
}

.topic-card {
  min-height: 90px;
  padding: 14px 38px 14px 82px;
  position: relative;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 252, 247, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 7px 18px rgba(40, 29, 20, .08);
}

.topic-card strong { display: block; margin: 4px 0 6px; }
.topic-card small { line-height: 1.35; display: block; }
.topic-card b { position: absolute; right: 18px; top: 36px; font-size: 28px; font-weight: 300; }

.topic-icon {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #211407;
  filter: drop-shadow(0 4px 4px rgba(34, 22, 10, .18));
}

.topic-icon svg {
  width: 48px;
  height: 48px;
  stroke-width: 2.2;
}

.scroll { color: #8a5119; }
.coin { color: #8b6d49; }
.temple { color: #8e6f3f; }
.book { color: #4f3724; }
.people { color: #3b6f7a; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.12fr) minmax(520px, .95fr);
  gap: 28px;
  margin-top: 20px;
  margin-bottom: 14px;
}

.tools-panel,
.study-panel {
  min-height: 298px;
  padding: 16px 22px;
  background: rgba(255, 252, 247, .76);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(40, 29, 20, .08);
}

.tools-panel {
  text-align: center;
}

.tools-panel h2,
.study-panel h2 {
  font: 600 20px/1.25 Cinzel, Georgia, serif;
  margin-bottom: 20px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  text-align: left;
  margin-bottom: 24px;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 0 18px 20px;
  color: white;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 8px 18px rgba(40, 29, 20, .14);
}

.tool-icon svg { width: 30px; height: 30px; }
.purple { background: linear-gradient(145deg, #8f67d5, #6351a8); }
.green { background: linear-gradient(145deg, #2d917b, #0e5f54); }
.blue { background: linear-gradient(145deg, #2d6dac, #1f427c); }
.amber { background: linear-gradient(145deg, #df9341, #bd6127); }
.rose { background: linear-gradient(145deg, #c15480, #942a58); }

.tool-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.tool-item p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
}

.study-panel { text-align: left; }

.study-shell {
  display: grid;
  grid-template-columns: 104px minmax(240px, 1fr) 148px;
  gap: 16px;
}

.study-tabs {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f2;
}

.study-tabs button {
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  font-size: 11px;
  cursor: pointer;
}

.study-tabs button.selected {
  background: #e3e9ef;
  box-shadow: inset 0 0 0 1px #cfd9e3;
}

.verse-card,
.evidence-stack > div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdfa;
}

.verse-card {
  padding: 12px 20px 10px;
}

.verse-card h3 {
  margin-bottom: 13px;
  font: 700 16px/1.2 Georgia, serif;
}

.translation-tabs {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #bfc6cf;
  margin-bottom: 10px;
}

.translation-tabs span {
  padding: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
}

.translation-tabs .selected {
  border-bottom: 2px solid #102c53;
}

.verse-card p {
  margin-bottom: 12px;
  font: 17px/1.2 Georgia, serif;
}

.player {
  display: grid;
  grid-template-columns: 26px 1fr 24px 22px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #eee4d8;
  margin-top: 10px;
  padding-top: 8px;
}

.player span,
.player svg {
  width: 24px;
  height: 24px;
  border: 1px solid #cbd3dc;
  border-radius: 50%;
}

.player span::before {
  content: "";
  display: block;
  margin: 6px 0 0 8px;
  border-left: 8px solid #10233c;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.player b {
  height: 2px;
  background: linear-gradient(90deg, #142949 0 18%, #bdb6ad 18%);
}

.player i {
  width: 20px;
  height: 20px;
  border: 1px solid #cbd3dc;
  border-radius: 50%;
}

.evidence-stack {
  display: grid;
  gap: 12px;
}

.evidence-stack > div {
  padding: 12px;
}

.evidence-stack h4 {
  margin-bottom: 8px;
  font-size: 10px;
}

.evidence-stack p,
.evidence-stack a {
  margin: 0 0 9px;
  color: #1d2530;
  font-size: 10px;
  line-height: 1.35;
}

.evidence-stack a { color: #284d85; }

footer {
  min-height: 72px;
  padding: 16px clamp(20px, 6vw, 190px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: white;
  background:
    radial-gradient(circle at 15% 0%, rgba(22, 108, 142, .4), transparent 32%),
    #001d34;
}

footer strong {
  display: block;
  font: 600 18px/1.15 Cinzel, Georgia, serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

footer span { display: block; margin-top: 4px; }

footer ul {
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
  list-style: none;
  font-size: 13px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 15, 30, 0.58);
  backdrop-filter: blur(5px);
}

.auth-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(241, 192, 109, 0.36);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 0%, rgba(213, 161, 83, 0.16), transparent 18rem),
    #fffaf3;
  box-shadow: 0 28px 80px rgba(0, 17, 32, 0.34);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(91, 72, 51, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  color: #5f3d12;
  cursor: pointer;
  font-weight: 800;
}

.auth-head {
  padding-right: 34px;
}

.auth-kicker {
  color: #8b5b1d;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-head h2 {
  margin: 4px 0 8px;
  color: var(--ink);
  font: 600 clamp(2rem, 4vw, 3rem)/1 Cinzel, Georgia, serif;
}

.auth-head p,
.optional-note p,
.auth-form small {
  color: var(--muted);
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0 16px;
  padding: 5px;
  border: 1px solid rgba(91, 72, 51, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5f6673;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-tabs button.active {
  background: #071a32;
  color: #f8d99a;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span {
  color: #132137;
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-form label b {
  color: #8b5b1d;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(91, 72, 51, 0.2);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #111827;
  outline: none;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: rgba(196, 139, 59, 0.72);
  box-shadow: 0 0 0 3px rgba(196, 139, 59, 0.14);
}

.optional-fields {
  display: grid;
  gap: 13px;
  margin-top: 2px;
  padding: 14px;
  border: 1px solid rgba(91, 72, 51, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.44);
}

.optional-note strong {
  color: #071a32;
}

.optional-note p {
  margin: 4px 0 0;
  font-size: 0.86rem;
}

.location-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.location-row button {
  min-height: 44px;
  border: 1px solid rgba(196, 139, 59, 0.44);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff6e8;
  color: #724812;
  cursor: pointer;
  font-weight: 900;
}

.auth-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.auth-consent input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-status {
  min-height: 22px;
  margin: 0;
  color: #1d734c;
  font-weight: 800;
  line-height: 1.45;
}

.auth-status.error {
  color: #9b2f1b;
}

@media (max-width: 1180px) {
  .site-header { height: auto; min-height: 84px; flex-wrap: wrap; padding-block: 14px; }
  .brand { min-width: 260px; }
  .nav-links { order: 3; flex-basis: 100%; }
  .hero-content { gap: 28px; }
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .brand-name { font-size: 26px; letter-spacing: 4px; }
  .brand-tagline { font-size: 8px; }
  .header-actions { margin-left: auto; gap: 8px; }
  .header-actions .button { padding-inline: 14px; }
  .nav-links { justify-content: flex-start; overflow-x: auto; gap: 20px; }
  .hero { min-height: 540px; background-position: 68% center; }
  .hero-content { grid-template-columns: 1fr; align-content: start; }
  .quote-card { max-width: 360px; }
  .ask-panel { margin-top: 42px; }
  .ask-row { grid-template-columns: 24px 1fr 48px; }
  .send-button { width: 48px; }
  .prompt-chips { gap: 8px; }
  .prompt-chips button { flex: 1 1 220px; }
  .topic-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .study-shell { grid-template-columns: 1fr; }
  .study-tabs { grid-template-columns: repeat(3, 1fr); }
  footer { flex-direction: column; align-items: flex-start; }
  footer ul { flex-wrap: wrap; gap: 12px 20px; }
}

@media (max-width: 560px) {
  .site-header { padding-inline: 14px; }
  .brand { min-width: 0; }
  .brand-mark { width: 44px; height: 40px; }
  .brand-name { font-size: 21px; }
  .brand-tagline { display: none; }
  .header-actions .icon-button,
  .header-actions .ghost { display: none; }
  .header-actions .gold { display: inline-flex; align-items: center; padding-inline: 12px; }
  .hero h1 { font-size: 39px; }
  .proof-points { gap: 14px; }
  .proof-points div { flex: 1 1 170px; }
  .ask-panel { width: calc(100% - 24px); margin-top: 18px; padding: 12px; }
  .ask-row input { font-size: 15px; }
  .tools-panel, .study-panel { padding: 16px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-icon { margin-left: 0; }
  .auth-modal { padding: 10px; }
  .auth-card { max-height: 94vh; border-radius: 10px; }
  .location-row { grid-template-columns: 1fr; }
}
