/* ============================================================
   LUCENT v1.3 — styles.css
   Apple Showroom Edition | 5-Scene Cinematic Scrollytelling
   ============================================================ */

/* ── Google Fonts are loaded in HTML ── */

/* ── 0. CSS Custom Properties ──────────────────────────────── */
:root {
  /* Void palette */
  --void:         #000000;
  --void-soft:    #050505;
  --void-mid:     #0a0a0a;

  /* Ink */
  --ink:          #f5f5f0;
  --ink-sub:      #a1a1aa;
  --ink-muted:    #52525b;

  /* Gold — restrained, cold */
  --gold:         #bf9b56;
  --gold-light:   #d4ae6e;

  /* Ledger */
  --ledger-line:  rgba(191, 155, 86, 0.18);

  /* Typography */
  --font-serif:   'Noto Serif KR', 'Georgia', serif;
  --font-sans:    'Pretendard Variable', 'Pretendard', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --nav-h:        72px;
}

/* ── 1. Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--void-soft);
  color: var(--ink);
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

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

/* ── 2. Nav ─────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 60px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, background 0.4s ease;
}

.nav.scrolled {
  border-bottom-color: rgba(191, 155, 86, 0.12);
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo img {
  height: 40px;
  width: auto;
  filter: invert(1);
  opacity: 0.85;
}

.nav-wordmark {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  color: var(--ink);
  opacity: 0.8;
  text-transform: uppercase;
}

.nav-cta {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  border: 1px solid rgba(245, 245, 240, 0.28);
  padding: 8px 20px;
  transition: border-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  opacity: 0.85;
}

.nav-cta:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  opacity: 1;
}

/* ── 3. Scene Foundation ────────────────────────────────────── */
.scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--void-soft);
  overflow: hidden;
}

.scene-inner {
  width: min(1160px, 100% - 96px);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* ── 4. Reveal Animation System ─────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 120ms; }
.delay-2 { transition-delay: 240ms; }
.delay-3 { transition-delay: 360ms; }

/* ── 5. Typography ──────────────────────────────────────────── */
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.2vw, 0.85rem);
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 2rem;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ink);
  word-break: keep-all;
  margin-bottom: 2rem;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 7vw, 7rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
  word-break: keep-all;
  margin-bottom: 2rem;
}

.lead {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.75;
  color: var(--ink-sub);
  max-width: 600px;
  word-break: keep-all;
  margin-bottom: 1.25rem;
}

.clarify {
  font-family: var(--font-sans);
  font-size: clamp(0.88rem, 1.5vw, 1rem);
  color: var(--gold);
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
  opacity: 0.9;
}

.accent {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--ink);
  line-height: 1.5;
  max-width: 640px;
  letter-spacing: -0.01em;
  margin-top: 1rem;
  word-break: keep-all;
}

.caption {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.2vw, 0.85rem);
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  margin-top: 1.5rem;
}

/* ── 6. CTA Buttons ─────────────────────────────────────────── */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 13px 28px;
  border: 1px solid rgba(245, 245, 240, 0.28);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(0.82rem, 1.4vw, 0.95rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ── 7. Scene 1 — Hero ──────────────────────────────────────── */
.scene--hero {
  padding-top: var(--nav-h);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - var(--nav-h));
  padding: 60px 0;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.certificate-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.certificate-visual img {
  width: auto;
  max-width: min(52vw, 700px);
  max-height: 82vh;
  object-fit: contain;
  will-change: transform;
}

/* Soft gold aura behind certificate */
.certificate-visual::before {
  content: '';
  position: absolute;
  width: 480px;
  height: 640px;
  background: radial-gradient(ellipse at center, rgba(191, 155, 86, 0.07) 0%, transparent 72%);
  pointer-events: none;
  border-radius: 50%;
}

/* ── 8. Scene 2 — Paradigm Shift ────────────────────────────── */
.scene--paradigm {
  text-align: center;
}

.scene--paradigm .scene-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
}

.scene--paradigm h2 {
  max-width: 820px;
}

.scene--paradigm .lead {
  text-align: center;
  max-width: 560px;
}

.scene--paradigm .accent {
  text-align: center;
  max-width: 580px;
  color: var(--gold-light);
  opacity: 0.85;
}

/* ── 9. Scene 3 — Workshop ──────────────────────────────────── */
.scene--workshop {
  background: var(--void-mid);
}

.workshop-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: center;
}

.workshop-text {
  display: flex;
  flex-direction: column;
}

.editor-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.editor-visual img {
  width: auto;
  max-width: min(72vw, 900px);
  max-height: 62vh;
  object-fit: contain;
  opacity: 0.88;
}

/* ── 10. Scene 4 — Ledger ───────────────────────────────────── */
.scene--ledger {
  text-align: center;
}

.scene--ledger .scene-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scene--ledger h2 {
  max-width: 740px;
}

.scene--ledger .lead {
  text-align: center;
  max-width: 540px;
  margin-bottom: 3.5rem;
}

.ledger-block {
  width: min(560px, 100%);
  border-top: 1px solid var(--ledger-line);
}

.ledger-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--ledger-line);
  gap: 24px;
}

.ledger-key {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.2vw, 0.82rem);
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.ledger-val {
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1.3vw, 0.88rem);
  color: var(--ink-sub);
  text-align: right;
  word-break: break-all;
}

.ledger-sealed {
  color: var(--gold);
  letter-spacing: 0.12em;
}

/* ── 11. Scene 5 — CTA ──────────────────────────────────────── */
.scene--cta {
  text-align: center;
  background: var(--void);
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.scene--cta .scene-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-seal {
  height: 64px;
  width: auto;
  filter: invert(1);
  opacity: 0.6;
  margin-bottom: 3rem;
}

.scene--cta h2 {
  max-width: 700px;
}

.scene--cta .lead {
  text-align: center;
  max-width: 540px;
}

.closing-line {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  color: var(--ink-muted);
  line-height: 1.7;
  max-width: 500px;
  text-align: center;
  margin-bottom: 3rem;
  word-break: keep-all;
}

.scene--cta .cta-group {
  justify-content: center;
}

/* ── 12. Lightbox ───────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  pointer-events: none;
  transition: background 0.35s ease;
}

.lightbox-overlay.open {
  background: rgba(0, 0, 0, 0.88);
  pointer-events: all;
}

.lightbox-overlay img {
  max-width: min(88vw, 1100px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 2px;
  transform: scale(0.88) translateY(24px);
  opacity: 0;
  transition:
    transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    opacity   0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-overlay.open img {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: rgba(245, 245, 240, 0.45);
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
}

.lightbox-close:hover {
  color: var(--ink);
}

/* 클릭 가능한 이미지 — 줌 커서 */
.editor-img,
.certificate-img {
  cursor: zoom-in;
}

/* 이미지 하단 캡션 (인라인) */
.img-caption {
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.1vw, 0.78rem);
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.6;
  opacity: 0.75;
  max-width: 420px;
}

/* 라이트박스 내부 래퍼 */
.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  pointer-events: none;
}

/* 라이트박스 하단 캡션 */
.lightbox-caption {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.2vw, 0.82rem);
  color: rgba(245, 245, 240, 0.5);
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1) 0.18s,
    transform 0.42s cubic-bezier(0.16, 1, 0.3, 1) 0.18s;
}

.lightbox-overlay.open .lightbox-caption {
  opacity: 1;
  transform: translateY(0);
}

/* ── 13. Footer ─────────────────────────────────────────────── */
.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px clamp(20px, 4vw, 60px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.footer-disclaimer {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
  word-break: keep-all;
}

/* ── 13. Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── 14. Responsive — Tablet 1024px ────────────────────────── */
@media (max-width: 1024px) {
  .scene-inner {
    width: min(960px, 100% - 56px);
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 80px 0 60px;
    text-align: center;
    min-height: auto;
  }

  .hero-text {
    align-items: center;
  }

  .hero-text .lead {
    text-align: center;
  }

  .certificate-visual img {
    max-width: 72vw;
    max-height: 60vh;
  }

  .workshop-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .workshop-text {
    align-items: center;
    text-align: center;
  }

  .workshop-text .lead {
    text-align: center;
  }
}

/* ── 15. Responsive — Mobile 768px ─────────────────────────── */
@media (max-width: 768px) {
  .scene {
    min-height: 100svh;
    padding: 80px 0;
  }

  .scene-inner {
    width: min(100%, 100% - 40px);
  }

  h1 {
    font-size: clamp(2.6rem, 10vw, 4rem);
    letter-spacing: -0.03em;
  }

  h2 {
    font-size: clamp(2.2rem, 9vw, 3.5rem);
    letter-spacing: -0.025em;
  }

  .certificate-visual img {
    max-width: 94vw;
    max-height: 62svh;
    object-fit: contain;
  }

  .editor-visual img {
    max-width: 96vw;
    max-height: 48svh;
  }

  .cta-group {
    flex-direction: column;
    width: min(100%, 320px);
  }

  .btn {
    text-align: center;
    width: 100%;
  }

  .ledger-line {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .ledger-val {
    text-align: left;
  }

  /* PATCH 3 — certificate 우선 노출 (display:contents로 order 직접 제어) */
  .hero-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 40px 0 48px;
    text-align: center;
  }

  /* hero-text 박스 해체 → 자식들이 hero-layout의 직접 flex 자식이 됨 */
  .hero-text {
    display: contents;
  }

  .hero-text .eyebrow   { order: 1; margin-bottom: 1.2rem; }
  .hero-text h1         { order: 2; margin-bottom: 1.5rem; }
  .certificate-visual   { order: 3; margin-bottom: 1.8rem; }
  .hero-text .lead      { order: 4; }
  .hero-text .cta-group { order: 5; align-self: center; }
}

/* ── 16. Responsive — Mobile 480px ─────────────────────────── */
@media (max-width: 480px) {
  .scene-inner {
    width: min(100%, 100% - 28px);
  }

  .nav {
    padding: 0 20px;
  }

  .nav-cta {
    font-size: 0.75rem;
    padding: 7px 14px;
    letter-spacing: 0.03em;
  }

  .certificate-visual img {
    max-width: 96vw;
    max-height: 56svh;
  }

  .scene--cta {
    padding-bottom: 80px;
  }

  .footer {
    position: relative;
    margin-top: 40px;
  }
}

/* ── 17. Responsive — Small Mobile 390px ───────────────────── */
@media (max-width: 390px) {
  h1 {
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  h2 {
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .certificate-visual::before {
    width: 280px;
    height: 360px;
  }
}
