/* hero-engineer.css — the design-engineer hero kit (home page).
 *   1. .hero-field      — day/night fallback background (video swap later)
 *   2. .hero-statusline — tmux-style mono status bar (open to work · SF · Spotify)
 *   3. .hx-*            — inspect mode: live spec annotations over the hero
 *   4. .ck-*            — ⌘K command palette
 */

/* ============ 1. hero background (fallback images → day/night video later) ============ */
/* Same geometry the CRT video had: full-bleed behind the hero. On the home
   page the field is position:fixed (see html.home below) so the footage stays
   put while hero content scrolls over it. */
.hero-field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  /* full-bleed past the fold: the footage dissolves into the next section.
     Decorative only — it underlaps the works section, so it must never
     eat clicks */
  height: 140dvh;
  z-index: 0;
  box-sizing: border-box;
  pointer-events: none;
}

/* Home: the field lives INSIDE the hero only — it scrolls away with the
   section (anchored to .div-block-9, which starts at the page top). */
html.home .div-block-9 {
  position: relative;
}
html.home .hero-field {
  position: absolute;
}
.hero-field__media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* instant paint under the videos while they buffer */
  background-image: var(--hero-bg-image, url('/assets/background/night.jpeg'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* same saturation grade as the .background-wall wallpaper on the other
     pages — applies to the stills AND the video children */
  filter: saturate(200%);
  /* bottom of the footage dissolves into the section below the fold —
     solid through the hero, then a long eased ramp from ~90dvh (64% of the
     140dvh field) that melts under the works section over ~48dvh */
  -webkit-mask-image: linear-gradient(to bottom,
    #000 64%, rgba(0, 0, 0, 0.87) 72%, rgba(0, 0, 0, 0.68) 79%,
    rgba(0, 0, 0, 0.45) 86%, rgba(0, 0, 0, 0.22) 92%, transparent 98%);
  mask-image: linear-gradient(to bottom,
    #000 64%, rgba(0, 0, 0, 0.87) 72%, rgba(0, 0, 0, 0.68) 79%,
    rgba(0, 0, 0, 0.45) 86%, rgba(0, 0, 0, 0.22) 92%, transparent 98%);
}
/* Day still rides a ::before layer above the night base so the theme
   toggle CROSSFADES the two (background-image itself can't animate). */
.hero-field__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: url('/assets/background/day.jpg') center / cover no-repeat;
  opacity: 0;
  transition: opacity 0.85s ease;
}

html.theme-core.day-mode .hero-field__media::before {
  opacity: 1;
}


/* Dim + vignette above the footage (videos AND poster fallbacks): a touch
   of overall darkening in the centre easing into a soft edge vignette, so
   the frame draws the eye inward and the glass tiles pop. */
.hero-field__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 50% 45%,
    rgba(0, 0, 0, 0.20) 40%,
    rgba(0, 0, 0, 0.32) 72%,
    rgba(0, 0, 0, 0.52) 100%);
}

/* Day/night videos stacked in the frame; the toggle crossfades them.
   Both keep playing during the fade (JS pauses the hidden one after). */
.hero-field__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.85s ease;
}
.hero-field__video--night {
  opacity: 1;
}
html.theme-core.day-mode .hero-field__video--night {
  opacity: 0;
}
html.theme-core.day-mode .hero-field__video--day {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .hero-field__video {
    display: none;
  }
}

/* Day mode: the footage is bright, so the frost tint (theme.css) carries the
   glass and the copy flips dark. */
html.theme-core.day-mode .hero-statusline {
  border-color: var(--card-border, rgba(0, 0, 0, 0.08));
  color: rgba(0, 0, 0, 0.62);
  text-shadow: none;
}

html.theme-core.day-mode .hero-statusline a.hsl-item:hover,
html.theme-core.day-mode .hero-statusline a.hsl-item:focus-visible {
  color: rgba(0, 0, 0, 0.92);
}

html.theme-core.day-mode .hero-statusline .hsl-sep {
  color: rgba(0, 0, 0, 0.22);
}

html.theme-core.day-mode .hero-statusline .hsl-note {
  color: rgba(0, 0, 0, 0.35);
}

html.theme-core.day-mode .hero-statusline .hsl-btn {
  color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.14);
}

html.theme-core.day-mode .hero-statusline .hsl-btn:hover,
html.theme-core.day-mode .hero-statusline .hsl-btn:focus-visible {
  color: #000;
  background: rgba(0, 0, 0, 0.09);
  border-color: rgba(0, 0, 0, 0.26);
}

/* ============ typer caret (role typewriter) ============ */
.typer-live::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.92em;
  margin-left: 0.09em;
  background: #6db3ff;
  vertical-align: -0.08em;
  animation: de-caret 1.05s steps(2, start) infinite;
}
@keyframes de-caret { 0% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .typer-live::after { display: none; } }

/* ============ 2. status line ============ */
/* Real liquid glass: the .glass-effect/-tint/-shine layers (liquid-glass.css +
   liquid-glass.js lens) do the refraction; the container only draws the rim. */
.hero-statusline {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.hero-statusline.liquid-glass {
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
}
.hero-statusline > :not(.glass-effect):not(.glass-effect-tint):not(.glass-effect-shine) {
  position: relative;
  z-index: 2;
}
.hsl-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: inherit; text-decoration: none; white-space: nowrap; }
a.hsl-item { transition: color 0.15s ease; }
a.hsl-item:hover, a.hsl-item:focus-visible { color: rgba(255, 255, 255, 0.92); }
.hsl-sep { color: rgba(255, 255, 255, 0.2); flex: 0 0 auto; }
.hsl-spacer { flex: 1 1 auto; min-width: 6px; }
.hsl-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
  animation: hsl-pulse 2.4s ease-in-out infinite;
}
@keyframes hsl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .hsl-dot { animation: none; } }
.hsl-loc > span:first-child { font-size: 12px; }

/* Spotify widget, reduced from card to status item (updater IDs unchanged) */
.hero-statusline .spotify-now-playing {
  display: inline-flex; align-items: center; gap: 6px;
  width: auto; max-width: none; margin: 0; padding: 0;
  border: none; border-radius: 0; background: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.hero-statusline .spotify-now-playing:hover { background: transparent; border: none; }
.hsl-note { color: rgba(255, 255, 255, 0.35); }
.hero-statusline .spotify-track {
  font-size: inherit; color: inherit; line-height: 1.4;
  max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-statusline .spotify-cover-wrap,
.hero-statusline .spotify-status,
.hero-statusline .spotify-artist { display: none !important; }

.hsl-btn {
  flex: 0 0 auto;
  font-family: inherit; font-size: 10.5px; letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.hsl-btn:hover, .hsl-btn:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.28); }
.hsl-btn[aria-pressed="true"] { color: #9ccaff; background: rgba(90, 176, 255, 0.16); border-color: rgba(90, 176, 255, 0.55); }

@media (max-width: 767px) {
  .hero-statusline { font-size: 10.5px; gap: 8px; padding: 8px 12px; border-radius: 12px; }
  .hero-statusline .spotify-track { max-width: 130px; }
  /* no pointer precision / hardware keyboard: drop the tool buttons */
  .hsl-btn, .hsl-spacer { display: none; }
}

/* ============ 3. inspect mode ============ */
.hx-overlay {
  position: absolute; inset: 0;
  z-index: 80;
  pointer-events: none;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
.hx-box {
  position: absolute;
  border: 1px dashed rgba(90, 176, 255, 0.9);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(10, 60, 120, 0.25);
}
.hx-label {
  position: absolute;
  transform: translateY(-100%);
  top: -3px; left: -1px;
  white-space: nowrap;
  font-size: 9.5px; line-height: 1;
  color: #fff;
  background: #0a84ff;
  border-radius: 3px 3px 3px 0;
  padding: 4px 7px;
}
.hx-label b { font-weight: 700; margin-right: 6px; }
.hx-gap { position: absolute; width: 0; border-left: 1px solid #ff5a52; }
.hx-gap::before, .hx-gap::after {
  content: ""; position: absolute; left: -5px; width: 9px; height: 0;
  border-top: 1px solid #ff5a52;
}
.hx-gap::before { top: 0; }
.hx-gap::after { bottom: 0; }
.hx-gap-label {
  position: absolute;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 9.5px; line-height: 1;
  color: #fff;
  background: #ff5a52;
  border-radius: 3px;
  padding: 3px 6px;
}
.hx-note {
  position: absolute;
  white-space: nowrap;
  font-size: 9.5px; line-height: 1;
  color: rgba(210, 230, 255, 0.9);
  background: rgba(8, 14, 24, 0.78);
  border: 1px solid rgba(90, 176, 255, 0.4);
  border-radius: 4px;
  padding: 4px 7px;
}

/* ============ 4. ⌘K command palette ============ */
.ck-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.16s ease;
}
.ck-panel {
  position: fixed; z-index: 201;
  left: 50%; top: 16vh;
  transform: translateX(-50%) translateY(6px) scale(0.985);
  width: min(560px, 92vw);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(11, 14, 20, 0.92);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}
.ck-open .ck-backdrop { opacity: 1; pointer-events: auto; }
.ck-open .ck-panel { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
@media (prefers-reduced-motion: reduce) { .ck-backdrop, .ck-panel { transition: none; } }

.ck-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ck-ps1 { color: #5ab0ff; font-size: 13px; font-weight: 600; }
.ck-input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  color: #d2ddec; font-family: inherit; font-size: 13.5px;
  caret-color: #5ab0ff;
}
.ck-input::placeholder { color: #6b7c93; }
.ck-esc {
  flex: 0 0 auto; font-size: 9.5px; color: #6b7c93;
  border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 4px; padding: 3px 6px;
}
.ck-list { max-height: 318px; overflow-y: auto; padding: 6px; }
.ck-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left; cursor: pointer;
  border: none; background: transparent; border-radius: 8px;
  padding: 9px 10px;
  color: #d2ddec; font-family: inherit; font-size: 12.5px;
}
.ck-item[aria-selected="true"] { background: rgba(90, 176, 255, 0.13); }
.ck-item__icon { flex: 0 0 18px; text-align: center; color: #5ab0ff; font-size: 12px; }
.ck-item__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-item__hint { flex: 0 0 auto; color: #6b7c93; font-size: 10px; }
.ck-empty { padding: 18px 12px 20px; text-align: center; color: #6b7c93; font-size: 12px; }
.ck-foot {
  display: flex; gap: 14px; justify-content: center;
  padding: 9px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #58677f; font-size: 9.5px; letter-spacing: 0.03em;
}

/* phones: the identity card meta keeps location only — "open to work"
   lives on /connect */
@media (max-width: 767px) {
  .hero-card-foot .hsl-status,
  .hero-card-foot .hsl-sep {
    display: none !important;
  }
}
