/* ============================================================
   qtvo93 // signal array
   Sonar-console portfolio. Palette = deep sea, not matrix green.
   ============================================================ */

:root {
  /* --- palette: sonar at depth --- */
  --abyss:  #05080D;   /* background, ocean at depth        */
  --hull:   #0B131B;   /* lifted panel / input surface      */
  --steel:  #14324A;   /* grid lines, muted secondary       */
  --teal:   #35E0C8;   /* THE SIGNAL: primary / interactive  */
  --teal-d: #1c8f80;   /* dim teal for rules                 */
  --foam:   #DCEBF2;   /* body text                          */
  --mute:   #6d8494;   /* captions / low-priority mono       */
  --amber:  #FFB454;   /* CONTACT: the one warm accent       */

  /* --- type --- */
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- rhythm --- */
  --pad-x: clamp(1.25rem, 5vw, 6rem);
  --pad-y: clamp(4rem, 11vh, 8.5rem);
  --measure: clamp(62ch, 46vw, 84ch);
  --rule: 1px solid color-mix(in srgb, var(--steel) 70%, transparent);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--abyss);
  color: var(--foam);
  font-family: var(--display);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.12rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* faint sonar grid in the deep */
  background-image:
    linear-gradient(color-mix(in srgb, var(--steel) 12%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--steel) 12%, transparent) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
}

::selection { background: var(--teal); color: var(--abyss); }

a { color: var(--teal); text-decoration: none; }

/* visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- boot overlay ---------------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--abyss);
  display: grid;
  place-items: center;
  transition: opacity 0.5s var(--ease);
}
.boot.is-done { opacity: 0; pointer-events: none; }
.boot__log {
  font-family: var(--mono);
  font-size: clamp(0.75rem, 2.6vw, 0.95rem);
  color: var(--teal);
  line-height: 2;
  white-space: pre;
  text-shadow: 0 0 12px color-mix(in srgb, var(--teal) 45%, transparent);
}

/* ---------------- status bar ---------------- */
.statusbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--pad-x);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--mute);
  background: color-mix(in srgb, var(--abyss) 82%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule);
}
.statusbar__brand { color: var(--foam); white-space: nowrap; }
.statusbar__slash { color: var(--teal); }
.statusbar__nav { display: flex; gap: 1.4rem; }
.statusbar__nav a { color: var(--mute); transition: color 0.2s var(--ease); }
.statusbar__nav a:hover, .statusbar__nav a.is-active { color: var(--teal); }
.statusbar__status { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--teal); white-space: nowrap; }
.statusbar__progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--teal), var(--amber));
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 70%, transparent);
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 60%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  min-height: calc(100svh - 46px);
  display: flex;
  align-items: center;
  padding: var(--pad-y) var(--pad-x);
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; transition: filter 0.5s var(--ease); }
.hero__scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 90% at 75% 15%, transparent 0%, var(--abyss) 78%),
    linear-gradient(180deg, transparent 20%, var(--abyss) 100%);
  transition: opacity 0.5s var(--ease);
}
.hero__inner { position: relative; z-index: 2; width: 100%; max-width: clamp(68ch, 50vw, 90ch); margin-inline: auto; }

.hero__readout {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin-bottom: 1.4rem;
  text-shadow: 0 0 14px color-mix(in srgb, var(--teal) 35%, transparent);
}
.hero__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 12vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 1.1rem;
}
.hero__name-accent {
  background: linear-gradient(100deg, var(--teal) 0%, var(--foam) 55%, var(--amber) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 46px color-mix(in srgb, var(--teal) 40%, transparent);
}
.hero__tagline {
  font-family: var(--mono);
  font-size: clamp(1rem, 3.4vw, 1.5rem);
  color: var(--foam);
  margin-bottom: 0.9rem;
  min-height: 1.6em;
}
.hero__prompt { color: var(--amber); font-weight: 700; }
.caret {
  display: inline-block;
  width: 0.62ch; height: 1.05em;
  translate: 0 0.16em;
  background: var(--teal);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* terminal */
.term { max-width: clamp(60ch, 44vw, 78ch); }
.term__log {
  position: relative;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: color-mix(in srgb, var(--foam) 65%, var(--mute) 35%);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 0.4rem;
  max-height: 40vh;
  overflow-y: auto;
}
.term__log.has-output { height: 40vh; }
.term__log .ok  { color: var(--teal); }
.term__log .hit { color: var(--amber); }
.term__log .err { color: #ff6b6b; }
.term__log .cmd-echo { color: var(--foam); }
/* faint faded divider between consecutive command outputs (not before the first) */
.term__echo:not(:first-child) { position: relative; margin-top: 0.8rem; padding-top: 0.85rem; }
.term__echo:not(:first-child)::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--steel) 90%, transparent) 15%, color-mix(in srgb, var(--steel) 90%, transparent) 85%, transparent);
}

.term__line {
  display: flex;
  align-items: center;
  gap: 0.6ch;
  border: var(--rule);
  border-left: 2px solid var(--teal);
  background: color-mix(in srgb, var(--hull) 70%, transparent);
  padding: 0.7rem 0.9rem;
}
.term__prompt { font-family: var(--mono); font-size: 0.82rem; color: var(--teal); white-space: nowrap; }
.term__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--foam);
  font-family: var(--mono);
  font-size: 0.9rem;
  caret-color: var(--teal);
}
.term__input:focus { outline: none; }
.term__input::placeholder { color: color-mix(in srgb, var(--mute) 80%, transparent); }

.hero__scroll {
  position: absolute;
  bottom: 1.4rem; left: 50%;
  translate: -50% 0;
  z-index: 2;
  color: var(--mute);
  font-size: 1.1rem;
  animation: bob 2.2s var(--ease) infinite;
}
@keyframes bob { 50% { translate: -50% 6px; } }

/* ---------------- panels ---------------- */
.panel {
  padding: var(--pad-y) var(--pad-x);
  border-top: var(--rule);
  opacity: 0;
  translate: 0 26px;
  transition: opacity 0.7s var(--ease), translate 0.7s var(--ease);
}
.panel.is-visible { opacity: 1; translate: 0 0; }

.panel__head {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.5vw, 1.7rem);
  margin-bottom: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.9rem;
  max-width: var(--measure);
  margin-inline: auto;
}
.panel__cmd { color: var(--teal); }
.panel__meta { font-size: 0.72rem; font-weight: 400; color: var(--mute); letter-spacing: 0.08em; }
.panel__body { max-width: var(--measure); margin-inline: auto; }

/* about */
.lede { font-size: clamp(1.3rem, 4vw, 1.9rem); line-height: 1.35; letter-spacing: -0.01em; margin-bottom: 1.4rem; }
.lede strong { color: var(--teal); font-weight: 500; }
.about p + p { margin-top: 1.2rem; color: color-mix(in srgb, var(--foam) 82%, var(--abyss)); }
.about em { color: var(--amber); font-style: normal; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--teal);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--teal-d);
  border-radius: 999px;
}

/* projects / contacts */
.contacts { list-style: none; display: grid; gap: 1.1rem; }
.contact {
  border: var(--rule);
  border-left: 2px solid var(--steel);
  background: color-mix(in srgb, var(--hull) 55%, transparent);
  padding: 1.6rem 1.7rem;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), translate 0.25s var(--ease);
}
.contact:hover { border-left-color: var(--teal); background: color-mix(in srgb, var(--hull) 85%, transparent); translate: 6px 0; animation: ping 0.6s var(--ease); }
.contact--featured { border-left-color: var(--amber); }
.contact--featured:hover { border-left-color: var(--amber); }
.contact__tag { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; color: var(--mute); margin-bottom: 0.7rem; }
.contact__flag { color: var(--amber); }
.contact__title { font-family: var(--mono); font-size: clamp(1.05rem, 3vw, 1.35rem); font-weight: 700; color: var(--foam); margin-bottom: 0.6rem; word-break: break-word; }
.contact__desc { color: color-mix(in srgb, var(--foam) 80%, var(--abyss)); margin-bottom: 0.9rem; }
.contact__desc strong { color: var(--amber); font-weight: 500; }
.contact__stack { font-family: var(--mono); font-size: 0.72rem; color: var(--mute); margin-bottom: 1rem; }
.contact__link { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; }
.contact__link:hover { color: var(--amber); }

/* now.log */
.log { list-style: none; font-family: var(--mono); font-size: 0.92rem; display: grid; gap: 0.7rem; }
.log li { color: color-mix(in srgb, var(--foam) 85%, var(--abyss)); }
.log__k { color: var(--mute); }
.log__k--live { color: var(--teal); }

/* comms */
.comms { list-style: none; display: grid; gap: 0; border-top: var(--rule); }
.comms__row {
  display: flex; align-items: baseline; gap: 1.5rem; padding: 1.1rem 0.2rem; border-bottom: var(--rule);
  transition: border-color 0.25s var(--ease), translate 0.25s var(--ease);
}
.comms__row:hover { border-bottom-color: var(--teal); translate: 6px 0; }
.comms__k { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; color: var(--mute); width: 6.5rem; flex-shrink: 0; }
.comms__v { font-family: var(--mono); font-size: clamp(0.95rem, 3vw, 1.15rem); font-weight: 700; }
.comms__v:hover { color: var(--amber); }
.comms__v--empty { color: var(--mute); font-weight: 400; }

/* ---------------- footer ---------------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 2rem var(--pad-x) 3rem;
  border-top: var(--rule);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mute);
}

/* inline code token */
code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  padding: 0.05em 0.4em;
  border-radius: 3px;
}

/* ---- live-mic control ---- */
.hero__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1rem; margin-top: 1.3rem; }
.listen {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--teal);
  background: color-mix(in srgb, var(--hull) 60%, transparent);
  border: 1px solid var(--teal-d);
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.listen:hover { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); }
.listen__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }
.listen.is-live { color: var(--amber); border-color: var(--amber); }
.listen.is-live .listen__dot { background: var(--amber); animation: ping 1.6s var(--ease) infinite; }
.listen__hint { font-family: var(--mono); font-size: 0.68rem; color: var(--mute); }

/* ---- research spotlight ---- */
.spotlight { max-width: clamp(68ch, 50vw, 90ch); }
.spotlight__lead {
  font-size: clamp(1.4rem, 4.4vw, 2.15rem);
  line-height: 1.28;
  letter-spacing: -0.015em;
  margin-bottom: 2.2rem;
}
.spotlight__lead strong { color: var(--teal); font-weight: 500; }
.spotlight__q {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--amber);
  margin: 1.8rem 0 0.5rem;
}
.spotlight p:not(.spotlight__q):not(.spotlight__lead) { color: color-mix(in srgb, var(--foam) 82%, var(--abyss)); }
.spotlight strong { color: var(--foam); font-weight: 500; }
.spotlight em { color: var(--amber); font-style: normal; }
.spotlight__links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2rem; font-family: var(--mono); font-size: 0.82rem; font-weight: 700; }
.spotlight__links a:hover { color: var(--amber); }

/* ---- contact multi-links ---- */
.contact__links { display: flex; flex-wrap: wrap; gap: 1.3rem; font-family: var(--mono); font-size: 0.82rem; font-weight: 700; }
.contact__links a:hover { color: var(--amber); }

/* ---- publications & talks ---- */
.sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 1.1rem;
}
.sub + .sub, .pubs + .sub, .talks + .sub { margin-top: 2.6rem; }
.pubs, .talks { list-style: none; display: grid; }
.pubs { gap: 1.3rem; margin-bottom: 0.5rem; }
.pubs li { padding-left: 1.1rem; border-left: 2px solid var(--teal-d); }
.pubs__title { display: block; font-family: var(--display); font-weight: 500; font-size: 1.05rem; line-height: 1.4; }
.pubs__title:hover { color: var(--amber); }
.pubs__meta { display: block; font-family: var(--mono); font-size: 0.74rem; color: var(--mute); margin-top: 0.4rem; }
.pubs__more { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; margin-top: 1rem; }
.pubs__more a:hover { color: var(--amber); }
.talks { gap: 0; border-top: var(--rule); }
.talks li { padding: 0.9rem 0.2rem; border-bottom: var(--rule); font-family: var(--mono); }
.talks__where { display: block; font-size: 0.85rem; line-height: 1.5; color: var(--teal); }
.talks__meta { display: block; font-size: 0.74rem; color: var(--mute); margin-top: 0.2rem; }

/* ---- hero role strip ---- */
.hero__roles {
  font-family: var(--mono);
  font-size: clamp(0.72rem, 2.4vw, 0.85rem);
  letter-spacing: 0.04em;
  color: var(--teal);
  margin-bottom: 2rem;
}

/* ---- experience (systemctl) ---- */
.svc { list-style: none; display: grid; gap: 1.7rem; }
.svc__item {
  border-left: 2px solid var(--steel);
  padding-left: 1.1rem;
  transition: border-color 0.25s var(--ease), translate 0.25s var(--ease);
}
.svc__item:has(.svc__dot--on) { border-left-color: var(--teal-d); }
.svc__item:hover { border-left-color: var(--teal); translate: 6px 0; }
.svc__unit {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--foam);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7ch;
  margin-bottom: 0.5rem;
}
.svc__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mute); flex-shrink: 0; }
.svc__dot--on { background: var(--teal); box-shadow: 0 0 8px color-mix(in srgb, var(--teal) 55%, transparent); }
.svc__state { font-size: 0.72rem; color: var(--mute); }
.svc__state--on { color: var(--teal); }
.svc__desc { color: color-mix(in srgb, var(--foam) 80%, var(--abyss)); max-width: 66ch; }
.svc__meta { font-family: var(--mono); font-size: 0.75rem; color: var(--mute); margin-bottom: 0.5rem; }
.svc__org { color: var(--teal); }

/* ---- education & certifications ---- */
.edu { list-style: none; display: grid; gap: 0; border-top: var(--rule); margin-bottom: 0.5rem; }
.edu__item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem;
  padding: 0.85rem 0.2rem; border-bottom: var(--rule);
  transition: border-color 0.25s var(--ease), translate 0.25s var(--ease);
}
.edu__item:hover { border-bottom-color: var(--teal); translate: 6px 0; }
.edu__what { font-family: var(--mono); font-size: 0.9rem; color: var(--foam); }
.edu__where { margin-left: auto; font-family: var(--mono); font-size: 0.75rem; color: var(--mute); }

/* ---- live HUD / acoustic lab ---- */
.live-hud {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.3rem;
  padding: 0.9rem 1rem;
  border: var(--rule);
  border-left: 2px solid var(--amber);
  background: color-mix(in srgb, var(--hull) 55%, transparent);
  font-family: var(--mono);
  font-size: 0.78rem;
  max-width: 60ch;
}
.live-hud[hidden] { display: none; }
.live-hud__top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.9rem; }
.live-hud__badge { display: inline-flex; align-items: center; gap: 0.5ch; color: var(--amber); font-weight: 700; letter-spacing: 0.08em; }
.live-hud__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: ping 1.4s var(--ease) infinite; }
.live-hud__src { color: var(--foam); }
.meter { position: relative; width: clamp(80px, 24vw, 150px); height: 9px; background: color-mix(in srgb, var(--steel) 55%, transparent); border: 1px solid var(--teal-d); overflow: hidden; }
.meter__fill { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); background: linear-gradient(90deg, var(--teal), var(--amber)); transition: transform 0.08s linear; }

.live-hud__readouts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; min-height: 1.4rem; }
.ro { color: var(--mute); }
.ro b { color: var(--teal); font-weight: 700; }

.live-hud__controls { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lhbtn {
  font-family: var(--mono); font-size: 0.72rem; color: var(--teal);
  background: color-mix(in srgb, var(--hull) 70%, transparent);
  border: 1px solid var(--teal-d); padding: 0.42rem 0.7rem; cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.lhbtn:hover { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); }
.lhbtn.is-on { color: var(--amber); border-color: var(--amber); }
.lhbtn:disabled { opacity: 0.55; cursor: default; }

.live-hud__sig { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.live-hud__sig[hidden] { display: none; }
.live-hud__sigimg { width: 100%; max-width: 380px; border: 1px solid var(--teal-d); display: block; }

.live-hud__hint { color: var(--mute); transition: opacity 0.4s var(--ease); }
.live-hud__hint.is-hidden { opacity: 0; }

/* live-mode cues elsewhere */
#status.is-live { color: var(--amber); }
#status.is-live .dot { background: var(--amber); animation: none; box-shadow: 0 0 8px var(--amber); }
body.live .hero::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--amber); z-index: 3;
  box-shadow: 0 0 14px color-mix(in srgb, var(--amber) 70%, transparent);
}
/* the background spectrogram leans forward while the mic is live */
body.live .hero__canvas { filter: brightness(1.32) saturate(1.25) contrast(1.05); }
body.live .hero__scrim { opacity: 0.72; }

/* ---------------- responsive ---------------- */
@media (max-width: 880px) { .statusbar__nav { display: none; } }

@media (max-width: 620px) {
  .statusbar__nav { display: none; }
  .comms__row { flex-direction: column; gap: 0.3rem; }
  .comms__k { width: auto; }
  body { background-size: 44px 44px, 44px 44px; }
  /* iOS Safari auto-zooms on focus when an input's font-size is under 16px */
  .term__input { font-size: 16px; }
  /* backdrop-filter forces a recomposite on every scroll frame; not worth it on mobile */
  .statusbar { backdrop-filter: none; background: color-mix(in srgb, var(--abyss) 94%, transparent); }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .panel { opacity: 1; translate: 0 0; }
  .caret { animation: none; }
  .hero__scroll { animation: none; }
}
