/* Updated: 2026-05-31 15:36 JST */
/* ============================================================
   PROTOCOL_27 — Landing Page
   Theme: obsidian black + molten gold, engraved-serif display
   ============================================================ */

:root {
  --bg:          #08060300;
  --bg-solid:    #0a0805;
  --gold:        #e3b54e;
  --gold-soft:   #c9a253;
  --gold-dim:    #8a7038;
  --gold-faint:  rgba(227, 181, 78, 0.18);
  --text:        #cdbb96;
  --text-dim:    #8c7f64;
  --line:        rgba(227, 181, 78, 0.14);
  --maxw:        1200px;
  --serif:       'Cinzel', 'Times New Roman', serif;
  --sans:        'Jost', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-solid);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- nav ---------- */
.nav {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 26px 48px;
  max-width: var(--maxw);
}

.nav-left { display: flex; gap: 40px; }

.nav-left a,
.nav-cta {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  transition: color 0.3s ease;
}
.nav-left a:hover { color: var(--gold); }

.brand { justify-self: center; display: flex; align-items: center; }
.brand-logo { height: 46px; width: auto; display: block; }

/* sigil reacts to interaction (transition smooths the charge glow set in JS) */
.brand-logo, .footer-logo {
  transition: filter 0.45s ease, transform 0.45s ease;
  will-change: filter, transform;
}

.nav-cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-soft);
}
.nav-cta:hover { color: var(--gold); }
.nav-cta:hover .arrow { transform: translateX(5px); }
.arrow { transition: transform 0.3s ease; display: inline-block; }

/* ---------- hero ---------- */
main { position: relative; z-index: 5; }

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-color: var(--bg-solid);
  background-image: url('assets/hero-bg.png');
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* left-to-right scrim keeps the copy legible over the artwork */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(8, 6, 3, 0.92) 0%,
    rgba(8, 6, 3, 0.70) 28%,
    rgba(8, 6, 3, 0.20) 50%,
    transparent 66%
  );
  pointer-events: none;
}
/* soften the seam into the pillars section below */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 22%;
  background: linear-gradient(to top, var(--bg-solid), transparent);
  pointer-events: none;
}

/* golden spark field — sits above the artwork, below the copy */
.hero-sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 48px;
}

.hero-copy { max-width: 440px; }

/* hero entrance */
.hero-title span,
.hero-sub,
.hero-copy .btn {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero-title span:nth-child(1) { animation-delay: 0.15s; }
.hero-title span:nth-child(2) { animation-delay: 0.30s; }
.hero-title span:nth-child(3) { animation-delay: 0.45s; }
.hero-sub                     { animation-delay: 0.70s; }
.hero-copy .btn               { animation-delay: 0.90s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.18;
  letter-spacing: 0.10em;
  color: #efe3c6;
  text-shadow: 0 0 26px rgba(227, 181, 78, 0.28);
  margin-bottom: 30px;
}
.hero-title span { display: block; }

.hero-sub {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.9;
  letter-spacing: 0.02em;
  margin-bottom: 40px;
  max-width: 340px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 30px;
  border: 1px solid var(--gold-dim);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  background: rgba(227, 181, 78, 0.02);
  transition: all 0.35s ease;
}
.btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(227, 181, 78, 0.08);
  box-shadow: 0 0 24px rgba(227, 181, 78, 0.22);
}
.btn:hover .arrow { transform: translateX(5px); }

/* ---------- pillars ---------- */
.pillars {
  position: relative;
  z-index: 5;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 90px 48px 110px;
}

.pillars-head { text-align: center; margin-bottom: 70px; }
.pillars-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.34em;
  color: var(--gold-soft);
}
.divider {
  display: inline-block;
  margin-top: 18px;
  font-size: 9px;
  color: var(--gold-dim);
  position: relative;
}
.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 60px;
  height: 1px;
  background: linear-gradient(to var(--dir, right), var(--line), transparent);
}
.divider::before { right: 18px; transform: scaleX(-1); }
.divider::after  { left: 18px; }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pillar {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(227, 181, 78, 0.03), transparent);
  padding: 56px 36px;
  text-align: center;
  transition: all 0.4s ease;
}
.pillar:hover {
  border-color: rgba(227, 181, 78, 0.35);
  background: linear-gradient(180deg, rgba(227, 181, 78, 0.07), transparent);
  transform: translateY(-4px);
}

.pillar-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 28px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
  transition: all 0.4s ease;
}
.pillar:hover .pillar-icon {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(227, 181, 78, 0.25);
}
.pillar-icon svg { width: 46px; height: 46px; }

.pillar h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: #e8dcbd;
  margin-bottom: 18px;
}
.pillar p {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.85;
  max-width: 240px;
  margin: 0 auto;
}

/* ---------- candidates ---------- */
.candidates {
  position: relative;
  z-index: 5;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 48px 30px;
}

.candidates-head { text-align: center; margin-bottom: 56px; }
.candidates-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.34em;
  color: var(--gold-soft);
}
.candidates-intro {
  margin-top: 22px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.candidate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 22px 40px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(227, 181, 78, 0.03), transparent);
  text-align: center;
  transition: all 0.4s ease;
  overflow: hidden;
}
.candidate:hover {
  border-color: rgba(227, 181, 78, 0.4);
  background: linear-gradient(180deg, rgba(227, 181, 78, 0.08), transparent);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.candidate-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
}
.candidate-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 46px;
  letter-spacing: 0.06em;
  color: #e8dcbd;
  line-height: 1;
  text-shadow: 0 0 18px rgba(227, 181, 78, 0.25);
}
/* the evolved "a" — rendered in the sans font (Cinzel has no lowercase glyphs) */
.candidate-num .num-a { font-family: var(--sans); font-weight: 500; text-transform: none; }

/* ACCESS PROTOCOL → fades into the 27-tap riddle on click */
.btn, .nav-cta { transition: opacity 0.35s ease, color 0.3s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease; }
.access-hint {
  font-family: var(--sans);
  text-transform: none;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--gold-soft, #e7bf5c);
}
.btn.revealed-hint, .nav-cta.revealed-hint {
  border-color: transparent; background: none; box-shadow: none; cursor: default;
  max-width: 360px; text-align: center; white-space: normal;
}

.candidate-link {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold-dim);
  transition: color 0.3s ease;
}
.candidate:hover .candidate-link { color: var(--gold); }

/* the chosen one */
.candidate.chosen {
  border-color: var(--gold);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(227, 181, 78, 0.16), transparent 65%),
    linear-gradient(180deg, rgba(227, 181, 78, 0.08), transparent);
  box-shadow: 0 0 0 1px rgba(227, 181, 78, 0.3), 0 0 34px rgba(227, 181, 78, 0.22);
  animation: chosenPulse 3.4s ease-in-out infinite;
}
.candidate.chosen .candidate-num {
  color: var(--gold);
  font-size: 52px;
  text-shadow: 0 0 26px rgba(227, 181, 78, 0.55);
}
.candidate.chosen .candidate-link { color: var(--gold-soft); }
.candidate.chosen:hover { transform: translateY(-4px) scale(1.01); }

/* "2743 evolved" note under the chosen vessel's number */
.candidate-evolve {
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--gold-dim);
  text-shadow: 0 0 12px rgba(227, 181, 78, 0.3);
}

.candidate-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--bg-solid);
  background: var(--gold);
  padding: 4px 12px;
  border-radius: 2px;
  box-shadow: 0 0 16px rgba(227, 181, 78, 0.5);
}

@keyframes chosenPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(227, 181, 78, 0.3), 0 0 28px rgba(227, 181, 78, 0.18); }
  50%      { box-shadow: 0 0 0 1px rgba(227, 181, 78, 0.5), 0 0 44px rgba(227, 181, 78, 0.34); }
}

/* ---------- story ---------- */
.story {
  position: relative;
  z-index: 5;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 48px 120px;
}

.story-head { text-align: center; margin-bottom: 64px; }
.story-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.34em;
  color: var(--gold-soft);
}
.story-intro {
  margin-top: 22px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* vertical timeline rail behind the frames */
.story-track {
  position: relative;
  padding-left: 78px;
}
.story-track::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-dim) 12%, var(--gold-dim) 88%, transparent);
  opacity: 0.5;
}

.story-frame {
  position: relative;
  margin: 0 0 70px;
  border: 1px solid var(--line);
  background: #000;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.story-frame:last-child { margin-bottom: 0; }
.story-frame:hover {
  border-color: rgba(227, 181, 78, 0.4);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 30px rgba(227, 181, 78, 0.12);
}
.story-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 6s ease;
}
.story-frame:hover img { transform: scale(1.04); }

/* one-time gleam sweep when a story frame scrolls into view */
.story-frame::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform: translateX(-190%) skewX(-18deg);
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(227, 181, 78, 0.18) 42%,
    rgba(255, 240, 200, 0.55) 50%,
    rgba(255, 255, 255, 0.7) 52%,
    rgba(227, 181, 78, 0.18) 60%,
    transparent 100%
  );
}
.story-frame.in-view::after { animation: storyGleam 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) 0.12s 1; }
@keyframes storyGleam {
  0%   { transform: translateX(-190%) skewX(-18deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateX(230%) skewX(-18deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .story-frame.in-view::after { animation: none; }
}

/* chapter index marker sitting on the rail */
.story-index {
  position: absolute;
  left: -78px;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  text-align: center;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--gold-soft);
  background: var(--bg-solid);
  padding: 10px 0;
  z-index: 2;
}
.story-index::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold);
}

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 5;
  border-top: 1px solid var(--line);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 48px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.footer-brand { display: flex; align-items: center; gap: 24px; flex: 1; min-width: 0; }
.footer-logo { height: 34px; width: auto; }
.footer-rule { flex: 1; height: 1px; background: var(--line); }

.footer-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}
.footer-links a:hover { color: var(--gold); }
.footer-sep { width: 1px; height: 16px; background: var(--line); }
.social { color: var(--text-dim); transition: color 0.3s ease; display: inline-flex; }
.social:hover { color: var(--gold); }

.copyright {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: rgba(140, 127, 100, 0.5);
}

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* transient gold burst */
.px-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 227, 156, 0.95),
    rgba(227, 160, 50, 0.55) 38%,
    rgba(6, 5, 3, 0) 74%);
  animation: pxflash 0.6s ease forwards;
}
@keyframes pxflash {
  0%   { opacity: 0; transform: scale(1.25); }
  22%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .nav { grid-template-columns: auto 1fr; padding: 20px 24px; }
  .nav-left { display: none; }
  .brand { justify-self: start; }
  .nav-cta { justify-self: end; }
  .brand-logo { height: 38px; }

  .hero {
    min-height: 92vh;
    background-position: 72% center;
  }
  .hero::before {
    background: linear-gradient(
      180deg,
      rgba(8, 6, 3, 0.92) 0%,
      rgba(8, 6, 3, 0.55) 32%,
      rgba(8, 6, 3, 0.30) 55%,
      rgba(8, 6, 3, 0.75) 100%
    );
  }
  .hero-inner { padding: 0 24px; }
  .hero-copy { max-width: 100%; }

  .pillar-grid { grid-template-columns: 1fr; }
  .pillars { padding: 60px 24px 80px; }

  .candidates { padding: 30px 24px 10px; }
  .candidate-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .candidate { padding: 40px 16px 32px; }
  .candidate-num { font-size: 38px; }
  .candidate.chosen .candidate-num { font-size: 42px; }

  .story { padding: 20px 24px 80px; }
  .story-track { padding-left: 0; }
  .story-track::before { display: none; }
  .story-frame { margin-bottom: 48px; }
  .story-index {
    left: 10px;
    top: 10px;
    transform: none;
    width: auto;
    background: rgba(8, 6, 3, 0.7);
    padding: 4px 12px;
    font-size: 18px;
  }
  .story-index::after { display: none; }

  .footer { flex-direction: column; gap: 22px; padding: 40px 24px 50px; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-rule { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .hero-title span,
  .hero-sub,
  .hero-copy .btn { animation: none; opacity: 1; transform: none; }
  .story-frame img { transition: none; }
  .hero-sparks { display: none; }
  .candidate.chosen { animation: none; }
}
