/* ══════════════════════════════════════════════════════════════
   NEKARI — Site Stylesheet
   Shared across all pages. Edit tokens here to change the whole site.
══════════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --void:      #08070D;
  --deep:      #111019;
  --mid:       #1C1A28;
  --border:    #2C293C;
  --brass:     #C8A05A;
  --brass-dim: #7A6038;
  --sky:       #6B9BA8;
  --parchment: #E4DECE;
  --muted:     #6E6A7A;
  --white:     #F4F0E8;

  --display: 'Cinzel', serif;
  --body:    'Lora', serif;
  --mono:    'Space Mono', monospace;
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--parchment);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.75;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ── HERO ───────────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 580px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keep Calyx and Jinjo visible in the left portion */
  object-position: 45% center;
  z-index: 0;
}

/* Heavy dark lower-left, fading to clear upper-right */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg,
      rgba(8,7,13,0.96) 0%,
      rgba(8,7,13,0.65) 38%,
      rgba(8,7,13,0.10) 72%,
      transparent 100%
    ),
    linear-gradient(to top,
      rgba(8,7,13,0.90) 0%,
      rgba(8,7,13,0.30) 30%,
      transparent 55%
    );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 6% 7vh;
  max-width: 580px;
}

.hero__eyebrow {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-family: var(--display);
  font-size: clamp(3.75rem, 9.5vw, 7.5rem);
  font-weight: 900;
  line-height: 0.89;
  color: var(--white);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.hero__author {
  font-family: var(--display);
  font-size: clamp(1.5rem, 9.5vw, 3rem);
  font-weight: 300;
  line-height: 0.89;
  color: var(--white);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.hero__sub {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--parchment);
  opacity: 0.75;
  max-width: 360px;
  margin-bottom: 2.75rem;
}

.hero__cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--brass);
  color: var(--void);
  padding: 0.9rem 1.75rem;
  border: none;
}
.btn--primary:hover { background: #D4AC68; }

.btn--ghost {
  background: transparent;
  color: var(--parchment);
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--border);
}
.btn--ghost:hover { border-color: var(--brass); color: var(--brass); }

/* ── SCROLL CARET ───────────────────────────────────────── */
.scroll-caret {
  position: absolute;
  bottom: 2.5rem;
  right: 5%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.scroll-caret__label {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-rl;
}
.scroll-caret__line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--brass-dim), transparent);
}

/* ── SHARED SECTION CHROME ──────────────────────────────── */
.section-label {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 2rem;
}

.rule { border: none; border-top: 1px solid var(--border); }

/* ── PREMISE ────────────────────────────────────────────── */
.premise {
  background: var(--deep);
  padding: 6.5rem 6%;
}
.premise__inner {
  max-width: 660px;
}
.premise__body {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--parchment);
}
.premise__body + .premise__body {
  margin-top: 1.25rem;
}
.premise__genre {
  margin-top: 2.5rem;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky);
}

/* ── CHARACTERS ─────────────────────────────────────────── */
.characters {
  background: var(--void);
  padding: 6.5rem 6%;
}
.characters__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 0;
}

/* Stagger: middle card leads, flanks offset down */
.char-card:nth-child(1) { padding-top: 2.5rem; }
.char-card:nth-child(2) { padding-top: 0; }
.char-card:nth-child(3) { padding-top: 4rem; }

.char-card__frame {
  position: relative;
  overflow: hidden;
}

.char-card:nth-child(1) .char-card__frame { aspect-ratio: 3 / 4; }
.char-card:nth-child(2) .char-card__frame { aspect-ratio: 9 / 14; }
.char-card:nth-child(3) .char-card__frame { aspect-ratio: 3 / 4; }

.char-card__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(8,7,13,0.92) 0%,
    rgba(8,7,13,0.45) 35%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
}

.char-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s ease;
}

/* Per-image focal points */
.char-card:nth-child(1) .char-card__img { object-position: 62% 18%; }
.char-card:nth-child(2) .char-card__img { object-position: center 8%; }
.char-card:nth-child(3) .char-card__img { object-position: center 5%; }

.char-card:hover .char-card__img { transform: scale(1.04); }

.char-card__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1.25rem 1.25rem;
  z-index: 2;
}

.char-card__role {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.3rem;
}

.char-card__name {
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.char-card__desc {
  font-family: var(--body);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--parchment);
  opacity: 0.72;
  line-height: 1.55;
}

/* ── PROGRESS LOG ───────────────────────────────────────── */
/*
   Signature element: progress rendered as an engineer's
   field log — monospace, date-stamped, precise.
   It reflects Casta's worldview without naming her.
*/
.progress {
  background: var(--deep);
  padding: 6.5rem 6%;
}
.progress__inner {
  max-width: 660px;
}
.log {
  margin-top: 2.5rem;
  padding-left: 1.75rem;
  border-left: 1px solid var(--brass-dim);
}
.log-entry {
  position: relative;
  margin-bottom: 2.25rem;
}
.log-entry:last-child { margin-bottom: 0; }

/* Dot on the timeline */
.log-entry::before {
  content: '';
  position: absolute;
  left: -2.075rem;
  top: 0.45rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 8px rgba(200,160,90,0.35);
}

/* Active entry gets a different dot */
.log-entry--current::before {
  background: var(--sky);
  box-shadow: 0 0 10px rgba(107,155,168,0.45);
}

.log-entry__date {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.2em;
  color: var(--brass);
  margin-bottom: 0.3rem;
}
.log-entry--current .log-entry__date { color: var(--sky); }

.log-entry__text {
  font-size: 0.9375rem;
  color: var(--parchment);
  opacity: 0.80;
  line-height: 1.65;
}

/* ── JOIN / CTA ─────────────────────────────────────────── */
.join {
  background: var(--void);
  padding: 6.5rem 6%;
  text-align: center;
}
.join__inner {
  max-width: 520px;
  margin: 0 auto;
}
.join__headline {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.1rem;
}
.join__body {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--parchment);
  opacity: 0.72;
  margin-bottom: 2.5rem;
}
.join__row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── FOOTER ─────────────────────────────────────────────── */
footer {
  background: var(--deep);
  border-top: 1px solid var(--border);
  padding: 2rem 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer__brand {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--brass);
}
.footer__copy {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
/* Links inside the footer credit (e.g. artist attribution) */
.footer__copy a {
  color: var(--parchment);
  text-decoration: none;
  border-bottom: 1px solid var(--brass-dim);
  transition: color 0.2s, border-color 0.2s;
}
.footer__copy a:hover {
  color: var(--brass);
  border-color: var(--brass);
}

/* ── ERROR PAGE (404) ───────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
  font-family: var(--mono);
}
.error-page__code {
  font-family: var(--display);
  font-size: 5rem;
  color: var(--brass);
  line-height: 1;
  margin-bottom: 1rem;
}
.error-page__msg {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .characters__grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin: 0 auto;
  }
  .char-card:nth-child(1),
  .char-card:nth-child(2),
  .char-card:nth-child(3) { padding-top: 0; }
  .char-card__frame { aspect-ratio: 3 / 4 !important; }
}

@media (max-width: 540px) {
  .hero__content { padding: 0 5% 6vh; }
  .join__row { flex-direction: column; align-items: center; }
  footer { flex-direction: column; text-align: center; }
}

/* ── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .char-card__img { transition: none; }
}
