/* Manoj Subedi — personal site
   Blueprint-inspired design: paper and drafting-line motifs, one slate-blue accent.
   Light and dark themes follow the system setting. All motion respects "reduce motion". */

/* ---------- Tokens ---------- */
:root {
  --bg: #F6F4EF;
  --bg-soft: rgba(19, 23, 28, .035);
  --surface: #FFFFFF;
  --ink: #13171C;
  --ink-2: #2E343B;
  --muted: #5A6068;
  --rule: rgba(19, 23, 28, .09);
  --rule-strong: rgba(19, 23, 28, .16);
  --accent: #24476B;
  --accent-soft: rgba(36, 71, 107, .09);
  --accent-line: rgba(36, 71, 107, .35);
  --accent-ring: rgba(36, 71, 107, .45);
  --accent-shadow: rgba(36, 71, 107, .55);
  --on-accent: #FFFFFF;
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(246, 244, 239, .78);
  --glass-border: rgba(19, 23, 28, .08);
  --glass-hi: rgba(255, 255, 255, .85);
  --overlay: rgba(246, 244, 239, .94);
  --shadow: 0 1px 2px rgba(19, 23, 28, .04), 0 14px 34px -18px rgba(19, 23, 28, .22);
  --shadow-lg: 0 2px 4px rgba(19, 23, 28, .05), 0 30px 64px -26px rgba(19, 23, 28, .34);
  --draw: rgba(36, 71, 107, .36);
  --grid-minor: rgba(36, 71, 107, .05);
  --grid-major: rgba(36, 71, 107, .095);
  --glow-1: rgba(79, 123, 166, .26);
  --glow-2: rgba(196, 170, 122, .24);
  --spot: rgba(36, 71, 107, .08);
  --hover: rgba(19, 23, 28, .05);

  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: 1rem;
  --header-h: 4.25rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B121A;
    --bg-soft: rgba(255, 255, 255, .035);
    --surface: #121B25;
    --ink: #ECE8E1;
    --ink-2: #C9CDD3;
    --muted: #9AA3AE;
    --rule: rgba(236, 232, 225, .09);
    --rule-strong: rgba(236, 232, 225, .17);
    --accent: #93B7DD;
    --accent-soft: rgba(147, 183, 221, .12);
    --accent-line: rgba(147, 183, 221, .4);
    --accent-ring: rgba(147, 183, 221, .5);
    --accent-shadow: rgba(0, 0, 0, .6);
    --on-accent: #0B121A;
    --glass: rgba(18, 27, 37, .58);
    --glass-strong: rgba(11, 18, 26, .78);
    --glass-border: rgba(147, 183, 221, .13);
    --glass-hi: rgba(255, 255, 255, .04);
    --overlay: rgba(11, 18, 26, .95);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .7);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .35), 0 30px 70px -28px rgba(0, 0, 0, .85);
    --draw: rgba(147, 183, 221, .3);
    --grid-minor: rgba(147, 183, 221, .045);
    --grid-major: rgba(147, 183, 221, .085);
    --glow-1: rgba(58, 104, 156, .38);
    --glow-2: rgba(147, 183, 221, .12);
    --spot: rgba(147, 183, 221, .1);
    --hover: rgba(255, 255, 255, .06);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  /* Fine paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, figure { margin: 0; }
h3 { font-size: 1.125rem; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color .3s, text-decoration-color .3s;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--on-accent); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.wrap {
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (min-width: 40rem) { :root { --gutter: 2rem; } }

[id] { scroll-margin-top: calc(var(--header-h) + 1.5rem); }

.icon {
  width: 1.05em; height: 1.05em;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

.skip-link {
  position: fixed;
  left: var(--gutter); top: -4rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; text-decoration: none;
  border-radius: 999px;
}
.skip-link:focus { top: .75rem; }

/* Scroll progress */
.progress {
  position: fixed; inset: 0 0 auto 0;
  height: 2px; z-index: 60;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .4s, border-color .4s, box-shadow .4s;
}
.site-header.scrolled {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--rule);
}
.site-header.open { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: transparent; }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  color: var(--ink); text-decoration: none;
  font-weight: 650; letter-spacing: -.01em;
}
.brand-mark {
  display: grid; place-items: center;
  width: 2.15rem; height: 2.15rem;
  border-radius: 9px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--display); font-size: 1.1rem; letter-spacing: .02em;
  transition: transform .5s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }

.nav-list { display: flex; flex-wrap: wrap; gap: .15rem; list-style: none; padding: 0; }
.nav-list a {
  display: block;
  padding: .45rem .85rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .9rem; font-weight: 500;
  text-decoration: none;
  transition: color .3s, background-color .3s;
}
.nav-list a:hover { color: var(--ink); background: var(--hover); }
.nav-list a[aria-current="true"] { color: var(--accent); background: var(--accent-soft); }

.menu-btn {
  display: none;
  align-items: center; gap: .6rem;
  padding: .5rem .95rem;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: 600 .85rem var(--sans);
  cursor: pointer;
}
.menu-lines { position: relative; width: 16px; height: 8px; }
.menu-lines::before, .menu-lines::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px;
  background: currentColor; border-radius: 1px;
  transition: transform .4s var(--ease), top .4s var(--ease);
}
.menu-lines::before { top: 0; }
.menu-lines::after { top: 6.5px; }
.open .menu-lines::before { top: 3.25px; transform: rotate(45deg); }
.open .menu-lines::after { top: 3.25px; transform: rotate(-45deg); }

/* Mobile menu (JS) */
@media (max-width: 59.99rem) {
  .js .menu-btn { display: inline-flex; }
  .js #site-nav {
    position: fixed; inset: 0;
    z-index: -1;
    display: flex; align-items: flex-start;
    padding: calc(var(--header-h) + 2rem) var(--gutter) 2rem;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden;
    transition: opacity .4s var(--ease), visibility 0s .4s;
  }
  .js .open #site-nav { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
  .js .nav-list { flex-direction: column; gap: 0; width: 100%; }
  .js .nav-list li { border-bottom: 1px solid var(--rule); }
  .js .nav-list a {
    padding: .55rem 0;
    border-radius: 0; background: none;
    font-family: var(--display); font-size: 2.2rem; font-weight: 400;
    color: var(--ink);
  }
  .js .nav-list a[aria-current="true"] { background: none; font-style: italic; }

  /* Without JS: links wrap under the name */
  html:not(.js) .site-header { position: absolute; }
  html:not(.js) .nav-inner { flex-wrap: wrap; padding-block: .75rem; }
}

/* ---------- Hero ---------- */
.hero {
  --truss-w: min(max(40rem, 100vw), 84rem);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Leave room at the bottom for the bridge drawing so it never sits under text */
  padding: calc(var(--header-h) + 3.5rem) 0 calc(var(--truss-w) * .29 + 1.5rem);
}
@media (min-width: 60rem) {
  .hero { padding-top: calc(var(--header-h) + 5rem); }
}

.hero-bg { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.grid-paper {
  position: absolute; inset: -40px;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 55% 40%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 70% at 55% 40%, #000 25%, transparent 80%);
  translate: calc(var(--mx, 0) * -14px) calc(var(--my, 0) * -14px);
  transition: translate .8s var(--ease);
}
.glow { position: absolute; border-radius: 50%; }
.glow-a {
  width: 60rem; height: 60rem; left: -22rem; top: -28rem;
  background: radial-gradient(circle, var(--glow-1), transparent 62%);
}
.glow-b {
  width: 48rem; height: 48rem; right: -18rem; top: 6rem;
  background: radial-gradient(circle, var(--glow-2), transparent 62%);
}

.truss {
  position: absolute; left: 50%; bottom: -2px; z-index: -1;
  width: var(--truss-w);
  transform: translateX(-50%);
  translate: calc(var(--mx, 0) * 16px) calc(var(--my, 0) * 6px);
  transition: translate .8s var(--ease);
  color: var(--draw);
  -webkit-mask-image: linear-gradient(to top, #000 60%, transparent);
  mask-image: linear-gradient(to top, #000 60%, transparent);
  pointer-events: none;
}
.truss path, .truss circle { fill: none; stroke: currentColor; stroke-width: 1.3; }
.truss .chord { stroke-width: 2.4; }
.truss .t-grid path { stroke-width: .8; opacity: .7; }
.truss .water { stroke-width: 1; opacity: .7; }
.truss .nodes circle { fill: var(--bg); stroke-width: 1.6; }
.truss text { fill: currentColor; font: 600 11px var(--sans); letter-spacing: .22em; text-anchor: middle; }
.truss .t-note { text-anchor: end; font-size: 10px; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; }

.hero-grid { display: grid; gap: 3.5rem; align-items: center; }
@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 4rem; }
}

.eyebrow {
  display: flex; align-items: center; gap: .85rem;
  color: var(--accent);
  font-size: .75rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
}
.eyebrow-rule { width: 2.5rem; height: 1px; background: currentColor; flex: none; }

.display {
  margin: 1.25rem 0 1.75rem;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(4.1rem, 14vw, 9rem);
  line-height: .9; letter-spacing: -.025em;
}
.line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.line > span { display: inline-block; }
.accent-word { font-style: italic; color: var(--accent); padding-right: .05em; }

.role { max-width: 33rem; color: var(--ink-2); font-size: 1.125rem; line-height: 1.65; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 3.1rem; padding: .75rem 1.45rem;
  border-radius: 999px;
  font-size: .95rem; font-weight: 650;
  text-decoration: none;
  transition: translate .4s var(--ease), box-shadow .4s var(--ease), background-color .3s, border-color .3s;
}
.btn:hover { translate: 0 -2px; }
.btn-primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 12px 30px -14px var(--accent-shadow);
}
.btn-primary:hover { color: var(--on-accent); box-shadow: 0 18px 36px -14px var(--accent-shadow); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .3) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .9s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-note { font-size: .78rem; font-weight: 500; opacity: .75; }
.btn-ghost {
  border: 1px solid var(--rule-strong);
  background: var(--glass);
  color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--accent-line); }

.profile-links {
  display: flex; flex-wrap: wrap; gap: .5rem 1.75rem;
  margin-top: 1.5rem; padding: 0; list-style: none;
  font-size: .92rem; font-weight: 600;
}

/* Portrait */
.portrait-wrap {
  position: relative;
  width: min(19rem, 74vw);
  justify-self: center;
  margin: 0 1.25rem 2.5rem 0;
}
.portrait-wrap .plate, .portrait-wrap .portrait, .portrait-wrap .crop {
  translate: calc(var(--mx, 0) * -10px) calc(var(--my, 0) * -10px);
  transition: translate .8s var(--ease);
}
.plate {
  position: absolute; inset: 0;
  transform: translate(1.2rem, 1.2rem);
  border: 1px solid var(--accent-line); border-radius: 8px;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 16px 16px;
}
.portrait-wrap .plate { translate: calc(var(--mx, 0) * 8px) calc(var(--my, 0) * 8px); }
.portrait { display: block; position: relative; }
.portrait img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
.crop { position: absolute; width: 18px; height: 18px; border: 0 solid var(--accent); }
.crop.tl { top: -11px; left: -11px; border-top-width: 1.5px; border-left-width: 1.5px; }
.crop.tr { top: -11px; right: -11px; border-top-width: 1.5px; border-right-width: 1.5px; }
.crop.bl { bottom: -11px; left: -11px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.crop.br { bottom: -11px; right: -11px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.portrait-tag {
  position: absolute; left: 0; bottom: -2.6rem;
  color: var(--muted);
  font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  white-space: nowrap;
}
@media (min-width: 60rem) {
  .portrait-wrap { width: 21rem; justify-self: end; margin: 0 1.5rem 1rem 0; }
}

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 40rem;
  margin-top: 3.5rem;
  border-top: 1px solid var(--rule-strong);
}
.stat { display: flex; flex-direction: column-reverse; gap: .35rem; padding: 1.1rem .75rem 0 0; }
.stat + .stat { padding-left: 1rem; border-left: 1px solid var(--rule); }
.stat dt { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1.4; }
.stat dd { margin: 0; font-family: var(--display); font-size: clamp(2.3rem, 7vw, 3.4rem); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { font-size: .5em; letter-spacing: 0; color: var(--muted); }
@media (max-width: 30rem) {
  .stat + .stat { padding-left: .75rem; }
  .stat dt { font-size: .6rem; letter-spacing: .08em; overflow-wrap: normal; }
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.5rem;
  display: none; flex-direction: column; align-items: center; gap: .6rem;
  translate: -50% 0;
  color: var(--muted); text-decoration: none;
  font-size: .65rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
}
.scroll-cue i { position: relative; width: 1px; height: 2.75rem; background: var(--rule-strong); overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 40%; background: var(--accent); }
@media (min-width: 60rem) and (min-height: 44rem) { .scroll-cue { display: flex; } }

/* ---------- Sections ---------- */
.block {
  position: relative;
  isolation: isolate;
  padding-block: clamp(4rem, 8vw, 6.5rem);
  overflow-x: clip; /* keeps background drawings inside the page without breaking sticky headings */
}
.block-grid { display: grid; gap: 2.25rem; }
.block-grid > * { min-width: 0; }
@media (min-width: 60rem) {
  .block-grid { grid-template-columns: 17rem minmax(0, 1fr); gap: 4.5rem; }
  .sec-head { position: sticky; top: calc(var(--header-h) + 2.5rem); align-self: start; }
}
.block-body { max-width: 47rem; }

.sec-num {
  margin-bottom: .6rem;
  color: var(--accent);
  font-family: var(--display); font-style: italic; font-size: 1.15rem;
}
.sec-head h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1; letter-spacing: -.015em;
}
/* Dimension line with architectural ticks */
.dim {
  position: relative; display: block;
  width: 100%; max-width: 11rem; height: 1px;
  margin-top: 1.4rem;
  background: var(--accent-line);
  transform-origin: 0 50%;
}
.dim::before, .dim::after {
  content: ""; position: absolute; top: -6px;
  width: 1.5px; height: 13px; background: var(--accent);
  transform: rotate(45deg);
}
.dim::before { left: 0; }
.dim::after { right: 0; }

.lede {
  margin-bottom: 1.75rem;
  font-family: var(--display);
  font-size: clamp(1.65rem, 3.4vw, 2.2rem);
  line-height: 1.25; letter-spacing: -.01em;
}
.prose { color: var(--ink-2); font-size: 1.0625rem; }
.prose p + p { margin-top: 1rem; }

/* Timeline entries */
.timeline { position: relative; padding-left: 2.25rem; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: .6rem; bottom: .6rem;
  width: 1px;
  background: linear-gradient(var(--accent-line), var(--rule) 70%, transparent);
}
.entry { position: relative; }
.entry + .entry { margin-top: 3rem; }
.timeline .entry::before {
  content: ""; position: absolute; left: calc(-2.25rem); top: .42rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 5px var(--bg);
  transition: background-color .6s .35s;
}

.entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; }
.date {
  padding: .15rem .7rem;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  color: var(--muted);
  font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.date-note { font-weight: 500; }
.sub { margin-top: .35rem; color: var(--muted); }
.entry > p:not(.sub) { margin-top: .75rem; color: var(--ink-2); }

.ticks { margin-top: 1.1rem; padding: 0; list-style: none; color: var(--ink-2); }
.ticks li { position: relative; padding-left: 1.6rem; }
.ticks li + li { margin-top: .55rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .85em;
  width: .85rem; height: 1px; background: var(--accent);
}

/* Glass cards */
.card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.35rem, 3.2vw, 2.1rem);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
  transition: translate .5s var(--ease), box-shadow .5s var(--ease), border-color .5s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: radial-gradient(28rem circle at var(--x, 50%) var(--y, 0%), var(--spot), transparent 60%);
  opacity: 0; transition: opacity .5s;
  pointer-events: none;
}
.card { z-index: 0; }
.card:hover { translate: 0 -3px; border-color: var(--accent-line); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-lg); }
.card:hover::before { opacity: 1; }
.card + .card { margin-top: 1.25rem; }

.card-eyebrow {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin-bottom: 1.1rem;
  color: var(--accent);
  font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}

.citation {
  margin-bottom: 1.2rem;
  padding-left: 1.15rem;
  border-left: 2px solid var(--accent);
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.3vw, 1.35rem);
  line-height: 1.42;
}
.citation strong {
  font-weight: 400;
  background: linear-gradient(transparent 62%, var(--accent-soft) 62%);
  box-shadow: 0 1px 0 var(--accent-line);
}
.citation cite { font-style: italic; }
.pub > p:not(.citation):not(.card-eyebrow) { color: var(--ink-2); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.35rem 0 1.4rem; padding: 0; list-style: none; }
.chips li {
  padding: .3rem .8rem;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-2);
  font-size: .8rem; font-weight: 600;
}
.chips .chip-strong { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.link-row { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; padding: 0; list-style: none; }
.arrow-link { font-weight: 650; font-size: .95rem; }
.arrow-link .icon { margin-left: .4rem; vertical-align: -.15em; transition: translate .4s var(--ease); }
.arrow-link:hover .icon { translate: 4px 0; }

.current h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3vw, 1.85rem); line-height: 1.2; margin-bottom: .6rem; }
.current p:last-child { color: var(--ink-2); }
.live { display: inline-flex; align-items: center; gap: .5rem; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Map card */
.map-card { padding: .75rem; }
.map-link {
  position: relative; display: block;
  overflow: hidden;
  border-radius: 13px;
  background: #FFFFFF;
}
.map-link img { width: 100%; transition: scale 1.2s var(--ease); }
.map-link:hover img { scale: 1.035; }
.map-zoom {
  position: absolute; right: .75rem; bottom: .75rem;
  padding: .4rem .8rem;
  border-radius: 999px;
  background: rgba(11, 18, 26, .78); color: #FFFFFF;
  font-size: .75rem; font-weight: 650; letter-spacing: .04em;
  opacity: 0; translate: 0 6px;
  transition: opacity .4s, translate .4s var(--ease);
}
.map-link:hover .map-zoom, .map-link:focus-visible .map-zoom { opacity: 1; translate: 0 0; }
.map-card figcaption { padding: 1.35rem .85rem .6rem; }
.map-card figcaption h3 { font-family: var(--display); font-weight: 400; font-size: clamp(1.45rem, 3vw, 1.8rem); line-height: 1.2; }
.map-card figcaption > p { margin-top: .6rem; color: var(--ink-2); }

/* CAD-style title block */
.title-block {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1.35rem;
  overflow: hidden;
  border: 1px solid var(--rule-strong); border-radius: 10px;
  background: var(--rule-strong);
}
.title-block > div { padding: .6rem .85rem; background: var(--surface); }
.title-block dt { color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.title-block dd { margin: .1rem 0 0; font-size: .88rem; font-weight: 600; }
@media (min-width: 40rem) { .title-block { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Project rows */
.project-list { display: grid; gap: 1rem; margin-top: 1.25rem; padding: 0; list-style: none; }
.project-list .card + .card { margin-top: 0; }
.project { display: grid; grid-template-columns: 2.85rem minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.project p { margin-top: .4rem; color: var(--ink-2); }
.project .tags { margin-top: .2rem; color: var(--muted); font-size: .85rem; font-weight: 500; }

.p-icon, .s-icon {
  width: 2.85rem; height: 2.85rem; padding: .62rem;
  border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Skills */
.skill-grid { display: grid; gap: 1rem; }
.skill-grid .card + .card { margin-top: 0; }
@media (min-width: 40rem) {
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-wide { grid-column: 1 / -1; }
}
.skill h3, .hobby h3 { margin: 1.1rem 0 .85rem; }
.pills { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; list-style: none; }
.pills li {
  padding: .35rem .8rem;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg-soft);
  font-size: .84rem; font-weight: 500;
}

.langs { display: grid; gap: .75rem; padding: 0; list-style: none; }
.langs li { display: grid; grid-template-columns: 4.4rem auto minmax(0, 1fr); align-items: center; gap: .8rem; font-size: .9rem; }
.l-name { font-weight: 650; }
.l-lvl { color: var(--muted); font-size: .8rem; }
.meter { display: inline-flex; gap: 4px; }
.meter i { width: 16px; height: 4px; border-radius: 2px; background: var(--rule-strong); transition: background-color .5s var(--ease); }
.meter i:nth-child(2) { transition-delay: .1s; }
.meter i:nth-child(3) { transition-delay: .2s; }
.meter i:nth-child(4) { transition-delay: .3s; }
.meter[data-level="1"] i:nth-child(-n+1),
.meter[data-level="2"] i:nth-child(-n+2),
.meter[data-level="3"] i:nth-child(-n+3),
.meter[data-level="4"] i:nth-child(-n+4) { background: var(--accent); }

.cert-list { display: grid; gap: 0 2rem; padding: 0; list-style: none; }
.cert-list li {
  display: flex; gap: .75rem; align-items: baseline;
  padding: .6rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: .93rem;
}
.cert-list li::before {
  content: ""; flex: none;
  width: 6px; height: 6px;
  border: 1.5px solid var(--accent);
  transform: translateY(-1px) rotate(45deg);
}
@media (min-width: 40rem) { .cert-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Hobbies */
.hobby-grid { display: grid; gap: 1rem; }
.hobby-grid .card + .card { margin-top: 0; }
.hobby p { color: var(--ink-2); }
@media (min-width: 40rem) { .hobby-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Contact */
.contact-block { padding-bottom: clamp(11rem, 26vw, 19rem); }
.contact-lead { color: var(--muted); }
.big-mail {
  margin: .4rem 0 2rem;
  font-family: var(--display);
  font-size: clamp(1.85rem, 6.2vw, 3.6rem);
  line-height: 1.1; letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.big-mail a {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat;
  transition: color .3s, background-size .5s var(--ease);
}
.big-mail a:hover { color: var(--accent); background-size: 100% 2px; }

.contact { padding-block: .35rem; }
.contact > div {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem;
  padding-block: .75rem;
  border-bottom: 1px solid var(--rule);
}
.contact > div:last-child { border-bottom: 0; }
.contact dt { color: var(--muted); font-size: .9rem; }
.contact dd { margin: 0; }
@media (max-width: 30rem) {
  .contact > div { grid-template-columns: 1fr; gap: .1rem; }
  .contact dt { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
}
.muted { margin-top: 1.25rem; color: var(--muted); }

/* ---------- Background drawings ---------- */
.motif {
  position: absolute; z-index: -1;
  fill: none; stroke: currentColor; stroke-width: 1.2;
  color: var(--draw);
  pointer-events: none;
  translate: 0 var(--py, 0px);
}
.motif text { fill: currentColor; stroke: none; font: 600 10px var(--sans); letter-spacing: .2em; text-anchor: middle; }
.motif .thin { stroke-width: .7; opacity: .7; }

.contours { right: -14rem; top: 1rem; width: 56rem; max-width: none; opacity: .8; }
.contours path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.contours .index { stroke-width: 2.1; }

.target { right: -9rem; top: 3rem; width: 32rem; opacity: .75; }
.target text { font-size: 13px; }
.ticks-ring { stroke-width: 7; stroke-dasharray: .9 9.05; }
.ticks-ring.major { stroke-width: 12; stroke-dasharray: 1.6 90.55; }

.rc { left: -2rem; bottom: 2rem; width: 15rem; opacity: .8; }
.rc .stirrup { stroke-dasharray: 5 4; }
.rc circle { fill: var(--draw); stroke: none; }

.arch { left: 0; bottom: 0; width: 100%; height: auto; opacity: .85; }
.arch path { stroke-dasharray: 1; }

@media (max-width: 59.99rem) {
  .contours { right: -20rem; width: 44rem; opacity: .55; }
  .target { right: -12rem; top: 1rem; width: 24rem; opacity: .5; }
  .rc { left: auto; right: -4rem; bottom: 1rem; width: 10rem; opacity: .45; }
}

/* ---------- Footer ---------- */
.site-footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--rule); }
.footer-block {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rule-strong); border-radius: 12px;
  background: var(--rule-strong);
}
.footer-block > div { display: flex; flex-direction: column; gap: .1rem; padding: .85rem 1rem; background: var(--bg); font-size: .9rem; }
.fb-label { color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
@media (min-width: 48rem) { .footer-block { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Motion (only when the visitor allows it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  @keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
  @keyframes fade-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes drift-a { to { transform: translate(6rem, 4rem) scale(1.08); } }
  @keyframes drift-b { to { transform: translate(-5rem, 3rem) scale(.94); } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes cue { 0% { transform: translateY(-100%); } 100% { transform: translateY(260%); } }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-ring); } 100% { box-shadow: 0 0 0 9px transparent; } }

  /* Hero entrance */
  .line > span { animation: rise 1.25s var(--ease) both .15s; }
  .line + .line > span { animation-delay: .27s; }
  .hero-in { animation: fade-up 1.1s var(--ease) both; animation-delay: calc(var(--i, 0) * .09s + .3s); }

  .truss .draw { stroke-dashoffset: 1; animation: draw 2s var(--ease) forwards; animation-delay: calc(var(--d, 0s) + .35s); }
  .truss .bubbles, .truss .nodes, .truss .t-dim text, .truss .t-note { opacity: 0; animation: fade 1.2s ease forwards 2s; }

  .glow-a { animation: drift-a 24s ease-in-out infinite alternate; }
  .glow-b { animation: drift-b 28s ease-in-out infinite alternate; }

  .scroll-cue i::after { animation: cue 2.2s cubic-bezier(.65, 0, .35, 1) infinite; }
  .live i { animation: pulse 2.2s ease-out infinite; }
  .target .spin { transform-origin: 200px 200px; animation: spin 140s linear infinite; }

  /* Scroll reveals (JS adds .in) */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition:
      opacity 1s var(--ease) calc(var(--i, 0) * 90ms),
      transform 1s var(--ease) calc(var(--i, 0) * 90ms),
      translate .5s var(--ease), box-shadow .5s var(--ease), border-color .5s;
  }
  .js [data-reveal].in { opacity: 1; transform: none; }

  .js .timeline .entry:not(.in)::before { background: var(--bg); }
  .js .skill:not(.in) .meter i { background: var(--rule-strong); }

  .js .dim { transform: scaleX(0); transition: transform 1.3s var(--ease) .25s; }
  .js .in .dim, .js .in.sec-head .dim { transform: scaleX(1); }

  /* Section drawings trace themselves in */
  .js .has-motif .contours path,
  .js .has-motif .arch path { stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s var(--ease) var(--d, 0s); }
  .js .has-motif.in .contours path,
  .js .has-motif.in .arch path { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .progress, .skip-link, .hero-bg, .truss, .motif, .scroll-cue, .actions, .site-footer { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
  .hero { padding: 0 0 1rem; min-height: 0; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .card { box-shadow: none; backdrop-filter: none; border-color: #CCCCCC; }
  .block { padding-block: 1.25rem; }
}
