@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;1,6..72,400&display=swap');

/* =====================================================
   DESIGN TOKENS — Warm ramp, paper world
   ===================================================== */
:root {
  /* Surfaces (warm light ramp) */
  --bg:         #f7f4ee;   /* page background   */
  --surface:    #fdfbf7;   /* card              */
  --raised:     #efe9df;   /* input / active row */
  --line:       rgba(31, 20, 12, 0.08); /* hairline */

  /* Text roles */
  --text-1:     #1f1b16;   /* primary           */
  --text-2:     #5e554a;   /* secondary         */
  --text-3:     #7b7266;   /* muted / meta      */

  /* Accent: warm amber from the school's world */
  --accent:     #8f5f2a;   /* primary action, selection */
  --accent-bg:  #493326;   /* filled button bg  */
  --accent-fg:  #fdfbf7;   /* text on accent    */

  /* Depth */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 16px rgba(31, 20, 12, 0.07);
  --shadow-lg:  0 8px 24px rgba(31, 20, 12, 0.08);

  /* Motion */
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

/* =====================================================
   BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: "Instrument Sans", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

a { color: inherit; }

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 16px 0;
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-name {
  color: var(--text-1);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
}

.brand-name small {
  display: block;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-3);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: color 150ms var(--ease);
}

.nav-links a:hover { color: var(--text-2); }
.nav-links a.active { color: var(--text-1); font-weight: 500; }

/* =====================================================
   RUNNING BIBLE VERSE
   ===================================================== */
.verse-marquee {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 10px 0;
  background: var(--accent-bg);
  color: var(--accent-fg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.verse-marquee-track {
  display: flex;
  width: max-content;
  flex-wrap: nowrap;
  align-items: center;
  animation: verse-scroll 36s linear infinite;
  will-change: transform;
}

.verse-marquee-content {
  display: block;
  flex: 0 0 auto;
  padding-right: 64px;
  color: rgba(253, 251, 247, 0.85);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
  white-space: nowrap;
}

.verse-marquee:hover .verse-marquee-track {
  animation-play-state: paused;
}

@keyframes verse-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =====================================================
   COVER — full-bleed hero
   ===================================================== */
.cover-front-section {
  width: 100%;
  margin: 0 0 40px;
}

.cover-composition {
  width: 100%;
  overflow: hidden;
  background: #382317;
}

.cover-front {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

/* =====================================================
   COUNTDOWN
   ===================================================== */
.countdown-section {
  width: min(960px, calc(100% - 48px));
  margin: 0 auto 48px;
  padding: 32px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

/* eyebrow label */
.eyebrow {
  margin: 0 0 8px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.countdown-heading h1 {
  margin: 0;
  color: var(--text-1);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.countdown-date {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 400;
}

.countdown-main { min-width: 0; }

.hday {
  margin-bottom: 8px;
  color: var(--text-1);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.timer-unit {
  min-height: 80px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-fg);
}

.timer-unit strong {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.timer-unit span {
  margin-top: 6px;
  color: rgba(253, 251, 247, 0.6);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.countdown-note {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}

/* =====================================================
   SECTION HEADING
   ===================================================== */
.content-section {
  width: min(960px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 64px;
}

.section-heading {
  margin: 0 auto 24px;
  text-align: center;
}

/* Divider rule — the page's signature detail */
.section-heading::before {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 16px;
  opacity: 0.6;
}

.section-heading h2 {
  margin: 0 0 8px;
  color: var(--text-1);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.section-intro {
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 400;
}

/* =====================================================
   RESOURCE CARDS
   ===================================================== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.resource-card {
  min-height: 160px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-1);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

a.resource-card:hover {
  background: var(--raised);
  border-color: rgba(31, 20, 12, 0.14);
  box-shadow: var(--shadow-md);
}

.resource-card-stack { justify-content: flex-start; }

.resource-icon {
  display: block;
  width: 48px;
  height: 48px;
  max-width: 100%;
  flex: 0 0 48px;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 4px;
}

.resource-title {
  color: var(--text-1);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.regular-title { font-weight: 400; }

.resource-description {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.resource-action {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-top: 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.resource-actions {
  width: 100%;
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Primary button */
.resource-action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--accent-bg);
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}

.resource-action-button:hover {
  background: #5f4232;
  border-color: #5f4232;
}

/* Secondary button (outline) */
.resource-action-button.secondary {
  background: transparent;
  border-color: rgba(31, 20, 12, 0.18);
  color: var(--text-1);
}

.resource-action-button.secondary:hover {
  background: var(--raised);
  border-color: rgba(31, 20, 12, 0.24);
}

/* =====================================================
   PANITIA / PEMERAN PAGE
   ===================================================== */
.subpage-main {
  width: min(1100px, calc(100% - 48px));
  min-height: 65vh;
  margin: 0 auto;
  padding: 32px 0 64px;
}

.subpage-hero {
  padding: 40px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--accent-bg);
  color: var(--accent-fg);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.subpage-hero .eyebrow {
  color: rgba(253, 251, 247, 0.65);
}

.subpage-hero h1 {
  margin: 8px 0 12px;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.subpage-hero p:last-of-type {
  max-width: 600px;
  margin: 0 auto;
  color: rgba(253, 251, 247, 0.75);
  font-size: 14px;
}

.pdf-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.button-link {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid rgba(31, 20, 12, 0.14);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 150ms var(--ease);
}

.button-link:hover { background: var(--raised); }

.button-link.button-light {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
  color: rgba(253, 251, 247, 0.9);
}

.button-link.button-light:hover { background: rgba(255, 255, 255, 0.1); }

.page-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 16px 0;
  padding: 8px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(247, 244, 238, 0.95);
  backdrop-filter: blur(10px);
}

.page-tabs a {
  padding: 8px 14px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}

.page-tabs a:hover {
  background: var(--raised);
  color: var(--text-1);
}

.source-note {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--raised);
  color: var(--text-3);
  font-size: 13px;
}

.role-section {
  padding: 28px 0 8px;
  scroll-margin-top: 72px;
}

.compact-heading { margin-bottom: 16px; }

.compact-heading h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-style: italic;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.role-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.role-card h3 {
  margin: 0 0 8px;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
}

.role-card ul {
  margin: 0;
  padding-left: 16px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
}

.role-card li { padding: 2px 0; }
.cast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cast-card { min-height: 90px; }
.cast-card ul { padding-left: 0; list-style: none; }

/* FIGURAN */
.extra-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.extra-group {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.extra-group summary {
  min-height: 48px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-1);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  list-style: none;
  transition: background 120ms var(--ease);
}

.extra-group summary::-webkit-details-marker { display: none; }
.extra-group summary:hover { background: var(--raised); }

.summary-mark {
  color: var(--text-3);
  font-size: 18px;
  font-weight: 400;
  transition: transform 180ms var(--ease);
}

.extra-group[open] .summary-mark { transform: rotate(45deg); }

.extra-group ul {
  margin: 0;
  padding: 0 20px 16px 32px;
  color: var(--text-2);
  font-size: 13px;
}

.extra-group li { padding: 2px 0; }

.original-pdf-section { padding-top: 32px; }
.pdf-viewer {
  width: 100%;
  height: min(900px, 90vh);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
}

.return-row { margin-top: 24px; text-align: center; }

.back-link {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 150ms var(--ease);
}

.back-link:hover { background: #5f4232; }

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  min-height: 80px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line);
  background: var(--accent-bg);
  color: var(--accent-fg);
  text-align: center;
}

.footer strong {
  color: rgba(253, 251, 247, 0.9);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.footer span {
  margin-top: 4px;
  color: rgba(253, 251, 247, 0.5);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* =====================================================
   IMAGE FALLBACK
   ===================================================== */
.resource-icon-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 4px;
}

.resource-icon-pair .resource-icon {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  margin: 0;
}

.image-unavailable {
  width: 48px;
  height: 48px;
  padding: 4px;
  border: 1px dashed rgba(31, 20, 12, 0.2);
  border-radius: 6px;
  font-size: 9px;
  color: var(--text-3);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 760px) {
  .navbar {
    width: calc(100% - 32px);
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
  }

  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }

  .cover-front-section {
    width: 100%;
    margin: 0 0 32px;
  }

  .countdown-section {
    width: calc(100% - 32px);
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 20px;
  }

  .countdown-heading { text-align: center; }

  .content-section,
  .subpage-main { width: calc(100% - 32px); }

  .resource-grid,
  .role-grid,
  .cast-grid,
  .extra-list { grid-template-columns: 1fr; }

  .resource-card { min-height: 0; padding: 20px; gap: 8px; }

  .page-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .role-card { padding: 16px; }
  .subpage-hero { padding: 32px 20px; }
}

@media (max-width: 400px) {
  .timer-grid { gap: 6px; }
  .timer-unit { min-height: 68px; }
  .timer-unit span { font-size: 10px; }
  .resource-actions { flex-direction: column; align-items: stretch; }
}

/* =====================================================
   ACCESSIBILITY — Respect reduced-motion preference
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .verse-marquee-track { animation: none; }
  .resource-card,
  a.resource-card:hover { transition: none; }
  .summary-mark { transition: none; }
}


/* =====================================================
   PASSWORD GATE
   ===================================================== */

/* While locked, the page content is hidden — not just
   covered — so it cannot be revealed by removing the
   overlay in DevTools. */
body.locked > *:not(#gate) {
  visibility: hidden;
}

#gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
  animation: gate-in 300ms var(--ease) both;
}

@keyframes gate-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes gate-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.015); }
}

#gate.gate-exit {
  animation: gate-out 280ms var(--ease) both;
}

.gate-card {
  width: 100%;
  max-width: 380px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.gate-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 16px;
}

.gate-title {
  margin: 0 0 4px;
  color: var(--text-1);
  font-family: "Instrument Sans", Arial, sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.gate-sub {
  margin: 0 0 28px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
}

.gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.gate-label {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.gate-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(31, 20, 12, 0.18);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-1);
  font-family: "Instrument Sans", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.gate-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(143, 95, 42, 0.12);
}

.gate-btn {
  width: 100%;
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-family: "Instrument Sans", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms var(--ease);
}

.gate-btn:hover:not(:disabled) { background: #5f4232; }

.gate-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Spinning indicator while PBKDF2 runs (~1s intentional delay) */
.gate-btn:disabled::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid rgba(253, 251, 247, 0.4);
  border-top-color: rgba(253, 251, 247, 0.9);
  border-radius: 50%;
  vertical-align: middle;
  animation: gate-spin 600ms linear infinite;
}

@keyframes gate-spin {
  to { transform: rotate(360deg); }
}

.gate-error {
  margin: 0;
  min-height: 20px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 400;
}

/* Wrong-password shake */
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

.gate-shake {
  animation: gate-shake 350ms var(--ease);
}
