@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --ink: #e8edf2;
  --muted: #82909e;
  --panel: #111923;
  --panel-raised: #16212d;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #e39c55;
  --accent-soft: rgba(227, 156, 85, 0.14);
  --cyan: #83e6dc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 70% 0%, rgba(76, 104, 126, 0.16), transparent 34%),
    linear-gradient(135deg, #070b10 0%, #0b1118 55%, #080d13 100%);
  font-family: "Manrope", Arial, sans-serif;
  padding: 32px 20px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.17;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

.lab-shell {
  width: min(1060px, 100%);
  margin: 0 auto;
  overflow: hidden;
  background: rgba(13, 20, 28, 0.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .45), inset 0 1px rgba(255,255,255,.035);
}

.lab-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  grid-template-columns: repeat(3, 4px);
  gap: 4px;
  border: 1px solid rgba(227, 156, 85, .35);
  border-radius: 11px;
  background: var(--accent-soft);
}

.brand-mark span { width: 4px; border-radius: 4px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 10px; margin-top: 8px; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 14px; margin-top: 4px; }

.brand-copy { flex: 1; }
.eyebrow, .step-label { margin: 0 0 5px; color: var(--accent); font: 500 10px/1.4 "DM Mono", monospace; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; letter-spacing: -.025em; font-weight: 600; }
h2 { margin-bottom: 7px; font-size: 20px; letter-spacing: -.025em; font-weight: 600; }

.system-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #aab6c0;
  font: 500 11px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.status-light { width: 8px; height: 8px; border-radius: 50%; background: #58d3a5; box-shadow: 0 0 0 4px rgba(88,211,165,.1), 0 0 16px rgba(88,211,165,.5); }

.app { display: grid; grid-template-columns: 390px 1fr; min-height: 625px; }
.rock-panel { padding: 34px 32px; border-right: 1px solid var(--line); }
.section-heading > p:last-child { max-width: 290px; margin-bottom: 25px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.specimen-list { display: grid; gap: 10px; }

.rock {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 10px 15px 10px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(110deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  cursor: grab;
  user-select: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.rock::after { content: "⋮⋮"; position: absolute; right: 7px; top: 5px; color: rgba(255,255,255,.1); font-size: 9px; letter-spacing: 1px; }
.rock:hover, .rock:focus-visible { transform: translateX(4px); border-color: rgba(227,156,85,.42); background: linear-gradient(110deg, rgba(227,156,85,.1), rgba(255,255,255,.02)); box-shadow: -3px 0 var(--accent); outline: none; }
.rock:active { cursor: grabbing; transform: translateX(7px) scale(.99); }
.rock.is-dragging {
  border-color: rgba(227,156,85,.22);
  background: rgba(255,255,255,.012);
  box-shadow: inset 0 0 24px rgba(0,0,0,.18);
}
.rock.is-dragging .rock-shape { opacity: .08; transform: scale(.82); }
.rock.is-dragging .rock-details,
.rock.is-dragging > p { opacity: .38; }
.rock .rock-shape,
.rock .rock-details,
.rock > p { transition: opacity .16s ease, transform .16s ease; }

body.carrying-rock,
body.carrying-rock * { cursor: grabbing !important; }

.drag-rock-ghost {
  position: fixed;
  z-index: 9999;
  top: -180px;
  left: -180px;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  pointer-events: none;
  filter: drop-shadow(0 18px 12px rgba(0,0,0,.5));
  transform: rotate(-8deg) scale(1.12);
}
.drag-rock-ghost__stone { grid-area: 1 / 1; transform: scale(1.18); }
.drag-rock-ghost__weight {
  grid-area: 1 / 1;
  align-self: end;
  margin-bottom: -7px;
  padding: 4px 7px;
  border: 1px solid rgba(227,156,85,.5);
  border-radius: 10px;
  color: #ffe0bd;
  background: rgba(13,20,28,.94);
  box-shadow: 0 5px 10px rgba(0,0,0,.35);
  font: 500 9px "DM Mono", monospace;
  white-space: nowrap;
}

.rock-shape, .falling-rock {
  display: block;
  justify-self: center;
  width: var(--rock-size, 34px);
  height: var(--rock-size, 34px);
  clip-path: polygon(18% 17%, 54% 5%, 86% 23%, 96% 62%, 71% 91%, 31% 95%, 7% 70%, 4% 37%);
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.23) 0 6%, transparent 7%),
    radial-gradient(circle at 67% 64%, rgba(0,0,0,.25) 0 8%, transparent 9%),
    linear-gradient(140deg, #817a70 0%, #4e4a45 48%, #282a2b 100%);
  box-shadow: inset -5px -7px 10px rgba(0,0,0,.32), inset 4px 4px 7px rgba(255,255,255,.1), 0 5px 10px rgba(0,0,0,.35);
}

.rock-small { --rock-size: 26px; }
.rock-medium { --rock-size: 34px; }
.rock-large { --rock-size: 41px; }
.rock-xlarge { --rock-size: 48px; }
.rock-details strong { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.rock-details small { display: block; color: var(--muted); font-size: 10px; }
.rock > p { margin: 0; padding-right: 5px; font: 500 17px "DM Mono", monospace; color: #dce3e8; }
.rock > p span { color: var(--muted); font-size: 10px; }

.lab-note { display: flex; gap: 11px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.lab-note > span { flex: 0 0 auto; width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid rgba(131,230,220,.35); border-radius: 50%; color: var(--cyan); font: 500 11px "DM Mono"; }
.lab-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.lab-note strong { display: block; color: #b9c3cb; font-size: 11px; }

.experiment { padding: 34px 42px 25px; display: flex; flex-direction: column; align-items: stretch; }
.experiment-heading { display: flex; justify-content: space-between; align-items: center; }
.chamber-id { padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font: 10px "DM Mono", monospace; letter-spacing: .08em; }
.chamber-wrap { position: relative; width: 230px; margin: 18px auto 0; padding-left: 48px; }

.pipe-entry {
  position: relative;
  z-index: 4;
  width: 182px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed rgba(227,156,85,.65);
  border-radius: 8px 8px 3px 3px;
  color: #e7b680;
  background: rgba(227,156,85,.08);
  font: 500 11px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: background .2s, box-shadow .2s, border-color .2s;
}
.pipe-entry::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -7px; height: 7px; background: linear-gradient(#5b6570, #262e36); border-radius: 0 0 2px 2px; }
.drop-icon { font-size: 17px; animation: hover 1.7s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(3px); } }
.pipe-entry.drag-over { border-style: solid; border-color: var(--accent); background: rgba(227,156,85,.2); box-shadow: 0 0 30px rgba(227,156,85,.15); }
.chamber-wrap.awaiting-drop .pipe-entry {
  border-color: rgba(227,156,85,.9);
  background: rgba(227,156,85,.13);
  box-shadow: 0 0 0 5px rgba(227,156,85,.04), 0 0 30px rgba(227,156,85,.1);
}
.chamber-wrap.awaiting-drop .drop-icon { animation-duration: .65s; }
.chamber-wrap.awaiting-drop .pipe { box-shadow: inset 15px 0 25px rgba(255,255,255,.025), inset -14px 0 20px rgba(0,0,0,.4), 0 15px 30px rgba(0,0,0,.35), 0 0 22px rgba(227,156,85,.08); }
.pipe-entry.drag-over {
  transform: scale(1.025);
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(131,230,220,.14);
  box-shadow: 0 0 0 6px rgba(131,230,220,.045), 0 0 34px rgba(131,230,220,.14);
}
.pipe-entry.drop-accepted { animation: accept-drop .42s ease-out; }
@keyframes accept-drop {
  0% { transform: scale(1.025); background: rgba(131,230,220,.2); }
  45% { transform: scale(.97); box-shadow: 0 0 42px rgba(131,230,220,.26); }
  100% { transform: scale(1); }
}

.pipe {
  position: relative;
  width: 150px;
  height: 455px;
  margin: 7px auto 0;
  overflow: hidden;
  border-left: 9px solid #29343e;
  border-right: 9px solid #29343e;
  background:
    repeating-linear-gradient(0deg, transparent 0 89px, rgba(255,255,255,.055) 90px, transparent 91px),
    linear-gradient(90deg, #151e27, #24333e 10%, #14202a 25%, #0d161e 62%, #1d2b35 88%, #101820);
  box-shadow: inset 15px 0 25px rgba(255,255,255,.025), inset -14px 0 20px rgba(0,0,0,.4), 0 15px 30px rgba(0,0,0,.35);
}
.pipe::before, .pipe::after { content: ""; position: absolute; z-index: 3; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.08); }
.pipe::before { left: 2px; }
.pipe::after { right: 2px; }
.chamber-glare { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 31%, rgba(145,203,220,.055) 42%, transparent 52%); pointer-events: none; }

.measurement-ruler { position: absolute; left: 0; top: 78px; bottom: 18px; width: 45px; border-right: 1px solid rgba(255,255,255,.12); }
.measurement-ruler::after { content: ""; position: absolute; right: 0; inset-block: 0; width: 8px; background: repeating-linear-gradient(to bottom, transparent 0 8px, rgba(255,255,255,.24) 9px, transparent 10px); }
.measurement-ruler span { position: absolute; right: 13px; top: calc(var(--i) * 25% - 4px); color: #65717d; font: 9px "DM Mono", monospace; }

.speed-display {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 17px;
  width: 116px;
  padding: 10px 12px;
  transform: translateX(-50%);
  border: 1px solid rgba(131,230,220,.22);
  border-radius: 7px;
  background: rgba(7, 14, 20, .9);
  box-shadow: 0 8px 20px rgba(0,0,0,.32);
  text-align: left;
  backdrop-filter: blur(8px);
}
.speed-display > span { display: block; margin-bottom: 5px; color: #6d848c; font: 8px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.speed-display strong { color: var(--cyan); font: 500 17px "DM Mono", monospace; }
.speed-display small { font-size: 8px; color: #7ea09f; }
.falling-rock { position: absolute; display: none; z-index: 2; left: 50%; transform: translateX(-50%) rotate(12deg); }
.chamber-base { position: relative; width: 182px; height: 16px; background: linear-gradient(#53606b, #222a32); border-radius: 2px 2px 8px 8px; box-shadow: 0 8px 13px rgba(0,0,0,.35); }
.chamber-base span { position: absolute; left: 20px; right: 20px; top: 4px; height: 3px; border-radius: 3px; background: #0a1015; }

.lab-footer { min-height: 42px; display: flex; justify-content: center; gap: 34px; align-items: center; padding: 10px 24px; border-top: 1px solid var(--line); color: #586571; font: 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; }
.lab-footer span::before { content: "•"; margin-right: 7px; color: #495762; }

@media (max-width: 760px) {
  body { padding: 12px; }
  .lab-header { padding: 18px; }
  .system-status { display: none; }
  .app { grid-template-columns: 1fr; }
  .rock-panel { padding: 26px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .experiment { padding: 28px 18px; }
  .specimen-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rock { grid-template-columns: 42px 1fr; gap: 8px; padding: 10px; }
  .rock > p { grid-column: 2; font-size: 13px; margin-top: -12px; }
  .rock-details small { display: none; }
  .lab-footer { flex-wrap: wrap; gap: 8px 20px; }
}

@media (max-width: 430px) {
  h1 { font-size: 17px; }
  .brand-mark { display: none; }
  .specimen-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
