/* 1D — First Dimension of Consciousness */

body.first-dimension-page .site-header,
body.first-dimension-page .site-header__nav-backdrop {
  display: none !important;
}

body.first-dimension-page {
  margin: 0;
}

body.first-dimension-page .site-main.dim-1 {
  max-width: none;
  margin: 0;
  padding: 0;
}

.first-dimension-page {
  color-scheme: dark;
  background: #040408;
  --dim1-bg: #040408;
  --dim1-bg-deep: #020204;
  --dim1-text: #e4ddd4;
  --dim1-text-soft: rgba(228, 221, 212, 0.72);
  --dim1-muted: rgba(168, 158, 148, 0.55);
  --dim1-iron: #8b4a3a;
  --dim1-iron-glow: rgba(196, 92, 58, 0.35);
  --dim1-gold: #c9a227;
  --dim1-gold-soft: rgba(201, 162, 39, 0.22);
  --dim1-crystal: #a8c4d4;
  --dim1-crystal-dim: rgba(168, 196, 212, 0.18);
  --dim1-magnetic: #5a6a9a;
  --dim1-magnetic-glow: rgba(90, 106, 154, 0.28);
  --dim1-core: #6a3030;
  --dim1-font-display: "Cormorant Garamond", Georgia, serif;
  --dim1-font-mono: "JetBrains Mono", ui-monospace, monospace;
  --dim1-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dim1-pad: clamp(1.25rem, 4vw, 3rem);
}

.dim-1 {
  position: relative;
  min-height: 100vh;
  color: var(--dim1-text);
  font-family: var(--font-body);
  overflow-x: clip;
}

/* ——— Ambient layers ——— */

.dim-1__canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.dim-1__grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.dim-1__magnetic-field {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(106, 48, 48, 0.12) 0%, transparent 55%);
}

.dim-1__cursor {
  position: fixed;
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--dim1-iron-glow) 0%, transparent 68%);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
}

body.first-dimension-page.has-dim1-cursor .dim-1__cursor {
  opacity: 1;
}

/* ——— Chrome ——— */

.dim-1__chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--dim1-pad);
  background: linear-gradient(180deg, rgba(4, 4, 8, 0.88) 0%, transparent 100%);
  pointer-events: none;
}

.dim-1__chrome > * {
  pointer-events: auto;
}

.dim-1__exit {
  font-family: var(--dim1-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim1-muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

.dim-1__exit:hover {
  color: var(--dim1-gold);
  text-decoration: none;
}

.dim-1__chapter-nav {
  display: none;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .dim-1__chapter-nav {
    display: flex;
  }
}

.dim-1__chapter-link {
  font-family: var(--dim1-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim1-muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

.dim-1__chapter-link:hover,
.dim-1__chapter-link.is-active {
  color: var(--dim1-crystal);
  text-decoration: none;
}

.dim-1__progress {
  position: fixed;
  left: clamp(0.65rem, 2vw, 1.1rem);
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: min(36vh, 200px);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  pointer-events: none;
}

.dim-1__progress span {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--dim1-gold), var(--dim1-iron));
  border-radius: inherit;
  transition: height 0.1s linear;
}

/* ——— Sections ——— */

.dim-1__section {
  position: relative;
  z-index: 10;
}

.dim-1__section [data-dim1-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--dim1-ease),
    transform 0.9s var(--dim1-ease);
}

.dim-1__section.is-visible [data-dim1-reveal] {
  opacity: 1;
  transform: translateY(0);
}

.dim-1__section.is-visible [data-dim1-reveal]:nth-child(2) { transition-delay: 0.08s; }
.dim-1__section.is-visible [data-dim1-reveal]:nth-child(3) { transition-delay: 0.16s; }
.dim-1__section.is-visible [data-dim1-reveal]:nth-child(4) { transition-delay: 0.24s; }
.dim-1__section.is-visible [data-dim1-reveal]:nth-child(5) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .dim-1__section [data-dim1-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ——— Hero ——— */

.dim-1__hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem var(--dim1-pad) 4rem;
}

.dim-1__hero-inner {
  max-width: 42rem;
}

.dim-1__eyebrow {
  font-family: var(--dim1-font-mono);
  font-size: clamp(0.65rem, 1.2vw, 0.75rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim1-muted);
  margin-bottom: 1.5rem;
}

.dim-1__title {
  font-family: var(--dim1-font-display);
  font-weight: 500;
  font-size: clamp(5rem, 18vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  background: linear-gradient(165deg, var(--dim1-crystal) 0%, var(--dim1-gold) 45%, var(--dim1-iron) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dim-1__title-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) scale(0.92);
  animation: dim1-title-in 1.2s var(--dim1-ease) forwards;
  animation-delay: calc(0.15s + var(--char-i, 0) * 0.12s);
}

@keyframes dim1-title-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dim-1__tagline {
  font-family: var(--dim1-font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--dim1-text-soft);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.dim-1__lead {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  color: var(--dim1-muted);
  line-height: 1.7;
  max-width: 32rem;
  margin-inline: auto;
}

.dim-1__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--dim1-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim1-muted);
}

.dim-1__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, var(--dim1-gold), transparent);
  animation: dim1-scroll-pulse 2.2s ease-in-out infinite;
}

@keyframes dim1-scroll-pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.7); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

.dim-1__crystal--hero {
  position: absolute;
  right: clamp(1rem, 8vw, 6rem);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(120px, 18vw, 220px);
  color: var(--dim1-crystal);
  opacity: 0.45;
  animation: dim1-crystal-float 8s ease-in-out infinite;
}

.dim-1__crystal--hero svg {
  width: 100%;
  height: auto;
}

@keyframes dim1-crystal-float {
  0%, 100% { transform: translateY(-50%) rotate(0deg); }
  50% { transform: translateY(calc(-50% - 12px)) rotate(6deg); }
}

@media (max-width: 700px) {
  .dim-1__crystal--hero {
    right: 50%;
    top: auto;
    bottom: 5rem;
    transform: translateX(50%);
    width: 100px;
    opacity: 0.25;
  }
}

/* ——— Chapters ——— */

.dim-1__chapter {
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(5rem, 12vh, 8rem) var(--dim1-pad);
  display: flex;
  align-items: center;
}

.dim-1__chapter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  width: min(1100px, 100%);
  margin-inline: auto;
  align-items: center;
}

@media (min-width: 800px) {
  .dim-1__chapter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.dim-1__chapter-inner {
  width: min(720px, 100%);
  margin-inline: auto;
  text-align: center;
}

.dim-1__chapter-inner--overlay {
  position: relative;
  z-index: 2;
}

.dim-1__chapter-num {
  font-family: var(--dim1-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--dim1-gold);
  margin-bottom: 1rem;
}

.dim-1__chapter-title {
  font-family: var(--dim1-font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.dim-1__chapter-title--center {
  text-align: center;
}

.dim-1__chapter-sub {
  font-family: var(--dim1-font-display);
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--dim1-muted);
  margin-bottom: 1.75rem;
}

.dim-1__prose {
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.8;
  color: var(--dim1-text-soft);
}

.dim-1__prose p + p {
  margin-top: 1.25rem;
}

.dim-1__prose--wide {
  max-width: 38rem;
  margin-inline: auto;
  text-align: center;
}

.dim-1__prose em {
  font-family: var(--dim1-font-display);
  font-style: italic;
  color: var(--dim1-gold);
  font-size: 1.1em;
}

/* ——— Elements grid ——— */

.dim-1__elements-label {
  font-family: var(--dim1-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim1-muted);
  margin-bottom: 1rem;
}

.dim-1__elements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.dim-1__element {
  --el-color: var(--dim1-crystal);
  --el-border: rgba(168, 196, 212, 0.12);
  --el-bg: rgba(255, 255, 255, 0.03);
  --el-glow: rgba(168, 196, 212, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 1.1rem 1.15rem;
  background: var(--el-bg);
  border: 1px solid var(--el-border);
  border-radius: 4px;
  color: var(--dim1-text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  overflow: hidden;
  transition:
    border-color 0.35s ease,
    transform 0.35s var(--dim1-ease),
    background 0.35s ease,
    box-shadow 0.35s ease;
}

.dim-1__element--carbon {
  --el-color: #ed851d;
  --el-border: rgba(237, 133, 29, 0.28);
  --el-bg: rgba(237, 133, 29, 0.06);
  --el-glow: rgba(237, 133, 29, 0.35);
}

.dim-1__element--hydrogen {
  --el-color: #5b8cff;
  --el-border: rgba(91, 140, 255, 0.28);
  --el-bg: rgba(91, 140, 255, 0.06);
  --el-glow: rgba(91, 140, 255, 0.35);
}

.dim-1__element--nitrogen {
  --el-color: #4ecf7a;
  --el-border: rgba(78, 207, 122, 0.28);
  --el-bg: rgba(78, 207, 122, 0.06);
  --el-glow: rgba(78, 207, 122, 0.35);
}

.dim-1__element--oxygen {
  --el-color: #f4f0eb;
  --el-border: rgba(244, 240, 235, 0.22);
  --el-bg: rgba(244, 240, 235, 0.05);
  --el-glow: rgba(244, 240, 235, 0.28);
}

.dim-1__element:hover,
.dim-1__element.is-active {
  border-color: var(--el-color);
  background: var(--el-bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--el-glow);
}

.dim-1__element-num {
  font-family: var(--dim1-font-mono);
  font-size: 0.6rem;
  color: var(--dim1-muted);
}

.dim-1__element-symbol {
  font-family: var(--dim1-font-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  color: var(--el-color);
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.dim-1__element.is-active .dim-1__element-symbol {
  text-shadow: 0 0 24px var(--el-glow);
}

.dim-1__element-name {
  font-size: 0.8rem;
  color: var(--dim1-text-soft);
}

.dim-1__element-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--el-glow), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.dim-1__element:hover .dim-1__element-glow,
.dim-1__element.is-active .dim-1__element-glow {
  opacity: 1;
}

.dim-1__elements-hint {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--dim1-muted);
}

/* ——— Awareness ——— */

.dim-1__chapter--awareness {
  position: relative;
  background: linear-gradient(180deg, transparent 0%, rgba(106, 48, 48, 0.06) 50%, transparent 100%);
}

.dim-1__quote {
  font-family: var(--dim1-font-display);
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--dim1-text-soft);
  max-width: 36rem;
  margin: 0 auto 3rem;
  padding: 0;
  border: none;
}

.dim-1__pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  text-align: left;
}

@media (min-width: 640px) {
  .dim-1__pillars {
    grid-template-columns: 1fr 1fr;
  }
}

.dim-1__pillar {
  padding: 1.75rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  transition: transform 0.4s var(--dim1-ease);
}

.dim-1__pillar h3 {
  font-family: var(--dim1-font-display);
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: 0.65rem;
  color: var(--dim1-crystal);
}

.dim-1__pillar p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--dim1-text-soft);
}

.dim-1__sleep-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(90, 106, 154, 0.08));
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,60 Q150,20 300,60 T600,60 T900,60 T1200,60 L1200,120 L0,120 Z' fill='white'/%3E%3C/svg%3E");
  mask-size: 200% 100%;
  animation: dim1-wave-drift 12s linear infinite;
  pointer-events: none;
}

@keyframes dim1-wave-drift {
  to { mask-position: 200% 0; }
}

/* ——— Core ——— */

.dim-1__chapter--core {
  position: relative;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.dim-1__core-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dim-1__core-planet {
  position: relative;
  width: min(420px, 70vw);
  aspect-ratio: 1;
}

.dim-1__core-inner {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9a4a4a, var(--dim1-core) 50%, #2a1010 100%);
  box-shadow:
    0 0 60px rgba(196, 92, 58, 0.25),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  animation: dim1-core-pulse 4s ease-in-out infinite;
}

@keyframes dim1-core-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.dim-1__core-field {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(90, 106, 154, 0.25);
  animation: dim1-field-spin 20s linear infinite;
}

.dim-1__core-field--b {
  inset: -12%;
  animation-duration: 28s;
  animation-direction: reverse;
  border-color: rgba(168, 196, 212, 0.15);
}

@keyframes dim1-field-spin {
  to { transform: rotate(360deg); }
}

.dim-1__core-field::before,
.dim-1__core-field::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim1-magnetic);
  box-shadow: 0 0 12px var(--dim1-magnetic-glow);
}

.dim-1__core-field::before {
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
}

.dim-1__core-field::after {
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
}

/* ——— Body ——— */

.dim-1__chapter--body {
  background: linear-gradient(180deg, transparent 0%, rgba(4, 4, 8, 0.6) 30%);
}

.dim-1__body-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  width: min(1000px, 100%);
  margin-inline: auto;
  align-items: center;
}

@media (min-width: 800px) {
  .dim-1__body-grid {
    grid-template-columns: auto 1fr;
    gap: 4rem;
  }
}

.dim-1__dna-wrap {
  display: flex;
  justify-content: center;
  color: var(--dim1-crystal);
  opacity: 0.55;
}

.dim-1__dna {
  width: clamp(60px, 12vw, 100px);
  height: auto;
  animation: dim1-dna-drift 6s ease-in-out infinite;
}

@keyframes dim1-dna-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.dim-1__body-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.dim-1__body-card {
  padding: 1.5rem 1.75rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(168, 196, 212, 0.1);
  border-radius: 6px;
  transition: transform 0.4s var(--dim1-ease);
}

.dim-1__body-card-icon {
  display: block;
  font-size: 1.25rem;
  color: var(--dim1-gold);
  margin-bottom: 0.5rem;
}

.dim-1__body-card h3 {
  font-family: var(--dim1-font-display);
  font-weight: 500;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.dim-1__body-card p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--dim1-text-soft);
}

/* ——— Footer ——— */

.dim-1__footer {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--dim1-pad) 6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dim-1__footer-eyebrow {
  font-family: var(--dim1-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim1-muted);
  margin-bottom: 1rem;
}

.dim-1__footer-line {
  font-family: var(--dim1-font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-style: italic;
  color: var(--dim1-text-soft);
  margin-bottom: 2rem;
}

.dim-1__footer-link {
  font-family: var(--dim1-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim1-gold);
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 2px;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s var(--dim1-ease);
}

.dim-1__footer-link:hover {
  background: rgba(201, 162, 39, 0.1);
  border-color: var(--dim1-gold);
  text-decoration: none;
  transform: translateY(-2px);
}

/* ——— Tilt (JS-enhanced) ——— */

[data-dim1-tilt] {
  transform-style: preserve-3d;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .dim-1__scroll-line,
  .dim-1__crystal--hero,
  .dim-1__core-inner,
  .dim-1__core-field,
  .dim-1__dna,
  .dim-1__sleep-wave,
  .dim-1__title-char {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
