:root {
  color-scheme: dark;
  --black: #020504;
  --surface: #080d0c;
  --silver: #c5cecb;
  --white: #eef5f2;
  --muted: #74817d;
  --line: rgba(197, 206, 203, 0.17);
  --emerald: #19d98b;
  --teal: #30f2cc;
  --mil: var(--emerald);
  font-family: Inter, Arial, sans-serif;
  background: var(--black);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background: var(--black);
}

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

#earth {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

main { position: relative; z-index: 2; }

main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  width: min(1400px, calc(100% - 64px));
  margin: 0 auto;
  padding: 7vh 0 6vh;
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.project-index, .project-state {
  font-family: "IBM Plex Mono", monospace;
}

h1 {
  margin: 0;
  color: var(--silver);
  font-family: Syncopate, sans-serif;
  font-size: clamp(2.65rem, 6vw, 6.25rem);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.09em;
  text-shadow: 0 0 35px rgba(48, 242, 204, 0.08);
}

h1 > span {
  display: block;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 0;
}

.brand-o {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 0.9em;
  height: 0.9em;
  flex: 0 0 auto;
  color: var(--silver);
  font: inherit;
  font-size: 1.12em;
  line-height: 0.8;
  letter-spacing: -0.09em;
  filter: drop-shadow(0 0 9px rgba(48, 242, 204, 0.22));
  transform: translate(-0.035em, 0.025em);
}

.brand-radar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.64em;
  height: 0.64em;
  overflow: visible;
  transform: translate(-50%, -50%);
  transform-origin: center;
  animation: radar-pulse 2.2s ease-in-out infinite;
}

.brand-radar circle,
.brand-radar path {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.brand-radar circle,
.brand-radar > path:not(.brand-radar-sweep) {
  opacity: 0.38;
}

.brand-radar .brand-radar-sweep {
  fill: rgba(48, 242, 204, 0.14);
  stroke: rgba(48, 242, 204, 0.7);
}

.brand-radar .brand-radar-point {
  fill: var(--white);
  stroke: var(--emerald);
  opacity: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: radar-point-pulse 1.1s ease-out infinite;
}

@keyframes radar-pulse {
  0%, 100% {
    opacity: 0.78;
    filter: drop-shadow(0 0 2px rgba(48, 242, 204, 0.24));
    transform: translate(-50%, -50%) scale(0.94);
  }
  48% {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(48, 242, 204, 0.72));
    transform: translate(-50%, -50%) scale(1);
  }
  62% {
    filter: drop-shadow(0 0 13px rgba(48, 242, 204, 0.38));
    transform: translate(-50%, -50%) scale(1.035);
  }
}

@keyframes radar-point-pulse {
  0%, 100% { opacity: 0.72; transform: scale(0.72); }
  45% { opacity: 1; transform: scale(1.45); }
}

.brand-bottom {
  color: var(--white);
  margin-left: 0.14em;
}

.projects { width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.project-card {
  --health: var(--mil);
  position: relative;
  min-height: 310px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(4, 10, 8, 0.56);
  backdrop-filter: blur(5px);
  transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--health) 42%, var(--line));
  background: rgba(10, 27, 22, 0.64);
}

.project-card h3 {
  margin: 17px 8px 14px;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.icon-frame {
  position: relative;
  height: 180px;
  overflow: hidden;
  border: 1px solid rgba(232, 236, 229, 0.09);
  border-radius: 10px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    rgba(2, 7, 6, 0.62);
  background-size: 22px 22px;
}

.icon-frame::after {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.025);
  border-radius: 6px;
  content: "";
  pointer-events: none;
}

.project-icon {
  width: 100%;
  height: 100%;
}

.signal {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0 8px 5px;
}

.ecg {
  width: 100%;
  height: 28px;
  overflow: visible;
}

.ecg .baseline { stroke: color-mix(in srgb, var(--health) 15%, transparent); }

.ecg .pulse {
  stroke: var(--health);
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--health) 55%, transparent));
  animation: heartbeat 2.4s linear infinite;
}

.health-value {
  color: var(--health);
  font: 500 0.58rem/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
}

@keyframes heartbeat {
  0% { stroke-dashoffset: 220; opacity: 0.2; }
  18%, 82% { opacity: 1; }
  100% { stroke-dashoffset: -220; opacity: 0.2; }
}

@media (max-width: 820px) {
  main { width: calc(100% - 32px); padding: 8vh 0 4vh; }
  .masthead {
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
  }
  h1 {
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(2.5rem, 11vw, 4.75rem);
  }
  .brand-top { justify-content: center; }
  .brand-bottom { margin-left: 0; text-align: center; }
  .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card { min-height: 280px; }
  .icon-frame { height: 155px; }
}

@media (max-width: 480px) {
  .project-list { grid-template-columns: 1fr; }
  .project-card { min-height: 295px; }
  .icon-frame { height: 175px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .ecg .pulse { animation: none !important; stroke-dashoffset: 0; }
  .brand-radar,
  .brand-radar-point { animation: none !important; }
}
