/* ============================================================
   DIAS' DIMENSIONS — KIMI DARK DESIGN SYSTEM
   Master stylesheet · All pages
   v2 — no drop caps, improved readability, mobile optimized
   ============================================================ */

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

:root {
  --ink: #0c0b0a;
  --deep: #141211;
  --mist: #1a1816;
  --shadow: #2a2622;
  --fog: #4a443c;
  --ash: #6b6560;
  --bone: #9a9488;
  --smoke: #c4bcb0;
  --paper: #e0d8c8;
  --light: #f0ebe0;
  --green-dream: #3a4a3a;
  --green-mist: #6b8a6b;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Crimson Text', 'Noto Serif SC', serif;
  background: var(--ink);
  color: var(--paper);
  font-size: 18px;
  line-height: 1.9;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 8rem;
}

/* ── Atmosphere ── */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--ink);
  overflow: hidden;
}

.atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 100% at 50% 0%, transparent 0%, var(--ink) 70%),
    radial-gradient(ellipse 80% 60% at 30% 100%, rgba(58,74,58,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 70% 80%, rgba(106,138,106,0.08) 0%, transparent 50%);
  filter: blur(60px);
  animation: breathe 20s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

/* ── Rain ── */
.rain {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.06;
  background-image: repeating-linear-gradient(
    90deg,
    transparent, transparent 200px,
    var(--paper) 200px, var(--paper) 201px
  );
  animation: fall 8s linear infinite;
}

@keyframes fall {
  0% { transform: translateX(0); }
  100% { transform: translateX(200px); }
}

/* ── Tunnel ── */
.tunnel {
  position: fixed;
  inset: 0;
  z-index: -1;
  perspective: 1000px;
  overflow: hidden;
  pointer-events: none;
}

.tunnel-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200vmax;
  height: 200vmax;
  border: 1px solid var(--green-dream);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(60deg);
  animation: tunnel 30s linear infinite;
  opacity: 0;
}

.tunnel-ring:nth-child(1) { animation-delay: 0s; }
.tunnel-ring:nth-child(2) { animation-delay: -10s; }
.tunnel-ring:nth-child(3) { animation-delay: -20s; }

@keyframes tunnel {
  0%   { transform: translate(-50%, -50%) rotateX(60deg) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translate(-50%, -50%) rotateX(60deg) scale(1); opacity: 0; }
}

/* ── Layout ── */
.container {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ── Whisper Nav ── */
.whispers {
  position: fixed;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  opacity: 0.45;
  transition: opacity 0.3s;
}

.whispers:hover { opacity: 1; }

.whisper {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
  text-decoration: none;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transition: color 0.3s;
  position: relative;
}

.whisper::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -12px;
  width: 1px;
  height: 0;
  background: var(--green-mist);
  transition: height 0.3s;
  transform: translateX(-50%);
}

.whisper:hover,
.whisper.active { color: var(--light); }

.whisper:hover::before,
.whisper.active::before { height: 8px; }

/* ── Whisper dropdown (Books menu) ── */
.whisper-group {
  position: relative;
  display: flex;
  align-items: center;
}

.whisper-dropdown {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 18, 17, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid var(--shadow);
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateY(-50%) translateX(6px);
  z-index: 200;
}

.whisper-group:hover .whisper-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(-50%) translateX(0);
}

.whisper-dropdown a {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ash);
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-transform: none;
}

.whisper-dropdown a:hover,
.whisper-dropdown a.active {
  color: var(--light);
  background: var(--mist);
}

.whisper-dropdown a.active {
  color: var(--green-mist);
}

/* ── Page Header ── */
.page-header {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 5rem 0 3.5rem;
}

.page-label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: emerge 1.5s ease-out 0.3s forwards;
}

.page-title {
  font-size: clamp(1.9rem, 5vw, 3.25rem);
  font-weight: 400;
  color: var(--light);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: emerge 1.5s ease-out 0.5s forwards;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--bone);
  font-style: italic;
  opacity: 0;
  animation: emerge 1.5s ease-out 0.7s forwards;
}

/* ── Homepage Entrance ── */
.entrance {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0;
  position: relative;
}

.entrance::after {
  content: '';
  position: absolute;
  bottom: 20%;
  left: calc(50% - 330px);
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--fog), transparent);
  opacity: 0.5;
  animation: pulse 4s ease-in-out infinite;
}

.epigraph {
  font-size: 0.85rem;
  color: var(--ash);
  letter-spacing: 0.15em;
  margin-bottom: 3rem;
  opacity: 0;
  animation: emerge 2s ease-out 0.5s forwards;
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 400;
  color: var(--light);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: emerge 2s ease-out 0.8s forwards;
}

.hero-title span {
  display: block;
  font-size: 0.58em;
  color: var(--bone);
  font-style: italic;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

.proposition {
  font-size: 1.1rem;
  color: var(--smoke);
  max-width: 540px;
  line-height: 1.9;
  opacity: 0;
  animation: emerge 2s ease-out 1.1s forwards;
}

.proposition p { margin-bottom: 1.5rem; }

/* ── Threshold ── */
.threshold {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--shadow);
  border-bottom: 1px solid var(--shadow);
  opacity: 0;
  animation: emerge 2s ease-out 1.5s forwards;
}

.threshold-label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 1.5rem;
}

.threshold-content {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
}

.glyphs {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.9rem;
  color: var(--green-mist);
  letter-spacing: 0.3em;
  opacity: 0.8;
}

.threshold-text {
  flex: 1;
  font-size: 1rem;
  color: var(--smoke);
  font-style: italic;
  min-width: 200px;
}

/* ── Rooms ── */
.room {
  padding: 4.5rem 0;
  border-top: 1px solid var(--deep);
}

.room-label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 1.75rem;
}

.room-title {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 400;
  color: var(--light);
  margin-bottom: 1.75rem;
  line-height: 1.3;
}

/* ── Room Body — the meat ── */
.room-body {
  color: var(--smoke);
}

/* Paragraphs: no drop cap, no indent, clean spacing */
.room-body p {
  margin-bottom: 1.4rem;
  line-height: 1.85;
  max-width: 62ch; /* keeps line length readable */
}

/* NO drop caps — removed entirely */

/* Generous space above headings, breathing room */
.room-body h2 {
  font-size: 1.35rem;
  color: var(--light);
  font-weight: 400;
  margin: 3rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--shadow);
  line-height: 1.3;
}

.room-body h3 {
  font-size: 1.1rem;
  color: var(--bone);
  font-weight: 400;
  margin: 2rem 0 0.75rem;
  font-style: italic;
}

.room-body h4 {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ash);
  margin: 1.75rem 0 0.5rem;
  font-style: normal;
}

.room-body em { color: var(--paper); font-style: italic; }
.room-body strong { color: var(--light); font-weight: 600; }

/* Lists — more air */
.room-body ul,
.room-body ol {
  margin: 1rem 0 1.75rem 1.25rem;
  color: var(--smoke);
}

.room-body li {
  margin-bottom: 0.65rem;
  line-height: 1.7;
}

/* Blockquotes */
.room-body blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.5rem;
  border-left: 2px solid var(--green-mist);
  color: var(--bone);
  font-style: italic;
  font-size: 1.05rem;
}

/* Horizontal rule */
.room-body hr {
  border: none;
  border-top: 1px solid var(--shadow);
  margin: 2.5rem 0;
}

/* ── Object Grid ── */
.objects {
  margin-top: 2.5rem;
  display: grid;
  gap: 1px;
  background: var(--shadow);
}

.object {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.1rem 1.5rem;
  background: var(--deep);
  text-decoration: none;
  color: var(--bone);
  transition: background 0.3s, color 0.3s;
  line-height: 1.5;
}

.object:hover {
  background: var(--mist);
  color: var(--light);
}

.object-num {
  font-size: 0.85rem;
  color: var(--ash);
  min-width: 2.5rem;
  flex-shrink: 0;
}

.object-name { flex: 1; }

.object-desc {
  font-size: 0.85rem;
  color: var(--ash);
  font-style: italic;
}

/* ── Links ── */
a.link {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--fog);
  padding-bottom: 1px;
  transition: color 0.3s, border-color 0.3s;
}

a.link:hover {
  color: var(--light);
  border-color: var(--green-mist);
}

.nav-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--fog);
  padding-bottom: 2px;
  font-size: 0.9375rem;
  transition: color 0.3s, border-color 0.3s;
}

.nav-link:hover {
  color: var(--light);
  border-color: var(--green-mist);
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--ash);
  letter-spacing: 0.08em;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: emerge 1.5s ease-out 0.2s forwards;
}

.breadcrumb a {
  color: var(--ash);
  text-decoration: none;
  transition: color 0.3s;
}

.breadcrumb a:hover { color: var(--bone); }
.breadcrumb span { margin: 0 0.5rem; }

/* ── Sequence nav ── */
.seq-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--shadow);
  gap: 2rem;
}

.seq-link {
  color: var(--ash);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  transition: color 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.seq-link:hover { color: var(--paper); }
.seq-link.next { text-align: right; }

.seq-link-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fog);
}

/* ── Divider ── */
.divider {
  width: 40px;
  height: 1px;
  background: var(--shadow);
  margin: 3rem 0;
}

/* ── Lang switcher ── */
.lang-switcher {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 100;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.lang-switcher a {
  color: var(--ash);
  text-decoration: none;
  transition: color 0.3s;
}

.lang-switcher a:hover { color: var(--paper); }
.lang-switcher .sep { color: var(--fog); margin: 0 0.5rem; }
.lang-switcher .current { color: var(--bone); }

/* ── Presence bar ── */
.presence {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  right: 4rem;
  z-index: 50;
  background: rgba(20, 18, 17, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--shadow);
  padding: 1.1rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.875rem;
  color: var(--smoke);
  opacity: 0;
  transform: translateY(20px);
  animation: presence 1s ease-out 3s forwards;
}

@keyframes presence {
  to { opacity: 1; transform: translateY(0); }
}

.presence-mark {
  width: 7px;
  height: 7px;
  background: var(--green-mist);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--green-mist);
  animation: throb 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes throb {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.presence-text { flex: 1; }
.presence-text strong { color: var(--light); font-weight: 400; }

.presence-action {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--fog);
  padding-bottom: 2px;
  white-space: nowrap;
  font-size: 0.825rem;
  transition: color 0.3s, border-color 0.3s;
  flex-shrink: 0;
}

.presence-action:hover {
  color: var(--light);
  border-color: var(--green-mist);
}

/* ── Animations ── */
@keyframes emerge {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.threshold-paths {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.threshold-paths a {
  color: var(--bone);
  text-decoration: none;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  transition: color 0.3s;
}

.threshold-paths a:hover {
  color: var(--light);
}

.path-divider {
  color: var(--fog);
  font-size: 0.9rem;
}
/* ── Mobile ── */
@media (max-width: 768px) {
  body { font-size: 17px; }

  /* Kill heavy animations on mobile */
  .tunnel { display: none; }
  .rain { display: none; }
  .atmosphere::before { animation: none; }

  .whispers { display: none; }

  .presence {
    right: 2rem;
    bottom: 1rem;
    left: 1rem;
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    padding: 0.9rem 1.25rem;
  }

  .presence-action { white-space: normal; }

  .container { padding: 0 1.25rem; }

  .page-header { min-height: 30vh; padding: 4rem 0 2.5rem; }

  .room-body p { max-width: 100%; }

  .seq-nav { flex-direction: column; gap: 1.5rem; }
  .seq-link.next { text-align: left; }

  .lang-switcher { top: 1rem; left: 1rem; }

  .entrance::after { display: none; }

  .objects { margin-top: 1.5rem; }
  .object { padding: 1rem 1.1rem; gap: 1rem; }
}

@media (max-width: 480px) {
  .page-title { font-size: 1.75rem; }
  .hero-title { font-size: 2rem; }
  .room-title { font-size: 1.5rem; }
}

/* ══════════════════════════════════════
   PUBLICATION / PAPER STYLES
   ══════════════════════════════════════ */

.paper-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--shadow);
}

.paper-byline {
  font-size: 0.9rem;
  color: var(--bone);
  margin: 0.75rem 0 0.5rem;
  font-style: italic;
}

.paper-meta-row {
  font-size: 0.78rem;
  color: var(--ash);
  margin-top: 0.4rem;
  line-height: 1.6;
}

.paper-meta-row a {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--fog);
  transition: color 0.3s, border-color 0.3s;
}

.paper-meta-row a:hover {
  color: var(--light);
  border-color: var(--green-mist);
}

.abstract-block {
  background: var(--deep);
  border-left: 2px solid var(--green-mist);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.abstract-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-mist);
  margin-bottom: 0.75rem;
}

.abstract-block p {
  font-size: 0.95rem;
  color: var(--smoke);
  line-height: 1.85;
  font-style: italic;
  margin: 0;
}

.operator-table,
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.875rem;
}

.operator-table th,
.comparison-table th {
  background: var(--deep);
  color: var(--green-mist);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--green-dream);
  font-weight: 400;
}

.operator-table td,
.comparison-table td {
  padding: 0.75rem 1rem;
  color: var(--smoke);
  border-bottom: 1px solid var(--shadow);
  vertical-align: top;
  line-height: 1.5;
}

.operator-table tr:hover td,
.comparison-table tr:hover td {
  background: var(--mist);
  color: var(--paper);
}

.operator-table td:first-child {
  color: var(--green-mist);
  font-size: 1.1rem;
  font-family: 'Crimson Text', serif;
  white-space: nowrap;
}

.mark-correct { color: var(--green-mist); }

.mark-wrong {
  color: var(--ash);
  text-decoration: line-through;
  text-decoration-color: var(--fog);
}

.prediction-block {
  background: var(--deep);
  border: 1px solid var(--shadow);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
  transition: border-color 0.3s;
}

.prediction-block:hover { border-color: var(--green-dream); }

.prediction-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-mist);
  margin-bottom: 0.5rem;
}

.prediction-title {
  font-size: 1rem;
  color: var(--light);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.prediction-block p:last-child {
  color: var(--smoke);
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 0;
}

.references-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.references-list li {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--shadow);
  font-size: 0.875rem;
  color: var(--smoke);
  line-height: 1.6;
}

.ref-num {
  color: var(--ash);
  min-width: 2.5rem;
  flex-shrink: 0;
  font-size: 0.78rem;
  padding-top: 0.1rem;
}

.references-list a {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--fog);
  transition: color 0.3s;
}

.references-list a:hover {
  color: var(--light);
  border-color: var(--green-mist);
}

.back-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--ash);
  text-decoration: none;
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
  transition: color 0.3s;
}

.back-link:hover { color: var(--bone); }

@media (max-width: 768px) {
  .operator-table,
  .comparison-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.8rem;
  }
  .prediction-block { padding: 1.1rem 1.25rem; }
  .abstract-block { padding: 1.1rem 1.25rem; }
}
