/* desca.works - Abandoned Space Station Botanical */
/* Palette: Void Black #0d0d0d, Station Gray #1a1a1a, Panel Line #3a3a3a,
   Phosphor White #e8e8e8, Fog Gray #b8b8b8, Signal Dim #6a6a6a,
   Spectral Lavender #8b7faa, Dried Petal #a89080 */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: #0d0d0d;
  color: #e8e8e8;
  font-family: 'Cormorant Garamond', Georgia, serif;
  line-height: 1.72;
  overflow-x: hidden;
}

/* ==============================
   BENTO GRID SYSTEM
   ============================== */

.bento-grid {
  display: grid;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.bento-cell {
  background: #1a1a1a;
  border: 2px solid #3a3a3a;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bento-cell.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Grid border pulse */
.bento-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #3a3a3a;
  opacity: 0;
  animation: borderPulse 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes borderPulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.02; }
}

/* ==============================
   CELL LABELS
   ============================== */

.cell-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #6a6a6a;
  position: absolute;
  top: 12px;
  left: 14px;
}

/* ==============================
   SECTION 1: STATION LOG (HERO)
   ============================== */

.station-log {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  padding: 2px;
}

.bento-hero {
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  height: 100%;
}

/* Title cell - spans 7 cols, 5 rows */
.cell-title {
  grid-column: 1 / 8;
  grid-row: 1 / 6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-content {
  text-align: center;
  padding: 40px;
}

.station-id {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #6a6a6a;
  display: block;
  margin-bottom: 20px;
}

.site-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8e8e8;
  text-shadow: 0 0 20px rgba(200,200,200,0.15);
  line-height: 1.1;
}

.title-dot {
  color: #8b7faa;
}

.terminal-line {
  margin-top: 30px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  color: #6a6a6a;
  letter-spacing: 0.12em;
}

.cursor-blink {
  animation: blink 1.2s step-end infinite;
  color: #e8e8e8;
}

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

/* Viewport cell */
.cell-viewport {
  grid-column: 8 / 13;
  grid-row: 1 / 4;
  overflow: hidden;
}

.nebula-viewport {
  position: absolute;
  inset: 0;
}

.nebula-layer {
  position: absolute;
  inset: 0;
}

.nebula-1 {
  background: radial-gradient(ellipse at 30% 40%, #2a2a3a 0%, #0d0d0d 60%);
  animation: nebulaDrift1 60s ease-in-out infinite alternate;
}

.nebula-2 {
  background: radial-gradient(ellipse at 70% 60%, rgba(139,127,170,0.08) 0%, transparent 50%);
  animation: nebulaDrift2 45s ease-in-out infinite alternate;
}

.nebula-3 {
  background: radial-gradient(circle at 50% 30%, rgba(168,144,128,0.04) 0%, transparent 40%);
  animation: nebulaDrift3 75s ease-in-out infinite alternate;
}

@keyframes nebulaDrift1 {
  0% { background-position: 0% 0%; background-size: 120% 120%; }
  100% { background-position: 20% 15%; background-size: 150% 150%; }
}

@keyframes nebulaDrift2 {
  0% { background-position: 0% 0%; }
  100% { background-position: -20% 10%; }
}

@keyframes nebulaDrift3 {
  0% { background-position: 0% 0%; }
  100% { background-position: 15% -10%; }
}

/* Specimen hero cell */
.cell-specimen-hero {
  grid-column: 8 / 11;
  grid-row: 4 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.botanical-svg {
  width: 100%;
  max-width: 160px;
  height: auto;
}

.specimen-orchid {
  max-height: 200px;
}

.draw-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 2400ms ease-in-out;
}

.draw-path.drawn {
  stroke-dashoffset: 0;
}

.specimen-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #6a6a6a;
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
}

/* Clock cell */
.cell-clock {
  grid-column: 11 / 13;
  grid-row: 4 / 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.met-display {
  font-family: 'Space Mono', monospace;
  font-size: clamp(14px, 1.5vw, 22px);
  letter-spacing: 0.08em;
  color: #e8e8e8;
  text-shadow: 0 0 15px rgba(200,200,200,0.1);
  margin-top: 8px;
}

.met-sep {
  color: #3a3a3a;
}

.met-unit {
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.15em;
  color: #3a3a3a;
  margin-top: 6px;
}

/* Log cell */
.cell-log {
  grid-column: 1 / 8;
  grid-row: 6 / 9;
  padding: 40px 30px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.log-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-style: italic;
  color: #b8b8b8;
  line-height: 1.72;
  margin-top: 20px;
  max-width: 600px;
}

.log-signature {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: #6a6a6a;
  letter-spacing: 0.08em;
  margin-top: 16px;
}

/* Data small cell */
.cell-data-small {
  grid-column: 11 / 13;
  grid-row: 6 / 9;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.data-readout {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.data-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #3a3a3a;
}

.data-value {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: #e8e8e8;
  text-shadow: 0 0 12px rgba(200,200,200,0.08);
}

/* Reticle marks */
.reticle {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid #3a3a3a;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.4;
}

.reticle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -4px;
  right: -4px;
  height: 1px;
  background: #3a3a3a;
}

.reticle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -4px;
  bottom: -4px;
  width: 1px;
  background: #3a3a3a;
}

.reticle-1 { top: 62%; left: 58%; }
.reticle-2 { top: 37%; left: 91%; }
.reticle-3 { top: 73%; left: 83%; }


/* ==============================
   SECTION 2: SPECIMEN ARCHIVE
   ============================== */

.specimen-archive {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 60px 2px 2px;
}

.section-header {
  padding: 0 30px 40px;
  position: relative;
}

.section-id {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: #3a3a3a;
  display: block;
  margin-bottom: 8px;
}

.section-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8e8e8;
  text-shadow: 0 0 20px rgba(200,200,200,0.15);
}

.section-meta {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #6a6a6a;
  display: block;
  margin-top: 12px;
}

.bento-specimens {
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(6, minmax(120px, 1fr));
  min-height: 80vh;
}

.specimen-cell {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  position: relative;
  cursor: default;
  transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.specimen-a { grid-column: 1 / 5; grid-row: 1 / 4; }
.specimen-b { grid-column: 5 / 8; grid-row: 1 / 3; }
.specimen-c { grid-column: 8 / 13; grid-row: 1 / 2; }
.specimen-d { grid-column: 8 / 10; grid-row: 2 / 4; }
.specimen-e { grid-column: 10 / 13; grid-row: 2 / 4; }
.specimen-f { grid-column: 5 / 8; grid-row: 3 / 7; }
.specimen-g { grid-column: 1 / 5; grid-row: 4 / 7; }
.specimen-h { grid-column: 8 / 13; grid-row: 4 / 7; }

.specimen-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.specimen-id {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #3a3a3a;
}

.specimen-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-style: italic;
  color: #b8b8b8;
}

.specimen-deck {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #6a6a6a;
}

/* Gradient blooms */
.gradient-bloom {
  position: absolute;
  inset: 0;
  opacity: 0.7;
}

.bloom-1 {
  background:
    radial-gradient(ellipse at 40% 30%, rgba(139,127,170,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 70%, rgba(139,127,170,0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(168,144,128,0.05) 0%, transparent 60%);
  animation: bloomDrift1 45s ease-in-out infinite alternate;
}

.bloom-2 {
  background:
    radial-gradient(ellipse at 30% 60%, rgba(139,127,170,0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 70% 30%, rgba(168,144,128,0.08) 0%, transparent 50%);
  animation: bloomDrift2 55s ease-in-out infinite alternate;
}

.bloom-3 {
  background:
    radial-gradient(circle at 50% 40%, rgba(139,127,170,0.18) 0%, transparent 40%),
    radial-gradient(ellipse at 30% 70%, rgba(42,42,58,0.3) 0%, transparent 50%);
  animation: bloomDrift3 38s ease-in-out infinite alternate;
}

.bloom-4 {
  background:
    radial-gradient(ellipse at 60% 50%, rgba(168,144,128,0.12) 0%, transparent 45%),
    radial-gradient(circle at 35% 35%, rgba(139,127,170,0.1) 0%, transparent 50%);
  animation: bloomDrift1 50s ease-in-out infinite alternate;
}

.bloom-5 {
  background:
    radial-gradient(ellipse at 45% 55%, rgba(139,127,170,0.14) 0%, transparent 50%),
    radial-gradient(circle at 70% 25%, rgba(168,144,128,0.06) 0%, transparent 40%);
  animation: bloomDrift2 42s ease-in-out infinite alternate;
}

.bloom-6 {
  background:
    radial-gradient(circle at 55% 45%, rgba(168,144,128,0.15) 0%, transparent 45%),
    radial-gradient(ellipse at 25% 65%, rgba(139,127,170,0.08) 0%, transparent 50%);
  animation: bloomDrift3 65s ease-in-out infinite alternate;
}

.bloom-7 {
  background:
    radial-gradient(ellipse at 40% 50%, rgba(139,127,170,0.2) 0%, transparent 40%),
    radial-gradient(ellipse at 65% 35%, rgba(168,144,128,0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 70%, rgba(42,42,58,0.15) 0%, transparent 50%);
  animation: bloomDrift1 70s ease-in-out infinite alternate;
}

@keyframes bloomDrift1 {
  0% { background-position: 0% 0%, 0% 0%, 0% 0%; background-size: 100% 100%, 120% 120%, 100% 100%; }
  100% { background-position: 10% 5%, -5% 10%, 5% -5%; background-size: 130% 130%, 100% 100%, 120% 120%; }
}

@keyframes bloomDrift2 {
  0% { background-position: 0% 0%, 0% 0%; background-size: 100% 100%, 110% 110%; }
  100% { background-position: -8% 12%, 8% -8%; background-size: 120% 120%, 100% 100%; }
}

@keyframes bloomDrift3 {
  0% { background-position: 0% 0%, 0% 0%; background-size: 110% 110%, 100% 100%; }
  100% { background-position: 5% -10%, -10% 5%; background-size: 100% 100%, 125% 125%; }
}

.specimen-fern {
  max-width: 200px;
  max-height: 280px;
}

/* Hover: adjacent cells contract */
.bento-specimens .specimen-cell:hover ~ .specimen-cell {
  transform: scale(0.98);
}

.bento-specimens .specimen-cell:hover {
  transform: scale(1) !important;
}

.bento-specimens .specimen-cell.revealed:hover {
  border-color: #4a4a4a;
  transition: border-color 300ms ease, transform 300ms ease;
}


/* ==============================
   SECTION 3: FIELD NOTES
   ============================== */

.field-notes {
  position: relative;
  width: 100%;
  height: 40vh;
  min-height: 350px;
  padding: 40px 0;
  overflow: hidden;
}

.field-notes .section-header {
  padding-bottom: 20px;
}

.notes-scroll-container {
  position: relative;
  width: 100%;
  height: calc(100% - 120px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a #1a1a1a;
}

.notes-scroll-container::-webkit-scrollbar {
  height: 4px;
}

.notes-scroll-container::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.notes-scroll-container::-webkit-scrollbar-thumb {
  background: #3a3a3a;
}

.notes-track {
  display: flex;
  gap: 2px;
  height: 100%;
  padding: 0 30px;
  width: max-content;
}

.note-card {
  flex: 0 0 320px;
  background: #1a1a1a;
  border: 2px solid #3a3a3a;
  padding: 24px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.note-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.note-date {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: #3a3a3a;
  margin-bottom: 12px;
}

.note-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-style: italic;
  color: #b8b8b8;
  line-height: 1.72;
  flex: 1;
}

.note-sketch {
  width: 60px;
  height: 60px;
  margin-top: 12px;
  align-self: flex-end;
}

.graph-paper-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(58,58,58,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58,58,58,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: -1;
}

/* ==============================
   SECTION 4: SIGNAL DECAY
   ============================== */

.signal-decay {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 60px 2px 120px;
}

.bento-decay {
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(4, minmax(100px, 1fr));
  min-height: 60vh;
}

.decay-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 1200ms ease, transform 1200ms ease, border-color 2000ms ease;
}

.decay-a { grid-column: 1 / 5; grid-row: 1 / 2; }
.decay-b { grid-column: 5 / 9; grid-row: 1 / 3; }
.decay-c { grid-column: 9 / 13; grid-row: 1 / 2; }
.decay-d { grid-column: 1 / 4; grid-row: 2 / 3; }
.decay-e { grid-column: 4 / 5; grid-row: 2 / 4; }
.decay-f { grid-column: 9 / 13; grid-row: 2 / 4; }
.decay-g { grid-column: 1 / 4; grid-row: 3 / 5; }
.decay-h { grid-column: 5 / 9; grid-row: 3 / 5; }

.decay-cell.decaying {
  border-color: #2a2a2a;
}

.decay-cell.decayed {
  opacity: 0;
  border-color: transparent;
}

.decay-fragment {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(18px, 3vw, 36px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8e8e8;
  text-shadow: 0 0 20px rgba(200,200,200,0.15);
}

.decay-fragment-sub {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(14px, 2vw, 24px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6a6a6a;
}

.decay-data {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #6a6a6a;
}

.scattered-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 20px;
  color: #3a3a3a;
  transition: transform 2000ms ease;
}

/* Decay blooms - dimmer */
.bloom-decay-1 {
  background: radial-gradient(circle at 50% 50%, rgba(139,127,170,0.06) 0%, transparent 50%);
  animation: bloomDrift1 90s ease-in-out infinite alternate;
}

.bloom-decay-2 {
  background: radial-gradient(circle at 50% 50%, rgba(168,144,128,0.04) 0%, transparent 45%);
  animation: bloomDrift2 80s ease-in-out infinite alternate;
}

.bloom-decay-3 {
  background: radial-gradient(ellipse at 40% 60%, rgba(139,127,170,0.05) 0%, transparent 50%);
  animation: bloomDrift3 70s ease-in-out infinite alternate;
}

/* Final glyph */
.final-glyph {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 0 40px;
  opacity: 0;
  transition: opacity 3000ms ease;
}

.final-glyph.visible {
  opacity: 1;
}

.wilting-flower {
  width: 60px;
  height: 90px;
}

/* Background fragments */
.bg-fragments {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-frag {
  position: absolute;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #6a6a6a;
  opacity: 0.15;
  transition: opacity 2000ms ease, transform 2000ms ease;
}


/* ==============================
   DATA FOG OVERLAYS
   ============================== */

.bento-cell::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, #1a1a1a 0%, transparent 100%);
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

.cell-title::before,
.cell-clock::before,
.cell-data-small::before,
.decay-cell::before {
  display: none;
}

/* ==============================
   RESPONSIVE: MOBILE
   ============================== */

@media (max-width: 768px) {
  .bento-hero {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    height: auto;
  }

  .station-log {
    height: auto;
    min-height: auto;
  }

  .cell-title {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 50vh;
  }

  .cell-viewport {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 200px;
  }

  .cell-specimen-hero {
    grid-column: 1 / 3;
    grid-row: auto;
    min-height: 250px;
  }

  .cell-clock {
    grid-column: 3 / -1;
    grid-row: auto;
    min-height: 120px;
  }

  .cell-log {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 200px;
  }

  .cell-data-small {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 100px;
    flex-direction: row;
    justify-content: space-around;
  }

  .bento-cell {
    border-color: #2a2a2a;
  }

  .bento-specimens {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    min-height: auto;
  }

  .specimen-a { grid-column: 1 / 3; grid-row: auto; min-height: 200px; }
  .specimen-b { grid-column: 3 / -1; grid-row: auto; min-height: 200px; }
  .specimen-c { grid-column: 1 / -1; grid-row: auto; min-height: 150px; }
  .specimen-d { grid-column: 1 / 3; grid-row: auto; min-height: 180px; }
  .specimen-e { grid-column: 3 / -1; grid-row: auto; min-height: 180px; }
  .specimen-f { grid-column: 1 / -1; grid-row: auto; min-height: 300px; }
  .specimen-g { grid-column: 1 / 3; grid-row: auto; min-height: 200px; }
  .specimen-h { grid-column: 3 / -1; grid-row: auto; min-height: 200px; }

  .field-notes {
    height: auto;
    min-height: 300px;
  }

  .note-card {
    flex: 0 0 280px;
  }

  .bento-decay {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    min-height: auto;
  }

  .decay-a { grid-column: 1 / 3; grid-row: auto; min-height: 100px; }
  .decay-b { grid-column: 3 / -1; grid-row: auto; min-height: 150px; }
  .decay-c { grid-column: 1 / -1; grid-row: auto; min-height: 80px; }
  .decay-d { grid-column: 1 / 3; grid-row: auto; min-height: 80px; }
  .decay-e { grid-column: 3 / -1; grid-row: auto; min-height: 100px; }
  .decay-f { grid-column: 1 / -1; grid-row: auto; min-height: 80px; }
  .decay-g { grid-column: 1 / 3; grid-row: auto; min-height: 100px; }
  .decay-h { grid-column: 3 / -1; grid-row: auto; min-height: 100px; }

  .site-title {
    font-size: 42px;
  }

  .section-title {
    font-size: 28px;
  }
}

/* ==============================
   SELECTION & SCROLLBAR
   ============================== */

::selection {
  background: rgba(139,127,170,0.3);
  color: #e8e8e8;
}

body::-webkit-scrollbar {
  width: 4px;
}

body::-webkit-scrollbar-track {
  background: #0d0d0d;
}

body::-webkit-scrollbar-thumb {
  background: #3a3a3a;
}
