@import url('./tokens.css');

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--void-black);
  font-family: var(--font-body), system-ui, sans-serif;
}
a {
  color: var(--fog-white);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes heroReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* ---------- buttons (design-system Button.jsx spec) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body), sans-serif;
  font-weight: 500;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: opacity var(--duration-control) var(--ease-journey),
              background var(--duration-control) var(--ease-journey);
  border: none;
  text-decoration: none;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary {
  background: var(--signal-amber);
  color: var(--accent-text);
}
.btn-secondary {
  background: transparent;
  color: var(--fog-white);
  border: 1px solid var(--fog-white);
  transition: background-color var(--duration-control) var(--ease-journey), color var(--duration-control) var(--ease-journey);
}
.btn-secondary:hover {
  background-color: #F5A623;
  border-color: #F5A623;
  color: var(--void-black);
}
.btn-sm { padding: 10px 20px; font-size: var(--text-caption); }
.btn-md { padding: 16px 32px; font-size: var(--text-small); }

/* ---------- nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  background: transparent;
  transition: background var(--duration-reveal) var(--ease-journey);
}
.site-nav.is-scrolled { background: var(--void-black); }
.nav-left {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-logo {
  height: 17px;
  display: block;
  filter: brightness(0) invert(1);
}
.nav-divider {
  width: 1px;
  height: 18px;
  background: rgba(244, 243, 239, .24);
}
.nav-social {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-social a {
  position: relative;
  display: flex;
  color: rgba(244, 243, 239, .7);
  transition: color var(--duration-control) var(--ease-journey);
}
.nav-social a:hover {
  color: var(--fog-white);
  text-decoration: none;
}

/* tooltip (CSS-only, ::before = label, ::after = arrow) */
.nav-social a::before {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--void-black);
  color: var(--fog-white);
  font: 500 12px var(--font-body), sans-serif;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-on-dark);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s var(--ease-journey),
              transform .2s var(--ease-journey),
              visibility .2s;
}
.nav-social a::after {
  content: '';
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  border: 5px solid transparent;
  border-bottom-color: var(--steel-gray);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s var(--ease-journey),
              transform .2s var(--ease-journey),
              visibility .2s;
}
.nav-social a:hover::before,
.nav-social a:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-body), sans-serif;
  font-size: var(--text-small);
}
.nav-links a {
  font-size: 14px;
  color: rgba(244, 243, 239, .82);
}

/* ---------- mobile hamburger + slide-in menu (모바일 전용, 데스크톱 숨김) ---------- */
.nav-toggle {
  display: none; /* 데스크톱: 숨김. 900px 이하에서 flex로 표시 */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 40;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 auto;
  background: var(--fog-white);
}
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(6, 6, 7, .6);
  opacity: 0;
  transition: opacity .3s var(--ease-journey);
}
.nav-scrim.is-open { opacity: 1; }
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 50;
  width: 78%;
  max-width: 340px;
  background: var(--void-black);
  border-left: 1px solid var(--border-on-dark);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .5);
  padding: 84px 30px 40px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .32s var(--ease-journey), visibility .32s;
  will-change: transform;
}
.mobile-menu.is-open {
  transform: translateX(0);
  visibility: visible;
}
.mobile-menu a {
  font: 500 19px var(--font-body), sans-serif;
  color: var(--fog-white);
  padding: 17px 4px;
  border-bottom: 1px solid var(--border-on-dark);
}
.mobile-menu a.is-current { color: var(--signal-amber); }
.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--fog-white);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
body.nav-open { overflow: hidden; } /* 패널 열릴 때 배경 스크롤 잠금 */
@media (prefers-reduced-motion: reduce) {
  .nav-scrim, .mobile-menu { transition: none; }
}

/* ---------- hero (CH.01) ---------- */
.hero-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--void-black);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 120px 48px 96px;
}
.hero-photo {
  position: absolute;
  top: -10%; left: 0; right: 0;
  height: 120%;
  will-change: transform;
  background-color: #141416;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-position: center 30%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 2s var(--ease-journey);
}
.hero-slide.is-active { opacity: 1; }
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(11,11,12,.5) 0%,
    rgba(11,11,12,.06) 26%,
    rgba(11,11,12,.12) 52%,
    rgba(11,11,12,.9) 100%);
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  opacity: 0;
  transform: translateY(24px);
  animation: heroReveal var(--duration-reveal) var(--ease-journey) both;
}
.hero-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--fog-white);
  margin: 0;
}
.hero-rule {
  height: 2px;
  width: 120px;
  background: rgba(244, 243, 239, .55);
  margin: 30px 0 0;
}
.hero-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono), monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .22em;
  color: rgba(244, 243, 239, .5);
}

/* ---------- shared section chrome ---------- */
.chapter-split {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.chapter-copy {
  padding: 120px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.chapter-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: clamp(30px, 3.4vw, 52px);
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--fog-white);
  margin: 0;
}
.chapter-rule {
  height: 3px;
  width: 104px;
  background: var(--signal-amber);
  margin: 30px 0 26px;
}
.chapter-body {
  font: 400 18px/1.75 var(--font-body), sans-serif;
  color: rgba(244, 243, 239, .7);
  margin: 0;
  max-width: 520px;
}
.chapter-photo {
  position: relative;
  background-color: #141416;
  overflow: hidden;
}
.chapter-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- CH.02 개입 ---------- */
.section-about { background: var(--void-black); }
.permit-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}
.permit-badge {
  font: 500 14px var(--font-mono), monospace;
  color: rgba(244, 243, 239, .82);
  border: 1px solid var(--border-on-dark);
  padding: 10px 16px;
}

/* ---------- CH.03 이동 ---------- */
.section-journey { background: #0f0f11; }
.stat-row {
  display: flex;
  gap: 40px;
  margin-top: 48px;
}
.stat-value {
  font: var(--weight-heading) clamp(22px, 6.5vw, 44px) var(--font-heading);
  color: var(--fog-white);
  line-height: 1;
  white-space: nowrap;
}
.stat-label {
  font: 400 15px var(--font-body), sans-serif;
  color: rgba(244, 243, 239, .55);
  margin-top: 8px;
}

/* ---------- CH.04 증명 ---------- */
.section-proof {
  position: relative;
  min-height: 100vh;
  background: var(--void-black);
  padding: 120px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.section-proof .chapter-title { max-width: 820px; }
.proof-lede {
  font: 400 18px/1.75 var(--font-body), sans-serif;
  color: rgba(244, 243, 239, .66);
  margin: 26px 0 0;
  max-width: 600px;
}
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}
.proof-card {
  border: 1px solid var(--border-on-dark);
  border-top: 3px solid var(--border-on-dark);
  padding: 36px;
}
.proof-card.is-accent { border-top-color: var(--signal-amber); }
.proof-card-index {
  font: 500 14px var(--font-mono), monospace;
  color: var(--steel-gray);
  margin-bottom: 16px;
}
.proof-card-title {
  font: 700 24px var(--font-display), sans-serif;
  color: var(--fog-white);
}
.proof-card-body {
  font: 400 16px/1.6 var(--font-body), sans-serif;
  color: rgba(244, 243, 239, .55);
  margin: 14px 0 0;
}
.proof-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border-on-dark);
}
.proof-cta-text {
  font: 400 19px/1.5 var(--font-body), sans-serif;
  color: var(--fog-white);
}

/* ---------- footer (shared across all pages) ---------- */
.site-footer {
  background: var(--void-black);
  padding: 44px 80px;
  border-top: 1px solid var(--border-on-dark);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.site-footer-wordmark {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: 15px;
  color: var(--fog-white);
  opacity: .7;
}
.site-footer-meta {
  font: 400 13px/1.7 var(--font-mono), monospace;
  color: var(--steel-gray);
}
.site-footer-link {
  font: 500 13px var(--font-body), sans-serif;
  color: var(--steel-gray);
  white-space: nowrap;
}
.site-footer-link:hover { color: var(--fog-white); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .chapter-split { grid-template-columns: 1fr; min-height: auto; }
  .chapter-photo { min-height: 320px; }
  .chapter-copy { padding: 64px 24px; }
  .proof-grid { grid-template-columns: 1fr; }
  .site-nav { padding: 16px 20px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .stat-row { gap: 20px; }
  .nav-social a::before,
  .nav-social a::after { display: none; }
  .hero-section { padding: 96px 24px 72px; }
  .section-proof { padding: 96px 24px; }
  .site-footer { padding: 32px 24px; }
}
