/* ==========================================================
   Dimitry;Portfolio
   Pure CSS. No protected assets. No external fonts.
   Visual direction: monochrome grunge / experimental lab file.
   ========================================================== */

:root {
  --black: #050505;
  --black-soft: #101010;
  --paper: #ece8dc;
  --paper-dim: #d5cfbd;
  --ink: #111111;
  --white: #f2efe6;

  --cyan: #9ccfd8;
  --teal: #5f8f8b;
  --sepia: #a48954;

  --line-dark: rgba(8, 8, 8, 0.75);
  --line-light: rgba(242, 239, 230, 0.65);
  --muted-light: rgba(242, 239, 230, 0.65);
  --muted-dark: rgba(17, 17, 17, 0.68);

  --serif: Georgia, "Times New Roman", Times, serif;
  --mono: "Courier New", Courier, monospace;
  --sans: Arial, Helvetica, sans-serif;

  --max-width: 1180px;
  --header-height: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 12%, rgba(156, 207, 216, 0.07), transparent 28rem),
    radial-gradient(circle at 85% 5%, rgba(164, 137, 84, 0.06), transparent 24rem),
    var(--black);
  font-family: var(--sans);
}

body.nav-open {
  overflow: hidden;
}

::selection {
  color: var(--black);
  background: var(--cyan);
}

/* ---------- Global worn document overlays ---------- */

.noise-layer,
.scanline-layer,
.ink-stains {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

.noise-layer {
  opacity: 0.09;
  background-image:
    repeating-radial-gradient(circle at 17% 23%, rgba(255,255,255,0.85) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 77% 43%, rgba(0,0,0,0.9) 0 1px, transparent 1px 4px);
  background-size: 160px 160px, 190px 190px;
  mix-blend-mode: overlay;
}

.scanline-layer {
  opacity: 0.14;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 5px,
    rgba(255, 255, 255, 0.045) 6px,
    transparent 7px
  );
  mix-blend-mode: overlay;
}

.ink-stains {
  opacity: 0.09;
  background:
    radial-gradient(circle at 8% 19%, #000 0 1px, transparent 2px),
    radial-gradient(circle at 38% 71%, #000 0 2px, transparent 4px),
    radial-gradient(circle at 76% 11%, #fff 0 1px, transparent 3px),
    radial-gradient(circle at 92% 82%, #000 0 2px, transparent 5px);
  background-size: 280px 280px;
  mix-blend-mode: multiply;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(242, 239, 230, 0.16);
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.12em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--white);
  font-family: var(--serif);
  font-weight: 900;
  line-height: 1;
  transform: skew(-8deg);
  box-shadow: inset 0 0 0 4px var(--black);
}

.brand-text {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted-light);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}

.site-nav a {
  position: relative;
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 180ms ease, color 180ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 220ms var(--ease);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--cyan);
  opacity: 1;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(242, 239, 230, 0.3);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 6px auto;
  background: var(--white);
  transition: transform 220ms ease;
}

.nav-open .nav-toggle span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-open .nav-toggle span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  min-height: 100vh;
  padding: clamp(92px, 12vw, 150px) clamp(18px, 5vw, 72px);
  isolation: isolate;
}

.dark-section {
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    var(--black);
  background-size: 86px 86px;
}

.light-section {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0,0,0,0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 92px 92px;
}

.light-section::before,
.dark-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.22;
  background:
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(0,0,0,0.18) 19px, transparent 20px),
    radial-gradient(circle at 20% 20%, rgba(0,0,0,0.24), transparent 25rem);
  mix-blend-mode: multiply;
}

.dark-section::before {
  opacity: 0.16;
  background:
    repeating-linear-gradient(0deg, transparent 0 18px, rgba(255,255,255,0.18) 19px, transparent 20px),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.22), transparent 25rem);
  mix-blend-mode: overlay;
}

.blueprint-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.32;
  background:
    linear-gradient(90deg, transparent 49%, rgba(156, 207, 216, 0.14) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(156, 207, 216, 0.10) 50%, transparent 51%);
  background-size: 130px 130px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.section-header {
  width: min(100%, var(--max-width));
  margin: 0 auto clamp(36px, 6vw, 70px);
}

.classified-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.classified-label::before,
.classified-label::after {
  content: "";
  display: inline-block;
  width: 42px;
  height: 4px;
  background: currentColor;
}

.classified-label.dark {
  color: var(--muted-dark);
}

.section-title,
.main-title {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: -0.055em;
  text-transform: none;
  line-height: 0.86;
}

.section-title {
  font-size: clamp(3.2rem, 10vw, 8.8rem);
}

.section-kicker {
  max-width: 720px;
  margin: 20px 0 0;
  color: currentColor;
  font-family: var(--mono);
  font-size: clamp(0.86rem, 1.8vw, 1rem);
  line-height: 1.8;
  opacity: 0.72;
}

/* ---------- Glitch titles ---------- */

.glitch-title {
  text-shadow:
    1px 0 rgba(156, 207, 216, 0.22),
    -1px 0 rgba(164, 137, 84, 0.22);
}

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

.glitch-title::before {
  transform: translate(2px, -1px);
  color: var(--cyan);
  clip-path: inset(0 0 54% 0);
}

.glitch-title::after {
  transform: translate(-2px, 1px);
  color: var(--sepia);
  clip-path: inset(54% 0 0 0);
}

.glitch-title.is-glitching::before,
.glitch-title.is-glitching::after {
  opacity: 0.34;
  animation: titleGlitch 420ms steps(2, end);
}

@keyframes titleGlitch {
  0% { transform: translate(0, 0); }
  20% { transform: translate(3px, -2px); }
  40% { transform: translate(-3px, 1px); }
  60% { transform: translate(1px, 2px); }
  100% { transform: translate(0, 0); }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  align-items: center;
  gap: clamp(34px, 6vw, 86px);
  padding-top: calc(var(--header-height) + 80px);
}

.hero-content,
.hero-visual {
  position: relative;
  width: min(100%, 680px);
}

.main-title {
  max-width: 850px;
  font-size: clamp(4rem, 12vw, 11.2rem);
}

.hero-subtitle {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(242, 239, 230, 0.72);
}

.hero-subtitle::after {
  content: "";
  display: block;
  width: min(100%, 520px);
  height: 10px;
  margin-top: 22px;
  background:
    linear-gradient(90deg, var(--white) 0 28%, transparent 28% 34%, var(--white) 34% 72%, transparent 72% 80%, var(--white) 80%);
  opacity: 0.9;
}

.meter-card {
  width: min(100%, 440px);
  margin-top: 36px;
  padding: 18px 20px;
  border: 2px solid rgba(242, 239, 230, 0.78);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 40%),
    rgba(0,0,0,0.26);
  box-shadow:
    inset 0 0 0 4px rgba(0,0,0,0.7),
    0 18px 40px rgba(0,0,0,0.3);
}

.meter-label,
.meter-note {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(242, 239, 230, 0.62);
}

.meter-value {
  display: block;
  margin: 8px 0;
  font-family: var(--mono);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1;
  color: var(--white);
  text-shadow: 0 0 14px rgba(156, 207, 216, 0.12);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid currentColor;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    background 180ms ease,
    color 180ms ease;
}

.btn.primary {
  color: var(--black);
  background: var(--white);
}

.btn.secondary {
  color: var(--white);
  background: transparent;
}

.btn:hover,
.btn:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 rgba(156, 207, 216, 0.45);
}

.dark-btn {
  color: var(--paper) !important;
  background: var(--black) !important;
}

.floating-formulas {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.floating-formulas span {
  position: absolute;
  color: rgba(242, 239, 230, 0.18);
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1vw, 0.88rem);
  transform: rotate(var(--rotation, 0deg));
}

.floating-formulas span:nth-child(1) { top: 20%; left: 6%; --rotation: -7deg; }
.floating-formulas span:nth-child(2) { top: 68%; left: 12%; --rotation: 3deg; }
.floating-formulas span:nth-child(3) { top: 28%; right: 8%; --rotation: 7deg; }
.floating-formulas span:nth-child(4) { bottom: 14%; right: 12%; --rotation: -4deg; }
.floating-formulas span:nth-child(5) { top: 12%; right: 32%; --rotation: 2deg; }

.worldline-composition {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  margin-inline: auto;
  border: 2px solid rgba(242, 239, 230, 0.74);
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(242,239,230,0.11), transparent 37%),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(242,239,230,0.05) 25px, transparent 26px),
    rgba(255,255,255,0.02);
  box-shadow:
    inset 0 0 0 8px rgba(0,0,0,0.65),
    inset 0 0 80px rgba(0,0,0,0.75);
}

.worldline-composition::before,
.worldline-composition::after {
  content: "";
  position: absolute;
  background: var(--white);
  opacity: 0.85;
}

.worldline-composition::before {
  left: 8%;
  right: 8%;
  top: 14%;
  height: 9px;
  box-shadow: 0 38px 0 rgba(242,239,230,0.45), 0 78px 0 rgba(242,239,230,0.26);
}

.worldline-composition::after {
  top: 8%;
  bottom: 8%;
  right: 17%;
  width: 2px;
  opacity: 0.32;
}

.scientific-ring {
  position: absolute;
  inset: 50%;
  border: 1px solid rgba(242, 239, 230, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ring-one {
  width: 76%;
  height: 76%;
  border-style: dashed;
  animation: rotateSlow 38s linear infinite;
}

.ring-two {
  width: 54%;
  height: 54%;
  border-color: rgba(156, 207, 216, 0.38);
  animation: rotateSlowReverse 46s linear infinite;
}

.ring-three {
  width: 34%;
  height: 34%;
  border-style: dotted;
  opacity: 0.72;
  animation: rotateSlow 30s linear infinite;
}

.gear {
  position: absolute;
  border-radius: 50%;
  border: 8px solid rgba(242, 239, 230, 0.78);
  opacity: 0.55;
  background:
    radial-gradient(circle, transparent 0 31%, rgba(242,239,230,0.8) 32% 39%, transparent 40%),
    repeating-conic-gradient(from 0deg, rgba(242,239,230,0.9) 0 9deg, transparent 9deg 18deg);
  mask:
    radial-gradient(circle, transparent 0 31%, black 32% 100%);
}

.gear::after {
  content: "";
  position: absolute;
  inset: 22%;
  border: 4px solid rgba(242, 239, 230, 0.78);
  border-radius: 50%;
}

.gear-large {
  width: 190px;
  height: 190px;
  left: -50px;
  bottom: 40px;
  animation: rotateSlow 34s linear infinite;
}

.gear-medium {
  width: 134px;
  height: 134px;
  right: 34px;
  top: 44px;
  opacity: 0.46;
  animation: rotateSlowReverse 28s linear infinite;
}

.gear-small {
  width: 92px;
  height: 92px;
  right: 110px;
  bottom: 74px;
  opacity: 0.38;
  animation: rotateSlow 24s linear infinite;
}

.worldline-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: url(#roughLine);
}

.timeline-path {
  fill: none;
  stroke: rgba(242, 239, 230, 0.88);
  stroke-width: 3;
  stroke-dasharray: 7 8;
}

.branch-path {
  stroke: rgba(156, 207, 216, 0.5);
  stroke-width: 2;
}

.branch-path.faint {
  stroke: rgba(164, 137, 84, 0.4);
}

.node {
  fill: var(--white);
}

.node.accent {
  fill: var(--cyan);
}

.lab-stamp,
.micro-copy {
  position: absolute;
  z-index: 3;
  font-family: var(--mono);
  text-transform: uppercase;
}

.lab-stamp {
  right: 26px;
  bottom: 22px;
  padding: 10px 12px;
  border: 2px solid rgba(242, 239, 230, 0.66);
  color: rgba(242, 239, 230, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  transform: rotate(-4deg);
}

.micro-copy {
  color: rgba(242, 239, 230, 0.52);
  font-size: 0.66rem;
  line-height: 1.55;
  letter-spacing: 0.1em;
}

.top-left {
  top: 24px;
  left: 22px;
}

.bottom-right {
  right: 24px;
  bottom: 88px;
  text-align: right;
}

/* ---------- About ---------- */

.about-layout,
.contact-layout {
  width: min(100%, var(--max-width));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.1fr 0.72fr;
  gap: clamp(22px, 4vw, 46px);
}

.classified-card,
.lab-report,
.social-panel,
.contact-form {
  position: relative;
  border: 2px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(0,0,0,0.065), transparent 32%),
    rgba(236, 232, 220, 0.76);
  box-shadow:
    inset 0 0 0 5px rgba(236, 232, 220, 0.78),
    10px 10px 0 rgba(0,0,0,0.12);
}

.classified-card {
  padding: clamp(22px, 4vw, 42px);
}

.classified-card::before,
.lab-report::before,
.project-card::before,
.skill-card::before,
.contact-form::before,
.social-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(0,0,0,0.16);
  pointer-events: none;
}

.card-topline,
.classified-footer,
.file-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.classified-card h3,
.lab-report h3,
.social-panel h3 {
  margin: 34px 0 16px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 0.95;
}

.classified-card p {
  max-width: 760px;
  color: rgba(17, 17, 17, 0.78);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.9;
}

.classified-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 8px solid var(--ink);
}

.lab-report {
  min-height: 360px;
  padding: 26px;
  overflow: hidden;
}

.lab-report ul {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
}

.lab-report li {
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(0,0,0,0.24);
}

.report-stamp {
  position: absolute;
  right: 18px;
  bottom: 20px;
  padding: 12px 14px;
  border: 3px solid rgba(0,0,0,0.55);
  color: rgba(0,0,0,0.55);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-align: center;
  transform: rotate(-8deg);
}

/* ---------- Skills ---------- */

.skills-grid,
.projects-grid {
  width: min(100%, var(--max-width));
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skill-card {
  position: relative;
  min-height: 220px;
  padding: 22px;
  border: 2px solid rgba(242, 239, 230, 0.7);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 45%),
    rgba(0,0,0,0.2);
  overflow: hidden;
  transition:
    transform 180ms var(--ease),
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.skill-card::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  height: 8px;
  background:
    linear-gradient(90deg, rgba(242,239,230,0.8) 0 42%, transparent 42% 50%, rgba(156,207,216,0.42) 50% 70%, transparent 70%);
}

.experiment-number {
  color: rgba(156, 207, 216, 0.82);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.skill-card h3 {
  margin: 28px 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 0.9;
}

.skill-card p {
  margin: 0;
  color: rgba(242, 239, 230, 0.68);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.7;
}

.skill-card:hover,
.project-card:hover {
  transform: translate(-4px, -4px);
  border-color: var(--cyan);
  box-shadow: 8px 8px 0 rgba(156, 207, 216, 0.23);
}

/* ---------- Projects ---------- */

.project-card {
  position: relative;
  min-height: 280px;
  padding: 24px;
  border: 2px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(0,0,0,0.06), transparent 38%),
    rgba(236, 232, 220, 0.8);
  box-shadow: inset 0 0 0 5px rgba(236, 232, 220, 0.8);
  transition:
    transform 180ms var(--ease),
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.project-card h3 {
  margin: 34px 0 14px;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.project-card p {
  color: rgba(17, 17, 17, 0.74);
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.8;
}

.status {
  padding: 3px 6px;
  border: 1px solid currentColor;
}

.status.active {
  color: var(--teal);
}

.status.prototype {
  color: var(--sepia);
}

.status.research {
  color: #4a7370;
}

.status.unstable {
  color: #765d39;
}

.file-button {
  position: absolute;
  left: 24px;
  bottom: 24px;
  min-height: 42px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--ease);
}

.file-button:hover,
.file-button:focus-visible {
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-2px);
}

/* ---------- Timeline ---------- */

.timeline-map {
  position: relative;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 40px 0;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(242, 239, 230, 0.56);
}

.timeline-line::before,
.timeline-line::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 170px;
  height: 2px;
  background: rgba(156, 207, 216, 0.34);
  transform-origin: left;
}

.timeline-line::before {
  top: 26%;
  transform: rotate(-18deg);
}

.timeline-line::after {
  top: 62%;
  transform: rotate(22deg);
}

.timeline-node {
  position: relative;
  width: min(44%, 420px);
  min-height: 170px;
  margin: 0 0 36px;
  padding: 20px;
  border: 2px solid rgba(242, 239, 230, 0.72);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.07), transparent 45%),
    rgba(0,0,0,0.26);
}

.timeline-node::before {
  content: "";
  position: absolute;
  top: 28px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--black);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(242,239,230,0.7);
}

.node-left {
  margin-right: auto;
}

.node-left::before {
  right: -63px;
}

.node-right {
  margin-left: auto;
}

.node-right::before {
  left: -63px;
}

.timeline-node.final {
  border-color: var(--cyan);
}

.timeline-code {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.timeline-node h3 {
  margin: 18px 0 12px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 0.9;
}

.timeline-node p {
  margin: 0;
  color: rgba(242, 239, 230, 0.68);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.7;
}

/* ---------- Contact ---------- */

.contact {
  min-height: auto;
}

.contact-form {
  padding: clamp(22px, 4vw, 36px);
}

.contact-form label {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--ink);
  outline: none;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(0,0,0,0.06) 24px),
    transparent;
  font-family: var(--mono);
  font-size: 1rem;
  padding: 14px 0;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--teal);
}

.form-note {
  margin: 16px 0 0;
  color: var(--muted-dark);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.social-panel {
  padding: 28px;
}

.social-panel h3 {
  margin-top: 0;
}

.social-panel a {
  display: block;
  padding: 14px 0;
  color: var(--ink);
  border-bottom: 1px dashed rgba(0,0,0,0.28);
  font-family: var(--mono);
  text-decoration: none;
  transition: color 180ms ease, padding-left 180ms var(--ease);
}

.social-panel a:hover,
.social-panel a:focus-visible {
  color: var(--teal);
  padding-left: 10px;
}

.terminal-readout {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  padding: 18px;
  color: rgba(242, 239, 230, 0.76);
  background: var(--black);
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 28px 18px;
  border-top: 1px solid rgba(242, 239, 230, 0.16);
  color: rgba(242, 239, 230, 0.58);
  background: var(--black);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-align: center;
}

/* ---------- Reveal animation ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms var(--ease),
    transform 700ms var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Keyframes ---------- */

@keyframes rotateSlow {
  to { transform: rotate(360deg); }
}

@keyframes rotateSlowReverse {
  to { transform: rotate(-360deg); }
}

.scientific-ring.ring-one,
.scientific-ring.ring-two,
.scientific-ring.ring-three {
  transform-origin: center;
}

/* Because rings are centered with transform, we use this alternative animation. */
.ring-one {
  animation-name: ringRotate;
}

.ring-two {
  animation-name: ringRotateReverse;
}

.ring-three {
  animation-name: ringRotate;
}

@keyframes ringRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes ringRotateReverse {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-content,
  .hero-visual {
    width: min(100%, var(--max-width));
    margin-inline: auto;
  }

  .worldline-composition {
    width: min(100%, 520px);
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    display: grid;
    gap: 0;
    padding: 18px;
    border-bottom: 1px solid rgba(242, 239, 230, 0.18);
    background: rgba(5, 5, 5, 0.96);
    transform: translateY(-120%);
    transition: transform 240ms var(--ease);
  }

  .nav-open .site-nav {
    transform: translateY(0);
  }

  .site-nav a {
    padding: 16px 0;
    border-bottom: 1px dashed rgba(242, 239, 230, 0.14);
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .timeline-line {
    left: 18px;
  }

  .timeline-line::before,
  .timeline-line::after {
    display: none;
  }

  .timeline-node {
    width: calc(100% - 46px);
    margin-left: 46px;
  }

  .node-left,
  .node-right {
    margin-right: 0;
  }

  .node-left::before,
  .node-right::before {
    left: -36px;
    right: auto;
  }

  .card-topline,
  .classified-footer,
  .file-meta {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 540px) {
  :root {
    --header-height: 68px;
  }

  .site-header {
    padding-inline: 14px;
  }

  .brand-text {
    display: none;
  }

  .section {
    padding-inline: 16px;
  }

  .main-title {
    font-size: clamp(3.3rem, 18vw, 5.8rem);
  }

  .section-title {
    font-size: clamp(3rem, 17vw, 5.4rem);
  }

  .classified-label {
    align-items: flex-start;
    line-height: 1.5;
  }

  .classified-label::before,
  .classified-label::after {
    width: 24px;
    margin-top: 6px;
  }

  .hero-actions {
    display: grid;
  }

  .btn {
    width: 100%;
  }

  .meter-value {
    font-size: 2.4rem;
  }

  .worldline-composition {
    min-height: 360px;
  }

  .gear-large {
    width: 140px;
    height: 140px;
  }

  .gear-medium {
    width: 110px;
    height: 110px;
  }

  .micro-copy {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}


/* ==========================================================
   Extra animated background + upgraded classified dossier
   Inspired by the uploaded lab/canvas/stamp version, but adapted
   to this monochrome document identity.
   ========================================================== */

.blueprint-canvas {
  position: fixed;
  inset: 0;
  z-index: 4;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: difference;
}

.animated-lab-background {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: difference;
}

.lab-bg-line {
  position: absolute;
  left: -12vw;
  width: 124vw;
  height: 2px;
  background:
    linear-gradient(90deg,
      transparent 0 5%,
      rgba(242, 239, 230, 0.0) 5% 8%,
      rgba(242, 239, 230, 0.35) 8% 24%,
      transparent 24% 30%,
      rgba(156, 207, 216, 0.34) 30% 43%,
      transparent 43% 52%,
      rgba(242, 239, 230, 0.28) 52% 78%,
      transparent 78%);
  transform: rotate(var(--angle, 0deg));
  animation: scanDrift var(--duration, 24s) linear infinite;
}

.line-a { top: 18%; --angle: -4deg; --duration: 28s; }
.line-b { top: 52%; --angle: 3deg; --duration: 35s; animation-direction: reverse; }
.line-c { top: 81%; --angle: -2deg; --duration: 42s; }

.bg-orbit {
  position: absolute;
  width: var(--size, 380px);
  height: var(--size, 380px);
  border: 1px dashed rgba(242, 239, 230, 0.3);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(156, 207, 216, 0.11),
    0 0 0 12px rgba(255,255,255,0.015);
  animation: backgroundOrbit var(--duration, 44s) linear infinite;
}

.bg-orbit::before,
.bg-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.bg-orbit::before {
  inset: 17%;
  border: 1px solid rgba(242, 239, 230, 0.15);
}

.bg-orbit::after {
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  background: rgba(156, 207, 216, 0.65);
  transform: translateY(-50%);
}

.orbit-a {
  --size: 420px;
  --duration: 58s;
  top: 8%;
  right: 4%;
}

.orbit-b {
  --size: 620px;
  --duration: 82s;
  left: -180px;
  bottom: -210px;
  animation-direction: reverse;
}

.orbit-c {
  --size: 260px;
  --duration: 46s;
  top: 58%;
  right: 20%;
  opacity: 0.5;
}

.drifting-data {
  position: absolute;
  color: rgba(242, 239, 230, 0.42);
  font-family: var(--mono);
  font-size: clamp(0.68rem, 1.1vw, 0.92rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 1px 0 rgba(156, 207, 216, 0.18);
  animation: dataDrift var(--duration, 26s) linear infinite;
}

.data-a { top: 23%; left: -35%; --duration: 31s; }
.data-b { top: 68%; left: -42%; --duration: 40s; animation-delay: -9s; }
.data-c { top: 12%; left: -55%; --duration: 48s; animation-delay: -18s; }
.data-d { top: 87%; left: -48%; --duration: 36s; animation-delay: -5s; }

.clearance-strip {
  width: fit-content;
  max-width: 100%;
  display: grid;
  gap: 5px;
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 2px solid rgba(242, 239, 230, 0.76);
  color: var(--white);
  background:
    repeating-linear-gradient(-45deg, rgba(242,239,230,0.09) 0 5px, transparent 5px 11px),
    rgba(0,0,0,0.28);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-0.7deg);
  box-shadow:
    inset 0 0 0 3px rgba(0,0,0,0.55),
    7px 7px 0 rgba(156, 207, 216, 0.08);
}

.clearance-strip span:last-child {
  color: rgba(156, 207, 216, 0.72);
  font-size: 0.66rem;
}

.upgraded-classified {
  overflow: hidden;
}

.classification-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -12px -12px 26px;
  padding: 8px;
  border: 2px solid rgba(0,0,0,0.78);
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.78) 0 16px, rgba(0,0,0,0.64) 16px 28px);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.classification-card-header span {
  padding: 4px 8px;
  border: 1px solid rgba(236, 232, 220, 0.42);
  background: rgba(236, 232, 220, 0.06);
}

.classification-card-header .security-level {
  color: var(--black);
  background: var(--paper);
  border-color: var(--paper);
  font-weight: 900;
}

.classified-stamp {
  position: absolute;
  top: 72px;
  right: clamp(16px, 4vw, 40px);
  z-index: 2;
  padding: 7px 16px;
  border: 3px solid rgba(0,0,0,0.54);
  color: rgba(0,0,0,0.54);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3vw, 2.35rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(12deg);
  opacity: 0.72;
  mix-blend-mode: multiply;
}

.classified-stamp::before,
.classified-stamp::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: currentColor;
  opacity: 0.7;
}

.classified-stamp::before { top: 5px; }
.classified-stamp::after { bottom: 5px; }

.redacted-block {
  display: grid;
  grid-template-columns: 0.8fr 0.5fr 1fr;
  gap: 8px;
  max-width: 560px;
  margin: 22px 0 24px;
}

.redacted-block span {
  height: 13px;
  background: var(--ink);
  opacity: 0.88;
  transform: skew(-12deg);
}

.dossier-quote {
  position: relative;
  padding: 16px 18px 16px 22px;
  border-left: 7px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.08), transparent);
  color: rgba(17,17,17,0.86) !important;
  font-style: italic;
}

.dossier-quote::after {
  content: "QUOTE VERIFIED // TEMPORAL ARCHIVE";
  display: block;
  margin-top: 8px;
  color: rgba(17,17,17,0.48);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-style: normal;
  letter-spacing: 0.14em;
}

@keyframes scanDrift {
  0% { transform: translateX(-18%) rotate(var(--angle, 0deg)); opacity: 0; }
  12% { opacity: 0.62; }
  84% { opacity: 0.45; }
  100% { transform: translateX(18%) rotate(var(--angle, 0deg)); opacity: 0; }
}

@keyframes backgroundOrbit {
  to { transform: rotate(360deg); }
}

@keyframes dataDrift {
  0% { transform: translateX(0) skewX(-4deg); opacity: 0; }
  10% { opacity: 0.5; }
  88% { opacity: 0.4; }
  100% { transform: translateX(160vw) skewX(-4deg); opacity: 0; }
}

/* Give existing section blueprint grids a slow mechanical motion. */
.blueprint-grid {
  animation: blueprintGridShift 38s linear infinite;
}

.floating-formulas span {
  animation: formulaFloat 11s ease-in-out infinite;
}

.floating-formulas span:nth-child(2n) {
  animation-duration: 15s;
  animation-direction: reverse;
}

@keyframes blueprintGridShift {
  to { background-position: 130px 130px; }
}

@keyframes formulaFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--rotation, 0deg)); }
  50% { transform: translate3d(12px, -18px, 0) rotate(calc(var(--rotation, 0deg) + 2deg)); }
}

@media (max-width: 820px) {
  .blueprint-canvas {
    opacity: 0.16;
  }

  .animated-lab-background {
    opacity: 0.28;
  }

  .classified-stamp {
    position: relative;
    top: auto;
    right: auto;
    display: inline-block;
    margin: 8px 0 18px;
    transform: rotate(-5deg);
  }

  .redacted-block {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blueprint-canvas,
  .animated-lab-background {
    opacity: 0.12;
  }
}


/* V3 tweak: remove the large CLASSIFIED stamp while keeping the TOP SECRET dossier bar. */
.stamp,
.report-stamp,
.classified-stamp,
.dossier-stamp {
  display: none !important;
}

.classified-card::after,
.lab-report::after,
.about-card::after,
.document-style::after {
  content: none !important;
}

/* ==========================================================
   V4 — WORLDLINE INTERFACE OVERHAUL
   Stronger temporal-laboratory identity, no external assets.
   ========================================================== */

:root {
  --signal: #9ccfd8;
  --signal-rgb: 156, 207, 216;
  --warning: #b4815c;
  --phosphor: #b7c28b;
  --header-height: 84px;
}

body[data-worldline="alpha"] {
  --cyan: #9ccfd8;
  --signal: #9ccfd8;
  --signal-rgb: 156, 207, 216;
  --sepia: #a48954;
}

body[data-worldline="beta"] {
  --cyan: #bb7655;
  --signal: #bb7655;
  --signal-rgb: 187, 118, 85;
  --sepia: #d0a06a;
}

body[data-worldline="omega"] {
  --cyan: #a9bd78;
  --signal: #a9bd78;
  --signal-rgb: 169, 189, 120;
  --sepia: #839c8d;
}

body {
  cursor: crosshair;
}

body.is-booting {
  overflow: hidden;
}

body.worldline-shift {
  animation: pageWorldlineShift 680ms steps(2, end);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--black);
  background: var(--white);
  font-family: var(--mono);
  font-size: 0.75rem;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Boot calibration ---------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--white);
  background:
    linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.025) 4px),
    #030303;
  transition: opacity 440ms ease, visibility 440ms ease;
}

.boot-screen::before,
.boot-screen::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.boot-screen::before {
  inset: 24px;
  border: 1px solid rgba(242, 239, 230, 0.34);
  box-shadow: inset 0 0 0 5px rgba(0,0,0,0.9);
}

.boot-screen::after {
  top: 0;
  left: 0;
  right: 0;
  height: 18%;
  background: linear-gradient(to bottom, transparent, rgba(var(--signal-rgb), 0.08), transparent);
  animation: bootScan 2.2s linear infinite;
}

.boot-screen.is-complete {
  opacity: 0;
  visibility: hidden;
}

.boot-noise {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: repeating-radial-gradient(circle, rgba(255,255,255,0.8) 0 1px, transparent 1px 5px);
  background-size: 83px 73px;
  mix-blend-mode: overlay;
}

.boot-terminal {
  position: relative;
  z-index: 2;
  width: min(100%, 720px);
  padding: clamp(24px, 5vw, 54px);
  border-left: 5px solid var(--signal);
  border-right: 1px solid rgba(242,239,230,0.18);
  background: linear-gradient(90deg, rgba(var(--signal-rgb), 0.08), transparent 42%);
  font-family: var(--mono);
}

.boot-brand {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 38px;
  font-family: var(--serif);
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.08em;
}

.boot-brand span {
  max-width: 210px;
  color: rgba(242,239,230,0.62);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.15em;
}

.boot-log {
  display: grid;
  gap: 10px;
  min-height: 118px;
  margin-bottom: 26px;
  color: rgba(242,239,230,0.65);
  font-size: 0.78rem;
  line-height: 1.5;
}

.boot-log span {
  opacity: 0;
  transform: translateX(-8px);
  animation: bootLine 280ms ease forwards;
}

.boot-log span:nth-child(2) { animation-delay: 240ms; }
.boot-log span:nth-child(3) { animation-delay: 520ms; }
.boot-log span:nth-child(4) { animation-delay: 820ms; color: var(--signal); }

.boot-progress {
  height: 10px;
  border: 1px solid rgba(242,239,230,0.6);
  padding: 2px;
}

.boot-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--signal) 0 14px, transparent 14px 18px);
}

.boot-percent {
  margin-top: 8px;
  color: var(--signal);
  font-size: 0.75rem;
  text-align: right;
}

.boot-skip {
  margin-top: 28px;
  padding: 0;
  border: 0;
  color: rgba(242,239,230,0.46);
  background: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.boot-skip:hover,
.boot-skip:focus-visible {
  color: var(--signal);
}

.temporal-flash {
  position: fixed;
  inset: 0;
  z-index: 950;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(255,255,255,0.9) 14% 15%, transparent 15% 63%, rgba(var(--signal-rgb),0.8) 63% 64%, transparent 64%),
    rgba(var(--signal-rgb), 0.08);
}

.temporal-flash.is-active {
  animation: temporalFlash 620ms steps(2, end);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.04);
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--signal);
  box-shadow: 0 0 16px rgba(var(--signal-rgb),0.72);
}

/* ---------- Pointer reticle ---------- */

.lab-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid rgba(var(--signal-rgb),0.7);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: width 140ms ease, height 140ms ease, margin 140ms ease, opacity 180ms ease;
  mix-blend-mode: difference;
}

.lab-cursor::before,
.lab-cursor::after {
  content: "";
  position: absolute;
  background: var(--signal);
}

.lab-cursor::before {
  top: 50%;
  left: -6px;
  right: -6px;
  height: 1px;
}

.lab-cursor::after {
  top: -6px;
  bottom: -6px;
  left: 50%;
  width: 1px;
}

.lab-cursor span {
  position: absolute;
  inset: 11px;
  border: 1px solid var(--signal);
  border-radius: 50%;
}

.lab-cursor.is-visible { opacity: 0.68; }
.lab-cursor.is-hovering {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
}

/* ---------- Header refinement ---------- */

.site-header {
  height: var(--header-height);
  gap: 24px;
  border-bottom-color: rgba(var(--signal-rgb), 0.23);
  background:
    linear-gradient(90deg, rgba(var(--signal-rgb),0.05), transparent 32%),
    rgba(5,5,5,0.88);
}

.site-header::after {
  content: "REC // 00:48:596";
  position: absolute;
  left: clamp(18px, 4vw, 56px);
  bottom: -18px;
  color: rgba(var(--signal-rgb),0.5);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(242,239,230,0.43);
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
}

.brand-status i,
.meter-signal i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(var(--signal-rgb),0.85);
  animation: statusPulse 1.8s ease-in-out infinite;
}

.site-nav a::before {
  content: attr(data-index);
  margin-right: 7px;
  color: rgba(var(--signal-rgb),0.54);
  font-size: 0.58rem;
}

.site-nav a.is-active {
  color: var(--signal);
  opacity: 1;
}

.site-nav a.is-active::after {
  width: 100%;
}

.header-coordinates {
  display: grid;
  gap: 3px;
  min-width: 140px;
  padding-left: 18px;
  border-left: 1px solid rgba(242,239,230,0.16);
  color: rgba(242,239,230,0.45);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-align: right;
}

.header-coordinates span:first-child {
  color: var(--signal);
  font-size: 0.68rem;
}

/* ---------- Global section markers ---------- */

.section::after {
  content: attr(data-section-code);
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  color: currentColor;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.34em;
  opacity: 0.22;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  pointer-events: none;
}

.hero::after {
  content: "WORLDLINE_01.048596";
}

.section-header {
  position: relative;
}

.section-header::after {
  content: "// OBSERVATION RECORD";
  position: absolute;
  top: 6px;
  right: 0;
  color: currentColor;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  opacity: 0.36;
}

/* ---------- Hero redesign ---------- */

.hero {
  min-height: max(780px, 100svh);
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.8fr);
  background:
    radial-gradient(circle at 72% 44%, rgba(var(--signal-rgb),0.07), transparent 24rem),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    var(--black);
  background-size: auto, 86px 86px, 86px 86px, auto;
}

.hero::before {
  background:
    linear-gradient(105deg, transparent 0 18%, rgba(255,255,255,0.03) 18.2% 18.6%, transparent 18.8%),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 25rem);
}

.hero-content {
  z-index: 4;
}

.hero-title-wrap {
  position: relative;
  width: fit-content;
}

.hero-title-index {
  position: absolute;
  top: -24px;
  left: -30px;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
}

.main-title {
  max-width: 820px;
  font-size: clamp(4.5rem, 10vw, 10.4rem);
  text-wrap: balance;
  filter: contrast(1.08);
}

.main-title::selection {
  background: var(--signal);
}

.title-semicolon {
  display: inline-block;
  margin-inline: 0.01em;
  color: var(--signal);
  font-family: var(--mono);
  font-weight: 400;
  transform: translateY(-0.04em) rotate(5deg);
  text-shadow: 0 0 18px rgba(var(--signal-rgb),0.34);
}

.title-annotation {
  position: absolute;
  right: -16px;
  bottom: -32px;
  padding-left: 12px;
  border-left: 2px solid var(--signal);
  color: rgba(242,239,230,0.43);
  font-family: var(--mono);
  font-size: 0.56rem;
  line-height: 1.55;
  letter-spacing: 0.12em;
  transform: translateX(100%);
}

.hero-subtitle span {
  color: var(--signal);
}

.hero-subtitle::after {
  background:
    linear-gradient(90deg, var(--white) 0 18%, transparent 18% 23%, var(--signal) 23% 36%, transparent 36% 43%, var(--white) 43% 74%, transparent 74% 82%, var(--white) 82%);
}

.clearance-strip {
  position: relative;
  border-color: rgba(var(--signal-rgb),0.65);
}

.clearance-strip::after {
  content: "AUTH_035";
  position: absolute;
  right: 8px;
  bottom: -17px;
  color: rgba(var(--signal-rgb),0.44);
  font-size: 0.52rem;
}

.meter-card {
  position: relative;
  width: min(100%, 510px);
  margin-top: 42px;
  padding: 16px 18px 18px;
  border-width: 1px;
  border-color: rgba(var(--signal-rgb),0.65);
  background:
    linear-gradient(90deg, rgba(var(--signal-rgb),0.08), transparent 58%),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(255,255,255,0.025) 7px),
    rgba(0,0,0,0.42);
  box-shadow:
    inset 0 0 0 4px rgba(0,0,0,0.72),
    0 20px 55px rgba(0,0,0,0.42);
}

.meter-card::before {
  content: "DM-048596";
  position: absolute;
  top: 8px;
  right: 10px;
  color: rgba(242,239,230,0.3);
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
}

.meter-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meter-signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(242,239,230,0.45);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.meter-readout {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 11px 0 6px;
  overflow: hidden;
}

.meter-sign,
.meter-unit {
  padding-bottom: 7px;
  color: rgba(var(--signal-rgb),0.64);
  font-family: var(--mono);
  font-size: 1rem;
}

.meter-value {
  margin: 0;
  color: var(--white);
  font-family: var(--mono);
  font-size: clamp(2.8rem, 6vw, 4.9rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-shadow:
    3px 0 0 rgba(var(--signal-rgb),0.14),
    0 0 22px rgba(var(--signal-rgb),0.13);
}

.meter-value.is-shifting {
  animation: meterScramble 480ms steps(3, end);
}

.meter-scale {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  height: 8px;
  margin: 0 0 12px;
}

.meter-scale span {
  background: rgba(242,239,230,0.18);
}

.meter-scale span:nth-child(-n + 4) {
  background: rgba(var(--signal-rgb),0.62);
}

.worldline-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(242,239,230,0.17);
}

.worldline-button {
  min-height: 38px;
  border: 1px solid rgba(242,239,230,0.2);
  color: rgba(242,239,230,0.44);
  background: rgba(255,255,255,0.02);
  font-family: var(--serif);
  font-size: 1rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.worldline-button span {
  margin-left: 4px;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
}

.worldline-button:hover,
.worldline-button:focus-visible,
.worldline-button.is-active {
  border-color: var(--signal);
  color: var(--signal);
  background: rgba(var(--signal-rgb),0.08);
}

.worldline-button:active {
  transform: scale(0.97);
}

.hero-visual {
  z-index: 3;
}

.worldline-composition {
  border-color: rgba(var(--signal-rgb),0.56);
  background:
    radial-gradient(circle at center, rgba(var(--signal-rgb),0.11), transparent 34%),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(242,239,230,0.04) 25px, transparent 26px),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(242,239,230,0.03) 25px, transparent 26px),
    rgba(255,255,255,0.015);
  transition: transform 220ms var(--ease), border-color 280ms ease;
}

.worldline-composition::before {
  background: linear-gradient(90deg, var(--white), var(--signal));
}

.worldline-composition::after {
  background: var(--signal);
}

.visual-axis {
  position: absolute;
  z-index: 1;
  opacity: 0.18;
  background: var(--signal);
}

.axis-x { top: 50%; left: 6%; right: 6%; height: 1px; }
.axis-y { left: 50%; top: 6%; bottom: 6%; width: 1px; }

.observation-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(var(--signal-rgb),0.75);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 28px rgba(var(--signal-rgb),0.14);
}

.observation-reticle::before,
.observation-reticle::after {
  content: "";
  position: absolute;
  background: var(--signal);
}

.observation-reticle::before { top: 50%; left: -11px; right: -11px; height: 1px; }
.observation-reticle::after { left: 50%; top: -11px; bottom: -11px; width: 1px; }

.observation-reticle span {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 16px rgba(var(--signal-rgb),0.8);
  animation: reticleBlink 2.4s ease-in-out infinite;
}

.incoming-mail {
  position: absolute;
  top: 20%;
  right: 3%;
  z-index: 5;
  display: grid;
  gap: 4px;
  width: min(54%, 250px);
  padding: 12px 14px;
  border: 1px solid rgba(var(--signal-rgb),0.58);
  color: rgba(242,239,230,0.55);
  background: rgba(5,5,5,0.78);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  transform: rotate(1.8deg);
  animation: mailInterference 7s steps(2,end) infinite;
}

.incoming-mail strong {
  color: var(--signal);
  font-size: 0.66rem;
}

.incoming-mail small {
  color: rgba(242,239,230,0.34);
}

.visual-index {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 5px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  color: rgba(242,239,230,0.32);
  font-family: var(--mono);
  font-size: 0.5rem;
}

.timeline-path {
  stroke: rgba(242,239,230,0.76);
  animation: pathFlow 16s linear infinite;
}

.branch-path,
.node.accent {
  stroke: rgba(var(--signal-rgb),0.66);
  fill: var(--signal);
}

.lab-stamp {
  border-color: rgba(var(--signal-rgb),0.54);
  color: rgba(var(--signal-rgb),0.72);
}

/* ---------- Profile / report ---------- */

.profile-verification {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  width: fit-content;
  margin-top: 28px;
  padding: 12px 16px;
  border-left: 6px solid var(--ink);
  background: rgba(0,0,0,0.07);
  font-family: var(--mono);
}

.profile-verification span {
  grid-row: span 2;
  align-self: center;
  color: rgba(17,17,17,0.55);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
}

.profile-verification strong {
  font-family: var(--serif);
  font-size: 1.5rem;
}

.profile-verification small {
  color: rgba(17,17,17,0.5);
  font-size: 0.62rem;
}

#profileWorldline {
  color: var(--teal);
}

/* ---------- Skill diagnostics ---------- */

.skill-card {
  isolation: isolate;
}

.skill-card::after {
  right: auto;
  width: calc((100% - 40px) * var(--level, 0.5));
  background:
    repeating-linear-gradient(90deg, var(--signal) 0 12px, transparent 12px 16px);
  box-shadow: 0 0 14px rgba(var(--signal-rgb),0.16);
  transition: width 900ms var(--ease);
}

.skill-card::before {
  border-color: rgba(var(--signal-rgb),0.13);
}

.skill-card h3::after {
  content: attr(data-level);
}

.skill-card .experiment-number::after {
  content: " / SIGNAL " attr(data-signal);
}

.skill-card:hover {
  background:
    linear-gradient(135deg, rgba(var(--signal-rgb),0.13), transparent 45%),
    rgba(0,0,0,0.28);
}

/* ---------- Project archive ---------- */

.project-card {
  overflow: hidden;
}

.project-card::after {
  content: "FILE";
  position: absolute;
  right: -16px;
  bottom: 32px;
  color: rgba(0,0,0,0.055);
  font-family: var(--serif);
  font-size: 6.4rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.project-card:hover::after {
  color: rgba(var(--signal-rgb),0.09);
}

.file-button {
  z-index: 2;
}

.file-button::before {
  content: "> ";
}

.project-dialog {
  width: min(calc(100% - 32px), 760px);
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 0;
  color: var(--white);
  background: transparent;
  overflow: visible;
}

.project-dialog::backdrop {
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(7px);
}

.project-dialog[open] {
  animation: dialogIn 320ms var(--ease);
}

.dialog-frame {
  position: relative;
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid rgba(var(--signal-rgb),0.72);
  background:
    linear-gradient(135deg, rgba(var(--signal-rgb),0.1), transparent 38%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255,255,255,0.02) 6px),
    #080808;
  box-shadow: inset 0 0 0 7px #080808, 0 0 0 8px rgba(var(--signal-rgb),0.16);
}

.dialog-frame::before {
  content: "TOP SECRET // DECRYPTED COPY";
  display: block;
  margin-bottom: 28px;
  padding: 8px 10px;
  border: 1px solid rgba(242,239,230,0.3);
  color: rgba(242,239,230,0.54);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(242,239,230,0.34);
  color: var(--white);
  background: rgba(0,0,0,0.5);
  font-size: 1.5rem;
  cursor: pointer;
}

.dialog-code,
.dialog-kicker {
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
}

.dialog-kicker {
  margin: 10px 0;
  color: rgba(242,239,230,0.4);
}

.dialog-frame h2 {
  margin: 12px 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
}

.dialog-frame > p:not(.dialog-kicker) {
  color: rgba(242,239,230,0.65);
  font-family: var(--mono);
  line-height: 1.8;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 30px;
  background: rgba(242,239,230,0.14);
  border: 1px solid rgba(242,239,230,0.14);
}

.dialog-grid > div {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #090909;
}

.dialog-grid span {
  color: rgba(242,239,230,0.36);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.dialog-grid strong {
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.dialog-log {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  color: rgba(242,239,230,0.38);
  font-family: var(--mono);
  font-size: 0.68rem;
}

/* ---------- Timeline attractor fields ---------- */

.timeline-map {
  overflow: visible;
}

.timeline-line {
  background: linear-gradient(to bottom, transparent, var(--signal) 12%, rgba(242,239,230,0.5) 48%, var(--signal) 85%, transparent);
  box-shadow: 0 0 18px rgba(var(--signal-rgb),0.14);
}

.timeline-node {
  border-color: rgba(242,239,230,0.48);
  transition: transform 220ms var(--ease), border-color 220ms ease, background 220ms ease;
}

.timeline-node:hover {
  transform: translateY(-5px);
  border-color: var(--signal);
  background:
    linear-gradient(135deg, rgba(var(--signal-rgb),0.12), transparent 45%),
    rgba(0,0,0,0.3);
}

.attractor-label {
  position: absolute;
  z-index: 0;
  color: rgba(var(--signal-rgb),0.28);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  pointer-events: none;
}

.attractor-alpha { top: 27%; left: 47%; transform: rotate(-18deg); }
.attractor-beta { top: 63%; left: 52%; transform: rotate(22deg); }

/* ---------- Contact terminal ---------- */

.terminal-readout b {
  color: var(--signal);
  font-weight: 400;
}

.signal-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 54px;
  margin-top: 16px;
  border: 1px solid rgba(0,0,0,0.18);
  overflow: hidden;
}

.signal-wave span {
  width: 4px;
  height: 12px;
  background: var(--ink);
  animation: signalWave 1.1s ease-in-out infinite;
}

.signal-wave span:nth-child(2) { animation-delay: -0.2s; }
.signal-wave span:nth-child(3) { animation-delay: -0.4s; }
.signal-wave span:nth-child(4) { animation-delay: -0.6s; }
.signal-wave span:nth-child(5) { animation-delay: -0.8s; }
.signal-wave span:nth-child(6) { animation-delay: -1s; }
.signal-wave span:nth-child(7) { animation-delay: -1.2s; }

.footer-signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-size: 0.6rem;
}

.footer-signal span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 9px rgba(var(--signal-rgb),0.75);
}

/* ---------- Scramble / interaction polish ---------- */

[data-scramble] {
  min-width: 1ch;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

/* ---------- Keyframes ---------- */

@keyframes bootScan {
  from { transform: translateY(-100%); }
  to { transform: translateY(560%); }
}

@keyframes bootLine {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.75); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes temporalFlash {
  0% { opacity: 0; transform: translateX(-3%); }
  12% { opacity: 0.8; }
  28% { opacity: 0.12; transform: translateX(2%); }
  42% { opacity: 0.65; }
  100% { opacity: 0; transform: translateX(0); }
}

@keyframes pageWorldlineShift {
  0% { filter: none; transform: translateX(0); }
  18% { filter: contrast(1.8) saturate(0); transform: translateX(6px); }
  32% { transform: translateX(-5px); }
  48% { filter: contrast(1.2); transform: translateX(2px); }
  100% { filter: none; transform: translateX(0); }
}

@keyframes meterScramble {
  0% { transform: translateX(0); filter: blur(0); }
  22% { transform: translateX(5px); filter: blur(1px); }
  44% { transform: translateX(-6px); }
  66% { transform: translateX(3px); filter: blur(0); }
  100% { transform: translateX(0); }
}

@keyframes reticleBlink {
  0%, 76%, 100% { opacity: 0.7; transform: scale(0.85); }
  80% { opacity: 0.15; transform: scale(1.5); }
  86% { opacity: 1; transform: scale(0.72); }
}

@keyframes mailInterference {
  0%, 86%, 100% { opacity: 0.72; transform: translate(0,0) rotate(1.8deg); }
  88% { opacity: 0.18; transform: translate(5px,-2px) rotate(1.8deg); }
  90% { opacity: 0.86; transform: translate(-3px,2px) rotate(1.8deg); }
}

@keyframes pathFlow {
  to { stroke-dashoffset: -90; }
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes signalWave {
  0%, 100% { height: 8px; opacity: 0.35; }
  50% { height: 34px; opacity: 0.9; }
}

/* ---------- Responsive V4 ---------- */

@media (max-width: 1180px) {
  .header-coordinates { display: none; }
  .title-annotation { display: none; }
  .hero { grid-template-columns: minmax(0,1fr) minmax(340px,0.72fr); }
}

@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { margin-top: 28px; }
  .worldline-composition { width: min(100%, 600px); }
  .section-header::after { display: none; }
}

@media (max-width: 820px) {
  :root { --header-height: 72px; }
  .site-header::after { display: none; }
  .brand-status { display: none; }
  .site-nav a::before { min-width: 18px; display: inline-block; }
  .section::after { display: none; }
  .attractor-label { display: none; }
  .lab-cursor { display: none; }
  body { cursor: auto; }
}

@media (max-width: 620px) {
  .hero { padding-top: calc(var(--header-height) + 64px); }
  .hero-title-index { left: 0; top: -22px; }
  .meter-card { margin-top: 34px; }
  .meter-readout { gap: 4px; }
  .meter-sign, .meter-unit { font-size: 0.75rem; }
  .meter-value { font-size: clamp(2.2rem, 13vw, 3.4rem); letter-spacing: 0; }
  .worldline-button span { display: none; }
  .incoming-mail { top: 18%; right: 4%; width: 62%; }
  .dialog-grid { grid-template-columns: 1fr; }
  .boot-brand { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-screen::after,
  .boot-log span,
  .brand-status i,
  .meter-signal i,
  .observation-reticle span,
  .incoming-mail,
  .timeline-path,
  .signal-wave span {
    animation: none !important;
  }

  .lab-cursor { display: none; }
}

/* V4 final QA patches */
.skill-signal {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  color: rgba(242,239,230,0.38);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.skill-card h3::after,
.skill-card .experiment-number::after {
  content: none;
}

.dialog-frame {
  max-height: calc(100svh - 32px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--signal) #080808;
}

.project-card.is-decrypting {
  animation: decryptPulse 420ms steps(2, end);
}

@keyframes decryptPulse {
  0% { filter: none; }
  35% { filter: contrast(1.55) invert(0.08); transform: translateX(3px); }
  70% { filter: contrast(1.2); transform: translateX(-2px); }
  100% { filter: none; transform: none; }
}


/* ==========================================================
   V5 project archive cleanup
   - curated CDA / personal projects
   - fixed card text/button overlap
   - responsive 2-column dossier layout
   ========================================================== */

.projects-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(18px, 2.5vw, 28px);
}

.project-card {
  display: flex;
  min-height: 390px;
  flex-direction: column;
  padding: clamp(22px, 3vw, 32px);
}

.project-card h3 {
  margin: clamp(28px, 4vw, 42px) 0 16px;
  font-size: clamp(2.15rem, 4.4vw, 4.35rem);
  line-height: 0.92;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.project-card p {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 62ch;
  padding-bottom: 24px;
  line-height: 1.78;
}

.project-card .file-button {
  position: relative;
  left: auto;
  bottom: auto;
  z-index: 3;
  align-self: flex-start;
  margin-top: auto;
}

.project-card::after {
  bottom: 10px;
  font-size: clamp(4.8rem, 9vw, 8.5rem);
}

.featured-project {
  min-height: 430px;
}

.projects-archive-link {
  display: flex;
  width: min(100%, var(--max-width));
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px auto 0;
  padding: 0 18px;
  border: 1px solid rgba(0,0,0,0.32);
  color: var(--ink);
  background: rgba(236, 232, 220, 0.56);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms var(--ease), background 180ms ease, color 180ms ease;
}

.projects-archive-link:hover,
.projects-archive-link:focus-visible {
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-3px);
}

.dialog-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.dialog-links a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--signal);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--ease);
}

.dialog-links a:hover,
.dialog-links a:focus-visible {
  color: #080808;
  background: var(--signal);
  transform: translateY(-2px);
}

.dialog-links a[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card,
  .featured-project {
    min-height: 340px;
  }
}

@media (max-width: 540px) {
  .project-card h3 {
    font-size: clamp(2rem, 12vw, 3.25rem);
  }

  .project-card,
  .featured-project {
    min-height: 0;
  }
}

/* Prevent decorative fixed layers from increasing the mobile scroll width. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.animated-lab-background,
.temporal-flash,
.blueprint-canvas {
  max-width: 100vw;
  contain: paint;
}

/* ==========================================================
   V7 - Recovered visual archives / project carousels
   Screens are extracted from the user's project reports.
   ========================================================== */

.project-card {
  min-height: 0;
  overflow: hidden;
}

.project-card > .file-meta,
.project-card > h3,
.project-card > p,
.project-card > .file-button,
.project-carousel,
.project-visual-placeholder {
  position: relative;
  z-index: 4;
}

.project-card h3 {
  margin-top: clamp(22px, 3vw, 34px);
}

.project-carousel {
  width: 100%;
  margin-top: 20px;
  user-select: none;
}

.project-carousel-header,
.dialog-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: rgba(17, 17, 17, 0.58);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-carousel-viewport,
.dialog-carousel-viewport {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.48);
  background:
    linear-gradient(135deg, rgba(156, 207, 216, 0.08), transparent 45%),
    #070707;
  box-shadow:
    inset 0 0 0 4px rgba(236, 232, 220, 0.08),
    5px 5px 0 rgba(0, 0, 0, 0.1);
  touch-action: pan-y;
}

.project-carousel-viewport {
  aspect-ratio: 16 / 9;
}

.project-carousel-track,
.dialog-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 520ms var(--ease);
  will-change: transform;
}

.project-slide,
.dialog-carousel-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(var(--signal-rgb), 0.08), transparent 55%),
    #080808;
}

.project-slide img,
.dialog-carousel-slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-position: center;
  filter: saturate(0.78) contrast(1.03) brightness(0.9);
  transition: transform 700ms var(--ease), filter 300ms ease;
}

.project-slide img[data-fit="cover"],
.dialog-carousel-slide img[data-fit="cover"] {
  object-fit: cover;
}

.project-slide img[data-fit="contain"],
.dialog-carousel-slide img[data-fit="contain"] {
  object-fit: contain;
  padding: 8px;
}

.project-card:hover .project-slide.is-active img,
.project-slide.is-active:focus-within img {
  transform: scale(1.018);
  filter: saturate(0.92) contrast(1.05) brightness(0.96);
}

.project-slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 48px 8px 12px;
  color: rgba(242, 239, 230, 0.82);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.46));
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.35;
}

.project-slide figcaption span {
  flex: 0 0 auto;
  color: var(--signal);
  letter-spacing: 0.1em;
}

.project-carousel-scan {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.22;
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255,255,255,0.035) 5px, transparent 6px),
    linear-gradient(90deg, transparent 0 48%, rgba(var(--signal-rgb),0.06) 50%, transparent 52%);
  mix-blend-mode: screen;
}

.carousel-control,
.dialog-carousel-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(242, 239, 230, 0.48);
  color: var(--white);
  background: rgba(5, 5, 5, 0.76);
  font-family: var(--mono);
  font-size: 1rem;
  transform: translateY(-50%);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.carousel-control:hover,
.carousel-control:focus-visible,
.dialog-carousel-control:hover,
.dialog-carousel-control:focus-visible {
  color: #070707;
  border-color: var(--signal);
  background: var(--signal);
  transform: translateY(-50%) scale(1.04);
}

.carousel-prev,
.dialog-carousel-prev {
  left: 9px;
}

.carousel-next,
.dialog-carousel-next {
  right: 9px;
}

.carousel-dots,
.dialog-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 24px;
  padding-top: 9px;
}

.carousel-dot,
.dialog-carousel-dot {
  width: 18px;
  height: 3px;
  padding: 0;
  border: 0;
  background: rgba(17, 17, 17, 0.24);
  cursor: pointer;
  transition: width 200ms var(--ease), background 200ms ease;
}

.carousel-dot.is-active,
.dialog-carousel-dot.is-active {
  width: 34px;
  background: var(--teal);
}

.project-visual-placeholder {
  display: grid;
  min-height: 220px;
  place-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 24px;
  border: 1px solid rgba(17, 17, 17, 0.44);
  color: rgba(17, 17, 17, 0.68);
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(17,17,17,0.045) 47% 53%, transparent 54%),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(17,17,17,0.035) 24px),
    rgba(236, 232, 220, 0.48);
  font-family: var(--mono);
  text-align: center;
}

.project-visual-placeholder span {
  color: var(--teal);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.project-visual-placeholder strong {
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  letter-spacing: 0.08em;
}

.project-visual-placeholder small {
  max-width: 38ch;
  font-size: 0.7rem;
  line-height: 1.6;
}

/* Large reconstructed gallery inside the decrypted dossier. */
.project-dialog {
  width: min(calc(100% - 24px), 1040px);
  max-height: calc(100svh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--signal) #080808;
}

.dialog-frame {
  min-height: 100%;
}

.dialog-carousel {
  margin: 26px 0 24px;
}

.dialog-carousel[hidden] {
  display: none;
}

.dialog-carousel-header {
  color: rgba(242, 239, 230, 0.5);
}

.dialog-carousel-header span:last-child {
  color: var(--signal);
}

.dialog-carousel-viewport {
  aspect-ratio: 16 / 9;
  border-color: rgba(var(--signal-rgb), 0.5);
  box-shadow:
    inset 0 0 0 5px #080808,
    0 0 0 1px rgba(242, 239, 230, 0.08);
}

.dialog-carousel-caption {
  min-height: 38px;
  padding: 10px 12px;
  border: solid rgba(242, 239, 230, 0.12);
  border-width: 0 1px 1px;
  color: rgba(242, 239, 230, 0.68);
  background: rgba(255,255,255,0.025);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
}

.dialog-carousel-dot {
  background: rgba(242, 239, 230, 0.22);
}

.dialog-carousel-dot.is-active {
  background: var(--signal);
}

@media (max-width: 900px) {
  .project-card,
  .featured-project {
    min-height: 0;
  }

  .project-carousel-header span:first-child {
    max-width: 70%;
  }
}

@media (max-width: 620px) {
  .project-carousel-viewport {
    aspect-ratio: 4 / 3;
  }

  .project-slide figcaption {
    min-height: 34px;
    padding: 6px 42px 6px 9px;
    font-size: 0.56rem;
  }

  .project-slide figcaption span {
    display: none;
  }

  .carousel-control,
  .dialog-carousel-control {
    width: 34px;
    height: 34px;
  }

  .dialog-carousel-viewport {
    aspect-ratio: 4 / 3;
  }

  .dialog-frame {
    padding: 24px 16px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-carousel-track,
  .dialog-carousel-track,
  .project-slide img,
  .carousel-control,
  .dialog-carousel-control {
    transition: none !important;
  }
}

/* V8 - Final project gallery layout */
.project-card .project-carousel {
  flex: 0 0 auto;
}

.project-card .file-button {
  margin-top: 20px;
}

.creative-project {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  grid-template-areas:
    "meta meta"
    "title visual"
    "copy visual"
    "button visual";
  column-gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.creative-project .file-meta { grid-area: meta; }
.creative-project h3 { grid-area: title; }
.creative-project > p { grid-area: copy; }
.creative-project .project-visual-placeholder {
  grid-area: visual;
  align-self: stretch;
  min-height: 100%;
  margin-top: 24px;
}
.creative-project .file-button {
  grid-area: button;
  justify-self: start;
  margin-top: 0;
}

@media (max-width: 900px) {
  .creative-project {
    grid-column: auto;
    display: flex;
  }

  .creative-project .project-visual-placeholder {
    min-height: 220px;
    margin-top: 20px;
  }

  .creative-project .file-button {
    margin-top: 20px;
  }
}

/* V9 — reliable carousel controls + mounted Blender archive */
.project-carousel-viewport:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

.carousel-control,
.carousel-dot {
  pointer-events: auto;
}

.carousel-control {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.creative-project .project-carousel {
  grid-area: visual;
  align-self: start;
  min-width: 0;
  margin-top: 24px;
}

.creative-project .blender-carousel .project-carousel-viewport {
  aspect-ratio: 16 / 10;
}

.creative-project .blender-carousel .project-slide img[data-fit="contain"] {
  padding: 0;
  background: #d7d7d7;
}

@media (max-width: 900px) {
  .creative-project .project-carousel {
    width: 100%;
    margin-top: 20px;
  }
}

/* ==========================================================
   V10 — stable Career / Contact dossiers + dialog gallery
   These rules intentionally live at the end of the stylesheet so
   later project-gallery patches cannot flatten the layout again.
   ========================================================== */

/* ---------- Career archive ---------- */
.career-overview {
  width: min(100%, var(--max-width));
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 38px);
  align-items: start;
}

.career-track {
  position: relative;
  min-width: 0;
  padding: clamp(22px, 3.2vw, 36px);
  border: 1px solid rgba(242, 239, 230, 0.38);
  background:
    linear-gradient(135deg, rgba(var(--signal-rgb), 0.075), transparent 42%),
    rgba(6, 6, 6, 0.72);
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.018),
    10px 10px 0 rgba(var(--signal-rgb), 0.055);
  overflow: hidden;
}

.career-track::before {
  content: attr(data-field);
  position: absolute;
  top: -0.18em;
  right: 0.12em;
  color: rgba(var(--signal-rgb), 0.06);
  font-family: var(--serif);
  font-size: clamp(8rem, 18vw, 15rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.career-track::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(242, 239, 230, 0.08);
  pointer-events: none;
}

.career-track-header,
.career-record,
.career-objective {
  position: relative;
  z-index: 2;
}

.career-track-header {
  padding-bottom: 22px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(242, 239, 230, 0.22);
}

.career-track-header > span {
  display: block;
  margin-bottom: 10px;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.career-track-header h3 {
  margin: 0;
  color: var(--white);
  font-family: var(--serif);
  font-size: clamp(2rem, 3.2vw, 3.35rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.career-record {
  position: relative;
  padding: 24px 0 24px 28px;
  border-bottom: 1px dashed rgba(242, 239, 230, 0.18);
}

.career-record::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 2px;
  width: 9px;
  height: 9px;
  border: 2px solid #070707;
  background: rgba(242, 239, 230, 0.72);
  box-shadow: 0 0 0 1px rgba(242, 239, 230, 0.38);
  transform: rotate(45deg);
}

.career-record::after {
  content: "";
  position: absolute;
  top: 43px;
  bottom: -1px;
  left: 6px;
  width: 1px;
  background: linear-gradient(rgba(var(--signal-rgb), 0.45), rgba(242, 239, 230, 0.05));
}

.career-record.is-current::before {
  background: var(--signal);
  box-shadow: 0 0 0 1px var(--signal), 0 0 18px rgba(var(--signal-rgb), 0.42);
}

.career-record:last-of-type::after {
  display: none;
}

.career-record-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  color: rgba(242, 239, 230, 0.48);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.career-record-meta span:last-child {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid rgba(var(--signal-rgb), 0.35);
  color: var(--signal);
}

.career-record h4 {
  margin: 0 0 8px;
  color: var(--white);
  font-family: var(--serif);
  font-size: clamp(1.42rem, 2.35vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.career-record p {
  margin: 0;
  color: rgba(242, 239, 230, 0.62);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.72;
}

.career-record .career-place {
  margin-bottom: 10px;
  color: rgba(242, 239, 230, 0.88);
  font-size: 0.72rem;
}

.career-objective {
  display: grid;
  gap: 7px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(var(--signal-rgb), 0.54);
  background:
    repeating-linear-gradient(-45deg, rgba(var(--signal-rgb), 0.055) 0 6px, transparent 6px 12px),
    rgba(var(--signal-rgb), 0.045);
}

.career-objective span,
.career-objective small {
  color: rgba(242, 239, 230, 0.5);
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.career-objective strong {
  color: var(--white);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.05;
}

/* ---------- Contact external channels ---------- */
.contact-layout {
  align-items: stretch;
}

.social-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
  padding: clamp(24px, 3.2vw, 36px);
  overflow: hidden;
}

.social-panel > * {
  position: relative;
  z-index: 2;
}

.social-panel h3 {
  margin: 0 0 22px;
}

.contact-identity,
.location-signal {
  display: grid;
  gap: 5px;
  padding: 15px 0;
  border-top: 1px solid rgba(17, 17, 17, 0.16);
  border-bottom: 1px dashed rgba(17, 17, 17, 0.22);
  font-family: var(--mono);
}

.contact-identity span,
.location-signal span {
  color: rgba(17, 17, 17, 0.5);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-identity strong,
.location-signal strong {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.contact-identity small,
.location-signal small {
  color: rgba(17, 17, 17, 0.62);
  font-size: 0.72rem;
  line-height: 1.5;
}

.social-panel > a,
.social-panel > .signal-link {
  display: block;
  width: 100%;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(17, 17, 17, 0.24);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.social-panel > .signal-link {
  color: rgba(17, 17, 17, 0.72);
}

.location-signal {
  margin-top: 4px;
  border-top: 0;
}

.social-panel .terminal-readout {
  width: 100%;
  margin-top: 22px;
  padding: 17px 18px;
  overflow: hidden;
}

.social-panel .terminal-readout span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.signal-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 46px;
  margin-top: 14px;
  border: 1px solid rgba(17, 17, 17, 0.16);
}

.signal-wave span {
  width: 3px;
  height: 10px;
  background: rgba(17, 17, 17, 0.58);
  animation: signalBar 1.2s ease-in-out infinite alternate;
}

.signal-wave span:nth-child(2),
.signal-wave span:nth-child(6) { height: 20px; animation-delay: -0.35s; }
.signal-wave span:nth-child(3),
.signal-wave span:nth-child(5) { height: 29px; animation-delay: -0.7s; }
.signal-wave span:nth-child(4) { height: 36px; animation-delay: -1s; }

@keyframes signalBar {
  to { transform: scaleY(0.45); opacity: 0.45; }
}

/* ---------- Enlarged project carousel ---------- */
.project-dialog[open] {
  display: block;
}

.dialog-carousel,
.dialog-carousel-viewport,
.dialog-carousel-track,
.dialog-carousel-slide {
  min-width: 0;
}

.dialog-carousel-viewport {
  isolation: isolate;
}

.dialog-carousel-track {
  position: relative;
  z-index: 1;
}

.dialog-carousel-control {
  z-index: 20;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.dialog-carousel-dots {
  position: relative;
  z-index: 20;
  pointer-events: auto;
}

.dialog-carousel-dot {
  pointer-events: auto;
  touch-action: manipulation;
}

.dialog-carousel-scan,
.project-carousel-scan {
  pointer-events: none !important;
}

@media (max-width: 980px) {
  .career-overview {
    grid-template-columns: 1fr;
  }

  .career-track {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .career-track {
    padding: 20px 16px;
  }

  .career-record {
    padding-left: 24px;
  }

  .career-record-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .social-panel {
    padding: 22px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signal-wave span {
    animation: none !important;
  }
}
