/* ============================================================
   rayendhahri.com — one quiet, editorial system.
   Warm paper and graphite, thin rules, a single teal accent.
   No glow, no blur, no motion beyond colour transitions.
   ============================================================ */

:root,
:root[data-theme="light"] {
  --bg:          #ffffff;
  --bg-raised:   #fafafa;
  --bg-inset:    #f2f3f4;
  --ink:         #1a232d;
  --ink-strong:  #0d1620;
  --muted:       #4a545f;
  --faint:       #6a6f76;
  --line:        #e4e6e9;
  --line-strong: #c3c7cc;
  --accent:      #0b6b78;
  --accent-soft: rgba(11, 107, 120, 0.07);
  --on-ink:      #ffffff;

  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --wrap: 1080px;
  --gutter: 32px;
  --nav-h: 64px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:          #0b0e13;
  --bg-raised:   #11161d;
  --bg-inset:    #161c24;
  --ink:         #dfe6ec;
  --ink-strong:  #ffffff;
  --muted:       #a0abb7;
  --faint:       #7d8996;
  --line:        rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent:      #4cc3d4;
  --accent-soft: rgba(76, 195, 212, 0.10);
  --on-ink:      #0b0e13;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .2s ease, color .2s ease;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p a, dd a, .prose a, .entry ul a { color: var(--ink-strong); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
p a:hover, dd a:hover, .prose a:hover, .entry ul a:hover { color: var(--accent); text-decoration-color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; color: var(--ink-strong); letter-spacing: -.025em; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
strong { font-weight: 600; color: var(--ink-strong); }
::selection { background: var(--accent); color: var(--on-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--ink-strong); color: var(--bg); border-radius: 6px; font-size: 14px; }
.skip-link:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: var(--bg); border-bottom: 1px solid var(--line); transition: background-color .2s ease; }
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-name { display: inline-flex; align-items: center; gap: 10px; font: 500 17px var(--font-head); letter-spacing: -.02em; color: var(--ink-strong); white-space: nowrap; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 4px; }
.nav-links a { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 6px; font-size: 14px; color: var(--muted); transition: color .15s, background-color .15s; }
.nav-links a:hover { color: var(--ink-strong); background: var(--bg-inset); }
.nav-links a[aria-current="page"] { color: var(--ink-strong); }
.nav-links a[aria-current="page"]::after { content: ''; display: block; width: 4px; height: 4px; margin-left: 7px; border-radius: 50%; background: var(--accent); }
.nav-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.icon-btn:hover { color: var(--ink-strong); border-color: var(--line-strong); }
.theme-toggle .icon-moon, :root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
.nav-toggle { display: none; }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle span + span { margin-top: 4px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Shared type ---------- */
.label { font: 12px/1.5 var(--font-mono); letter-spacing: .04em; color: var(--faint); }
.label-accent { color: var(--accent); }
.lede { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 640px; }

/* ---------- Page heads ---------- */
.page-head { padding: 88px 0 56px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-top: 16px; font-size: clamp(38px, 5.6vw, 60px); line-height: 1.04; letter-spacing: -.04em; max-width: 820px; }
.page-head .lede { margin-top: 22px; }

/* ---------- Home hero ---------- */
.hero { padding: 104px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: start; }
.hero-photo { margin: 6px 0 0; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-inset); }
.hero h1 { font-size: clamp(44px, 7.4vw, 84px); line-height: 1; letter-spacing: -.045em; }
.hero-role { margin-top: 20px; font: 400 clamp(19px, 2.2vw, 23px)/1.4 var(--font-head); letter-spacing: -.015em; color: var(--ink); }
.hero-role span { color: var(--faint); }
.hero .lede { margin-top: 28px; }
.hero .lede + .lede { margin-top: 14px; font-size: 17px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 36px; }
.link-row a { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-strong); border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: color .15s, border-color .15s; }
.link-row a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Facts strip ---------- */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.facts > div { padding: 28px 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.facts > div:first-child { border-left: 0; padding-left: 0; }
.facts b { font: 500 26px/1.1 var(--font-head); letter-spacing: -.03em; color: var(--ink-strong); }
.facts span { font-size: 14px; line-height: 1.5; color: var(--ink); }
.facts small { font: 11px/1.5 var(--font-mono); color: var(--faint); letter-spacing: .02em; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 48px; }
.section-head h2 { margin-top: 12px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -.035em; }
.section-head p:not(.label) { margin-top: 14px; max-width: 560px; color: var(--muted); }
.more-link { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 14px; color: var(--muted); transition: color .15s; }
.more-link:hover { color: var(--accent); }

/* ---------- News ---------- */
.news { list-style: none; border-top: 1px solid var(--line); }
.news li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.news time { font: 12px/1.9 var(--font-mono); color: var(--faint); }
.news p { color: var(--ink); }

/* ---------- Publications ---------- */
.pubs { list-style: none; }
.pub { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding: 40px 0; border-top: 1px solid var(--line); }
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub-thumb { align-self: start; display: block; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; transition: border-color .15s; }
.pub-thumb:hover { border-color: var(--line-strong); }
.pub-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; padding: 10px; }
.pub-venue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font: 500 11px var(--font-mono); letter-spacing: .03em; color: var(--accent); background: var(--accent-soft); }
.badge-plain { color: var(--muted); background: var(--bg-inset); }
.pub h3 { margin-top: 12px; font-size: 21px; line-height: 1.3; letter-spacing: -.02em; }
.pub h3 a { transition: color .15s; }
.pub h3 a:hover { color: var(--accent); }
.pub-authors { margin-top: 10px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.pub-authors strong { color: var(--ink-strong); font-weight: 600; }
.pub-venue-full { margin-top: 4px; font-size: 14px; font-style: italic; color: var(--faint); }
.pub-summary { margin-top: 14px; color: var(--ink); max-width: 680px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-raised); font: 500 12px var(--font-mono); letter-spacing: .02em; color: var(--ink-strong); cursor: pointer; transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-primary { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--bg); }
.chip-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-ink); }

.results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); }
.results > div { padding: 14px 16px; border-left: 1px solid var(--line); }
.results > div:first-child { border-left: 0; }
.results dt { font: 500 19px/1.2 var(--font-head); letter-spacing: -.02em; color: var(--ink-strong); }
.results dd { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.pub-more { margin-top: 18px; border-top: 1px solid var(--line); }
.pub-more details { border-bottom: 1px solid var(--line); }
.pub-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; list-style: none; font: 500 12px var(--font-mono); letter-spacing: .03em; color: var(--muted); transition: color .15s; }
.pub-more summary::-webkit-details-marker { display: none; }
.pub-more summary::after { content: '+'; font: 400 16px var(--font-mono); color: var(--faint); }
.pub-more details[open] summary::after { content: '−'; }
.pub-more summary:hover { color: var(--ink-strong); }
.pub-more .detail-body { padding: 4px 0 22px; color: var(--ink); font-size: 15px; }
.pub-more .detail-body p + p { margin-top: 12px; }
.pub-more figure { margin: 0; }
.pub-more figure img { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 8px; }
.pub-more figcaption { margin-top: 10px; font-size: 13px; color: var(--faint); }
.bibtex { position: relative; }
.bibtex pre { margin: 0; padding: 16px 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-inset); font: 12.5px/1.7 var(--font-mono); color: var(--ink); white-space: pre; }
.bibtex .chip { position: absolute; top: 10px; right: 10px; height: 26px; }

.teaser { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 28px; font-size: 15px; color: var(--muted); }
.teaser b { font-weight: 500; color: var(--ink-strong); }
.teaser .more-link { margin-left: auto; }

.pubs-year { margin-top: 64px; }
.pubs-year:first-child { margin-top: 0; }
.pubs-year > h2 { font: 500 13px var(--font-mono); letter-spacing: .06em; color: var(--faint); margin-bottom: 4px; }

/* ---------- Notes / callouts ---------- */
.callout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding: 32px 0; border-top: 1px solid var(--line); }
.callout:last-child { border-bottom: 1px solid var(--line); }
.callout h3 { font-size: 19px; }
.callout p { color: var(--muted); max-width: 640px; }
.callout p + p { margin-top: 10px; }

/* ---------- Interests ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.pillars article { padding: 28px 28px 8px; border-left: 1px solid var(--line); }
.pillars article:first-child { border-left: 0; padding-left: 0; }
.pillars h3 { margin-top: 14px; font-size: 20px; }
.pillars p { margin-top: 10px; font-size: 15px; color: var(--muted); }

/* ---------- Affiliations ---------- */
.affils { display: flex; flex-wrap: wrap; gap: 10px 36px; margin-top: 8px; }
.affils span { font: 500 17px var(--font-head); letter-spacing: -.01em; color: var(--muted); transition: color .2s ease; }
.affils span:hover { color: var(--ink-strong); }

/* ---------- Two-column prose (About) ---------- */
.split { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; }
.split aside { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; }
.facts-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.facts-list div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts-list dt { font: 11px var(--font-mono); letter-spacing: .04em; color: var(--faint); }
.facts-list dd { margin: 4px 0 0; font-size: 15px; color: var(--ink-strong); }
.prose { max-width: 680px; }
.prose h2 { font-size: 24px; letter-spacing: -.025em; margin: 56px 0 16px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink); font-size: 17px; line-height: 1.75; }
.prose p + p { margin-top: 18px; }
.prose ul { margin: 18px 0; padding-left: 20px; }
.prose li { font-size: 17px; line-height: 1.7; margin-top: 8px; }
.prose .traits { margin: 24px 0 8px; border-top: 1px solid var(--line); }
.traits div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.traits dt { font: 500 17px var(--font-head); letter-spacing: -.015em; color: var(--ink-strong); }
.traits dd { margin: 6px 0 0; font-size: 16px; line-height: 1.7; color: var(--muted); }
.prose blockquote { margin: 28px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); font: 400 20px/1.5 var(--font-head); letter-spacing: -.01em; color: var(--ink-strong); }

/* ---------- CV ---------- */
.cv-block { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding: 56px 0; border-top: 1px solid var(--line); }
.cv-block:first-of-type { border-top: 0; }
.cv-block > h2 { font-size: 22px; }
.entries { list-style: none; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 4px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; }
.entry h3 { font-size: 17px; letter-spacing: -.015em; }
.entry .org { grid-column: 1; font-size: 14.5px; color: var(--muted); }
.entry time { grid-column: 2; grid-row: 1; text-align: right; font: 12px/1.9 var(--font-mono); color: var(--faint); white-space: nowrap; }
.entry ul { grid-column: 1 / -1; margin-top: 10px; padding-left: 18px; color: var(--ink); font-size: 15px; }
.entry li + li { margin-top: 4px; }
.entry li::marker { color: var(--faint); }
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline .entry { position: relative; }
.timeline .entry::before { content: ''; position: absolute; left: -30px; top: 27px; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--bg); transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.timeline .entry:first-child::before { top: 7px; }
.timeline .entry h3 { transition: color .2s ease; }
.timeline .entry:hover::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline .entry:hover h3 { color: var(--accent); }
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.skills div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.skills dt { font: 11px var(--font-mono); letter-spacing: .04em; color: var(--faint); }
.skills dd { margin: 4px 0 0; font-size: 15px; color: var(--ink); }
.cv-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-btn[aria-pressed="true"] { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--bg); }
.projects { list-style: none; border-top: 1px solid var(--line); }
.project { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.project[hidden] { display: none; }
.project-meta { display: flex; flex-direction: column; gap: 4px; }
.project-meta .label:first-child { color: var(--accent); }
.project h3 { font-size: 19px; line-height: 1.3; }
.project p { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 680px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font: 11.5px var(--font-mono); color: var(--faint); }
.project .pub-links { margin-top: 14px; }

/* ---------- Notes list ---------- */
.notes { list-style: none; border-top: 1px solid var(--line); }
.notes li a { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 24px; align-items: baseline; padding: 24px 0; border-bottom: 1px solid var(--line); }
.notes time { font: 12px var(--font-mono); color: var(--faint); }
.notes h3 { font-size: 19px; transition: color .15s; }
.notes p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.notes .arrow { color: var(--faint); transition: color .15s, transform .15s; }
.notes li a:hover h3, .notes li a:hover .arrow { color: var(--accent); }

/* ---------- Post ---------- */
.post-head { padding: 88px 0 48px; border-bottom: 1px solid var(--line); }
.post-head h1 { margin-top: 16px; font-size: clamp(36px, 5vw, 54px); line-height: 1.06; letter-spacing: -.04em; max-width: 760px; }
.post-head .lede { margin-top: 18px; }
.post-body { padding: 64px 0 96px; }
.post-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }

/* ---------- Humility note ---------- */
.humble { padding: 72px 0; border-top: 1px solid var(--line); }
.humble-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 40px; align-items: center; }
.humble-figure { width: 160px; height: 160px; border-radius: 16px; background: #fff; border: 1px solid var(--line); transition: transform .3s ease; }
.humble-figure:hover { transform: translateY(-4px) rotate(-2deg); }
.humble-joke { margin-top: 12px; max-width: 560px; font: 400 clamp(19px, 2.2vw, 23px)/1.45 var(--font-head); letter-spacing: -.015em; color: var(--ink-strong); }
.humble-aside { margin-top: 8px; font: 13px var(--font-mono); color: var(--faint); }
@media (max-width: 600px) {
  .humble-row { grid-template-columns: 1fr; gap: 20px; }
  .humble-figure { width: 128px; height: 128px; }
}

/* ---------- Contact band ---------- */
.contact { padding: 88px 0; border-top: 1px solid var(--line); }
.contact .wrap { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.contact h2 { margin-top: 12px; font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.035em; max-width: 620px; line-height: 1.15; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--ink-strong); background: var(--ink-strong); color: var(--bg); font-size: 15px; font-weight: 500; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-ink); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }
.footer nav { display: flex; gap: 20px; }
.footer a { transition: color .15s; }
.footer a:hover { color: var(--ink-strong); }

/* ---------- 404 ---------- */
.not-found { min-height: calc(100vh - var(--nav-h) - 90px); display: grid; place-items: center; text-align: center; }
.not-found h1 { margin: 14px 0 12px; font-size: 72px; letter-spacing: -.05em; }
.not-found p { color: var(--muted); margin-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; }
  .pub { grid-template-columns: 1fr; gap: 24px; }
  .pub-thumb { max-width: 420px; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results > div:nth-child(3) { border-left: 0; }
  .results > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pillars { grid-template-columns: 1fr; }
  .pillars article { border-left: 0; padding-left: 0; padding-right: 0; border-top: 1px solid var(--line); }
  .pillars article:first-child { border-top: 0; }
  .split, .cv-block, .callout { grid-template-columns: 1fr; gap: 24px; }
  .split aside { position: static; }
  .project { grid-template-columns: 1fr; gap: 10px; }
  .project-meta { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; }
}

@media (max-width: 768px) {
  :root { --gutter: 16px; }
  .nav-toggle { display: inline-grid; place-content: center; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 0; flex-direction: column; align-items: stretch; gap: 0; padding: 12px 16px; background: var(--bg); visibility: hidden; opacity: 0; transition: opacity .2s ease, visibility .2s; }
  .nav-links.open { visibility: visible; opacity: 1; }
  .nav-links a { display: flex; height: 52px; padding: 0 4px; font-size: 18px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-links a:hover { background: transparent; }
  .hero { padding: 48px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { order: -1; width: 168px; margin: 0; }
  .page-head, .post-head { padding: 56px 0 40px; }
  .section { padding: 64px 0; }
  .section-head { flex-direction: column; align-items: start; margin-bottom: 32px; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .entry { grid-template-columns: 1fr; }
  .entry time { grid-column: 1; grid-row: auto; text-align: left; }
  .skills { grid-template-columns: 1fr; }
  .notes li a { grid-template-columns: 1fr; gap: 6px; }
  .notes .arrow { display: none; }
  .contact { padding: 64px 0; }
}

@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr; }
  .facts > div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .facts > div:first-child { border-top: 0; }
  .results { grid-template-columns: 1fr; }
  .results > div { border-left: 0; border-top: 1px solid var(--line); }
  .results > div:first-child { border-top: 0; }
}

/* ---------- Print (CV) ---------- */
@media print {
  .nav, .footer, .contact, .cv-tools, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-head { padding: 0 0 16px; }
  .cv-block { padding: 20px 0; break-inside: avoid; }
  .entry { break-inside: avoid; }
  a { text-decoration: none !important; }
}
