:root {
  --bg: #08090b;
  --panel: #101216;
  --card: #14171c;
  --line: #272b33;
  --red: #ef3038;
  --cyan: #39d9ff;
  --green: #61f59a;
  --text: #edf0f4;
  --muted: #9299a5;
  --mono: 'DM Mono', monospace;
  --sans: 'Manrope', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.section-wrap {
  width: min(1160px, calc(100% - 64px));
  margin-inline: auto;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(32px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid #ffffff0c;
  background: #08090beF;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font: 500 12px var(--mono);
  letter-spacing: .09em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--red);
  font-size: 18px;
  color: var(--text);
  letter-spacing: -.1em;
}

.brand-mark span {
  color: var(--red);
}

.brand-muted {
  color: var(--red);
}

nav {
  display: flex;
  gap: 30px;
}

nav a {
  font-size: 12px;
  color: var(--muted);
  transition: color .2s;
}

nav a:hover,
nav a:focus-visible {
  color: var(--text);
}

.availability {
  font: 10px var(--mono);
  letter-spacing: .06em;
  color: #b9c0c9;
}

.status-dot,
.tiny-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
  box-shadow: 0 0 12px #61f59a55;
}

.menu-button {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 20px;
}

.hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  position: relative;
  padding-top: 48px;
  padding-bottom: 90px;
}

.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 49.9%, #ffffff07 50%, transparent 50.1%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow,
.section-index {
  font: 10px var(--mono);
  letter-spacing: .14em;
  color: var(--muted);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
}

.eyebrow-line {
  width: 28px;
  height: 1px;
  background: var(--red);
}

h1 {
  font-size: clamp(48px, 6vw, 76px);
  line-height: 1.08;
  letter-spacing: -.065em;
  margin: 28px 0 24px;
  font-weight: 800;
}

.accent {
  color: var(--red);
}

.hero-name {
  font: 10px var(--mono);
  letter-spacing: .11em;
  color: #cbd0d8;
}

.slash {
  color: var(--red);
  padding: 0 7px;
}

.intro {
  max-width: 470px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
  margin: 20px 0 29px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 23px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  transition: transform .2s, border-color .2s;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--red);
}

.button.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.button.primary:hover {
  background: #d9252d;
}

.button.secondary {
  background: #ffffff04;
}

.hero-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 48px;
  font: 9px var(--mono);
  letter-spacing: .07em;
  color: #737b87;
}

.hero-meta .tiny-dot {
  width: 5px;
  height: 5px;
  margin-right: 5px;
}

.earth-stage {
  height: 470px;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.earth-stage:before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: #176ca61c;
  filter: blur(45px);
}

.earth {
  width: min(300px, 67vw);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 31% 28%, #3c8fba 0%, #195274 24%, #0b2338 48%, #05090f 75%);
  box-shadow: inset -34px -12px 50px #000, inset 9px 5px 20px #7bdfff55, 0 0 22px #39d9ff20;
  animation: earth-float 8s ease-in-out infinite;
}

.earth:before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: repeating-linear-gradient(0deg, transparent 0 17px, #65d8ff1a 18px 19px),
              repeating-linear-gradient(90deg, transparent 0 22px, #65d8ff14 23px 24px);
  transform: rotate(-22deg) scale(1.15);
  mask-image: radial-gradient(circle, #000 48%, transparent 71%);
}

.earth:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 33% 31%, #62d4f844, transparent 42%),
              linear-gradient(110deg, transparent 35%, #02060bdc 79%);
  mix-blend-mode: screen;
}

.earth-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 27% 25%, #ffffff20, transparent 33%);
  z-index: 2;
}

.earth-grid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid #68dfff45;
  box-shadow: 0 0 18px #39d9ff40;
}

.orbit {
  position: absolute;
  border: 1px solid #39d9ff24;
  border-radius: 50%;
  width: 390px;
  height: 150px;
  transform: rotate(-27deg);
}

.orbit-two {
  width: 420px;
  height: 220px;
  transform: rotate(52deg);
  border-color: #ef30382b;
}

.orbit-three {
  width: 335px;
  height: 400px;
  transform: rotate(65deg);
  border-style: dashed;
  border-color: #ffffff12;
}

.orbit-label {
  position: absolute;
  font: 9px var(--mono);
  letter-spacing: .1em;
  color: #c7d2dc;
  background: #08090bdc;
  padding: 9px 12px;
  border: 1px solid var(--line);
}

.orbit-label small {
  color: #747c88;
  margin-left: 12px;
}

.label-top {
  top: 72px;
  right: 0;
}

.label-bottom {
  bottom: 72px;
  left: 0;
}

.label-pip {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--red);
  margin-right: 8px;
}

.label-pip.cyan {
  background: var(--cyan);
}

.crosshair {
  position: absolute;
  color: var(--cyan);
  font: 20px var(--mono);
  opacity: .7;
}

.cross-a {
  top: 80px;
  left: 22%;
}

.cross-b {
  bottom: 93px;
  right: 18%;
}

@keyframes earth-float {
  0%, 100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

.scroll-cue {
  position: absolute;
  bottom: 25px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font: 9px var(--mono);
  letter-spacing: .15em;
  color: #747b85;
}

.scroll-cue span {
  height: 27px;
  width: 1px;
  background: var(--red);
}

/* --- Ticker / Marquee Section --- */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: #0c0e11;
  padding: 15px 0;
  white-space: nowrap;
  width: 100%;
}

.ticker div {
  display: inline-block;
  width: max-content;
  animation: ticker 30s linear infinite;
  font: 10px var(--mono);
  letter-spacing: .14em;
  color: #8e96a2;
}

.ticker b {
  color: var(--red);
  margin: 0 25px;
}

@keyframes ticker {
  0% {
    transform: translateX(100vw);
  }
  100% {
    transform: translateX(-100%);
  }
}
/* -------------------------------- */

.content-section {
  padding-top: 110px;
}

.section-heading {
  margin-bottom: 35px;
}

.section-heading h2,
.contact-panel h2 {
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -.055em;
  line-height: 1.2;
  margin: 13px 0 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.big-copy {
  font-size: 25px;
  line-height: 1.5;
  letter-spacing: -.03em;
  max-width: 420px;
  margin: 0 0 16px;
}

.big-copy em {
  font-style: normal;
  color: var(--red);
}

.muted {
  color: var(--muted);
}

.about-lead > .muted {
  max-width: 450px;
  line-height: 1.9;
}

.info-card {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #14171c, #0d0f12);
  padding: 8px 25px;
}

.info-row {
  display: flex;
  gap: 19px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row > span {
  font: 10px var(--mono);
  color: var(--red);
  padding-top: 4px;
}

.info-row strong {
  font-size: 13px;
}

.info-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-intro {
  margin-top: -20px;
  margin-bottom: 25px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 22px;
  min-height: 180px;
  transition: transform .2s, border-color .2s;
}

.skill-card:hover,
.project-card:hover {
  transform: translateY(-3px);
  border-color: #ef303866;
}

.skill-icon {
  font: 22px var(--mono);
  color: var(--cyan);
}

.skill-card h3 {
  font-size: 13px;
  margin: 18px 0 7px;
}

.skill-card p {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  min-height: 39px;
}

.tag,
.tags span {
  font: 9px var(--mono);
  letter-spacing: .07em;
  color: #e6a2a5;
}

.tag {
  display: inline-block;
  border: 1px solid #ef303833;
  padding: 4px 7px;
}

.project-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-top: -12px;
  margin-bottom: 22px;
}

.project-toolbar p {
  font-size: 11px;
}

.filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.filter {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  font: 10px var(--mono);
  cursor: pointer;
}

.filter.active,
.filter:hover {
  background: #ef30381a;
  border-color: #ef303866;
  color: var(--text);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.project-card {
  border: 1px solid var(--line);
  background: var(--card);
  min-width: 0;
  transition: transform .2s, border-color .2s;
}

.project-top {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: #777f8a;
  font: 9px var(--mono);
  letter-spacing: .1em;
}

.project-symbol {
  color: var(--red);
  font-size: 16px;
}

.project-art {
  height: 155px;
  margin: 0 12px;
  background: #0a0d11;
  border: 1px solid #ffffff0a;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.art-web > span {
  font: 26px var(--mono);
  color: var(--cyan);
  text-shadow: 0 0 25px #39d9ff3b;
}

.art-line {
  display: inline-block;
  width: 50px;
  height: 1px;
  background: var(--red);
  vertical-align: middle;
  margin: 0 9px;
}

.art-network {
  background-image: linear-gradient(#39d9ff0a 1px, transparent 1px),
                    linear-gradient(90deg, #39d9ff0a 1px, transparent 1px);
  background-size: 20px 20px;
}

.node {
  width: 10px;
  height: 10px;
  position: absolute;
  border: 1px solid var(--cyan);
  background: #0c2832;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 14px #39d9ff55;
}

.n1 {
  top: 35px;
  left: 25%;
}

.n2 {
  top: 75px;
  left: 48%;
  border-color: var(--red);
  background: #341318;
}

.n3 {
  top: 30px;
  right: 23%;
}

.n4 {
  bottom: 24px;
  right: 35%;
}

.network-lines {
  position: absolute;
  width: 65%;
  height: 65%;
  border-top: 1px solid #39d9ff45;
  border-right: 1px solid #39d9ff45;
  transform: skew(-28deg) rotate(22deg);
}

.network-caption {
  position: absolute;
  bottom: 9px;
  left: 10px;
  font: 8px var(--mono);
  color: var(--red);
}

.art-code {
  justify-content: start;
  padding: 22px;
  font: 11px/2 var(--mono);
  color: #c3cbd5;
}

.art-code i {
  color: var(--red);
  font-style: normal;
  margin-right: 12px;
}

.project-body {
  padding: 20px;
}

.tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tags span {
  font-size: 8px;
  color: var(--muted);
}

.project-body h3 {
  font-size: 15px;
  margin: 13px 0 8px;
}

.project-body p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.85;
  min-height: 60px;
}

.text-link {
  font-size: 11px;
  color: #e4e8ee;
  display: inline-flex;
  gap: 13px;
  margin-top: 8px;
}

.text-link span {
  color: var(--red);
}

.terminal-section {
  padding-top: 110px;
}

.terminal-window {
  border: 1px solid #343a43;
  background: #090b0e;
  box-shadow: 0 20px 60px #0005;
}

.terminal-title {
  height: 42px;
  border-bottom: 1px solid #272b33;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font: 10px var(--mono);
  color: #858d99;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef3038;
}

.window-dots i:nth-child(2) {
  background: #e4b84d;
}

.window-dots i:nth-child(3) {
  background: #61f59a;
}

.terminal-title button {
  background: none;
  border: 0;
  color: #858d99;
  font: 9px var(--mono);
  cursor: pointer;
}

.terminal-output {
  padding: 20px 20px 6px;
  min-height: 140px;
  max-height: 220px;
  overflow: auto;
  font: 11px/1.9 var(--mono);
  color: #d0d6df;
}

.terminal-output p {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}

.terminal-muted {
  color: #737c88;
}

.term-green {
  color: var(--green);
}

.term-red {
  color: var(--red);
}

.terminal-input-row {
  display: flex;
  gap: 10px;
  padding: 12px 20px 20px;
  font: 11px var(--mono);
  color: var(--green);
}

.terminal-input-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
}

.terminal-input-row input:focus-visible {
  outline: 1px solid #39d9ff44;
}

.terminal-note {
  font: 9px var(--mono);
  letter-spacing: .08em;
  color: #777f8a;
  margin-top: 13px;
}

.terminal-note .status-dot {
  width: 5px;
  height: 5px;
}

.research-list {
  border-top: 1px solid var(--line);
}

.research-item {
  display: grid;
  grid-template-columns: 130px 1fr 30px;
  gap: 20px;
  align-items: center;
  padding: 21px 10px;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}

.research-item:hover {
  background: #ffffff04;
}

.research-id {
  font: 9px var(--mono);
  color: var(--red);
}

.research-item strong {
  font-size: 13px;
  font-weight: 600;
}

.research-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.research-arrow {
  font-size: 18px;
  color: var(--red);
  text-align: right;
}

.contact-section {
  padding-top: 110px;
  padding-bottom: 100px;
}

.contact-panel {
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 90% 20%, #ef303810, transparent 42%), #101216;
  padding: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.contact-panel h2 {
  font-size: clamp(30px, 4vw, 43px);
  margin: 14px 0;
}

.contact-panel .muted {
  max-width: 440px;
  font-size: 12px;
}

.contact-actions {
  min-width: 180px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

.tiny-note,
.copy-status {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
}

.copy-email {
  border: 0;
  padding: 0;
  background: none;
  color: #c9cfd7;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 11px;
  cursor: pointer;
}

.footer {
  border-top: 1px solid var(--line);
  padding-top: 23px;
  padding-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer p {
  font-size: 10px;
  color: var(--muted);
}

.footer-code {
  font: 9px var(--mono);
  color: #777f8a;
  letter-spacing: .07em;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar {
    padding-inline: 24px;
  }
  .section-wrap {
    width: calc(100% - 48px);
  }
  nav {
    gap: 17px;
  }
  .availability {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr 0.8fr;
    min-height: 600px;
  }
  .earth-stage {
    transform: scale(.86);
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card:last-child {
    display: none;
  }
  .about-grid {
    gap: 35px;
  }
  .contact-panel {
    padding: 32px;
  }
}

@media (max-width: 650px) {
  .topbar {
    height: 64px;
    padding-inline: 20px;
  }
  .menu-button {
    display: block;
  }
  nav {
    display: none;
    position: absolute;
    top: 63px;
    left: 0;
    right: 0;
    background: #0d0f12;
    border-bottom: 1px solid var(--line);
    padding: 18px 22px;
    flex-direction: column;
    gap: 15px;
  }
  nav.open {
    display: flex;
  }
  .section-wrap {
    width: calc(100% - 40px);
  }
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 70px;
    padding-bottom: 75px;
    min-height: auto;
  }
  .hero:before {
    display: none;
  }
  h1 {
    font-size: clamp(48px, 12vw, 66px);
  }
  .hero-name {
    font-size: 9px;
    line-height: 1.9;
  }
  .intro {
    font-size: 13px;
  }
  .hero-meta {
    margin-top: 29px;
    gap: 12px;
  }
  .earth-stage {
    height: 340px;
    transform: none;
    margin-top: 12px;
  }
  .earth {
    width: 220px;
  }
  .orbit {
    transform: scale(.76) rotate(-27deg);
  }
  .orbit-two {
    transform: scale(.76) rotate(52deg);
  }
  .orbit-three {
    transform: scale(.78) rotate(65deg);
  }
  .label-top {
    top: 34px;
    right: 0;
  }
  .label-bottom {
    bottom: 34px;
    left: 0;
  }
  .scroll-cue {
    bottom: 15px;
  }
  .content-section,
  .terminal-section {
    padding-top: 78px;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .skill-card {
    padding: 15px;
    min-height: 175px;
  }
  .skill-card h3 {
    font-size: 12px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card:last-child {
    display: block;
  }
  .project-art {
    height: 145px;
  }
  .project-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .research-item {
    grid-template-columns: 78px 1fr 18px;
    gap: 10px;
    padding: 18px 2px;
  }
  .research-item strong {
    font-size: 12px;
  }
  .research-item small {
    font-size: 10px;
  }
  .research-id {
    font-size: 8px;
  }
  .contact-section {
    padding-top: 78px;
    padding-bottom: 70px;
  }
  .contact-panel {
    padding: 25px;
    align-items: flex-start;
    flex-direction: column;
  }
  .contact-actions {
    margin-top: 5px;
  }
  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .footer p {
    margin: 0;
  }
  .footer-code {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* Advanced interaction layer */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.utility-button {
  border: 1px solid var(--line);
  background: #ffffff05;
  color: var(--text);
  padding: 7px 10px;
  font: 10px var(--mono);
  cursor: pointer;
}

.utility-button:hover {
  border-color: var(--cyan);
}

.earth-stage #earthCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: grab;
  outline: none;
}

.earth-stage #earthCanvas:active {
  cursor: grabbing;
}

.earth-stage .earth,
.earth-stage .earth-shade,
.earth-stage .earth-grid {
  display: none;
}

.earth-stage .orbit {
  z-index: 0;
}

.earth-stage .orbit-label,
.earth-stage .crosshair {
  z-index: 2;
  pointer-events: none;
}

.earth-loading {
  position: absolute;
  z-index: 3;
  bottom: 25px;
  font: 9px var(--mono);
  letter-spacing: .1em;
  color: var(--cyan);
  background: #08090bd9;
  padding: 5px 9px;
  border: 1px solid #39d9ff30;
}

.earth-stage.globe-fallback .earth {
  display: block;
}

.earth-stage.globe-fallback #earthCanvas {
  display: none;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: linear-gradient(100deg, #101216, #0b0d10);
  margin-top: 12px;
}

.signal-strip > div {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.signal-strip > div:last-child {
  border-right: 0;
}

.signal-value {
  font: 20px var(--mono);
  color: var(--cyan);
}

.signal-label {
  font: 8px var(--mono);
  letter-spacing: .1em;
  color: var(--muted);
}

.project-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.project-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  color: var(--cyan);
}

.project-search input {
  width: 145px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: 10px var(--mono);
}

.learning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.learning-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 235px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform .2s, border-color .2s;
}

.learning-card:hover {
  transform: translateY(-4px);
  border-color: #39d9ff70;
}

.learning-icon {
  font: 24px var(--mono);
  color: var(--cyan);
  margin-bottom: 18px;
}

.learning-kicker {
  font: 9px var(--mono);
  letter-spacing: .12em;
  color: var(--red);
}

.learning-card h3 {
  margin: 9px 0;
  font-size: 16px;
}

.learning-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin: 0 0 18px;
}

.learning-link {
  font: 10px var(--mono);
  color: var(--cyan);
  margin-top: auto;
}

.command-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #030406c9;
  backdrop-filter: blur(10px);
  display: grid;
  place-items: start center;
  padding: 15vh 20px 20px;
}

.command-overlay[hidden] {
  display: none;
}

.command-dialog {
  width: min(600px, 100%);
  background: #101318;
  border: 1px solid #343b46;
  box-shadow: 0 30px 100px #0009;
}

.command-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  font: 10px var(--mono);
  letter-spacing: .12em;
  color: var(--muted);
}

.command-heading button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: 10px var(--mono);
  cursor: pointer;
}

.command-search {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--cyan);
  font-size: 20px;
}

.command-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 13px var(--sans);
}

.command-results {
  padding: 7px;
  max-height: 330px;
  overflow: auto;
}

.command-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.command-option.selected,
.command-option:hover {
  background: #39d9ff0c;
  border-color: #39d9ff40;
}

.command-option span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.command-option strong {
  font-size: 12px;
}

.command-option small,
.command-hint,
.command-empty {
  font-size: 10px;
  color: var(--muted);
}

.command-option kbd {
  border: 1px solid var(--line);
  padding: 2px 6px;
  color: var(--muted);
}

.command-hint {
  padding: 0 17px 14px;
  margin: 0;
}

.command-empty {
  padding: 15px;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: #101216;
  color: var(--cyan);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.reading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--red);
  z-index: 101;
  box-shadow: 0 0 12px #ef3038;
}

.light-theme {
  --bg: #eef2f6;
  --panel: #fff;
  --card: #fff;
  --line: #d6dde5;
  --text: #151b24;
  --muted: #566170;
}

.light-theme .topbar {
  background: #eef2f6ed;
}

.light-theme .ticker,
.light-theme .signal-strip {
  background: #e3eaf1;
}

.light-theme .info-card,
.light-theme .contact-panel {
  background: #fff;
}

.light-theme .terminal-window {
  background: #f8fafc;
}

.light-theme .terminal-input-row input {
  color: var(--text);
}

.light-theme .command-dialog {
  background: #fff;
}

.light-theme .command-search input {
  color: var(--text);
}

.light-theme .back-to-top {
  background: #fff;
}

.light-theme .earth-loading {
  background: #ffffffdd;
  color: #087a98;
}

@media (max-width: 900px) {
  .signal-strip > div {
    padding: 16px;
  }
  .project-tools {
    width: 100%;
  }
  .learning-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .top-actions {
    gap: 5px;
  }
  .utility-button {
    padding: 7px;
  }
  .command-trigger {
    font-size: 9px;
  }
  .signal-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .signal-strip > div:nth-child(2) {
    border-right: 0;
  }
  .signal-strip > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
  .signal-value {
    font-size: 17px;
  }
  .project-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .project-search input {
    width: 100%;
  }
  .learning-grid {
    grid-template-columns: 1fr;
  }
  .learning-card {
    min-height: 190px;
  }
  .earth-loading {
    bottom: 12px;
    font-size: 8px;
  }
  .command-overlay {
    padding-top: 10vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .earth-stage #earthCanvas {
    display: none;
  }
  .earth-stage .earth {
    display: block;
  }
}

/* Field log / image gallery */
.record-form {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  margin: 26px 0 24px;
}

.record-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.record-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font: 10px var(--mono);
  letter-spacing: .04em;
  color: var(--muted);
}

.record-form-grid .wide {
  grid-column: 1 / -1;
}

.record-form input,
.record-form select,
.record-form textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 12px var(--sans);
  border-radius: 0;
}

.record-form input[type=file] {
  font-size: 10px;
}

.record-form textarea {
  resize: vertical;
}

.record-form .button {
  display: inline-flex;
  align-items: center;
  margin: 10px 10px 0 0;
  cursor: pointer;
}

.import-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--cyan);
  font: 10px var(--mono);
  cursor: pointer;
}

.import-label input {
  max-width: 220px;
  font: 10px var(--sans);
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.record-card {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  min-width: 0;
  overflow: hidden;
}

.record-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font: 9px var(--mono);
  color: var(--cyan);
  text-transform: uppercase;
}

.record-card h3 {
  font-size: 18px;
  margin: 15px 0 7px;
  overflow-wrap: anywhere;
}

.record-organizer,
.record-card > p {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.record-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 15px 0;
}

.record-images a {
  display: block;
  aspect-ratio: 4/3;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.record-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.record-delete {
  margin-top: 12px;
  border: 1px solid #ef303855;
  background: transparent;
  color: var(--red);
  padding: 7px 10px;
  font: 9px var(--mono);
  cursor: pointer;
}

.record-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}

.light-theme .record-form {
  background: #fff;
}

.light-theme .record-form input,
.light-theme .record-form select,
.light-theme .record-form textarea {
  background: #f7f9fb;
  color: #151b24;
}

@media (max-width: 650px) {
  .record-form {
    padding: 16px;
  }
  .record-form-grid,
  .record-grid {
    grid-template-columns: 1fr;
  }
  .record-form-grid .wide {
    grid-column: auto;
  }
  .record-form .button {
    width: 100%;
    justify-content: center;
  }
  .import-label {
    flex-wrap: wrap;
  }
  .record-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Static public image galleries */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.gallery-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color .2s, transform .2s;
}

.gallery-card:hover {
  border-color: #ef303866;
  transform: translateY(-3px);
}

.gallery-image-button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #0a0d11;
  cursor: zoom-in;
  overflow: hidden;
}

.gallery-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}

.gallery-image-button:hover img {
  transform: scale(1.04);
}

.gallery-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 8px;
  background: #08090bdd;
  color: #fff;
  font: 9px var(--mono);
  letter-spacing: .06em;
}

.gallery-card-body {
  padding: 18px;
}

.gallery-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--cyan);
  font: 9px var(--mono);
  text-transform: uppercase;
}

.gallery-card-body h3 {
  font-size: 15px;
  margin: 13px 0 7px;
  overflow-wrap: anywhere;
}

.gallery-card-body p {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.gallery-card-body .gallery-issuer {
  color: var(--text);
}

.gallery-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  padding: 28px;
  min-height: 155px;
}

.gallery-empty-mark {
  font: 24px var(--mono);
  color: var(--red);
}

.gallery-empty h3 {
  font-size: 15px;
  margin: 10px 0;
}

.gallery-empty p {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 680px;
}

.gallery-empty code {
  color: var(--cyan);
  overflow-wrap: anywhere;
}

.image-lightbox {
  width: min(92vw, 1100px);
  max-width: 92vw;
  max-height: 92vh;
  padding: 42px 18px 18px;
  border: 1px solid var(--line);
  background: #08090bf5;
  color: #fff;
}

.image-lightbox::backdrop {
  background: #000d;
  backdrop-filter: blur(5px);
}

.image-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  margin: auto;
}

.image-lightbox p {
  font: 11px var(--mono);
  color: #c4ccd6;
  text-align: center;
  line-height: 1.7;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-card-body {
    padding: 15px;
  }
}