@font-face {
  font-family: 'Nothing Font 5x7';
  src: url('./fonts/ndot-47.otf') format('opentype');
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

/* Root Variables — Dark Default */
:root {
  --font-family: "Nothing Font 5x7", monospace;
  --line-height: 1.20rem;
  --border-thickness: 2px;
  --text-color: #fff;
  --text-color-alt: #aaa;
  --background-color: #000;
  --background-color-alt: #111;
  --accent-color: lightcoral;
  --divider-color: rgba(255, 255, 255, 0.25);

  --font-weight-normal: 500;
  --font-weight-medium: 600;
  --font-weight-bold: 800;

  font-family: var(--font-family);
  font-optical-sizing: auto;
  font-weight: var(--font-weight-normal);
  font-style: normal;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 16px;
}

/* Light Theme Override */
[data-theme="light"] {
  --text-color: #111;
  --text-color-alt: #555;
  --background-color: #f5f5f0;
  --background-color-alt: #e8e8e3;
  --accent-color: #c0392b;
  --divider-color: rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
}

*+* {
  margin-top: var(--line-height);
}

html {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  flex-direction: column;
  align-items: center;
  background: var(--background-color);
  color: var(--text-color);
}

body {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0 2ch var(--line-height);
  max-width: 80ch;
  line-height: var(--line-height);
  overflow-x: hidden;
  box-sizing: border-box;
  min-height: 100vh;
}

#app {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0;
  padding-top: calc(var(--line-height) * 2);
  background-image: repeating-linear-gradient(-45deg,
      var(--divider-color) 0,
      var(--divider-color) 1px,
      transparent 1px,
      transparent 10px);
  background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  margin: calc(var(--line-height) * 2) 0 var(--line-height);
  line-height: var(--line-height);
}

h1 {
  font-size: 2rem;
  line-height: calc(2 * var(--line-height));
  margin-bottom: calc(var(--line-height) * 2);
  text-transform: uppercase;
}

h2 {
  font-size: 1rem;
  text-transform: uppercase;
}

hr {
  position: relative;
  display: block;
  height: var(--line-height);
  margin: calc(var(--line-height) * 1.5) 0;
  border: none;
  color: var(--text-color);
}

hr:after {
  display: block;
  content: "";
  position: absolute;
  top: calc(var(--line-height) / 2 - var(--border-thickness));
  left: 0;
  width: 100%;
  border-top: calc(var(--border-thickness) * 3) double var(--text-color);
  height: 0;
}

a {
  text-decoration-thickness: var(--border-thickness);
}

a:link,
a:visited {
  color: var(--text-color);
}

p {
  margin-bottom: var(--line-height);
  word-break: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

strong {
  font-weight: var(--font-weight-bold);
}

em {
  font-style: italic;
}

sub {
  position: relative;
  display: inline-block;
  margin: 0;
  vertical-align: sub;
  line-height: 0;
  width: calc(1ch / 0.75);
  font-size: .75rem;
}

table {
  position: relative;
  top: calc(var(--line-height) / 2);
  width: 100%;
  border-collapse: collapse;
  margin: calc(var(--line-height) * 2) 0;
}

th,
td {
  border: 1px solid var(--divider-color);
  padding:
    calc((var(--line-height) / 2)) calc(1ch - var(--border-thickness) / 2) calc((var(--line-height) / 2) - (var(--border-thickness)));
  line-height: var(--line-height);
  vertical-align: top;
  text-align: left;
}

table tbody tr:first-child>* {
  padding-top: calc((var(--line-height) / 2) - var(--border-thickness));
}

th {
  font-weight: 700;
}

.width-min {
  width: 0%;
}

.width-auto {
  width: 100%;
}

.header {
  top: 0;
  margin: 0 0 calc(var(--line-height) * 2);
  padding: 1.5rem 0;
  background: var(--background-color);
  border-top: 1px solid var(--divider-color);
  border-bottom: 1px solid var(--divider-color);
}

.header h1 {
  margin: 0;
}

.header tr td:last-child {
  text-align: right;
}

/* Page-specific headers (Projects, About, etc.) */
.header-page {
  margin-top: 0 !important;
  padding: 0 !important;
}

.page-header-inner {
  display: flex;
  align-items: stretch;
}

.page-header-title {
  padding: 1.5rem 2ch;
  white-space: nowrap;
  border-right: 1px solid var(--divider-color);
  display: flex;
  align-items: center;
}

.page-header-title h1 {
  font-size: 1.6rem;
  line-height: 1.4;
  margin: 0;
}

.page-header-desc {
  padding: 1.5rem 2ch;
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.75;
  display: flex;
  align-items: center;
  flex: 1;
}

/* The About header carries the full intro with inline links; flow it as a
   normal text block so the shared flex layout doesn't split the inline
   content (text + links) into separate columns. */
#header-about .page-header-desc {
  display: block;
}

/* Header swap animation */
@keyframes headerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-animate {
  animation: headerFadeIn 0.35s ease-out forwards;
}

img,
video {
  display: block;
  width: 100%;
  object-fit: contain;
  overflow: hidden;
}

img {
  font-style: italic;
  color: var(--text-color-alt);
}

ul,
ol {
  padding: 0;
  margin: 0 0 var(--line-height);
}

ul {
  list-style-type: square;
  padding: 0 0 0 2ch;
}

ol {
  list-style-type: none;
  counter-reset: item;
  padding: 0;
}

ol li:before {
  content: counters(item, ".") ". ";
  counter-increment: item;
  font-weight: var(--font-weight-medium);
}

li {
  margin: 0;
  padding: 0;
}

li::marker {
  line-height: 0;
}

::-webkit-scrollbar {
  height: var(--line-height);
}

/* Forms */
input,
button,
textarea {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc(var(--line-height) / 2 - var(--border-thickness)) calc(1ch - var(--border-thickness));
  margin: 0;
  font: inherit;
  font-weight: inherit;
  height: calc(var(--line-height) * 2);
  background: var(--background-color);
  color: var(--text-color);
  -webkit-font-smoothing: inherit;
  -moz-osx-font-smoothing: inherit;
  -webkit-appearance: none;
}

input[type=checkbox],
input[type=radio] {
  display: inline-grid;
  place-content: center;
  vertical-align: top;
  width: 2ch;
  height: var(--line-height);
  cursor: pointer;
}

input[type=checkbox]:checked:before,
input[type=radio]:checked:before {
  content: "";
  width: 1ch;
  height: calc(var(--line-height) / 2);
  background: var(--text-color);
}

input[type=radio],
input[type=radio]:before {
  border-radius: 100%;
}

button:focus,
input:focus {
  --border-thickness: 3px;
  outline: none;
}

::placeholder {
  color: var(--text-color-alt);
  opacity: 1;
}

button {
  text-transform: uppercase;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

button:hover {
  background: var(--background-color-alt);
}

button:active {
  transform: translate(2px, 2px);
}

/* Fixed Top Navbar */
.top-navbar {
  position: sticky;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 0.6rem 2ch;
  background: var(--background-color);
  border-bottom: 1px solid var(--text-color-alt);
  margin: 0;
}

.top-navbar a {
  position: relative;
  color: var(--text-color-alt);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  transition: color 0.2s;
  margin: 0;
}

.top-navbar a::after {
  content: attr(data-quip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-size: 10px;
  white-space: nowrap;
  background: var(--text-color);
  color: var(--background-color);
  padding: 4px 8px 6px 8px;
  line-height: 1.4;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.05em;
  z-index: 1000;
  margin: 0;
}

.top-navbar a:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.top-navbar a:hover {
  color: var(--accent-color);
  transform: none;
}

.top-navbar a.active {
  color: var(--accent-color);
}

/* Theme Toggle (inside navbar) */
.theme-toggle {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-color-alt);
  padding: 0;
  margin: 0;
  line-height: 1;
  height: auto;
  transition: color 0.2s;
}

.theme-toggle:hover {
  color: var(--text-color);
  background: none;
  transform: none;
}

/* Responsive Breakpoints */
@media screen and (max-width: 768px) {
  :root {
    font-size: 14px;
  }

  body {
    padding: 0 1ch var(--line-height);
  }

  .header tbody,
  .header tr,
  .header td,
  .header th,
  .header tr td:last-child {
    display: block;
    width: 100%;
    text-align: left;
  }

  /* center the name block and social icons on phones */
  .header .title,
  .header .subtitle {
    display: block;
    text-align: center;
  }

  .header .social-links {
    justify-content: center;
  }

  /* label + value pairs share one line (Rank · Voyager, B10GS · Zesty Writes) */
  .header tr {
    display: flex;
    flex-wrap: wrap;
  }

  /* the global *+* margin misaligns cells within a flex row */
  .header tr > * {
    margin-top: 0;
  }

  .header th {
    width: auto !important;
    flex: 0 0 auto;
  }

  .header th + td {
    width: auto !important;
    flex: 1 1 0;
  }

  .top-navbar {
    gap: 1.2rem;
    padding: 0.5rem 1ch;
  }

  .top-navbar a {
    font-size: 0.8rem;
    padding: 0.6rem 0.2rem;
  }

  .theme-toggle {
    padding: 0.6rem;
  }

  .social-icon {
    width: 40px;
    height: 40px;
  }

  .social-links {
    gap: 0.8rem;
  }

  #app {
    background-attachment: scroll;
  }
}

@media screen and (max-width: 480px) {
  table,
  tbody,
  tr,
  th,
  td {
    width: 100% !important;
    display: block;
    box-sizing: border-box;
  }
}

/* Touch devices: hover-only decorations off */
@media (hover: none) {
  .top-navbar a::after,
  .social-icon::after {
    content: none;
  }
}

@media screen and (max-width: 600px) {
  .page-header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-title {
    border-right: none;
    border-bottom: 1px solid var(--divider-color);
    padding: 1rem 2ch;
  }

  .page-header-desc {
    padding: 1rem 2ch;
  }
}

/* Optional: Hover red text effect scoped only to links in nav/TOC/etc */
a:hover {
  color: var(--accent-color);
  transform: scale(1.05);
}

/* Social Icon Links */
.social-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

.social-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-color);
  opacity: 0.6;
  transition: opacity 0.25s, transform 0.25s, color 0.25s;
  text-decoration: none;
  margin: 0;
}

.social-icon svg {
  width: 20px;
  height: 20px;
  margin: 0;
}

.social-icon:hover {
  opacity: 1;
  color: var(--accent-color);
  transform: scale(1.3);
  animation: icon-glitch 0.3s ease-out;
}

/* Quirky tooltip from data-quip */
.social-icon::after {
  content: attr(data-quip);
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  transform: translateY(6px);
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--text-color);
  color: var(--background-color);
  padding: 4px 8px 6px 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.05em;
  z-index: 9999;
  margin: 0;
  border-radius: 2px;
}

.social-icon:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* Glitch micro-animation */
@keyframes icon-glitch {
  0% {
    transform: scale(1.3) translate(0, 0);
  }

  20% {
    transform: scale(1.3) translate(-2px, 1px);
  }

  40% {
    transform: scale(1.3) translate(2px, -1px);
  }

  60% {
    transform: scale(1.3) translate(-1px, -1px);
  }

  80% {
    transform: scale(1.3) translate(1px, 1px);
  }

  100% {
    transform: scale(1.3) translate(0, 0);
  }
}

/* ====== Card UI (Projects / Experience) ====== */

.section-wrapper {
  position: relative;
  margin: 2.5rem 0;
  padding: 2rem 0;
  background: var(--background-color);
  border-top: 1px dashed var(--divider-color);
  border-bottom: 1px dashed var(--divider-color);
}

/* phones: desktop section air stacks up to ~90px of dead space */
@media screen and (max-width: 600px) {
  .section-wrapper {
    margin: 1.5rem 0;
    padding: 1.25rem 0;
  }
}

.section-label {
  font-size: 1.1rem;
  margin: 0;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-label .asterisk {
  color: var(--accent-color);
}

.pw-card {
  background: var(--background-color);
  border: 1px solid var(--text-color-alt);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  z-index: 1;
  /* keep above slants */
  transition: border-color 0.2s;
}

.pw-card:hover {
  border-color: var(--text-color);
  transform: none;
  /* remove default link hover scaling */
}

.pw-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--background-color-alt);
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--text-color-alt);
}

.pw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.pw-title {
  font-weight: var(--font-weight-bold);
  font-size: 1.1rem;
  margin: 0;
  text-transform: none;
}

.pw-desc {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-color-alt);
  margin: 0;
  flex-grow: 1;
}

.pw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.pw-tag {
  font-size: 0.7rem;
  background: var(--background-color-alt);
  border: 1px solid var(--text-color-alt);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  color: var(--text-color-alt);
}

/* ====== POW Carousel ====== */
.pow-carousel {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
  padding: 1rem 0 0.5rem;
}

.pow-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.pow-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
}

/* Card */
.pow-slide.pw-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  width: 100%;
  background: var(--background-color-alt);
  border: 1px solid var(--divider-color);
  border-radius: 12px;
  overflow: hidden;
  transform: scale(0.95);
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .pow-slide.pw-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.pow-slide.pw-card:hover {
  transform: scale(0.97) translateY(-4px);
  border-color: var(--accent-color);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .pow-slide.pw-card:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
}

/* Neutralize the global "* + *" margin */
.pow-slide.pw-card *,
.pow-slide.pw-card *+* {
  margin-top: 0;
}

.pow-slide.pw-card .pw-image {
  width: 100%;
  height: 240px;
  margin: 0;
  display: block;
  object-fit: cover;
  border: none;
  border-radius: 0;
  background: var(--background-color);
  aspect-ratio: auto;
}

.pw-content {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.1rem 1.3rem 1.2rem;
  min-width: 0;
}

.pw-content .pw-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0;
}

.pw-content .pw-title {
  font-size: 1.05rem;
  font-weight: var(--font-weight-bold);
  margin: 0;
  text-transform: none;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.pw-year {
  font-size: 0.65rem;
  color: var(--text-color-alt);
  opacity: 0.55;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pw-content .pw-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-color-alt);
  margin: 0;
}

/* Tech icon row — monochrome, reveal color on hover */
.pw-content .pw-tags {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 0;
  min-height: 26px;
}

.pw-tech-icon {
  width: 22px;
  height: 22px;
  display: block;
  filter: grayscale(100%) brightness(1.5);
  opacity: 0.65;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
  cursor: help;
}

.pw-tech-icon:hover {
  filter: none;
  opacity: 1;
  transform: translateY(-2px) scale(1.15);
}

[data-theme="light"] .pw-tech-icon {
  filter: grayscale(100%) brightness(0.5);
  opacity: 0.6;
}

[data-theme="light"] .pw-tech-icon:hover {
  filter: none;
  opacity: 1;
}

/* Links */
.pw-content .pw-links {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.5rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--divider-color);
}

.pw-link {
  font-size: 0.7rem;
  color: var(--text-color-alt);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.2s, transform 0.2s;
}

@media (hover: none) and (pointer: coarse) {
  .pw-link {
    padding: 0.7rem 0.5rem;
    margin: -0.7rem -0.5rem;
  }
}

.pw-link:hover {
  color: var(--accent-color);
  transform: translateY(-1px);
}

/* Arrow buttons */
.pow-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--background-color);
  border: 1px solid var(--text-color-alt);
  color: var(--text-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s, border-color 0.2s;
  z-index: 10;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.pow-carousel:hover .pow-arrow {
  opacity: 0.85;
}

.pow-arrow:hover {
  opacity: 1 !important;
  background: var(--background-color-alt);
  border-color: var(--text-color);
  transform: translateY(-50%);
}

.pow-arrow:active {
  transform: translateY(-50%) scale(0.92);
}

.pow-arrow-left {
  left: 8px;
}

.pow-arrow-right {
  right: 8px;
}

/* Dot indicators */
.pow-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 0 0.2rem;
  margin: 0;
}

.pow-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-color-alt);
  opacity: 0.3;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: opacity 0.3s, transform 0.2s, background 0.3s;
}

/* enlarge the tap area without changing the visual */
.pow-dot::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.pow-dot:hover {
  opacity: 0.6;
  transform: scale(1.3);
}

.pow-dot.active {
  opacity: 1;
  background: var(--accent-color);
  transform: scale(1.2);
}

@media screen and (max-width: 600px) {
  .pow-carousel {
    max-width: 100%;
    padding: 0.5rem 0;
  }

  .pow-slide.pw-card {
    transform: scale(0.96);
  }

  .pow-slide.pw-card:hover {
    transform: scale(0.98) translateY(-2px);
  }

  .pow-slide.pw-card .pw-image {
    height: 180px;
  }

  .pow-dots {
    gap: 16px;
  }
}

/* Touch devices: arrows must be visible (no hover to reveal them) and
   tapped cards must not stay "lifted" by sticky :hover */
@media (hover: none) and (pointer: coarse) {
  .pow-arrow {
    opacity: 0.85;
    width: 40px;
    height: 40px;
  }
}

/* phones: smaller arrows anchored over the card image, off the title text */
@media screen and (max-width: 600px) {
  .pow-arrow {
    width: 36px;
    height: 36px;
    top: 90px;
    transform: none;
  }

  .pow-arrow:hover {
    transform: none;
  }

  .pow-arrow:active {
    transform: scale(0.92);
  }
}

@media (hover: none) {
  .pow-slide.pw-card:hover {
    transform: scale(0.96);
    border-color: var(--divider-color);
  }

  .pw-tech-icon,
  [data-theme="light"] .pw-tech-icon {
    filter: none;
    opacity: 0.9;
  }
}

.pw-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-color-alt);
  text-decoration: none;
  margin-top: 1rem;
  transition: color 0.2s;
}

.pw-more:hover {
  color: var(--text-color);
  transform: none;
}

.work-card {
  background: var(--background-color);
  border: 1px solid var(--text-color-alt);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.work-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.work-title-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.work-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--background-color-alt);
}

.work-title {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  margin: 0 0 0.2rem 0;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.work-subtitle {
  font-size: 0.85rem;
  color: var(--accent-color);
  margin: 0;
}

.work-meta {
  text-align: right;
  color: var(--text-color-alt);
}

.work-meta .role {
  margin: 0 0 0.2rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.work-meta .loc {
  margin: 0;
  font-size: 0.75rem;
}

.work-tech-title {
  font-size: 0.85rem;
  color: var(--text-color-alt);
  margin-bottom: 0.5rem;
}

.work-desc {
  margin: 0;
  padding-left: 2ch;
  list-style: square;
}

.work-desc li {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-color-alt);
}

.work-desc li::marker {
  color: var(--accent-color);
}

.work-desc li+li {
  margin-top: 0.5rem;
}

.work-desc strong {
  color: var(--text-color);
  font-weight: var(--font-weight-bold);
}

/* "Highlights" / "Technologies" block label */
.work-desc-title {
  font-size: 0.85rem;
  color: var(--text-color-alt);
  margin-bottom: 0.5rem;
}

/* Company website link beside the title (matches .social-icon treatment) */
.work-site {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.2s, color 0.2s, transform 0.2s;
  vertical-align: middle;
}

.work-site svg {
  width: 15px;
  height: 15px;
  margin: 0;
}

@media (hover: none) and (pointer: coarse) {
  .work-site {
    padding: 0.7rem;
    margin: -0.7rem;
  }
}

@media screen and (max-width: 600px) {
  .work-meta {
    text-align: left;
  }
}

.work-site:hover {
  opacity: 1;
  color: var(--accent-color);
  transform: scale(1.15);
}

/* Only the flex gap should space work-card blocks — cancel the global "*+*" */
.work-card>*+* {
  margin-top: 0;
}

/* Technology tags: icon + label pills (icons via the CDN the site already uses) */
.work-tech .pw-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.work-tech .pw-tag-icon {
  width: 14px;
  height: 14px;
  margin: 0;
  display: block;
  flex: none;
}

/* Cancel the global "*+*" between tags so they keep a uniform height */
.work-tech .pw-tags>*+* {
  margin-top: 0;
}


/* LogoLoop Component CSS */
.logoloop-root {
  position: relative;
  overflow: hidden;
  --logoloop-fadeColorAuto: var(--background-color);
}

.logoloop-root.vertical-root {
  height: 100%;
  display: inline-block;
}

.logoloop-track {
  display: flex;
  position: relative;
  z-index: 0;
  box-sizing: border-box;
}

.logoloop-track.horizontal {
  flex-direction: row;
  width: max-content;
}

.logoloop-track.vertical {
  flex-direction: column;
  height: max-content;
  width: 100%;
}

.logoloop-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.logoloop-list.vertical {
  flex-direction: column;
}

.logoloop-item {
  display: flex !important;
  align-items: center;
  flex: none;
  font-family: var(--font-family);
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-color-alt);
  line-height: 1;
  transition: color 0.3s ease;
}

.logoloop-item.horizontal {
  margin-right: var(--logoloop-gap);
}

.logoloop-item.vertical {
  margin-bottom: var(--logoloop-gap);
}

.logoloop-item:hover {
  color: var(--text-color);
}

.logoloop-content {
  display: flex;
  align-items: center;
  filter: grayscale(100%) brightness(1.5);
  transition: filter 0.3s ease;
}

.logoloop-item:hover .logoloop-content {
  filter: grayscale(0%) brightness(1.2);
}

.logoloop-img {
  height: var(--logoloop-logoHeight);
  width: auto;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.logoloop-title {
  margin-left: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

/* Fades */
.logoloop-fade {
  position: absolute;
  z-index: 9999;
  pointer-events: none;
}

.logoloop-fade.fade-left {
  top: 0;
  bottom: 0;
  left: 0;
  width: 60px;
  background: linear-gradient(to right, var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%, transparent 100%);
}

.logoloop-fade.fade-right {
  top: 0;
  bottom: 0;
  right: 0;
  width: 60px;
  background: linear-gradient(to left, var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%, transparent 100%);
}

.logoloop-fade.fade-top {
  left: 0;
  right: 0;
  top: 0;
  height: 60px;
  background: linear-gradient(to bottom, var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%, transparent 100%);
}

.logoloop-fade.fade-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: linear-gradient(to top, var(--logoloop-fadeColor, var(--logoloop-fadeColorAuto)) 0%, transparent 100%);
}

.logoloop-css-marquee {
  width: max-content;
  animation: logo-marquee linear infinite;
  display: flex;
}

.logoloop-hoverable:hover .logoloop-css-marquee {
  animation-play-state: paused;
}

/* sticky :hover on touch would freeze the marquee after a tap */
@media (hover: none) {
  .logoloop-hoverable:hover .logoloop-css-marquee {
    animation-play-state: running;
  }
}

@media screen and (max-width: 600px) {
  .logoloop-fade.fade-left,
  .logoloop-fade.fade-right {
    width: 28px;
  }

  /* compact banner: the desktop 32px/60px marquee reads huge on a phone */
  .logoloop-img {
    height: 20px !important;
  }

  .logoloop-css-marquee {
    gap: 28px !important;
  }

  .logoloop-item {
    font-size: 0.72rem;
    --logoloop-gap: 28px;
  }

  .logoloop-title {
    margin-left: 0.5rem;
  }

  /* pull the two rows together: 30px inline spacer + global *+* margins */
  #techstack-root .logoloop-root,
  #techstack-root .logoloop-root + div {
    margin-top: 0;
  }

  #techstack-root .logoloop-root + div {
    height: 14px !important;
  }
}

@keyframes logo-marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-33.3333% - var(--logoloop-gap, 0px) / 3));
  }
}


/* Dark Mode GIF Easter Egg — sits right of the theme toggle in the navbar */
#bottom-right-gif {
  height: 1.8rem;
  width: auto;
  margin: 0;
  pointer-events: none;
  opacity: 0.8;
  mix-blend-mode: screen;
}

@media screen and (max-width: 768px) {
  #bottom-right-gif {
    height: 2.4rem;
  }
}

html[data-theme='light'] #bottom-right-gif {
  display: none;
}

/* ====== Dino Game ====== */
.dino-hint {
  font-size: 0.75rem;
  color: var(--text-color-alt);
  margin: 0 0 0.8rem 0;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.dino-hint-tap {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .dino-hint-key {
    display: none;
  }

  .dino-hint-tap {
    display: inline;
  }
}

.dino-game-wrapper {
  display: block;
  border: 1px solid var(--text-color-alt);
  border-radius: 6px;
  margin: 0 auto;
  /* no side padding: the game measures paddingLeft at init, so the render
     spans edge to edge of the frame */
  padding: 1rem 0;
  background: rgba(247, 247, 247, 0.03);
  overflow: hidden;
}

@media screen and (max-width: 768px) {
  .dino-game-wrapper {
    padding-bottom: 2.25rem;
  }
}

[data-theme="light"] .dino-game-wrapper {
  background: rgba(255, 255, 255, 0.5);
}

.dino-game-wrapper .dino-container {
  max-width: 100%;
  overflow: hidden;
  width: 100%;
}

.dino-game-wrapper .dino-canvas {
  /* inline canvas sits on the text baseline — the descender gap can make
     the overflow-hidden container clip the bottom of the render */
  display: block;
  max-width: 100%;
  opacity: 1;
  overflow: hidden;
  z-index: 2;
  position: static;
}

.dino-game-wrapper .controller {
  background: rgba(247, 247, 247, .1);
  left: 0;
  width: 100%;
  z-index: 1;
}

.dino-icon {
  -webkit-user-select: none;
  user-select: none;
  display: inline-block;
}

#dinosaur-game,
[id^=dino-game-sprites] {
  display: none;
}

/* ====== Polaroid Project Cards ====== */
.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem 2rem;
  padding: 2rem 0;
  margin: 0;
}

.polaroid-card {
  --tilt: 0deg;
  transform: rotate(var(--tilt));
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.4s ease;
  margin: 0;
}

.polaroid-card:hover {
  z-index: 10;
}

.polaroid-frame {
  background: var(--background-color);
  border: 1px solid var(--divider-color);
  border-bottom: 4px solid var(--divider-color);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.4s;
  margin: 0;
}

.polaroid-card:hover .polaroid-frame {
  border-color: var(--accent-color);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .polaroid-card:hover .polaroid-frame {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.polaroid-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--background-color-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--divider-color);
  margin: 0;
  position: relative;
  overflow: hidden;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
  z-index: 0;
}

.polaroid-card:hover .polaroid-img {
  transform: scale(1.08);
}

/* touch devices: taps must not latch the hover lift/zoom/recolor */
@media (hover: none) {
  .polaroid-card:hover .polaroid-frame {
    border-color: var(--divider-color);
    box-shadow: none;
  }

  [data-theme="light"] .polaroid-card:hover .polaroid-frame {
    box-shadow: none;
  }

  .polaroid-card:hover .polaroid-img {
    transform: none;
  }

  .polaroid-body .pw-tag:hover {
    background-color: transparent !important;
    color: inherit !important;
    transform: none !important;
  }
}

.polaroid-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 1;
  pointer-events: none;
}

.polaroid-body {
  padding: 1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
}

.polaroid-body>* {
  margin: 0;
}

.polaroid-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.polaroid-title {
  font-size: 1.05rem;
  font-weight: var(--font-weight-bold);
  margin: 0;
  text-transform: none;
  letter-spacing: 0.02em;
}

.polaroid-year {
  font-size: 0.7rem;
  color: var(--text-color-alt);
  opacity: 0.6;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.polaroid-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-color-alt);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.polaroid-body .pw-tags {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1.2rem;
  margin-top: 0.8rem;
  min-height: 3rem;
  width: 100%;
}

.polaroid-body .pw-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  color: var(--text-color);
  background-color: transparent;
  opacity: 0.8;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.3s,
    background-color 0.3s,
    color 0.3s,
    filter 0.3s;
  animation: floatIcon 4s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  cursor: help;
}

.polaroid-body .pw-tag:nth-child(1) {
  animation-delay: 0s;
}

.polaroid-body .pw-tag:nth-child(2) {
  animation-delay: 0.5s;
}

.polaroid-body .pw-tag:nth-child(3) {
  animation-delay: 1s;
}

.polaroid-body .pw-tag:nth-child(4) {
  animation-delay: 1.5s;
}

.polaroid-body .pw-tag:hover {
  opacity: 1 !important;
  background-color: #f8f6f0 !important;
  color: #0d0d0d !important;
  transform: scale(1.3) translateY(-4px) !important;
  filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.15));
  animation-play-state: paused;
}

.polaroid-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-color-alt);
  text-decoration: none;
  letter-spacing: 0.06em;
  padding-top: 0.3rem;
  transition: color 0.2s, transform 0.2s;
  margin: 0;
}

.polaroid-link:hover {
  color: var(--accent-color);
  transform: translateY(-1px);
}

@keyframes floatIcon {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .polaroid-body .pw-tag {
    animation: none;
  }
}

@keyframes polaroidIn {
  from {
    opacity: 0;
    transform: rotate(var(--tilt)) translateY(20px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: rotate(var(--tilt)) translateY(0) scale(1);
  }
}

#content-projects .polaroid-card {
  animation: polaroidIn 0.5s ease-out backwards;
}

#content-projects .polaroid-card:nth-child(1) {
  animation-delay: 0.05s;
}

#content-projects .polaroid-card:nth-child(2) {
  animation-delay: 0.12s;
}

#content-projects .polaroid-card:nth-child(3) {
  animation-delay: 0.19s;
}

#content-projects .polaroid-card:nth-child(4) {
  animation-delay: 0.26s;
}

#content-projects .polaroid-card:nth-child(5) {
  animation-delay: 0.33s;
}

#content-projects .polaroid-card:nth-child(6) {
  animation-delay: 0.40s;
}

@media screen and (max-width: 600px) {
  .polaroid-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .polaroid-card {
    --tilt: 0deg !important;
  }

  .polaroid-link {
    font-size: 0.9rem;
    padding: 0.6rem 1ch 0.4rem 0;
  }
}

/* ====== About Page ====== */
.about-prose {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-color);
  max-width: 70ch;
}

.about-prose+.about-prose {
  margin-top: 1rem;
}

.about-currently {
  width: 100%;
  margin: 0;
}

.about-currently th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-color-alt);
  white-space: nowrap;
  width: 0;
  font-weight: var(--font-weight-medium);
}

.about-currently td {
  font-size: 0.9rem;
}

.about-currently cite {
  font-style: italic;
  color: var(--text-color-alt);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 0.5rem;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.about-list {
  list-style-type: square;
  padding-left: 2ch;
  margin: 0;
}

.about-list li {
  margin: 0.6rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-color);
}

.about-list li::marker {
  color: var(--accent-color);
}

/* About photo segments — a uniform-height photo strip above the prose */
.about-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.3rem;
}

.about-photo {
  margin: 0;
  max-width: 100%;
}

.about-photo img {
  height: 210px;
  width: auto;
  max-width: 100%;
  display: block;
  border: 1px solid var(--divider-color);
  border-radius: 6px;
  background: var(--background-color-alt);
}

.about-photo figcaption {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-color-alt);
  max-width: 26ch;
}

@media (max-width: 640px) {
  .about-photo {
    flex: 1 1 100%;
  }

  .about-photo img {
    height: auto;
    width: 100%;
    /* portrait photos would otherwise stack ~490px tall each */
    max-height: 320px;
    object-fit: cover;
  }

  .about-photo figcaption {
    max-width: none;
    font-size: 0.8rem;
  }
}

/* ====== Blog ====== */
/* Post list — wickstrom.tech style: title left, date right */
.blog-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-posts *,
.blog-posts *+* {
  margin-top: 0;
}

.blog-post-link {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1.5ch;
  padding: 0.6rem 0;
  text-decoration: none;
  border-bottom: 1px dashed var(--divider-color);
}

/* the section-wrapper already closes the list with a dashed border —
   a separator on the last row would double it */
.blog-posts li:last-child .blog-post-link {
  border-bottom: none;
}

.blog-post-title {
  font-size: 0.95rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
  transition: color 0.15s;
}

.blog-post-link:hover .blog-post-title {
  color: var(--accent-color);
}

.blog-post-date {
  margin-left: auto;
  white-space: nowrap;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-color-alt);
}

.blog-status {
  font-size: 0.85rem;
  color: var(--text-color-alt);
}

/* Article view */
.blog-back {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-color-alt);
  text-decoration: none;
  margin-bottom: 1.2rem;
}

.blog-back:link,
.blog-back:visited {
  color: var(--text-color-alt);
}

.blog-back:hover {
  color: var(--accent-color);
}

.blog-title {
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 0.6rem;
  text-transform: none;
}

.blog-post-title,
.blog-title {
  overflow-wrap: anywhere;
}

.blog-byline {
  font-size: 0.8rem;
  color: var(--text-color-alt);
  margin: 0;
}

/* Rendered markdown body — leans on the site's monospace-web defaults
   (headings, hr, tables); adds prose readability + code/media styling */
.blog-body {
  font-size: 0.95rem;
  line-height: 1.65;
  /* long tokens (URLs, hashes, inline code) must wrap — the page clips, not scrolls */
  overflow-wrap: anywhere;
}

.blog-body h1,
.blog-body h2 {
  font-size: 1.15rem;
  text-transform: none;
  line-height: 1.4;
}

.blog-body h3,
.blog-body h4 {
  font-size: 1rem;
  text-transform: none;
  line-height: 1.4;
}

.blog-body li+li {
  margin-top: 0.4rem;
}

.blog-body img {
  max-width: 100%;
  width: auto;
  height: auto;
  border: 1px solid var(--divider-color);
  border-radius: 6px;
  background: var(--background-color-alt);
}

.blog-body code {
  background: var(--background-color-alt);
  border: 1px solid var(--divider-color);
  border-radius: 3px;
  padding: 0.05em 0.4ch;
  font-size: 0.85em;
}

.blog-body pre {
  background: var(--background-color-alt);
  border: 1px solid var(--divider-color);
  border-radius: 6px;
  padding: 0.9rem 1.5ch;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.blog-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.blog-body blockquote {
  margin: 0;
  padding-left: 2ch;
  border-left: var(--border-thickness) solid var(--accent-color);
  color: var(--text-color-alt);
}

.blog-body blockquote *+* {
  margin-top: 0.5rem;
}

@media screen and (max-width: 600px) {
  .blog-back {
    padding: 0.6rem 2ch 0.6rem 0;
    margin-bottom: 0.6rem;
  }

  .blog-post-link {
    padding: 0.85rem 0;
  }

  .blog-post-date {
    font-size: 0.8rem;
  }
}

/* ====== 3D Terminal Hero ====== */
:root {
  --term-bg:     rgba(13, 13, 13, 0.88);
  --term-bar-bg: rgba(20, 20, 20, 0.78);
}
[data-theme="light"] {
  --term-bg:     rgba(245, 245, 240, 0.92);
  --term-bar-bg: rgba(232, 232, 227, 0.85);
}

.hero-3d {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 0 0 2rem 0;
  border: 1px solid var(--divider-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--background-color-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-3d canvas#hero-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.hero-3d .term-frame {
  position: relative;
  z-index: 2;
  width: min(580px, 90%);
  background: var(--term-bg);
  border: 1px solid var(--text-color-alt);
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-color);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--divider-color);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  margin: 0;
}

.hero-3d .term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  background: var(--term-bar-bg);
  border-bottom: 1px solid var(--divider-color);
  margin: 0;
}
.hero-3d .term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin: 0;
}
.hero-3d .dot-red    { background: #ff5f56; }
.hero-3d .dot-yellow { background: #ffbd2e; }
.hero-3d .dot-green  { background: #27c93f; }
.hero-3d .term-title {
  margin-left: auto;
  margin-right: auto;
  font-size: 0.7rem;
  color: var(--text-color-alt);
  opacity: 0.65;
  letter-spacing: 0.05em;
}

.hero-3d .term-body {
  padding: 0.8rem 1rem 0.3rem;
  min-height: 180px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  margin: 0;
}
.hero-3d .term-body::-webkit-scrollbar { width: 6px; }
.hero-3d .term-body::-webkit-scrollbar-thumb {
  background: var(--text-color-alt);
  border-radius: 3px;
}

.hero-3d .term-line {
  margin: 0 0 0.18rem 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.hero-3d .term-muted  { color: var(--text-color-alt); opacity: 0.75; }
.hero-3d .term-accent { color: var(--accent-color); }
.hero-3d .term-cmd    { color: var(--accent-color); font-weight: 600; }
.hero-3d .term-err    { color: #ff6b6b; }
.hero-3d .term-link {
  color: var(--text-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero-3d .term-link:hover { color: var(--accent-color); }

.hero-3d .term-input-line {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.4rem 1rem 0.8rem;
  gap: 0.5rem;
  margin: 0;
  cursor: text;
}
.hero-3d .term-prompt      { color: var(--accent-color); white-space: nowrap; flex-shrink: 0; margin: 0; }
.hero-3d .term-prompt-sep  { color: var(--text-color-alt); margin: 0; }
.hero-3d .term-prompt-path { color: var(--text-color); margin: 0; }
.hero-3d .term-typed       { color: var(--text-color); white-space: pre; margin: 0; }
.hero-3d .term-cursor {
  display: inline-block;
  color: var(--accent-color);
  margin: 0;
  line-height: 1;
  opacity: 1; /* solid by default — keyboard "disconnected" */
}
.hero-3d .term-input-line:focus-within .term-cursor {
  /* keyboard "connected" — blink confirms input is being captured */
  animation: term-blink 1s steps(2) infinite;
}
@keyframes term-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* CRITICAL: hide the real input — overrides the global `input` rule in this file. */
.hero-3d #term-input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  font: inherit !important;
  /* >=16px stops iOS focus auto-zoom; the input is opacity:0 so nothing visible changes */
  font-size: 16px !important;
  cursor: text !important;
  z-index: 3 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.hero-3d #term-input:focus {
  outline: none !important;
}

@media (max-width: 600px) {
  .hero-3d { height: 360px; }
  .hero-3d .term-frame {
    width: 92%;
    font-size: 0.85rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .hero-3d .term-body { min-height: 140px; max-height: 180px; }
  .hero-3d .term-typed {
    white-space: pre-wrap;
    word-break: break-all;
    min-width: 0;
  }
}