/* Mobile Manuscript (iPhone Pro Max 430x932) — shared tokens, touch ergonomics, 18 touch Easter eggs, bottom sheet. */
:root {
  color-scheme: light;
  --paper: #fcfcfc;
  --bar-bg: rgba(252, 252, 252, 0.92);
  --surface: #f5f5f3;
  --ink-1: #121314;
  --ink-2: #27292c;
  --ink-3: #545652;
  --rule: rgba(18, 19, 20, 0.14);
  --rule-strong: rgba(18, 19, 20, 0.28);
  --tone: rgba(18, 19, 20, 0.06);
  --tone-active: rgba(18, 19, 20, 0.11);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --g-blue: #4285f4;
  --g-red: #ea4335;
  --g-yellow: #fbbc05;
  --g-green: #34a853;
  --f-chrome: "JetBrains Mono", ui-monospace, monospace;
}

:is(html[data-theme="dark"], html.dark) {
  color-scheme: dark;
  --paper: #0d0e0f;
  --bar-bg: rgba(13, 14, 15, 0.92);
  --surface: #151618;
  --ink-1: #f2f2ef;
  --ink-2: #c8cac6;
  --ink-3: #9a9d98;
  --rule: rgba(242, 242, 239, 0.16);
  --rule-strong: rgba(242, 242, 239, 0.34);
  --tone: rgba(242, 242, 239, 0.08);
  --tone-active: rgba(242, 242, 239, 0.16);
}

html.eg-linen:not([data-theme="dark"]) {
  --paper: #f4f1ea;
  --bar-bg: rgba(244, 241, 234, 0.94);
  --surface: #ece8de;
}

html.eg-linen[data-theme="dark"] {
  --paper: #141311;
  --bar-bg: rgba(20, 19, 17, 0.94);
  --surface: #1c1a17;
}

html[data-contrast="high"] {
  --paper: #ffffff;
  --bar-bg: rgba(255, 255, 255, 0.96);
  --surface: #f2f2f2;
  --ink-1: #000000;
  --ink-2: #0a0b0c;
  --ink-3: #2a2c2f;
  --rule: rgba(0, 0, 0, 0.28);
  --rule-strong: rgba(0, 0, 0, 0.56);
}

:is(html[data-theme="dark"], html.dark)[data-contrast="high"] {
  --paper: #000000;
  --bar-bg: rgba(0, 0, 0, 0.96);
  --surface: #111111;
  --ink-1: #ffffff;
  --ink-2: #f0f0ee;
  --ink-3: #cbcdc9;
  --rule: rgba(255, 255, 255, 0.30);
  --rule-strong: rgba(255, 255, 255, 0.62);
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; overflow-x: clip; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink-2); font-family: var(--f-body); font-size: var(--body-size, 14px); line-height: var(--body-lh, 1.62); overflow-x: clip; }
h1, h2, h3, h4, p, ul, ol, dl, dt, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 42%, transparent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 6px Top Reading Progress Bar + opaque full-width backing so scrolled text never peeks through */
.m-progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--paper);
  z-index: 89;
  pointer-events: none;
}

.m-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--ink-1);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 90;
  pointer-events: none;
}

.m-host {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: max(48px, env(safe-area-inset-top)) 20px 108px;
}

/* Shared Hero Typography & Interactive Atoms */
.mh-name {
  font-family: var(--f-display);
  font-size: var(--name-size, 44px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink-1);
  cursor: pointer;
  user-select: none;
}

.mh-title {
  margin-top: 12px;
  font-family: var(--f-display);
  font-size: 16px;
  line-height: 1.38;
  color: var(--ink-1);
  cursor: pointer;
}

.mh-org {
  margin-top: 6px;
  font-family: var(--f-display);
  font-size: 14.5px;
  color: var(--ink-3);
}

/* "o" dot eyes inside Anton Volkov */
.name-o { position: relative; display: inline-block; }
.o-eye {
  position: absolute;
  left: 50%;
  top: 59.5%;
  width: 0.28em;
  height: 0.31em;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.15);
  transition: transform 170ms cubic-bezier(0.4, 0, 1, 1), opacity 140ms var(--ease-out);
}
.o-eye svg { display: block; width: 100%; height: 100%; overflow: visible; }
.o-iris { fill: var(--ink-1); }
.o-glint { fill: var(--paper); }
.o-eye-lid { transform-box: fill-box; transform-origin: center; transition: transform 90ms var(--ease-out); }
.name-o.is-blink .o-eye-lid { transform: scaleY(0.14); }
.mh-name.eyes-awake .o-eye { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 130ms var(--ease-out); }

/* Title Highlighter Typer */
.ty-chunk { display: inline; padding: 1px 4px; border-radius: 3px; }
.ty-chunk.is-hl { background: var(--ink-1); color: var(--paper); }
.ty-caret { display: inline-block; width: 1.5px; height: 1em; margin-left: 2px; vertical-align: -0.14em; background: var(--ink-1); opacity: 0; }
.ty-caret.is-on { opacity: 0.9; }

/* Zero-Shift 4-Color Google Wordmark */
.g-org { display: inline-flex; align-items: baseline; cursor: pointer; }
.g-logo { display: block; height: 1.04em; width: auto; transform: translateY(0.2em); }
.g-logo path { fill: currentColor; transition: fill 260ms var(--ease-out); }
.g-org.is-colored .g-logo .g-b { fill: var(--g-blue); }
.g-org.is-colored .g-logo .g-r { fill: var(--g-red); }
.g-org.is-colored .g-logo .g-y { fill: var(--g-yellow); }
.g-org.is-colored .g-logo .g-g { fill: var(--g-green); }
.g-rest { white-space: pre; }
.m-co-name .g-logo { height: 15px; transform: translateY(2px); }

/* Hairline Light/Dark Toggle (iOS thumb-sized touch ergonomics) */
.theme-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 60px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tt-track {
  position: relative;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  padding: 3px;
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out);
}
.theme-toggle:active .tt-track { transform: scale(0.96); }
.tt-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink-1);
  transform: translateX(0);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
:is(html[data-theme="dark"], html.dark) .tt-dot { transform: translateX(26px); }

/* Section Headers + Readability Caliper */
.m-sec { padding-top: 36px; }
.m-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 14px;
  font: 600 11px/1.2 var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.m-h::after { content: ""; flex: 1; min-width: 16px; height: 1px; background: var(--rule); order: 2; }
.m-caliper { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; order: 3; }
.m-cal-btn {
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  font: 500 11px/1 var(--f-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.m-cal-btn[aria-pressed="true"] { background: var(--ink-1); color: var(--paper); border-color: var(--ink-1); }
.m-cal-btn svg { width: 11px; height: 11px; display: block; }

/* Summary & KPIs */
.m-lede { font-family: var(--f-display); font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.m-lede strong { color: var(--ink-1); font-weight: 600; }
.m-facts { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.m-fig dd { font-family: var(--f-display); font-size: 24px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink-1); line-height: 1.05; }
.m-fig dt { margin-top: 3px; font: 400 11.5px/1.35 var(--f-mono); color: var(--ink-3); }

/* Experience & Touch 5-Step Scrubber */
.m-co + .m-co { margin-top: 32px; }
.m-co-head {
  position: sticky;
  top: 6px;
  z-index: 20;
  background: var(--paper);
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--rule);
}
.m-co-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; min-width: 0; }
.m-co-name { font: 600 13px/1.3 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-1); overflow-wrap: anywhere; min-width: 0; }
.m-co-loc { font: 400 11.5px/1.3 var(--f-mono); color: var(--ink-3); overflow-wrap: anywhere; }

/* Touch-native 5-step scrubber bar (GPU transform only) */
.m-scrub {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.m-scrub-track {
  position: relative;
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  touch-action: none;
  cursor: pointer;
}
.m-scrub-line { width: 100%; height: 1px; background: var(--rule-strong); position: relative; }
.m-scrub-ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.m-scrub-ticks span { width: 1px; height: 6px; background: var(--rule-strong); }
.m-scrub-slider {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translateX(var(--scrub-x, 100%));
  transition: transform 140ms var(--ease-out);
}
.m-scrub-track.is-dragging .m-scrub-slider { transition: none; }
.m-scrub-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: var(--ink-1);
  transform: translate(-50%, -50%);
  transition: transform 120ms var(--ease-out);
}
.m-scrub-track.is-dragging .m-scrub-thumb { transform: translate(-50%, -50%) scale(1.12); }
.m-scrub-lab {
  min-width: 52px;
  text-align: right;
  font: 500 10.5px/1 var(--f-mono);
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.m-role { padding-top: 18px; min-width: 0; overflow-wrap: anywhere; }
.m-role-t { font-family: var(--f-display); font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-1); overflow-wrap: anywhere; }
.m-date-btn {
  appearance: none;
  margin-top: 2px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font: 400 12px/1.3 var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  cursor: pointer;
  text-align: left;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.m-date-btn.is-tenure { color: var(--ink-1); font-weight: 500; }
.m-scope { margin-top: 4px; color: var(--ink-2); overflow-wrap: anywhere; }
.m-list { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.m-list li { position: relative; padding-left: 14px; cursor: pointer; overflow-wrap: anywhere; transition: opacity 160ms var(--ease-out); }
.m-list li::before { content: var(--bullet-glyph, "›"); position: absolute; left: 0; font-family: var(--f-mono); color: var(--ink-3); }
.m-list .lead { font-weight: 600; color: var(--ink-1); }
.m-list.has-spot li { opacity: 0.34; }
.m-list.has-spot li.is-spot { opacity: 1; }
.m-co[data-level="0"] .m-list { display: none; }
.m-co[data-level="0"] .m-scope { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); }

/* Acronym tap trigger */
.eg-acr { text-decoration: underline dotted var(--rule-strong); text-underline-offset: 3px; cursor: pointer; }

/* Patents tap-to-expand */
.m-pat li { padding: 11px 0; border-top: 1px solid var(--tone); cursor: pointer; }
.m-pat li:first-child { border-top: 0; }
.m-pat-head { display: flex; flex-direction: column; gap: 4px; }
.m-pat-t { color: var(--ink-1); font-weight: 500; line-height: 1.4; }
.m-pat-no { font: 400 11.5px/1.3 var(--f-mono); color: var(--ink-3); }
.m-pat-det { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms var(--ease-out); }
.m-pat li.is-open .m-pat-det { grid-template-rows: 1fr; opacity: 1; }
.m-pat-in { overflow: hidden; font-size: 13px; line-height: 1.72; color: var(--ink-3); padding-bottom: 8px; }
.m-pat-in p:first-child { margin-top: 14px; }
.m-pat-in p + p { margin-top: 12px; }
.m-pat-in strong { color: var(--ink-2); }
.m-pat-link { display: inline-flex; align-items: center; min-height: 36px; margin-top: 4px; font: 500 11.5px/1 var(--f-mono); color: var(--ink-1); }

/* Recognition, Skills, Education, Footer */
.m-hon li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--tone); cursor: pointer; min-height: 44px; }
.m-hon li:first-child { border-top: 0; }
.m-hon em { font-style: normal; color: var(--ink-3); }
.m-hon-yr { font: 500 11.5px/1 var(--f-mono); color: var(--ink-3); opacity: 0; transition: opacity 160ms var(--ease-out); flex-shrink: 0; }
.m-hon li.is-yr .m-hon-yr { opacity: 1; color: var(--ink-1); }

.m-skills > div { padding: 9px 0; border-top: 1px solid var(--tone); }
.m-skills > div:first-child { border-top: 0; }
.m-skills dt { font: 600 11px/1.3 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.m-skills dd { color: var(--ink-2); }

.m-lang-btn { appearance: none; border: 0; background: transparent; padding: 8px 0; min-height: 44px; display: inline-flex; align-items: center; font: inherit; color: var(--ink-1); text-decoration: underline dotted var(--rule-strong); text-underline-offset: 3px; cursor: pointer; }

.m-foot { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--rule); }
.m-motto-a { font-family: var(--f-display); font-size: 15px; font-weight: 600; color: var(--ink-1); }
.m-motto-b { font-family: var(--f-display); font-size: 14px; color: var(--ink-3); }
.m-foot-tag { margin-top: 16px; font: 500 11px/1.55 var(--f-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.m-foot-imprint { margin-top: 10px; font: 400 12px/1.5 var(--f-mono); color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; min-height: 36px; }
.m-foot-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; font: 400 12.5px/1.4 var(--f-mono); color: var(--ink-2); }
.m-foot-links a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; transition: transform 140ms var(--ease-out); }
.m-foot-links a:active { transform: scale(0.96); }
.m-top-btn { appearance: none; margin-top: 12px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink-2); font: 500 11.5px/1 var(--f-mono); cursor: pointer; }

/* Bottom Thumb Dock (Mobile Actions) */
.m-dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100% - 16px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--bar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.m-dock-btn {
  appearance: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font: 500 11px/1 var(--f-chrome);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms var(--ease-out), transform 120ms var(--ease-out);
}
.m-dock-btn:active { background: var(--tone-active); transform: scale(0.96); }
.m-dock-btn svg { width: 12px; height: 12px; display: block; }

/* Bottom-Sheet Field Guide (0/18) + Toast + Acronym Popover */
.m-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 95;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink-1);
  color: var(--paper);
  font: 500 11.5px/1 var(--f-chrome);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-out), transform 180ms var(--ease-out);
  white-space: nowrap;
}
.m-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.m-acr-pop {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 74px;
  max-width: 398px;
  margin: 0 auto;
  z-index: 85;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink-1);
  font: 400 12.5px/1.45 var(--f-chrome);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.m-acr-pop[hidden] { display: none; }

.m-sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0, 0, 0, 0.36);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.m-sheet-bg[hidden] { display: none; }
.m-sheet-card {
  width: 100%;
  max-width: 430px;
  max-height: 76vh;
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--rule-strong);
  background: var(--paper);
  padding: 16px 18px 28px;
}
.m-sheet-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.m-sheet-title { font: 600 12px/1.3 var(--f-chrome); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-1); }
.m-sheet-sub { margin-top: 2px; font: 400 11px/1.4 var(--f-chrome); color: var(--ink-3); }
.m-sheet-close { min-width: 40px; min-height: 40px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink-1); font: 500 16px/1 var(--f-chrome); cursor: pointer; }
.m-sheet-actions { margin-top: 12px; display: flex; gap: 8px; }
.m-sheet-act { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-1); font: 500 11px/1 var(--f-chrome); cursor: pointer; }
.m-eg-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.m-eg-item { display: flex; gap: 10px; align-items: flex-start; font: 400 12px/1.45 var(--f-chrome); color: var(--ink-3); }
.m-eg-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; border: 1px solid var(--rule-strong); }
.m-eg-item.is-found .m-eg-dot { background: var(--ink-1); border-color: var(--ink-1); }
.m-eg-item strong { display: block; color: var(--ink-1); font-weight: 600; }

@media print {
  .m-progress, .m-dock, .m-toast, .m-acr-pop, .m-sheet-bg, .theme-toggle, .m-caliper, .m-scrub { display: none !important; }
  .m-host { padding: 0; max-width: 100%; }
}
