/* kaigenrei.com - Martial Law Aesthetic */
/* Colors: #162338, #E07A5F, #0B1623, #C8D6E5, #8395A7, #D4A574, #3D5A80 */
/* Fonts: Inter (display/body), Space Grotesk (secondary), Space Mono (mono) */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: #0B1623;
  color: #C8D6E5;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  perspective: 1200px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* SVG Filters - hidden */
.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Grain Overlay */
.grain-overlay {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
  mix-blend-mode: overlay;
}

/* Scan Line */
.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(61, 90, 128, 0.3), transparent);
  z-index: 999;
  animation: scanDown 8s linear infinite;
  pointer-events: none;
}

@keyframes scanDown {
  0% { top: -2px; }
  100% { top: 100vh; }
}

/* Background Grid Lines */
.layer-0 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grid-lines {
  position: relative;
  width: 100%;
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
}

.grid-line-v {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(61, 90, 128, 0.06);
}

/* Section Styles */
.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  z-index: 1;
}

/* Content Grid */
.content-grid {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 24px;
  position: relative;
}

/* Typography */
.display-headline {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(60px, 12vw, 160px);
  letter-spacing: -0.06em;
  line-height: 0.88;
  text-transform: uppercase;
  color: #C8D6E5;
}

.section-headline {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(32px, 5vw, 64px);
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
  color: #C8D6E5;
  margin-bottom: 16px;
}

.body-text {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.7;
  color: #8395A7;
  max-width: 600px;
}

.mono-text {
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #3D5A80;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 20px;
  color: #C8D6E5;
  margin-bottom: 12px;
}

/* Horizontal Rule */
.horizontal-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #3D5A80, transparent);
  margin: 32px 0;
}

/* Bounce Enter Animation */
.bounce-enter {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bounce-enter.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Watercolor Boundary */
.watercolor-boundary {
  position: absolute;
  bottom: -40px;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(to bottom, #0B1623, transparent);
  filter: url(#watercolor-dissolve);
  z-index: 2;
  pointer-events: none;
}

/* ==================== */
/* SECTION: Proclamation */
/* ==================== */
.section-proclamation {
  background: radial-gradient(ellipse at 30% 50%, #162338 0%, #0B1623 70%);
  min-height: 100vh;
}

.section-proclamation .content-grid {
  padding-top: 10vh;
}

.section-proclamation .headline-block {
  grid-column: 1 / -1;
  text-align: left;
  padding-left: 5%;
}

.section-proclamation .subtitle-block {
  grid-column: 1 / 5;
  padding-left: 5%;
  margin-top: -8px;
}

.classification-stamp {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid rgba(61, 90, 128, 0.3);
  color: #D4A574;
  font-size: 10px;
}

.section-proclamation .decree-line {
  grid-column: 1 / -1;
  padding: 0 5%;
}

.section-proclamation .body-text-block {
  grid-column: 2 / 6;
  padding-left: 5%;
}

/* ==================== */
/* SECTION: Archive */
/* ==================== */
.section-archive {
  background: linear-gradient(180deg, #0B1623 0%, #162338 50%, #0B1623 100%);
}

.section-archive .archive-header {
  grid-column: 1 / -1;
  margin-bottom: 48px;
}

.archive-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.archive-card {
  background: rgba(22, 35, 56, 0.6);
  border: 1px solid rgba(61, 90, 128, 0.15);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s ease, transform 0.4s ease;
}

.archive-card:hover {
  border-color: rgba(61, 90, 128, 0.4);
  transform: translateY(-4px);
}

.card-index {
  margin-bottom: 16px;
  color: #D4A574;
  font-size: 13px;
}

.card-redaction-bar {
  width: 60%;
  height: 3px;
  background: #E07A5F;
  margin-bottom: 20px;
  opacity: 0.6;
}

.card-body {
  margin-bottom: 20px;
}

.card-timestamp {
  color: #3D5A80;
  font-size: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(61, 90, 128, 0.1);
}

/* ==================== */
/* SECTION: Descent */
/* ==================== */
.section-descent {
  background: linear-gradient(180deg, #0B1623 0%, #0a1320 100%);
}

.section-descent .descent-header {
  grid-column: 1 / -1;
  margin-bottom: 48px;
}

.descent-timeline {
  grid-column: 2 / 7;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 40px;
}

.timeline-node {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  position: relative;
}

.node-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #E07A5F;
  border: 2px solid #0B1623;
  box-shadow: 0 0 12px rgba(224, 122, 95, 0.4);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.node-content {
  padding-bottom: 8px;
}

.node-date {
  display: block;
  margin-bottom: 8px;
  color: #D4A574;
}

.timeline-connector {
  width: 2px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(224, 122, 95, 0.4), rgba(61, 90, 128, 0.15));
  margin-left: 5px;
  flex-shrink: 0;
}

/* ==================== */
/* SECTION: Redacted */
/* ==================== */
.section-redacted {
  background: linear-gradient(180deg, #0a1320 0%, #162338 50%, #0B1623 100%);
}

.section-redacted .redacted-block {
  grid-column: 1 / -1;
  text-align: center;
  position: relative;
}

.redaction-overlay {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.redaction-bar-large {
  width: 80%;
  height: 24px;
  background: #162338;
  border: 1px solid rgba(61, 90, 128, 0.1);
}

.redaction-bar-medium {
  width: 55%;
  height: 18px;
  background: #162338;
  border: 1px solid rgba(61, 90, 128, 0.1);
}

.redaction-bar-small {
  width: 35%;
  height: 14px;
  background: #162338;
  border: 1px solid rgba(61, 90, 128, 0.1);
}

.redacted-content {
  grid-column: 2 / 7;
  margin-top: 48px;
  text-align: center;
}

.redacted-inline {
  display: inline-block;
  width: 80px;
  height: 1.1em;
  background: #162338;
  vertical-align: middle;
  margin: 0 4px;
  border-bottom: 2px solid #E07A5F;
}

.document-seal {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 64px;
}

.seal-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(224, 122, 95, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sealPulse 4s ease-in-out infinite;
}

.seal-inner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(224, 122, 95, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.seal-text {
  color: #E07A5F;
  font-size: 12px;
  letter-spacing: 0.3em;
}

@keyframes sealPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(224, 122, 95, 0.1); }
  50% { box-shadow: 0 0 40px rgba(224, 122, 95, 0.25); }
}

/* ==================== */
/* SECTION: Transmission */
/* ==================== */
.section-transmission {
  background: linear-gradient(180deg, #0B1623 0%, #162338 50%, #0B1623 100%);
}

.section-transmission .transmission-header {
  grid-column: 1 / -1;
  margin-bottom: 32px;
}

.signal-visualization {
  grid-column: 1 / -1;
  margin-bottom: 48px;
}

#signal-canvas {
  width: 100%;
  height: 200px;
  background: rgba(22, 35, 56, 0.4);
  border: 1px solid rgba(61, 90, 128, 0.1);
}

.transmission-text {
  grid-column: 2 / 6;
  margin-bottom: 48px;
}

.frequency-readout {
  grid-column: 1 / -1;
  display: flex;
  gap: 64px;
  padding: 24px 32px;
  border: 1px solid rgba(61, 90, 128, 0.15);
  background: rgba(11, 22, 35, 0.6);
}

.freq-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.freq-label {
  font-size: 9px;
  color: #3D5A80;
}

.freq-value {
  font-size: 14px;
  color: #C8D6E5;
}

.signal-active {
  color: #E07A5F !important;
  animation: signalBlink 2s ease-in-out infinite;
}

@keyframes signalBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==================== */
/* SECTION: Emergence */
/* ==================== */
.section-emergence {
  background: radial-gradient(ellipse at 70% 50%, #162338 0%, #0B1623 70%);
  min-height: 100vh;
}

.section-emergence .emergence-header {
  grid-column: 1 / -1;
  text-align: right;
  padding-right: 5%;
}

.emergence-title {
  color: #D4A574;
}

.section-emergence .emergence-body {
  grid-column: 4 / 8;
  margin-top: 32px;
}

.emergence-text {
  color: #8395A7;
  font-size: clamp(15px, 1.3vw, 20px);
  line-height: 1.8;
}

.section-emergence .emergence-footer {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 64px;
}

.emergence-footer .mono-text {
  color: #8395A7;
}

/* ==================== */
/* Scroll Progress */
/* ==================== */
.scroll-progress {
  position: fixed;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  z-index: 998;
  background: rgba(61, 90, 128, 0.08);
}

.scroll-progress-bar {
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, #3D5A80, #E07A5F);
  transition: height 0.1s linear;
}

/* ==================== */
/* Section Nav */
/* ==================== */
.section-nav {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 998;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(61, 90, 128, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-dot:hover {
  background: #3D5A80;
  transform: scale(1.4);
}

.nav-dot.active {
  background: #E07A5F;
  box-shadow: 0 0 8px rgba(224, 122, 95, 0.4);
}

/* ==================== */
/* Responsive */
/* ==================== */
@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px;
  }

  .section-proclamation .headline-block,
  .section-proclamation .subtitle-block,
  .section-proclamation .decree-line,
  .section-proclamation .body-text-block {
    grid-column: 1 / -1;
    padding-left: 0;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .descent-timeline {
    grid-column: 1 / -1;
    padding-left: 20px;
  }

  .section-redacted .redacted-block,
  .redacted-content,
  .document-seal {
    grid-column: 1 / -1;
  }

  .signal-visualization,
  .transmission-text,
  .frequency-readout,
  .section-transmission .transmission-header {
    grid-column: 1 / -1;
  }

  .frequency-readout {
    flex-direction: column;
    gap: 24px;
  }

  .section-emergence .emergence-header,
  .section-emergence .emergence-body,
  .section-emergence .emergence-footer {
    grid-column: 1 / -1;
    text-align: left;
    padding-right: 0;
  }

  .section-nav {
    right: 12px;
  }

  .section {
    padding: 60px 16px;
  }
}
