/* Theme tokens */
:root {
  --bg: #f0eee7;
  --paper: #f8f6ef;
  --ink: #252622;
  --muted: #676960;
  --line: #c9c8bb;
  --accent: #87643c;
  --signal: #9b743e;
  --shadow: #77705f20;
  --neon: #ae8aff;
  --cyan: #7be5ff;
  --max: 1280px;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: Arial, Helvetica, sans-serif;
  --glow: 0;
  --mx: 60%;
  --my: 40%;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #101117;
  --paper: #171820;
  --ink: #f2eff5;
  --muted: #a9a5b4;
  --line: #35343f;
  --accent: #c4a9ff;
  --signal: #b496ff;
  --shadow: #0006;
  --glow: 1;
  color-scheme: dark;
}
/* Base styles and shared components */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  overflow-x: hidden;
}
button,
a {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 5px;
}
::selection {
  background: #9a73e7;
  color: #fff;
}
.wrap {
  max-width: var(--max);
  width: calc(100% - 112px);
  margin: auto;
}
.mono {
  font: 11px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.label {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
}
.label:before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--glow) * 12px) var(--signal);
}
.section {
  position: relative;
  padding: 110px 0;
  border-top: 1px solid var(--line);
  isolation: isolate;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 45px;
}
.section h2 {
  font-size: clamp(39px, 6.1vw, 90px);
  letter-spacing: -0.075em;
  line-height: 0.98;
  margin: 13px 0 0;
  font-weight: 700;
}
.section-index {
  font: 12px var(--mono);
  color: var(--muted);
  white-space: nowrap;
}
.small {
  font-size: 13px;
  color: var(--muted);
}
.outline {
  color: transparent;
  -webkit-text-stroke: 1px var(--ink);
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 25px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 13px;
  font-weight: bold;
  transition:
    transform 0.2s,
    background 0.25s,
    color 0.25s;
  min-height: 48px;
}
.button:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.button.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.arrow {
  font-size: 18px;
  line-height: 1;
}
.skip {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 99;
  padding: 12px;
  background: var(--paper);
}
.skip:focus {
  top: 10px;
}
/* Header, language controls and physical lamp */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.nav {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 36px;
  padding-right: 128px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 44px;
  color: var(--ink);
}
.brand-mark { display: block; width: 46px; height: 46px; overflow: visible; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .brand-mark use { transition: translate .24s ease-out; }
  .brand:hover .brand-d { translate: 0 2px; }
  .brand:hover .brand-k { translate: 0 -2px; }
}
.brand-name {
  font: 700 11px/1 var(--sans);
  letter-spacing: .035em;
  text-transform: uppercase;
}
.brand-name span { display: block; margin-top: 2px; letter-spacing: .15em; }
nav {
  display: flex;
  gap: 24px;
  margin: auto;
  font: 11px var(--mono);
  text-transform: uppercase;
}
nav a:hover {
  color: var(--accent);
}
.languages {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 11px var(--mono);
  color: var(--muted);
}
.languages button {
  background: transparent;
  border: 0;
  padding: 6px 0;
  font: inherit;
  color: var(--muted);
}
.languages button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}
.lamp {
  position: absolute;
  top: 0;
  border: 0;
  background: none;
  touch-action: none;
  padding: 0;
  user-select: none;
  z-index: 12;
  width: 112px;
  height: 180px;
  right: max(18px, calc((100vw - var(--max)) / 2));
  --pull: 0px;
  overflow: visible;
  cursor: grab;
  filter: drop-shadow(0 2px 3px #0002);
}
.lamp svg {
  height: 100%;
  width: 100%;
  overflow: visible;
}
.lamp .glass {
  transition:
    fill 0.55s,
    stroke 0.55s;
  fill: url(#glassLit);
  stroke: #be9e6d;
}
.lamp .filament {
  transition: stroke 0.5s;
  stroke: #fff8d0;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px #ffb541);
}
.lamp .warm {
  opacity: 1;
  transition: opacity 0.38s;
}
.lamp .chain {
  transform: none;
  transform-origin: 84px 51px;
  transition: transform 0.25s;
}
.lamp.dragging .chain {
  transition: none;
}
.lamp.release .chain {
  animation: pendulum 0.7s ease-out;
}
[data-theme="dark"] .lamp .glass {
  fill: url(#glassDark);
  stroke: #68707c;
}
[data-theme="dark"] .lamp .filament {
  stroke: #827663;
  filter: none;
}
[data-theme="dark"] .lamp .warm {
  opacity: 0;
}
.lamp-hint {
  position: absolute;
  font: 11px var(--mono);
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
  top: 169px;
  right: max(18px, calc((100vw - var(--max)) / 2));
}
/* Hero and artwork */
@media (min-width: 691px) {
  .compact-lamp {
    --lamp-inset: max(56px, calc((100% - var(--max)) / 2));
  }
  .compact-lamp .nav { padding-right: 200px; }
  .compact-lamp .lamp {
    right: var(--lamp-inset);
    width: 48px;
    height: 64px;
  }
  .compact-lamp .lamp-hint {
    right: calc(var(--lamp-inset) + 52px);
    top: 50%;
    transform: translateY(-50%);
  }
}
.hero {
  position: relative;
  isolation: isolate;
  min-height: min(780px, calc(100svh - 70px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(24px, 5vh, 48px) 0 30px;
}
.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, transparent 49px, var(--line) 50px, transparent 51px),
    linear-gradient(transparent 49px, var(--line) 50px, transparent 51px);
  background-size: 50px 50px;
  opacity: 0.25;
  mask-image: linear-gradient(90deg, transparent 18%, #000 100%);
}
.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -4;
  background: radial-gradient(ellipse at 78% 9%, #fff2bd9c, transparent 58%);
  transition: opacity 0.7s;
}
[data-theme="dark"] .hero:after {
  opacity: 0;
}
.night-ambient {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0;
  background:
    radial-gradient(ellipse at 76% 48%, #6836b533, transparent 48%),
    radial-gradient(ellipse at 99% 90%, #1b749b25, transparent 38%);
  transition: opacity 1.5s 0.3s;
  pointer-events: none;
}
[data-theme="dark"] .night-ambient {
  opacity: 1;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 0;
  flex: 1;
}
.hero-copy {
  position: relative;
  z-index: 2;
  align-self: start;
  padding: 12px 0 32px;
}
.hero h1 {
  font-size: clamp(58px, 8.4vw, 132px);
  line-height: 0.86;
  letter-spacing: -0.083em;
  margin: 32px 0 30px;
  font-weight: 750;
}
.hero h1 span {
  display: block;
}
.hero h1 .outline {
  letter-spacing: -0.09em;
}
.hero h1.ru {
  font-size: clamp(42px, 5.9vw, 92px);
  letter-spacing: -0.075em;
}
/* Size the long Russian middle line independently of the two short lines. */
:root:not([data-debug="true"]) .hero h1.ru {
  font-size: clamp(54px, 8vw, 116px);
  line-height: 0.94;
  letter-spacing: -0.065em;
}
:root:not([data-debug="true"]) .hero h1.ru .outline {
  font-size: 0.81em;
  line-height: 1.06;
  letter-spacing: -0.055em;
  -webkit-text-stroke: 1.25px var(--ink);
}
.hero-name {
  font-size: 19px;
  font-weight: bold;
  margin: 0 0 10px;
}
.hero-desc {
  max-width: 460px;
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 26px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-art {
  position: relative;
  align-self: center;
  width: 100%;
  margin-left: -15px;
  aspect-ratio: 1/1;
  max-height: 650px;
}
.hero-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.solid {
  opacity: 1;
  transition: opacity 0.75s;
}
.wire {
  opacity: 0;
  transition: opacity 1.15s 0.23s;
}
.day-shadow {
  opacity: 0.28;
  transition: opacity 0.65s;
}
[data-theme="dark"] .solid,
[data-theme="dark"] .day-shadow {
  opacity: 0;
}
[data-theme="dark"] .wire {
  opacity: 1;
}
.wire .purple {
  stroke: #c5a7ff;
  filter: drop-shadow(0 0 4px #9c5bff) drop-shadow(0 0 11px #7b35ff);
}
.wire .blue {
  stroke: #b5f3ff;
  filter: drop-shadow(0 0 4px #58c9ff) drop-shadow(0 0 10px #2168ff);
}
.blueprint {
  stroke: var(--line);
  fill: none;
  stroke-width: 1;
}
.art-note {
  font: 11px var(--mono);
  fill: var(--muted);
  letter-spacing: 0.08em;
}
.secret {
  opacity: 0;
  transition: opacity 1.2s 0.35s;
  pointer-events: none;
}
[data-theme="dark"] .secret {
  opacity: 1;
}
.uv-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #d5b7ff;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  --mx: -500px;
  --my: -500px;
  mask-image: radial-gradient(
    circle 168px at var(--mx) var(--my),
    #000 28%,
    #000d 55%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    circle 168px at var(--mx) var(--my),
    #000 28%,
    #000d 55%,
    transparent 100%
  );
  background: radial-gradient(circle 156px at var(--mx) var(--my), #a64eff14, transparent 100%);
  z-index: 3;
  transition:
    opacity 0.18s,
    visibility 0.18s;
}
[data-theme="dark"] .uv-layer {
  opacity: 0;
  visibility: hidden;
}
.uv-text {
  position: absolute;
}
.work-uv {
  display: none;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  background: var(--paper);
  font: 12px/1.5 var(--mono);
}
[data-theme="dark"]:not([data-debug="true"]) .work-uv { display: block; }
.work-uv summary, .work-uv button { padding: 12px 14px; cursor: pointer; }
.work-uv-body { padding: 0 14px 6px; }
.work-uv p { margin: 0; color: var(--ink); }
.work-uv small { display: block; color: var(--accent); }
.work-uv button { background: none; border: 0; color: var(--accent); font: inherit; padding-left: 0; }
.hero-bottom {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 4;
}
.numbers {
  display: flex;
  gap: 36px;
}
.stat strong {
  font-size: 40px;
  letter-spacing: -0.08em;
  line-height: 1;
  display: block;
  margin-bottom: 5px;
}
.scroll {
  font: 10px var(--mono);
  color: var(--muted);
}
/* Portfolio sections */
.philosophy {
  padding: clamp(28px, 4vw, 56px) 0;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
}
.layer-count { margin-bottom: 12px; }
.philosophy h2 {
  margin: 0;
  font: 500 clamp(32px, 3.2vw, 40px)/1.12 var(--sans);
  letter-spacing: -.035em;
}
.philosophy p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.4;
}
.stack-toggle {
  width: min(100%, 335px);
  justify-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: manipulation;
}
.layer-stack { display: block; width: 100%; overflow: visible; }
.stack-toggle[aria-pressed="true"] { --fan: 1; }
.sheet-ui { translate: calc(-8px * var(--fan, 0)) calc(-15px * var(--fan, 0)); }
.sheet-logic { translate: calc(var(--sheet-shift, 0px) + 6px * var(--fan, 0)) 0; }
.sheet-code {
  translate: calc(var(--sheet-shift, 0px) + 8px * var(--fan, 0)) calc(15px * var(--fan, 0));
}
.sheet {
  color: var(--muted);
  stroke: currentColor;
  stroke-width: 1;
  stroke-linejoin: round;
  fill: var(--sheet-shade);
  --sheet-shade: color-mix(in srgb, var(--paper) 88%, var(--muted));
}
.sheet-edge { fill: color-mix(in srgb, var(--sheet-shade) 75%, currentColor); }
.sheet-guide { fill: none; stroke: var(--line); stroke-dasharray: 2 4; }
.sheet-detail { fill: none; stroke-width: 1.8; stroke-linecap: round; }
:root:not([data-theme="dark"]) .sheet-ui,
[data-theme="dark"]:not([data-debug="true"]) .sheet-logic,
[data-debug="true"] .sheet-code {
  color: var(--accent);
  stroke-width: 1.6;
  --sheet-shade: color-mix(in srgb, var(--paper) 60%, var(--accent));
}
.philosophy .alt, .philosophy .source,
[data-theme="dark"] .philosophy .normal { display: none; }
[data-theme="dark"]:not([data-debug="true"]) .philosophy .alt,
[data-debug="true"] .philosophy .source { display: block; }
#about { padding-block: clamp(36px, 5vw, 72px); }
#about .section-head { margin-bottom: clamp(18px, 2vw, 28px); }
#about h2 {
  margin: 0;
  font-size: clamp(32px, 3.2vw, 40px);
  letter-spacing: -.035em;
  line-height: 1.12;
  font-weight: 500;
}
.about-tenure { margin: 7px 0 0; color: var(--muted); }
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 60px;
}
.about-lead {
  font-size: clamp(26px, 3.4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.22;
  margin: 0;
}
.about-detail {
  font-size: 17px;
  color: var(--muted);
  margin: 0;
}
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  margin-top: 30px;
}
.principle {
  padding: 22px 20px 0 0;
}
.principle + .principle {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.principle h3 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -0.04em;
}
.principle p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
#work {
  padding-top: clamp(36px, 4.5vw, 64px);
  padding-bottom: clamp(32px, 4vw, 56px);
}
#work .section-head { margin-bottom: 20px; }
#work .section-head h2 { font-size: clamp(39px, 5vw, 72px); margin-top: 0; }
#work .section-head p { margin: 12px 0 0; }
.work-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: fit-content;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.work-tabs button {
  min-height: 44px;
  padding: 8px 20px;
  border: 0;
  background: transparent;
}
.work-tabs button:focus-visible { z-index: 1; }
.live-sites:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.live-sites .live-card:first-child { grid-column: 1 / -1; }
.live-sites .live-card:not(:first-child) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.live-card:not(:first-child) .live-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}
.live-card:not(:first-child) .project-address { margin-top: auto; }
.work-tabs [aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.live-sites a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: clamp(18px, 3vw, 36px) 8px;
  border-top: 1px solid var(--line);
}
.live-sites a:last-child { border-bottom: 1px solid var(--line); }
.live-sites strong { font-size: clamp(28px, 4vw, 52px); letter-spacing: -0.055em; }
.live-sites span { grid-column: 1; color: var(--muted); }
.live-sites i { grid-column: 2; grid-row: 1 / 3; font: 26px var(--sans); }
.live-sites a:hover { color: var(--accent); background: var(--paper); }
.live-sites .live-card {
  grid-template-columns: 1.7fr 1fr;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}
.healbe-preview {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1440 / 735;
  width: 100%;
  align-self: center;
}
.healbe-preview img, .healbe-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.healbe-overlay {
  background: linear-gradient(145deg, #497fca80, transparent 69%);
}
.healbe-copy {
  position: absolute;
  left: 4.7%;
  top: 30%;
  color: white;
}
.healbe-copy b {
  display: block;
  font: 600 4.3cqw/1.1 var(--sans);
  letter-spacing: -0.035em;
}
.healbe-copy small {
  display: table;
  margin-top: 4cqw;
  padding: 1.1cqw 2cqw;
  border-radius: 2em;
  background: #425a7d;
  font: 500 1.8cqw var(--sans);
}
.live-info { padding: clamp(16px, 2.5vw, 34px); }
.live-info strong { display: block; line-height: 1.15; margin-top: 6px; }
.live-info p { color: var(--muted); margin: 10px 0 18px; }
.healbe-preview img { transition: filter .55s; }
[data-theme="dark"] .healbe-preview img { filter: saturate(.5) brightness(.62); }
.tea-preview { position: relative; container-type: inline-size; }
.tea-preview img { width: 100%; height: auto; display: block; }
.project-layer {
  display: none;
  gap: 6px;
  padding: 14px 5%;
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--accent);
}
.project-layer b { color: var(--accent); font: 600 14px/1.4 var(--mono); }
.project-layer p { margin: 0; font: 14px/1.45 var(--sans); }
.project-layer code { border-left: 1px solid var(--accent); padding-left: 10px; font: 12px/1.5 var(--mono); }
[data-theme="dark"]:not([data-debug="true"]) .project-logic,
[data-debug="true"] .project-data { display: grid; }
.night-diagram {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: none;
  stroke: #e1d8ff;
  stroke-width: 1.15;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px #14111f);
}
[data-theme="dark"]:not([data-debug="true"]) .night-diagram { display: block; }
.night-diagram circle { fill: #282238; }
@media (max-width: 690px) {
  .work-tabs { width: 100%; }
  .live-sites:not([hidden]), .live-sites .live-card { grid-template-columns: 1fr; }
  .healbe-copy small { font-size: max(10px, 1.8cqw); }
}
.paleo-preview { position: relative; color: #fff; }
.paleo-preview img { display: block; width: 100%; height: auto; }
.paleo-caption, .paleo-timeline { display: none; position: absolute; }
[data-theme="dark"] .paleo-caption {
  display: grid;
  left: 3%;
  top: 32%;
  padding-left: 7px;
  border-left: 1px solid var(--accent);
  text-shadow: 0 1px 3px #000;
}
.paleo-caption small { font: 10px/1.5 var(--mono); }
@media (max-width: 690px) {
  .paleo-caption small { font-size: 11px; }
}
.paleo-caption b { font-size: 15px; }
[data-debug="true"] .paleo-caption { display: none; }
[data-debug="true"] .paleo-timeline {
  display: block;
  inset: auto 3% 3%;
  color: var(--accent);
  font: 11px/1.2 var(--mono);
  text-shadow: 0 1px 3px #000;
}
.paleo-track {
  position: relative;
  margin-top: 4px;
  height: 5px;
  border-bottom: 1px solid currentColor;
  background: repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 10%);
}
.paleo-track time {
  position: absolute;
  left: 69.81%; /* 7 seconds into the 10.027-second clip */
  bottom: 0;
  padding: 0 0 6px 4px;
  border-left: 2px solid currentColor;
  font-weight: bold;
}
.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.project {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  transition:
    background 0.65s,
    border 0.5s;
  overflow: hidden;
}
.project:first-child {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
}
.project-visual {
  position: relative;
  min-height: 280px;
  aspect-ratio: 1.6;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  background: var(--visual, #dedbd2);
}
.project:first-child .project-visual {
  aspect-ratio: 1.45;
}
.project-visual:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, #ffffff50, transparent 70%);
  z-index: -1;
}
.forma-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.forma-media { min-width: 0; }
.forma-media .forma-visual { width: 100%; }
.forma-focus, .forma-coordinates { display: none; }
[data-theme="dark"] .forma-focus { display: inline; color: #efdeff; }
.forma-crop { fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
[data-debug="true"] .forma-focus { color: #81f5cf; }
[data-debug="true"] .forma-crop { display: none; }
[data-debug="true"] .forma-coordinates { display: inline; font: 24px var(--mono); }
.forma-photo {
  transition: filter 0.65s;
}
.forma-drawing {
  color: #e0c7ff;
  opacity: 0;
  stroke-width: 1.4;
  transition: opacity 0.65s, color 0.45s;
}
.forma-axes {
  stroke-width: 1;
  opacity: 0.75;
}
[data-theme="dark"] .forma-photo {
  filter: grayscale(0.8) brightness(0.55);
}
[data-debug="true"] .forma-drawing {
  opacity: 1;
}
[data-debug="true"] .forma-photo {
  filter: grayscale(1) brightness(0.35);
}
[data-debug="true"] .forma-drawing {
  color: #81f5cf;
}
.project .mock {
  width: 78%;
  background: #fcfaf4;
  color: #242621;
  box-shadow: 0 22px 50px #29261d30;
  transition:
    transform 0.8s,
    opacity 0.8s;
  transform: rotate(-3deg);
  border-radius: 5px;
  overflow: hidden;
  font: 10px var(--sans);
}
.mock-top {
  height: 19px;
  background: #d5d4cd;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
}
.mock-top i {
  height: 4px;
  width: 4px;
  border-radius: 50%;
  background: #9f9f99;
}
.mock-body {
  padding: 17px;
  min-height: 150px;
}
.mock-nav {
  font: 8px var(--mono);
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}
.mock-title {
  font-size: clamp(19px, 3vw, 42px);
  font-weight: bold;
  letter-spacing: -0.06em;
  line-height: 0.95;
}
.mock-bars {
  display: flex;
  gap: 5px;
  margin-top: 17px;
}
.mock-bars i {
  display: block;
  width: 26%;
  height: 30px;
  background: #a7ad97;
}
.mock-bars i:nth-child(2) {
  background: #d7c6aa;
}
.mock-bars i:nth-child(3) {
  background: #797e73;
}
.project-visual.mono-visual {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  --chart-ink: #244bb5;
  background: #e9edf5;
  color: #35445c;
}
.mono-chart {
  width: 100%;
  height: 100%;
  font: 13px var(--mono);
  fill: currentColor;
}
.chart-heading {
  font: 600 22px var(--sans);
  letter-spacing: -0.04em;
}
.chart-rules {
  stroke: currentColor;
  opacity: 0.23;
}
.chart-area {
  fill: var(--chart-ink);
  opacity: 0.09;
}
.chart-line, .chart-point, .chart-guide {
  stroke: var(--chart-ink);
}
.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linejoin: round;
}
.chart-point {
  fill: var(--paper);
  stroke-width: 2.5;
}
.chart-guide, .chart-record, .chart-index {
  opacity: 0;
  transition: opacity 0.45s;
}
.chart-guide {
  stroke-dasharray: 3 3;
}
.chart-record rect {
  fill: var(--chart-ink);
}
.chart-record text {
  fill: #161823;
  font-weight: bold;
}
[data-theme="dark"] .mono-visual {
  --chart-ink: var(--accent);
  color: #d8cfea;
  background: #1b1826;
}
[data-theme="dark"] .chart-guide,
[data-theme="dark"] .chart-record,
[data-debug="true"] .chart-index {
  opacity: 1;
}
.chart-record text, .chart-index, .chart-month, .chart-scale { font-size: 17px; }
[data-debug="true"] .mono-visual {
  background: #0b181a;
  color: var(--accent);
}
.project-visual.offset-visual {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  --spread-paper: #f4eddf;
  --spread-ink: #25231f;
  --plate-ink: #ba4933;
  background: #d9d0c2;
}
.offset-spread {
  width: 100%;
  height: 100%;
  font: 11px var(--mono);
}
.offset-sheet, .offset-glyph {
  fill: var(--spread-paper);
}
.offset-print {
  fill: var(--spread-ink);
}
.offset-rule {
  stroke: var(--spread-ink);
}
.offset-headline {
  font: 57px Georgia, serif;
  letter-spacing: -0.055em;
}
.offset-ink {
  fill: var(--plate-ink);
}
.offset-glyph {
  font: italic 290px Georgia, serif;
}
.offset-guides, .offset-source {
  opacity: 0;
  transition: opacity 0.55s;
}
.offset-guides {
  fill: none;
  stroke: var(--accent);
}
.offset-columns {
  stroke-dasharray: 3 4;
  opacity: 0.6;
}
.offset-source {
  fill: var(--accent);
}
[data-theme="dark"] .offset-visual {
  --spread-paper: #211d2b;
  --spread-ink: #cec3d7;
  --plate-ink: #7c658b;
  background: #15121b;
}
[data-theme="dark"] .offset-guides,
[data-debug="true"] .offset-source {
  opacity: 1;
}
[data-debug="true"] .offset-visual {
  --spread-paper: #102323;
  --spread-ink: #acc7bf;
  --plate-ink: #436c62;
  background: #091817;
}
.offset-grid-labels, .offset-source { font: 17px var(--mono); fill: var(--accent); }
.offset-grid-labels { display: none; }
[data-theme="dark"]:not([data-debug="true"]) .offset-grid-labels { display: inline; }
#offset-fields { white-space: pre-wrap; overflow-wrap: anywhere; }
.offset-source rect { fill: var(--spread-paper); }
@media (max-width: 690px) {
  .offset-source, .chart-month, .chart-scale, .chart-index { font-size: 16px; }
  .forma-crop { x: -110px; y: -135px; width: 220px; height: 270px; }

}
.project-info {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.project-info h3 {
  font-size: clamp(24px, 3.2vw, 40px);
  letter-spacing: -0.055em;
  line-height: 1.08;
  margin: 11px 0;
}
@media (min-width: 1101px) {
  [data-theme="dark"]:not([data-debug="true"]) .project:not(:first-child) {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
  [data-theme="dark"]:not([data-debug="true"]) .project:not(:first-child) .project-info {
    justify-content: flex-start;
  }
  [data-theme="dark"]:not([data-debug="true"]) .project:not(:first-child) .project-logic {
    align-content: start;
  }
}
.project-info p {
  color: var(--muted);
  font-size: 15px;
  margin: 8px 0 18px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tags span {
  font: 10px var(--mono);
  padding: 5px 8px;
  border: 1px solid var(--line);
}
.architecture {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 1s 0.25s;
  pointer-events: none;
  background: radial-gradient(ellipse, #3d235a55, transparent 70%);
}
.arch-stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 65%;
  transform: rotate(-6deg);
}
.arch-stack div {
  border: 1px solid #bd98ff;
  background: #1b152be8;
  box-shadow: 0 0 16px #a46dff30;
  color: #d3bcff;
  padding: 11px 13px;
  font: 11px var(--mono);
  position: relative;
}
.arch-stack div:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  height: 14px;
  border-left: 1px dashed #a98bde;
}
.arch-stack div:last-child:after {
  display: none;
}
.arch-caption {
  position: absolute;
  bottom: 11px;
  left: 14px;
  font: 9px var(--mono);
  color: #bca6e4;
}
.project .engineering {
  display: none;
  color: var(--accent);
  font: 11px/1.5 var(--mono);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 18px;
}
[data-theme="dark"] .project-visual {
  background: #13131e;
}
[data-theme="dark"] .project .mock {
  transform: translateY(-42px) scale(0.8) rotate(-3deg);
  opacity: 0.13;
}
[data-theme="dark"] .architecture {
  opacity: 1;
}
[data-theme="dark"] .project .engineering {
  display: block;
}
.demo-note {
  margin-top: 18px;
}
/* Experience, skills and contact */
.experience-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 45px;
}
.exp-total {
  font-size: clamp(80px, 13vw, 180px);
  line-height: 0.8;
  letter-spacing: -0.1em;
  font-weight: bold;
}
#experience { padding-block: clamp(32px, 4vw, 56px); }
#experience .section-head { margin-bottom: 24px; }
#experience h2 {
  margin: 0;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -.055em;
}
.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  column-gap: clamp(24px, 4vw, 64px);
  align-items: baseline;
  padding-block: 20px;
}
.timeline-item + .timeline-item { border-top: 1px solid var(--line); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item h3 {
  font-size: clamp(21px, 2vw, 26px);
  line-height: 1.2;
  letter-spacing: -.04em;
  margin: 0;
}
.timeline-item p {
  color: var(--muted);
  margin: 0;
  max-width: 62ch;
}
@media (max-width: 690px) {
  #experience .section-head { margin-bottom: 8px; }
  .timeline-item { grid-template-columns: 1fr; row-gap: 8px; }
}
.experience-measure {
  position: relative;
  max-width: 560px;
  margin: 14px 0;
}
.experience-measure meter {
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  background: var(--line);
  border: 0;
}
.experience-measure meter::-webkit-meter-bar {
  background: var(--line);
  border: 0;
  border-radius: 0;
}
.experience-measure meter::-webkit-meter-optimum-value { background: var(--accent); }
.experience-measure meter::-moz-meter-bar { background: var(--accent); }
[data-theme="dark"] .experience-measure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to right, transparent 0 calc(12.5% - 2px), var(--bg) calc(12.5% - 2px) 12.5%);
  pointer-events: none;
}
#skills { padding-block: clamp(32px, 4vw, 56px); }
#skills .section-head { margin-bottom: 18px; }
#skills h2 { font-size: clamp(36px, 4.4vw, 56px); margin-top: 0; }
#skills .section-head p { max-width: 70ch; margin: 12px 0 0; }
.skill-hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.skill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 20px;
  gap: 8px;
  font: 15px/1.45 var(--sans);
}
.skill-category { color: var(--muted); }
.skill strong { font-size: 25px; line-height: 1.15; letter-spacing: -.045em; }
.skill.related { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.skill[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.skill[aria-pressed="true"] .skill-category { color: inherit; }
.skill-connection { margin-top: 4px; padding-top: 8px; border-top: 1px solid currentColor; font-weight: 600; }
.section.contact { padding-block: clamp(36px, 5vw, 64px); }
.contact .section-head { margin-bottom: 14px; }
.contact h2 {
  margin: 0;
  font-size: clamp(53px, 9vw, 130px);
  line-height: .96;
  letter-spacing: -.075em;
}
.contact-copy { margin-top: 24px; }
.contact-copy p { color: var(--muted); max-width: 54ch; margin: 0; }
.contact-methods { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 20px; }
.contact-methods a { text-decoration: underline; text-underline-offset: .2em; }
footer {
  padding: 22px 0 32px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
}
.footer-btn {
  border: 1px solid var(--line);
  background: none;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  min-height: 44px;
  text-align: left;
}
.footer-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.debug-panel {
  position: fixed;
  z-index: 30;
  display: none;
  bottom: 20px;
  right: 20px;
  width: 306px;
  max-width: calc(100vw - 40px);
  background: #10201ff5;
  color: #bcdfd4;
  border: 1px solid #41675b;
  border-radius: 8px;
  box-shadow: 0 16px 40px #0005;
  padding: 12px 15px;
  font: 10px/1.4 var(--mono);
  backdrop-filter: blur(12px);
}
[data-debug="true"] .debug-panel {
  display: block;
  animation: sourceIn 0.3s ease-out;
}
.debug-panel button {
  display: block;
  background: none;
  color: inherit;
  border: 1px solid #488363;
  padding: 4px 8px;
  margin-top: 6px;
  font: inherit;
}
.lamp svg,
.lamp svg * {
  pointer-events: none;
}
.lamp:active,
.lamp.dragging {
  cursor: grabbing;
}
.lamp .chain-beads {
  transform-origin: 84px 51px;
  transform: scaleY(var(--stretch, 1));
  transition: transform 0.16s;
}
.lamp .chain-tip {
  transform: translateY(var(--pull, 0px));
  transition: transform 0.16s;
}
.lamp.dragging .chain-beads,
.lamp.dragging .chain-tip {
  transition: none;
}
.lamp.release .chain-tip {
  animation: recoil 0.44s ease-out;
}
.lamp.release .chain-beads {
  animation: stretch 0.44s ease-out;
}
@keyframes pendulum {
  20% {
    transform: rotate(-3deg);
  }
  48% {
    transform: rotate(2deg);
  }
  75% {
    transform: rotate(-0.8deg);
  }
  100% {
    transform: rotate(0);
  }
}
@keyframes recoil {
  0% {
    transform: translateY(11px);
  }
  35% {
    transform: translateY(-4px);
  }
  65% {
    transform: translateY(2px);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes stretch {
  0% {
    transform: scaleY(1.11);
  }
  35% {
    transform: scaleY(0.96);
  }
  65% {
    transform: scaleY(1.02);
  }
  100% {
    transform: scaleY(1);
  }
}
[data-theme="dark"] .lamp .lead {
  stroke: #6a6b72;
}
[data-theme="dark"] .lamp .chain-beads {
  stroke: #a5a5a7;
}
/* Source mode */
.source-visual,
.source-status,
.source-meta {
  display: none;
}
:root[data-debug="true"] {
  --bg: #0b1416;
  --paper: #101e20;
  --ink: #e0eee9;
  --muted: #94ada8;
  --line: #28403e;
  --accent: #94e9cb;
  --signal: #71f4c4;
  --glow: 0;
  --shadow: #0005;
  color-scheme: dark;
}
[data-debug="true"] .hero:before {
  opacity: 0.75;
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent 5%, #000 70%);
}
[data-debug="true"] .night-ambient {
  background: radial-gradient(ellipse at 76% 48%, #155a4b33, transparent 57%);
  opacity: 1;
}
[data-debug="true"] .model-drawing,
[data-debug="true"] .model-toggle {
  display: none;
}
[data-debug="true"] .hero-art {
  aspect-ratio: auto;
  max-height: none;
  margin: 14px auto;
}
[data-debug="true"] .source-visual {
  display: block;
  position: relative;
  padding: clamp(16px, 2.4vw, 28px);
  border: 1px solid #35534c;
  border-radius: 8px;
  background: #102121;
  box-shadow: 5px 5px 0 #091516;
  font-family: var(--mono);
  animation: sourceIn 0.4s ease-out;
}
[data-debug="true"] .source-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 10px var(--mono);
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 19px;
}
[data-debug="true"] .source-status i,
.source-dot {
  width: 7px;
  height: 7px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 12px #71f4c488;
}
.inspector-head code { font-size: 12px; color: var(--muted); }
.inspector-head h2 {
  margin: 6px 0 18px;
  font: 600 clamp(22px, 2.3vw, 32px)/1.12 var(--sans);
  letter-spacing: -.045em;
}
.inspector-picker { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.inspector-select { display: block; position: relative; }
.inspector-select::after {
  content: "";
  position: absolute; inset-inline-end: 17px; top: 50%;
  width: 8px; height: 8px;
  border: solid var(--ink); border-width: 0 1.5px 1.5px 0;
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.inspector-select:has(select:open)::after { transform: translateY(-30%) rotate(225deg); }
.inspector-picker select {
  appearance: none; display: block; cursor: pointer;
  width: 100%; min-width: 0; min-height: 44px; padding: 6px 44px 6px 12px;
  border: 1px solid #426559; border-radius: 3px;
  background: var(--bg); color: var(--ink); font: 15px var(--sans);
}
.inspector-picker select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.inspector-layout {
  margin: 15px 0;
  background: #0c191a;
  border: 1px solid var(--line);
}
.inspector-layout svg {
  display: block; width: 100%; height: auto; overflow: hidden;
  background: radial-gradient(circle, #2c423c .7px, transparent 1px) center / 12px 12px;
}
.layout-box { fill: #142a26; stroke: #577d70; }
.layout-media { fill: url(#media-hatch); stroke: #83baca; }
.layout-box, .layout-media { stroke-width: .85; vector-effect: non-scaling-stroke; }
.layout-text { fill: #83a99b; }
.layout-heading { fill: #b4edda; }
#layout-shapes rect { cursor: pointer; }
.inspector-layout:is([data-highlight="text"], [data-highlight="media"], [data-highlight="box"]) #layout-shapes rect { opacity: .34; }
.inspector-layout[data-highlight="text"] #layout-shapes :is(.layout-text, .layout-heading) { opacity: 1; fill: #b8ffe7; }
.inspector-layout[data-highlight="media"] #layout-shapes .layout-media,
.inspector-layout[data-highlight="box"] #layout-shapes .layout-box { opacity: 1; stroke: var(--accent); stroke-width: 1.6; }
.inspector-layout[data-highlight="box"] .layout-box { fill: #204339; }
@media (prefers-reduced-motion: no-preference) {
  #layout-shapes rect { transition: opacity .16s ease, fill .16s ease, stroke .16s ease; }
}
.inspector-layout figcaption {
  display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 3px 5px;
  border-top: 1px solid var(--line); color: var(--muted);
  font: 12px/1.4 var(--sans);
}
.inspector-layout button {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px;
  padding: 0 6px; border: 0; border-radius: 3px; background: transparent;
  color: inherit; font: inherit; cursor: pointer;
}
.inspector-layout button.is-highlighted { color: var(--accent); background: #19372f; }
.inspector-layout button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.inspector-layout button:disabled { opacity: .5; cursor: default; }
.inspector-layout button::before { content: ""; width: 10px; height: 7px; }
.inspector-layout [data-kind="text"]::before { background: linear-gradient(#a5dbc7 0 40%, transparent 40% 65%, #a5dbc7 65%); }
.inspector-layout [data-kind="media"]::before { background: repeating-linear-gradient(135deg, #83baca 0 1px, transparent 1px 3px); }
.inspector-layout [data-kind="box"]::before { border: 1px solid #598678; }
@media (pointer: coarse) {
  .inspector-layout button { min-height: 44px; }
  #layout-shapes [data-kind="text"] {
    stroke: transparent; stroke-width: 6px; vector-effect: non-scaling-stroke;
  }
}
.inspector-details {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
  color: var(--accent); font: 13px/1.5 var(--mono);
}
.inspector-details span { color: var(--muted); }
#inspector-jump {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: underline; text-underline-offset: 4px; font: 14px var(--sans);
}
@keyframes sourceIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
[data-debug="true"] .hero h1 {
  font-family: var(--mono);
  font-size: clamp(45px, 7vw, 105px);
  letter-spacing: -0.085em;
}
[data-debug="true"] .hero h1.ru {
  font-size: clamp(37px, 6vw, 88px);
}
[data-debug="true"] .hero h1 .outline {
  color: var(--accent);
  -webkit-text-stroke: 0;
}
[data-debug="true"] .uv-layer {
  display: none;
}
[data-debug="true"] .section h2 {
  font-family: var(--mono);
  font-size: clamp(34px, 5.3vw, 76px);
}
[data-debug="true"] .source-meta {
  display: block;
  width: fit-content;
  text-decoration: underline dotted;
  text-underline-offset: 4px;
  font: 12px/1.5 var(--mono);
  letter-spacing: 0.035em;
  color: var(--accent);
  margin: 0 0 10px;
  opacity: 0.85;
}
[data-debug="true"] .project-visual {
  background: #0b181a;
}
[data-debug="true"] .architecture {
  background: radial-gradient(ellipse, #1c5a4540, transparent 75%);
}
[data-debug="true"] .arch-stack {
  transform: none;
}
[data-debug="true"] .arch-stack div {
  color: #b1e9d5;
  border-color: #4e9b87;
  background: #102923;
  box-shadow: none;
}
[data-debug="true"] .arch-stack div:after {
  border-color: #4e9b87;
}
[data-debug="true"] .arch-caption {
  color: var(--muted);
}
.debug-header {
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #304b43;
  padding-bottom: 9px;
  margin-bottom: 9px;
}
.debug-header button {
  margin: 0 0 0 auto;
  border: 0;
  background: transparent;
  color: #95bcb0;
  padding: 4px;
  cursor: pointer;
}
.debug-header button:hover {
  color: #fff;
}
.debug-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.debug-metrics span {
  display: block;
  color: #8ba99f;
  font-size: 9px;
}
.debug-metrics strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: #d8f4e7;
  white-space: nowrap;
}
/* Footer invitation */
.hint-night,
.hint-source {
  display: none;
}
.hint-action {
  border-bottom: 1px solid currentColor;
  opacity: 0.72;
  transition: opacity 0.25s;
}
.footer-btn:hover .hint-action,
.footer-btn:focus-visible .hint-action {
  opacity: 1;
}
.footer-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.hint-night {
  color: var(--accent);
  gap: 9px;
  flex-wrap: wrap;
  align-items: baseline;
  text-shadow: 0 0 14px #ac79ff55;
}
.hint-night .hint-action {
  font-weight: 600;
}
[data-theme="dark"] .hint-day {
  display: none;
}
[data-theme="dark"] .hint-night {
  display: inline-flex;
}
[data-debug="true"] .hint-night,
[data-debug="true"] .hint-day {
  display: none;
}
[data-debug="true"] .hint-source {
  display: inline;
  color: var(--accent);
}
/* Localized UV notes */
[data-theme="dark"]:not([data-debug="true"]) .uv-layer.uv-active {
  opacity: 1;
  visibility: visible;
}
.uv-layer .uv-text:nth-child(n) {
  left: var(--ux);
  top: var(--uy);
  max-width: min(30%, 260px);
  font: 11px/1.45 var(--mono);
  letter-spacing: 0.035em;
  color: #d9c1ff;
  text-shadow: 0 0 9px #9a52ff88;
  overflow-wrap: break-word;
}
.uv-text > span {
  display: block;
}
.uv-id {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #a98be7;
  margin-bottom: 4px;
}
.uv-toggle:hover,
.uv-toggle:focus-visible {
  opacity: 1;
}
[data-debug="true"] .lamp .glass {
  fill: #174b3d;
  stroke: #a6f5d8;
  filter: drop-shadow(0 0 7px #62ffc4aa);
}
[data-debug="true"] .lamp .filament {
  stroke: #c7ffeb;
  filter: drop-shadow(0 0 3px #b1ffe2) drop-shadow(0 0 9px #3dffb4);
}
[data-debug="true"] .lamp .warm {
  opacity: 0.22;
  filter: hue-rotate(92deg) saturate(1.8);
}
/* One short pass across the viewport when the lamp changes layers. */
.switch-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}
.layer-transition { display: none; }
@media (prefers-reduced-motion: no-preference) {
  [data-layer-change] .button { transition-property: transform; }
  [data-layer-change] .switch-ring { animation: switch-ring .44s ease-out; }
  [data-layer-change] .lamp-hint { animation: switch-label .32s ease-out; }
  [data-layer-change] .layer-transition {
    display: block;
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 9;
    contain: strict;
  }
  .layer-transition::before {
    content: "";
    display: block;
    position: absolute;
    opacity: 0;
  }
  [data-layer-change="logic"] .layer-transition::before {
    inset: 0 0 0 auto;
    width: clamp(56px, 12vw, 180px);
    background: linear-gradient(90deg, transparent 0%, #b699ff57 3%, #a989ff19 5%, transparent 100%);
    animation: enter-logic .65s cubic-bezier(.3,.1,.3,1);
  }
  [data-layer-change="source"] .layer-transition::before {
    inset: 0 0 auto;
    height: clamp(48px, 12vh, 110px);
    background:
      linear-gradient(to top, #8aeac36b, transparent 2px, #78e6bd12 3px, transparent 80%),
      repeating-linear-gradient(90deg, #8aeac33d 0 1px, transparent 1px 24px) left bottom / 100% 7px no-repeat;
    animation: enter-source .72s cubic-bezier(.3,.1,.3,1);
  }
  [data-layer-change="interface"] .layer-transition::before {
    inset: 0;
    transform-origin: top right;
    background: radial-gradient(ellipse at top right, #ffdb9570, #eabe6b30 38%, transparent 70%);
    animation: enter-interface .68s ease-out;
  }
}
@keyframes switch-ring {
  from { opacity: .8; transform: scale(.7); }
  to { opacity: 0; transform: scale(1.6); }
}
@keyframes switch-label {
  from { opacity: .45; translate: 0 3px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes enter-logic {
  0% { opacity: 0; transform: translateX(100%); }
  15%, 70% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-100vw); }
}
@keyframes enter-source {
  0% { opacity: 0; transform: translateY(-100%); }
  12%, 78% { opacity: 1; }
  100% { opacity: 0; transform: translateY(100vh); }
}
@keyframes enter-interface {
  0% { opacity: 0; transform: scale(.65); }
  24% { opacity: .9; }
  100% { opacity: 0; transform: scale(1.25); }
}
@media (min-width: 691px) and (max-width: 1000px) {
  .compact-lamp {
    --lamp-inset: 12px;
  }
  .compact-lamp .nav {
    padding-right: 176px;
    gap: 12px;
  }
}
@media (max-width: 1000px) {
  .wrap {
    width: calc(100% - 72px);
  }
  .nav {
    gap: 20px;
    padding-right: 104px;
  }
  nav {
    gap: 15px;
  }
  .hero h1 {
    font-size: clamp(56px, 9.7vw, 98px);
  }
  .hero h1.ru {
    font-size: clamp(37px, 5.9vw, 60px);
  }
  .hero-art {
    margin-left: -12px;
  }
  .section {
    padding: 80px 0;
  }
  .about-grid {
    gap: 35px;
  }
  .project:first-child {
    grid-template-columns: 1.2fr 1fr;
  }
  .project-visual {
    min-height: 220px;
  }
  .lamp {
    right: 12px;
    width: 93px;
    height: 153px;
  }
  .lamp-hint {
    top: 143px;
    right: 9px;
  }
}
@media (max-width: 690px) {
  .wrap {
    width: calc(100% - 38px);
  }
  .nav {
    height: 62px;
    gap: 15px;
    padding-right: 72px;
  }
  .brand-mark { width: 40px; height: 40px; }
  nav {
    display: none;
  }
  .languages {
    margin-left: auto;
  }
  .lamp {
    width: 72px;
    height: 122px;
    right: 4px;
  }
  .compact-lamp .lamp {
    width: 48px;
    height: 56px;
    right: 16px;
  }
  .lamp-hint {
    font-size: 11px;
    top: 44px;
    right: 85px;
  }
  /* Hero and artwork */
  .hero {
    padding: 62px 0 22px;
    min-height: 0;
  }
  .hero-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .hero-copy {
    padding: 5px 0 0;
  }
  .hero h1 {
    font-size: clamp(59px, 15vw, 95px);
    margin: 22px 0;
  }
  .hero h1.ru {
    font-size: clamp(43px, 11.5vw, 78px);
  }
  :root:not([data-debug="true"]) .hero h1.ru {
    font-size: clamp(42px, 13.1vw, 82px);
  }
  .hero-copy .actions {
    display: grid;
    width: fit-content;
    max-width: 100%;
  }
  .hero-copy .button {
    justify-content: space-between;
  }
  .hero-desc {
    font-size: 15px;
  }
  .hero-art {
    width: 100%;
    max-width: 480px;
    margin: -12px auto -6px;
    aspect-ratio: 1.16;
  }
  :root:not([data-debug="true"]) .hero-art {
    margin-top: 12px;
  }
  .hero-bottom {
    padding-top: 18px;
  }
  .numbers {
    gap: 23px;
  }
  .stat strong {
    font-size: 33px;
  }
  .mono {
    font-size: 10px;
  }
  .scroll {
    font-size: 9px;
  }
  /* Portfolio sections */
  .philosophy {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 28px 0 36px;
  }
  .stack-toggle {
    grid-row: 1;
    width: 192px;
    justify-self: start;
    margin-left: -18px;
  }
  .section {
    padding: 62px 0;
  }
  .section-head {
    margin-bottom: 27px;
  }
  .section h2 {
    font-size: clamp(39px, 11vw, 68px);
  }
  .section-index {
    font-size: 10px;
  }
  .about-grid,
  .experience-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  #about .about-grid { gap: 16px; }
  .principles {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }
  .principle,
  .principle + .principle {
    padding: 16px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
  .projects {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .project:first-child {
    grid-column: auto;
    display: block;
  }
  .project:first-child .project-visual {
    aspect-ratio: 1.6;
  }
  .project-visual {
    min-height: 180px;
  }
  .project-info {
    padding: 19px;
  }
  .skills { grid-template-columns: 1fr; gap: 8px; }
  .skill { display: grid; grid-template-columns: 1fr auto; padding: 14px 16px; gap: 6px 12px; }
  .skill strong { grid-area: 1 / 1; font-size: 22px; }
  .skill .skill-category { grid-area: 1 / 2; align-self: center; }
  .skill > span:not(.skill-category) { grid-column: 1 / -1; }

  .exp-total {
    font-size: 94px;
  }
  .contact h2 {
    font-size: clamp(36px, 10.5vw, 68px);
  }
  .contact-methods { flex-direction: column; }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .arch-stack div {
    font-size: 9px;
    padding: 8px 10px;
  }
  [data-theme="dark"] .project:first-child .project-visual {
    width: 100%;
    min-height: 220px;
  }
  .project:first-child .architecture {
    padding-bottom: 32px;
  }
  .debug-panel {
    position: static;
    width: 100%;
    max-width: none;
    margin: 24px 0 20px;
    padding: 9px 11px;
  }
  .debug-metrics strong {
    font-size: 12px;
  }
  .debug-metrics span {
    font-size: 8px;
  }
  [data-debug="true"] .hero h1 {
    font-size: clamp(45px, 12vw, 78px);
  }
  [data-debug="true"] .hero h1.ru {
    font-size: clamp(35px, 10vw, 65px);
  }
  .uv-layer .uv-text:nth-child(n) {
    font-size: 10px;
    max-width: 35%;
    left: min(var(--ux), 62%);
  }
  .uv-id {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

}
@media (hover: none) {
  .hint-action {
    opacity: 1;
  }
}

#metrics-toggle { display: none; }
@media (min-width: 691px) {
  .debug-panel {
    position: static;
    width: fit-content;
    margin: 0 0 16px;
    padding: 0;
    box-shadow: none;
  }
  #metrics-toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    font-size: 12px;
    cursor: pointer;
  }
  #metrics-toggle::after { content: "+"; }
  #metrics-toggle[aria-expanded="true"]::after { content: "−"; }
  .debug-panel .debug-header,
  #metrics-toggle[aria-expanded="false"] ~ #debug-data { display: none; }
  #debug-data { min-width: 245px; padding: 0 14px 14px; }
}

#concepts-panel .project { position: relative; }
.concept-link { color: inherit; text-decoration: none; }
.concept-link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.concept-open, .live-sites .project-address {
  align-self: flex-start;
  color: var(--ink);
  font: 600 15px/1.45 var(--sans);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.concept-open { margin-top: 16px; }
.live-card:hover .project-address { color: var(--accent); }
#concepts-panel .project:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
#concepts-panel .project:hover .concept-open { color: var(--accent); }

/* Construction drawings share the same paper, paths and registration points. */
.study, .service-mark, .dispatch {
  display: block;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.study {
  width: min(100%, 232px);
  height: auto;
  margin: 0 0 16px;
  background: radial-gradient(circle, var(--line) .65px, transparent .85px) 0 0 / 9px 9px;
  border-block: 1px solid var(--line);
}
.study-guide {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.study-face, .plane-top {
  fill: color-mix(in srgb, var(--paper) 82%, var(--accent));
  stroke: currentColor;
}
.study-ink { stroke: var(--ink); }
.study-route { fill: none; stroke-width: 2; }
.study-pins { fill: var(--paper); opacity: 0; }
[data-theme="dark"] .study-face, [data-theme="dark"] .plane-top {
  fill: var(--paper);
}
[data-theme="dark"] .study-route { stroke: var(--cyan); }
[data-theme="dark"] .study-ink { opacity: .65; }
[data-debug="true"] .study-route { stroke: var(--accent); stroke-dasharray: .045 .025; }
[data-debug="true"] .study-pins { opacity: 1; }
[data-debug="true"] .study-guide { stroke: var(--muted); }
[data-debug="true"] .study { background-size: 12px 12px; }

.timeline-item {
  grid-template-columns: clamp(62px, 7vw, 96px) minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
}
.service-mark { width: 100%; max-width: 76px; }

.skill { position: relative; }
.skill-map {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 29px;
  fill: none;
  stroke: var(--line);
}
.skill-category { padding-right: 34px; }
.skill-map .map-self { fill: currentColor; stroke: currentColor; }
.skill-map .map-related { fill: var(--line); }
.skill.related .map-self, [data-theme="dark"] .map-related {
  fill: var(--accent);
  stroke: var(--accent);
}
.skill[aria-pressed="true"] .map-related {
  fill: currentColor;
  stroke: currentColor;
  opacity: .65;
}
[data-debug="true"] .skill-map rect:not(.map-self) { rx: 3.5px; }

.contact-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(140px, 21vw, 270px);
  align-items: center;
  column-gap: 20px;
}
.dispatch { grid-column: 2; grid-row: 1 / 3; width: 100%; }
.plane-fold { fill: color-mix(in srgb, var(--accent) 44%, var(--paper)); }
.flight-path { stroke-dasharray: .018 .027; }
[data-theme="dark"] .flight-path { stroke: var(--cyan); }
[data-debug="true"] .flight-path { stroke: currentColor; }
[data-debug="true"] .plane-fold { fill: none; stroke-dasharray: 3 3; }

@keyframes seat-volume {
  from { transform: translate(14px, -24px); }
  to { transform: translate(0, 0); }
}
@keyframes draw-route {
  from { stroke-dasharray: 1; stroke-dashoffset: 1; }
  to { stroke-dasharray: 1; stroke-dashoffset: 0; }
}
@keyframes approach {
  from { transform: translate(-18px, 9px); }
  to { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-theme="dark"]) .hero-art.in-view .front-volume {
    animation: seat-volume .9s cubic-bezier(.19, 1, .22, 1);
  }
  .layer-stack .sheet { transition: translate .45s ease-out; }
  [data-theme="dark"]:not([data-debug="true"]) .sheet-logic,
  [data-debug="true"] .sheet-code { --sheet-shift: 11px; }
  :root:not([data-debug="true"]) .in-view > .study-route {
    animation: draw-route .8s ease-out;
  }
  .dispatch.in-view .paper-plane { animation: approach .8s ease-out; }
  [data-theme="dark"]:not([data-debug="true"]) .live-card.in-view .night-diagram [data-card-route] {
    animation: draw-route .85s ease-out;
  }
}

/* Ambient responses are confined to the artwork and the outside margin. */
.uv-text.over-copy { visibility: hidden; }
.scroll-signal, .source-ruler { display: none; }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-theme="dark"]) .day-shadow {
    translate: calc(3 * var(--shadow-x, 0px)) calc(3 * var(--shadow-y, 0px));
    transition: translate .18s ease-out, opacity .65s;
  }
  :root:not([data-theme="dark"]) :is(.study-face, .paper-plane) {
    filter: drop-shadow(var(--shadow-x, 1px) var(--shadow-y, 2px) 1px #75634644);
    transition: filter .15s ease-out;
  }
  [data-theme="dark"]:not([data-debug="true"]) .scroll-signal {
    display: inline;
    fill: none;
    stroke: #f3fcff;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: .09 1;
    stroke-dashoffset: var(--signal-offset, -.35);
    filter: drop-shadow(0 0 2px #72d5ef);
    pointer-events: none;
  }
  [data-debug="true"] .source-ruler {
    display: block;
    position: fixed;
    z-index: 5;
    pointer-events: none;
    top: 50%;
    left: clamp(3px, .8vw, 14px);
    translate: 0 -50%;
    width: 9px;
    height: min(144px, 24vh);
    color: var(--accent);
    border-left: 1px solid var(--line);
    background:
      repeating-linear-gradient(to bottom, var(--muted) 0 1px, transparent 1px 24px) left / 7px 100% no-repeat,
      repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 6px) left / 4px 100% no-repeat;
  }
  .source-ruler::after {
    content: "";
    position: absolute;
    left: 0;
    top: calc(var(--page-position, 0) * (100% - 5px));
    width: 9px;
    height: 5px;
    background: currentColor;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
}
@media (max-width: 690px) {
  .principle, .principle + .principle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(78px, 23vw, 140px);
    column-gap: 14px;
    align-content: start;
  }
  .study { grid-row: 1 / 3; grid-column: 2; align-self: center; margin: 0; }
  .timeline-item { grid-template-columns: 46px minmax(0, 1fr); column-gap: 14px; }
  .service-mark { grid-row: 1 / 3; align-self: start; }
  .timeline-item p { grid-column: 2; }
  .contact-copy { grid-template-columns: minmax(0, 1fr) 86px; gap: 12px; }
  .dispatch { grid-row: 2; }
  .contact-copy p { grid-column: 1 / -1; }
  .contact-methods { margin-top: 0; }
}

.preview-measure {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--accent);
  font: 12px/1.3 var(--mono);
}
.preview-measure::before, .preview-measure::after {
  content: "";
  flex: 1;
  height: 7px;
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}
.preview-measure::before { border-left: 1px solid; }
.preview-measure::after { border-right: 1px solid; }
@media (prefers-reduced-motion: no-preference) {
  .live-card, #concepts-panel .project {
    transition: box-shadow .22s ease, border-color .22s ease;
  }
}
@media (hover: hover) {
  :root:not([data-theme="dark"]) :is(.live-card, #concepts-panel .project):is(:hover, :focus-within) {
    border-color: var(--accent);
    box-shadow: 3px 4px 0 var(--line);
  }
}

/* Only the illustration or its source field responds inside a project card. */
.tea-cover, .paleo-preview { overflow: hidden; }
.tea-filter {
  display: block;
  width: min(100%, 160px);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-trace { display: none; }
.record-field { background: transparent; color: inherit; }
:is(.live-card, .project):focus-within { --card-active: 1; }
@media (hover: hover) {
  :is(.live-card, .project):hover { --card-active: 1; }
}
@media (hover: none) {
  :is(.live-card, .project).in-view { --card-active: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  :root[data-theme="light"] :is(.live-card img, .forma-frame, .mono-chart, .offset-spread) {
    scale: calc(1 + .025 * var(--card-active, 0));
    transition: scale .36s cubic-bezier(.2,.65,.35,1);
  }
  [data-theme="dark"]:not([data-debug="true"]) .card-trace {
    display: inline;
    fill: none;
    stroke: var(--cyan);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 1 1;
    stroke-dashoffset: calc(1 - var(--card-active, 0));
    opacity: var(--card-active, 0);
    pointer-events: none;
    transition: stroke-dashoffset .65s ease-out, opacity .18s;
  }
}

[data-debug="true"] .record-field {
  background: linear-gradient(#85efc52b, #85efc52b) left center /
    calc(100% * var(--card-active, 0)) 100% no-repeat;
  transition: background-size .32s ease-out;
}
[data-debug="true"] .forma-coordinates rect {
  stroke: var(--accent);
  stroke-opacity: var(--card-active, 0);
  transition: stroke-opacity .32s;
}

/* Exploded axonometric model. The paper, grid and annotations stay registered. */
.model-drawing { display: block; }
.model-toggle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: manipulation;
  cursor: default;
}
.hero-art:has(.model-toggle[aria-pressed="true"]) { --spread: 1; }
@media (prefers-reduced-motion: no-preference) {
  .rear-volume, .front-volume, .model-lid, .wire .purple, .wire .blue,
  .wire .scroll-signal, .day-shadow path:last-child {
    transition: translate .42s cubic-bezier(.22,.68,.24,1);
  }
  .model-guides { transition: opacity .3s; }
}
.model-guides { color: var(--muted); opacity: calc(var(--spread, 0) * .8); }
.rear-volume, .wire .purple {
  translate: calc(-32px * var(--spread, 0)) calc(-18px * var(--spread, 0));
}
.front-volume, .wire .blue, .wire .scroll-signal {
  translate: calc(36px * var(--spread, 0)) calc(21px * var(--spread, 0));
}
.model-lid { translate: 0 calc(-43px * var(--spread, 0)); }
.day-shadow path:last-child { translate: calc(23px * var(--spread, 0)) calc(12px * var(--spread, 0)); }
[data-theme="dark"] .secret, .wire > g[stroke-dasharray] { opacity: calc(1 - var(--spread, 0)); }
