:root {
  --bg: #040811;
  --bg-deep: #02050d;
  --panel: rgba(10, 18, 32, 0.62);
  --panel-border: rgba(79, 247, 214, 0.22);
  --text: #edf8ff;
  --muted: #87a0b7;
  --cyan: #67ebff;
  --emerald: #41f2be;
  --emerald-strong: #1dffb1;
  --purple: #8b63ff;
  --purple-strong: #b564ff;
  --lime: #b7ff8a;
  --shadow: 0 0 36px rgba(65, 242, 190, 0.12);
  --parallax-x: 0px;
  --parallax-y: 0px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  /* Site-wide 125% upscale: everything sized in rem (fonts, spacing,
     cards, buttons) scales proportionally for readability. */
  font-size: 125%;
}

html.home-page {
  font-size: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 16%, rgba(139, 99, 255, 0.2), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(65, 242, 190, 0.16), transparent 22%),
    linear-gradient(180deg, #071120 0%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

body.booting {
  overflow: hidden;
}

body.reduced-effects *,
body.reduced-effects *::before,
body.reduced-effects *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 3px, 3px 100%;
  opacity: 0.16;
  z-index: 0;
}

body::after {
  background:
    linear-gradient(90deg, rgba(2, 5, 13, 0.72), transparent 16%, transparent 84%, rgba(2, 5, 13, 0.72)),
    linear-gradient(180deg, rgba(2, 5, 13, 0.46), transparent 18%, transparent 84%, rgba(2, 5, 13, 0.56));
  z-index: 1;
}

.background-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  contain: strict;
}

.boot-sequence {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 5, 13, 0.92);
  z-index: 20;
  transition: opacity 420ms ease, visibility 420ms ease;
}

body.page-ready .boot-sequence {
  opacity: 0;
  visibility: hidden;
}

.boot-panel {
  width: min(42rem, 100%);
  padding: 1rem 1rem 1.1rem;
  border: 1px solid rgba(65, 242, 190, 0.22);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(14, 28, 24, 0.92), rgba(4, 12, 10, 0.96)),
    rgba(8, 16, 30, 0.94);
  box-shadow: 0 0 34px rgba(65, 242, 190, 0.08);
  font-family: "Orbitron", sans-serif;
}

.boot-label,
.terminal-topline,
.dossier-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.boot-label {
  color: #c3f8df;
  font-size: 0.78rem;
}

.boot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0.1rem 0.75rem;
}

.boot-state {
  color: var(--emerald-strong);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.boot-console {
  position: relative;
  min-height: 15rem;
  padding: 1rem;
  border: 1px solid rgba(65, 242, 190, 0.14);
  border-radius: 0.8rem;
  background:
    linear-gradient(rgba(65, 242, 190, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(65, 242, 190, 0.03) 1px, transparent 1px),
    rgba(1, 8, 6, 0.86);
  background-size: 100% 18px, 18px 100%, auto;
  overflow: hidden;
}

.boot-console::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.24) 100%);
  pointer-events: none;
}

.boot-progress-shell {
  margin-top: 0.85rem;
}

.boot-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.boot-progress {
  position: relative;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.boot-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  animation: boot-progress 2s cubic-bezier(.2, .8, .2, 1) forwards;
  background: linear-gradient(90deg, #86ffd5, var(--emerald), #8bffb9);
}

.boot-lines {
  display: grid;
  gap: 0.5rem;
  color: #dff7ea;
  font-size: 0.78rem;
  line-height: 1.5;
}

.boot-line {
  opacity: 0;
  transform: translateY(8px);
  animation: boot-line-in 0.28s ease forwards;
}

.boot-line em {
  font-style: normal;
  color: #7ff5bf;
}

.boot-line:nth-child(1) { animation-delay: 0.12s; }
.boot-line:nth-child(2) { animation-delay: 0.34s; }
.boot-line:nth-child(3) { animation-delay: 0.58s; }
.boot-line:nth-child(4) { animation-delay: 0.84s; }
.boot-line:nth-child(5) { animation-delay: 1.1s; }
.boot-line:nth-child(6) { animation-delay: 1.36s; }

body:not(.page-ready) .page-shell {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
}

.page-shell {
  transition: opacity 420ms ease, transform 520ms ease;
}

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 560ms ease, transform 560ms ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

#background-canvas,
.background-grid,
.background-vignette {
  position: absolute;
  inset: 0;
}

#background-canvas {
  width: 100%;
  height: 100%;
  opacity: 0.92;
}

.background-grid {
  background:
    linear-gradient(transparent 0%, rgba(65, 242, 190, 0.03) 52%, rgba(139, 99, 255, 0.09) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(103, 235, 255, 0.05) 0,
      rgba(103, 235, 255, 0.05) 1px,
      transparent 1px,
      transparent 120px
    );
  opacity: 0.28;
}

.background-vignette {
  background:
    radial-gradient(circle at center, transparent 35%, rgba(2, 5, 13, 0.28) 65%, rgba(2, 5, 13, 0.72) 100%),
    linear-gradient(180deg, rgba(2, 5, 13, 0.14) 0%, rgba(2, 5, 13, 0.52) 100%);
}

.cursor-orb {
  --orb-x: 50vw;
  --orb-y: 34vh;
  position: absolute;
  left: 0;
  top: 0;
  width: 5rem;
  height: 5rem;
  transform: translate3d(calc(var(--orb-x) - 50%), calc(var(--orb-y) - 50%), 0);
  opacity: 0;
  transition: opacity 180ms ease;
  will-change: transform;
  contain: layout paint;
}

body.orb-active .cursor-orb {
  opacity: 1;
}

.cursor-orb-core,
.cursor-orb-ring {
  position: absolute;
  inset: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Every part of the orb transitions on its own, so the hover state can grow,
   recolour and spin without the tracking loop being involved — the loop stops
   as soon as it catches the cursor, so it cannot drive an idle animation. */
.cursor-orb-core {
  width: 0.42rem;
  height: 0.42rem;
  background: rgba(103, 235, 255, 0.92);
  box-shadow:
    0 0 12px rgba(103, 235, 255, 0.65),
    0 0 22px rgba(65, 242, 190, 0.3);
  transition: width 260ms cubic-bezier(.34,1.56,.64,1), height 260ms cubic-bezier(.34,1.56,.64,1),
    background 260ms ease, box-shadow 260ms ease;
}

.cursor-orb-ring {
  border: 1px solid rgba(103, 235, 255, 0.28);
  box-shadow: inset 0 0 10px rgba(65, 242, 190, 0.06);
  transition: width 320ms cubic-bezier(.34,1.56,.64,1), height 320ms cubic-bezier(.34,1.56,.64,1),
    border-color 260ms ease, box-shadow 260ms ease, transform 320ms ease;
}

.cursor-orb-ring-a {
  width: 1.7rem;
  height: 1.7rem;
}

.cursor-orb-ring-b {
  width: 2.6rem;
  height: 2.6rem;
  border-color: rgba(65, 242, 190, 0.24);
}

.cursor-orb-ring-c {
  width: 3.8rem;
  height: 3.8rem;
  border-style: dashed;
  border-color: rgba(181, 100, 255, 0.22);
}

/* ---- over a link: bigger, magenta, brighter, and turning ---- */
body.orb-link .cursor-orb-core {
  width: 0.78rem;
  height: 0.78rem;
  background: rgba(255, 47, 214, 0.95);
  box-shadow:
    0 0 18px rgba(255, 47, 214, 0.8),
    0 0 34px rgba(181, 100, 255, 0.45);
}

body.orb-link .cursor-orb-ring-a {
  width: 2.5rem;
  height: 2.5rem;
  border-color: rgba(255, 47, 214, 0.6);
  box-shadow: 0 0 16px rgba(255, 47, 214, 0.3), inset 0 0 12px rgba(255, 47, 214, 0.1);
}

body.orb-link .cursor-orb-ring-b {
  width: 3.7rem;
  height: 3.7rem;
  border-color: rgba(181, 100, 255, 0.5);
  box-shadow: 0 0 18px rgba(181, 100, 255, 0.25);
}

body.orb-link .cursor-orb-ring-c {
  width: 5.2rem;
  height: 5.2rem;
  border-color: rgba(255, 47, 214, 0.42);
  animation: orb-ring-spin 3.2s linear infinite;
}

/* The dashed ring turns only while over a link — the motion is the cue. */
@keyframes orb-ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.orb-link .cursor-orb-ring-c { animation: none; }
}

.background-frame {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(103, 235, 255, 0.22), transparent);
  opacity: 0.7;
}

.background-frame-top {
  top: 2.2rem;
  left: 7vw;
  width: 86vw;
  height: 1px;
}

.background-frame-left,
.background-frame-right {
  top: 2.2rem;
  width: 1px;
  height: 42vh;
  background: linear-gradient(180deg, rgba(103, 235, 255, 0.36), transparent);
}

.background-frame-left {
  left: 7vw;
}

.background-frame-right {
  right: 7vw;
}

.hud-block {
  position: absolute;
  top: 5rem;
  width: min(20vw, 14rem);
  height: min(20vw, 14rem);
  border: 1px solid rgba(103, 235, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(139, 99, 255, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(65, 242, 190, 0.05);
}

.hud-block::before,
.hud-block::after {
  content: "";
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--emerald);
  box-shadow: 0 0 16px rgba(65, 242, 190, 0.28);
}

.hud-block::before {
  top: -0.25rem;
  left: -0.25rem;
}

.hud-block::after {
  right: -0.25rem;
  bottom: -0.25rem;
}

.hud-block-left {
  left: clamp(1rem, 4vw, 3rem);
}

.hud-block-right {
  right: clamp(1rem, 4vw, 3rem);
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.5rem 0 2rem;
}

.hero-shell {
  display: block;
  margin-bottom: 1rem;
}

.hero {
  position: relative;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  contain: layout paint;
  transform: translate3d(calc(var(--parallax-x) * -0.018), calc(var(--parallax-y) * -0.018), 0);
  transition: transform 180ms ease;
}

.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.6rem;
  width: min(52rem, 82vw);
  height: 18rem;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at center, rgba(139, 99, 255, 0.16), transparent 48%),
    radial-gradient(circle at 52% 36%, rgba(65, 242, 190, 0.12), transparent 42%);
  opacity: 0.72;
  z-index: -1;
}

.eyebrow,
.section-kicker,
.footer p,
.card-tag,
.card-state,
.status-pill,
.card-meta span {
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.eyebrow,
.section-kicker,
.footer p,
.card-meta,
.hero-copy {
  color: var(--muted);
}

.glitch {
  position: relative;
  display: inline-block;
  margin: 0.6rem 0 1rem;
  max-width: 100%;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow:
    0 0 12px rgba(103, 235, 255, 0.4),
    0 0 24px rgba(139, 99, 255, 0.24);
}

.title-desktop,
.title-mobile {
  display: block;
}

.title-mobile {
  display: none;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glitch::before {
  color: var(--cyan);
  transform: translate(-2px, 0);
  clip-path: inset(0 0 48% 0);
  animation: glitch-shift 2.4s infinite steps(2, end);
}

.glitch::after {
  color: var(--purple-strong);
  transform: translate(2px, 0);
  clip-path: inset(54% 0 0 0);
  animation: glitch-shift 1.8s infinite steps(2, end) reverse;
}

.hero-copy {
  width: min(44rem, 100%);
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
}

.terminal-panel {
  position: fixed;
  top: 1.1rem;
  right: 1.25rem;
  width: min(26rem, calc(100vw - 2rem));
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  contain: layout paint;
  transform: translate3d(calc(var(--parallax-x) * 0.024), calc(var(--parallax-y) * 0.024), 0);
  transition: transform 180ms ease;
  z-index: 4;
}

.terminal-topline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.terminal-status {
  color: var(--emerald-strong);
}

.terminal-screen {
  margin-top: 0.4rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: right;
}

.terminal-line {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.82rem;
  line-height: 1.6;
}

.terminal-line-static {
  color: var(--muted);
}

.terminal-line-active {
  min-height: 2.4rem;
  margin-top: 0.35rem;
  color: #dff5ff;
}

.terminal-line-active::after {
  content: "_";
  display: inline-block;
  margin-left: 0.18rem;
  color: var(--emerald-strong);
  animation: terminal-caret 0.9s steps(1, end) infinite;
}

.terminal-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.content {
  padding: 1rem 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem 1.25rem;
}

.project-tabs-shell {
  align-items: center;
}

.section-heading h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.project-tabs {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

/* Real tabs: a rounded top, borders on three sides and no bottom edge, so the
   active one reads as a folder tab sitting on the panel below it. Both tabs
   carry the same padding and a transparent border, so switching between them
   cannot shift the row. */
.project-tab {
  position: relative;
  padding: 0.35em 0.85em 0.3em;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 0.6em 0.6em 0 0;
  background: none;
  color: rgba(237, 248, 255, 0.62);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 180ms ease, text-shadow 180ms ease, filter 180ms ease,
    opacity 180ms ease, background 180ms ease, border-color 180ms ease;
}

.project-tab.is-active {
  color: #f1feff;
  border-color: rgba(103, 235, 255, 0.55);
  background: linear-gradient(180deg, rgba(103, 235, 255, 0.13), rgba(103, 235, 255, 0.02));
  text-shadow:
    0 0 10px rgba(103, 235, 255, 0.28),
    0 0 18px rgba(65, 242, 190, 0.2);
  animation: project-tab-pulse 2.8s ease-in-out infinite;
}

/* The glow is painted on a pseudo-element so it can bloom outwards without
   the border clipping it or the layout reflowing. */
.project-tab.is-active::after {
  content: "";
  position: absolute;
  inset: -2px -2px 0;
  border-radius: 0.65em 0.65em 0 0;
  pointer-events: none;
  animation: project-tab-halo 2.8s ease-in-out infinite;
}

@keyframes project-tab-pulse {
  0%, 100% { border-color: rgba(103, 235, 255, 0.45); }
  50%      { border-color: rgba(65, 242, 190, 0.85); }
}

@keyframes project-tab-halo {
  0%, 100% {
    box-shadow: 0 0 10px rgba(103, 235, 255, 0.22), inset 0 0 8px rgba(103, 235, 255, 0.06);
  }
  50% {
    box-shadow: 0 0 26px rgba(65, 242, 190, 0.5), inset 0 0 14px rgba(65, 242, 190, 0.12);
  }
}

.project-tab:hover:not(.is-active),
.project-tab:focus-visible:not(.is-active) {
  color: rgba(237, 248, 255, 0.92);
  border-color: rgba(103, 235, 255, 0.28);
  outline: none;
}

.project-tab:not(.is-active) {
  filter: blur(1.6px);
  opacity: 0.72;
}

/* A pulsing border is decoration; honour a request for less motion. */
@media (prefers-reduced-motion: reduce) {
  .project-tab.is-active,
  .project-tab.is-active::after { animation: none; }
}
body.reduced-effects .project-tab.is-active,
body.reduced-effects .project-tab.is-active::after { animation: none; }

.project-tab-divider {
  color: rgba(255, 255, 255, 0.34);
  font-weight: 400;
}

.project-panel {
  display: none;
}

.project-panel[hidden] {
  display: none !important;
}

.project-panel.is-active {
  display: grid;
}

.status-pill {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(65, 242, 190, 0.35);
  border-radius: 999px;
  color: var(--emerald-strong);
  background: rgba(65, 242, 190, 0.08);
  white-space: nowrap;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(312px, 1fr));
  gap: 1rem;
  padding: 0 1rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  padding: 1rem;
  border: 1px solid rgba(103, 235, 255, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(8, 16, 30, 0.94);
  box-shadow: 0 0 14px rgba(65, 242, 190, 0.06);
  overflow: hidden;
  contain: layout paint;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(103, 235, 255, 0.05), transparent 34%, rgba(181, 100, 255, 0.05));
  pointer-events: none;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0%, rgba(65, 242, 190, 0.28) 14%, transparent 28%) top / 220% 1px no-repeat,
    linear-gradient(180deg, transparent 0%, rgba(65, 242, 190, 0.22) 16%, transparent 30%) right / 1px 220% no-repeat,
    linear-gradient(270deg, transparent 0%, rgba(139, 99, 255, 0.2) 14%, transparent 28%) bottom / 220% 1px no-repeat,
    linear-gradient(0deg, transparent 0%, rgba(103, 235, 255, 0.18) 16%, transparent 30%) left / 1px 220% no-repeat;
  animation: edge-glow 5.4s linear infinite;
  opacity: 0.95;
}

.featured-card {
  transform: translate3d(calc(var(--parallax-x) * 0.03), calc(-6px + var(--parallax-y) * 0.03), 0);
}

.reveal-card.revealed {
  transform: translate3d(calc(var(--parallax-x) * 0.03), calc(-6px + var(--parallax-y) * 0.03), 0);
}

.teaser-card.revealed {
  transform: translate3d(calc(var(--parallax-x) * 0.02), calc(var(--parallax-y) * 0.02), 0);
}

.card-preview {
  position: relative;
  min-height: 10.2rem;
  border: 1px solid rgba(103, 235, 255, 0.14);
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgba(2, 10, 18, 0.94);
}

.preview-chrome {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-chrome span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.preview-surface {
  position: relative;
  min-height: 8rem;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 74% 28%, rgba(65, 242, 190, 0.12), transparent 24%),
    radial-gradient(circle at 20% 20%, rgba(181, 100, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(8, 18, 30, 0.96), rgba(3, 8, 16, 0.98));
}

.preview-media,
.preview-overlay,
.preview-site-logo,
.preview-urlbar,
.preview-snapshot-badge {
  position: absolute;
}

.preview-media {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.04);
}

.preview-overlay {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 8, 16, 0.16), rgba(2, 8, 16, 0.74)),
    radial-gradient(circle at 74% 24%, rgba(65, 242, 190, 0.16), transparent 24%);
}

.preview-site-logo {
  top: 1rem;
  left: 1rem;
  z-index: 1;
  width: min(12rem, 62%);
  filter: drop-shadow(0 0 12px rgba(65, 242, 190, 0.14));
}

.preview-urlbar {
  left: 1rem;
  right: 1rem;
  bottom: 0.9rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(103, 235, 255, 0.16);
  border-radius: 999px;
  background: rgba(4, 10, 18, 0.72);
  color: #e5f6ff;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-snapshot-badge {
  top: 0.9rem;
  right: 0.9rem;
  z-index: 1;
  padding: 0.38rem 0.58rem;
  border: 1px solid rgba(65, 242, 190, 0.16);
  border-radius: 999px;
  background: rgba(4, 10, 18, 0.68);
  color: var(--emerald-strong);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.preview-surface-offline {
  display: flex;
  align-items: end;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(8, 18, 30, 0.88), rgba(3, 8, 16, 0.98)),
    radial-gradient(circle at 76% 26%, rgba(181, 100, 255, 0.14), transparent 26%);
}

.preview-offline-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.45rem;
  max-width: 16rem;
}

.preview-offline-copy strong {
  color: #f0fbff;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-offline-copy p {
  margin: 0;
  color: #c7ddeb;
  font-size: 0.82rem;
  line-height: 1.45;
}

.preview-surface-studio {
  background:
    radial-gradient(circle at 18% 18%, rgba(103, 235, 255, 0.12), transparent 24%),
    radial-gradient(circle at 82% 26%, rgba(181, 100, 255, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(10, 18, 30, 0.94), rgba(3, 8, 16, 0.98));
}

.preview-site-logo-studio {
  top: 1rem;
  left: auto;
  right: 1rem;
  width: 3.1rem;
}

.preview-studio-copy {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 3.2rem;
  z-index: 1;
  display: grid;
  gap: 0.45rem;
  max-width: 15rem;
}

.preview-studio-copy strong {
  color: #f0fbff;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-studio-copy p {
  margin: 0;
  color: #c7ddeb;
  font-size: 0.8rem;
  line-height: 1.45;
}

.preview-surface-repo {
  background:
    radial-gradient(circle at 18% 18%, rgba(103, 235, 255, 0.1), transparent 24%),
    radial-gradient(circle at 82% 28%, rgba(65, 242, 190, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(8, 18, 30, 0.94), rgba(4, 10, 18, 0.98));
}

.preview-repo-copy {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 3.15rem;
  z-index: 1;
  display: grid;
  gap: 0.45rem;
  max-width: 16rem;
}

.preview-repo-copy strong {
  color: #f0fbff;
  font-family: "Orbitron", sans-serif;
  font-size: 0.94rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-repo-copy p {
  margin: 0;
  color: #c7ddeb;
  font-size: 0.78rem;
  line-height: 1.45;
}

.card-topline,
.card-meta,
.card-actions {
  position: relative;
  z-index: 1;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.card-tag,
.card-state {
  font-size: 0.72rem;
  font-weight: 700;
}

.card-tag {
  color: var(--cyan);
}

.card-tag.muted {
  color: var(--purple-strong);
}

.card-state {
  color: var(--emerald-strong);
}

.card-body {
  position: relative;
  z-index: 1;
}

.card-body h3 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
}

.card-body p {
  margin: 0;
  line-height: 1.55;
  font-size: 0.94rem;
  color: #d8e9fb;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  font-size: 0.68rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: auto;
}

.card-dossier {
  position: relative;
  z-index: 1;
}

.dossier-toggle {
  min-height: 2.35rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(65, 242, 190, 0.18);
  border-radius: 999px;
  color: var(--text);
  background: rgba(65, 242, 190, 0.06);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.project-card.is-expanded .dossier-toggle {
  border-color: rgba(103, 235, 255, 0.3);
  background: rgba(103, 235, 255, 0.1);
  color: #effbff;
}

.dossier-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border: 1px solid transparent;
  border-radius: 0.9rem;
  background: rgba(6, 14, 24, 0);
  transition:
    max-height 260ms ease,
    opacity 220ms ease,
    margin-top 220ms ease,
    padding 220ms ease,
    border-color 220ms ease,
    background 220ms ease;
  padding: 0 0.9rem;
}

.project-card.is-expanded .dossier-content {
  /* Rows stack taller than the old columns did, and some dossiers are much
     wordier than others — this is a transition ceiling, not a design size, so
     it has to clear the longest entry rather than silently clipping it. */
  max-height: 60rem;
  margin-top: 0.9rem;
  opacity: 1;
  padding: 1rem 1.05rem;
  border-color: rgba(65, 242, 190, 0.14);
  background: rgba(6, 14, 24, 0.72);
}

/* One row per entry. The old three-column grid gave each sentence ~95px
   inside a 372px card, breaking them to one or two words a line. A row gets
   the full card width, so a sentence reads as a sentence. */
.dossier-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.dossier-row {
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(103, 235, 255, 0.1);
}

.dossier-row:first-child { padding-top: 0; border-top: 0; }
.dossier-row:last-child { padding-bottom: 0; }

/* The label is a quiet kicker; the eye should land on the text. */
.dossier-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dossier-text {
  margin: 0;
  color: #d7e8f7;
  font-size: 0.86rem;
  line-height: 1.65;
}

/* Wide cards have room to set the label beside the text rather than above,
   which tightens the block without ever narrowing the reading column. */
@media (min-width: 900px) {
  .dossier-row {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.25rem 0.9rem;
    align-items: baseline;
  }
  .dossier-label { padding-top: 0.12rem; }
}

.primary-button,
.secondary-button,
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.primary-button,
.secondary-button {
  min-height: 2.55rem;
  padding: 0 1rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.primary-button {
  color: #041219;
  background: linear-gradient(135deg, var(--emerald), #afffe3);
  box-shadow: 0 0 14px rgba(65, 242, 190, 0.16);
}

.secondary-button {
  color: var(--text);
  border: 1px solid rgba(181, 100, 255, 0.34);
  background: rgba(181, 100, 255, 0.08);
}

.teaser-card {
  justify-content: center;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.5rem 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.social-links a {
  width: 3rem;
  min-height: 2.75rem;
  padding: 0;
  color: var(--text);
  border: 1px solid rgba(103, 235, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(65, 242, 190, 0.08), rgba(181, 100, 255, 0.08)),
    rgba(103, 235, 255, 0.05);
}

.social-links a svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    border-color: rgba(103, 235, 255, 0.26);
    box-shadow: 0 0 24px rgba(65, 242, 190, 0.12);
  }

  .featured-card:hover,
  .reveal-card.revealed.featured-card:hover {
    transform: translate3d(calc(var(--parallax-x) * 0.03), calc(-12px + var(--parallax-y) * 0.03), 0);
  }

  .teaser-card.revealed:hover {
    transform: translate3d(calc(var(--parallax-x) * 0.02), calc(-6px + var(--parallax-y) * 0.02), 0);
  }

  .primary-button:hover,
  .secondary-button:hover,
  .social-links a:hover {
    transform: translateY(-2px);
  }

  .secondary-button:hover,
  .social-links a:hover {
    border-color: rgba(103, 235, 255, 0.45);
    box-shadow: 0 0 12px rgba(103, 235, 255, 0.08);
  }
}

@keyframes glitch-shift {
  0%,
  18%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3px, -1px);
  }
  22% {
    transform: translate(3px, 1px);
  }
  24% {
    transform: translate(-2px, 2px);
  }
  26% {
    transform: translate(0, 0);
  }
  72% {
    transform: translate(0, 0);
  }
  74% {
    transform: translate(2px, -1px);
  }
  76% {
    transform: translate(-2px, 1px);
  }
  78% {
    transform: translate(0, 0);
  }
}

body.glitch-pulse .glitch {
  animation: title-flicker 220ms linear 1;
}

@keyframes title-flicker {
  0%,
  100% {
    opacity: 1;
  }
  25% {
    opacity: 0.84;
  }
  50% {
    opacity: 0.96;
  }
  75% {
    opacity: 0.78;
  }
}

@keyframes beacon-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes edge-glow {
  0% {
    background-position:
      0% 0,
      100% 0%,
      100% 100%,
      0 100%;
  }
  100% {
    background-position:
      220% 0,
      100% 220%,
      -120% 100%,
      0 -120%;
  }
}

@keyframes boot-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes boot-line-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes terminal-caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 1rem, 1180px);
    padding-top: 2rem;
  }

  .boot-panel {
    width: 100%;
    padding: 0.8rem;
  }

  .boot-console {
    min-height: 13rem;
    padding: 0.85rem;
  }

  .boot-lines {
    font-size: 0.68rem;
  }

  .hero-shell {
    display: block;
  }

  .hero {
    padding-top: 2rem;
  }

  .hero-copy {
    font-size: 0.98rem;
  }

  .glitch {
    margin-bottom: 0.75rem;
    font-size: clamp(1.7rem, 10.2vw, 2.85rem);
    line-height: 0.9;
    letter-spacing: 0.02em;
    text-wrap: balance;
  }

  .glitch::before,
  .glitch::after {
    display: none;
  }

  .title-desktop {
    display: none;
  }

  .title-mobile {
    display: block;
    width: 100%;
  }

  .section-heading,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-tabs {
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    font-size: 1.08rem;
  }

  .project-tab:not(.is-active) {
    filter: blur(1px);
  }

  .featured-card {
    transform: none;
  }

  .reveal-card.revealed,
  .teaser-card.revealed {
    transform: none;
  }

  .terminal-panel {
    top: 0.8rem;
    right: 0.8rem;
    width: min(18rem, calc(100vw - 1.6rem));
    transform: none;
  }

  .terminal-line-active {
    min-height: 2.1rem;
    font-size: 0.72rem;
  }

  .terminal-meta,
  .terminal-topline {
    font-size: 0.64rem;
  }

  .card-preview {
    min-height: 9.4rem;
  }

  .project-card::after {
    animation: none;
    opacity: 0.45;
  }

  .preview-media {
    display: none;
  }

  .preview-site-logo {
    width: min(10.5rem, 65%);
    filter: none;
  }

  .preview-urlbar {
    font-size: 0.6rem;
  }

  /* Rows are already single-column here; just tighten the rhythm. */
  .dossier-row {
    padding: 0.5rem 0;
  }

  .background-frame-top {
    top: 1rem;
    width: 92vw;
    left: 4vw;
  }

  .background-frame-left,
  .background-frame-right,
  .hud-block,
  .cursor-orb {
    display: none;
  }

  .background-grid {
    opacity: 0.34;
  }

  #background-canvas {
    opacity: 0.72;
  }
}

body.reduced-effects .project-card::after,
body.reduced-effects .glitch::before,
body.reduced-effects .glitch::after,
body.reduced-effects .preview-media {
  display: none !important;
}

body.reduced-effects .preview-site-logo {
  filter: none;
}

/* ============================================================
   Site Portal — in-page live site launcher / iframe preview
   ============================================================ */
.site-portal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}

.site-portal[hidden] {
  display: none;
}

.site-portal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(6, 12, 24, 0.72), rgba(2, 4, 10, 0.88));
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 320ms ease, background 220ms ease;
}

.site-portal.is-open .site-portal-backdrop {
  opacity: 1;
}

/* X hover (and new-tab hover) darkens the world behind the frame */
.site-portal:has(.site-portal-close:hover) .site-portal-backdrop,
.site-portal:has(.site-portal-newtab:hover) .site-portal-backdrop {
  background: radial-gradient(circle at 50% 40%, rgba(2, 4, 10, 0.92), rgba(0, 1, 4, 0.97));
}

.site-portal-frame {
  position: relative;
  width: 95vw;
  height: 95vh;
  border-radius: 16px;
  overflow: hidden;
  transform-origin: 0 0;
  background: var(--bg-deep);
  border: 1px solid var(--panel-border);
  box-shadow:
    0 0 0 1px rgba(103, 235, 255, 0.12),
    0 30px 120px rgba(2, 5, 13, 0.75),
    var(--shadow);
  will-change: transform;
}

.site-portal-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-deep);
}

/* Snapshot layer that "rescales" out of the card while the iframe loads */
.site-portal-snapshot {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg-deep);
  opacity: 1;
  transition: opacity 420ms ease;
  z-index: 2;
  pointer-events: none;
}

.site-portal-snapshot > * {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}

.site-portal.is-live .site-portal-snapshot {
  opacity: 0;
}

/* Persistent flicker / scanline overlay kept over the live site */
.site-portal-flicker {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.5;
  background:
    linear-gradient(rgba(103, 235, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 99, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 3px, 3px 100%;
  animation: portal-flicker 5.2s steps(1) infinite;
}

.site-portal-flicker::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(65, 242, 190, 0.06) 48%, transparent 52%, transparent 100%);
  background-size: 100% 220%;
  animation: portal-scan 6.5s linear infinite;
}

@keyframes portal-flicker {
  0%, 100% { opacity: 0.5; }
  47% { opacity: 0.5; }
  48% { opacity: 0.24; }
  49% { opacity: 0.62; }
  50% { opacity: 0.42; }
  51% { opacity: 0.5; }
  82% { opacity: 0.5; }
  83% { opacity: 0.3; }
  84% { opacity: 0.5; }
}

@keyframes portal-scan {
  0% { background-position: 0 -110%; }
  100% { background-position: 0 210%; }
}

/* Controls sit above the iframe and flicker */
.site-portal-newtab {
  position: absolute;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
  border-radius: 999px;
  border: 1px solid rgba(103, 235, 255, 0.28);
  background: rgba(6, 12, 24, 0.72);
  box-shadow: 0 0 14px rgba(2, 5, 13, 0.55);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.site-portal-newtab:hover {
  transform: translateX(-50%) translateY(-1px);
  border-color: rgba(103, 235, 255, 0.55);
  background: rgba(10, 20, 36, 0.92);
  box-shadow: 0 0 18px rgba(103, 235, 255, 0.22);
}

.site-portal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 5;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid rgba(181, 100, 255, 0.34);
  background: rgba(6, 12, 24, 0.72);
  box-shadow: 0 0 14px rgba(2, 5, 13, 0.55);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.site-portal-close:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: rgba(181, 100, 255, 0.7);
  background: rgba(18, 10, 30, 0.94);
  box-shadow: 0 0 20px rgba(181, 100, 255, 0.32);
}

/* Fallback shown when a site refuses to be embedded */
.site-portal-fallback {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg-deep);
}

.site-portal.is-blocked .site-portal-fallback {
  display: flex;
}

.site-portal-fallback strong {
  color: var(--text);
  font-size: 1.05rem;
}

.site-portal-fallback a {
  color: #041219;
  background: linear-gradient(135deg, var(--emerald), #afffe3);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

body.reduced-effects .site-portal-flicker {
  animation: none;
  opacity: 0.28;
}

body.reduced-effects .site-portal-flicker::after {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .site-portal-frame {
    transition: none !important;
  }
}
