/* ==========================================================================
   oleg.emeliyanov.it — "flight chart" design system
   Palette inherited from the previous site: zinc neutrals + teal accent.
   ========================================================================== */

:root {
  --font-display: 'Geologica', 'Golos Text', system-ui, sans-serif;
  --font-body: 'Golos Text', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* dark (default, as on the old site) */
  --bg: #0a0a0a;
  --bg-2: #121212;
  --bg-3: #18181b;
  --line: #27272a;
  --line-2: #3f3f46;
  --ink: #f4f4f5;
  --ink-2: #a1a1aa;
  --ink-3: #71717a;
  --accent: #2dd4bf;
  --accent-ink: #5eead4;
  --accent-soft: rgb(45 212 191 / 0.12);
  --accent-deep: #115e59;
  --on-accent: #042f2e;
  --grid: rgb(255 255 255 / 0.035);
  --shadow: 0 30px 60px -30px rgb(0 0 0 / 0.8);

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #fafafa;
    --bg-2: #f4f3f3;
    --bg-3: #ececee;
    --line: #e4e4e7;
    --line-2: #d4d4d8;
    --ink: #18181b;
    --ink-2: #52525b;
    --ink-3: #71717a;
    --accent: #14b8a6;
    --accent-ink: #0f766e;
    --accent-soft: rgb(20 184 166 / 0.12);
    --accent-deep: #99f6e4;
    --on-accent: #042f2e;
    --grid: rgb(0 0 0 / 0.045);
    --shadow: 0 30px 60px -30px rgb(24 24 27 / 0.25);
    color-scheme: light;
  }
}
:root[data-theme='light'] {
  --bg: #fafafa;
  --bg-2: #f4f3f3;
  --bg-3: #ececee;
  --line: #e4e4e7;
  --line-2: #d4d4d8;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #71717a;
  --accent: #14b8a6;
  --accent-ink: #0f766e;
  --accent-soft: rgb(20 184 166 / 0.12);
  --accent-deep: #99f6e4;
  --on-accent: #042f2e;
  --grid: rgb(0 0 0 / 0.045);
  --shadow: 0 30px 60px -30px rgb(24 24 27 / 0.25);
  color-scheme: light;
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html, body { overflow-x: clip; }
::selection { background: var(--accent); color: var(--on-accent); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.mono-label { font: 500 0.72rem/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* blueprint grid, fading out downwards */
.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(60rem 40rem at 85% -10%, var(--accent-soft), transparent 70%);
  background-size: 48px 48px, 48px 48px, 100% 100%;
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}

/* ---------------------------------------------------------------- monogram */

.mono { width: 100%; height: auto; overflow: visible; }
.mono .mono-o, .mono .mono-e { fill: none; stroke: currentColor; stroke-width: 2.2; }
.mono .mono-e { stroke-width: 1.6; }
.mono .mono-arm { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, transform 0.35s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar.hidden { transform: translateY(-100%); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-mono { width: 34px; color: var(--ink); transition: color 0.3s, transform 0.6s var(--ease); }
.brand:hover .brand-mono { color: var(--accent); transform: rotate(-12deg); }
.brand-name { font: 600 0.95rem/1 var(--font-display); letter-spacing: -0.01em; }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 8px 12px; border-radius: 999px;
  font: 500 0.88rem/1 var(--font-body); text-decoration: none; color: var(--ink-2);
  transition: color 0.2s, background 0.2s;
}
.nav a:hover, .nav a.active { color: var(--ink); background: var(--bg-3); }
.nav a.active { color: var(--accent-ink); }
.tools { display: flex; align-items: center; gap: 8px; }
.langs { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.langs a {
  font: 600 0.7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 6px 9px; border-radius: 999px; text-decoration: none; color: var(--ink-3);
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current] { background: var(--accent); color: var(--on-accent); }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-2);
  cursor: pointer; font-size: 18px; transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--line-2); }
.theme-btn svg:first-child { display: none; }
:root[data-theme='light'] .theme-btn svg:first-child { display: block; }
:root[data-theme='light'] .theme-btn svg:last-child { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .theme-btn svg:first-child { display: block; }
  :root:not([data-theme='dark']) .theme-btn svg:last-child { display: none; }
}
.menu-btn { display: none; }

@media (max-width: 920px) {
  .menu-btn { display: grid; }
  .brand-name { display: none; }
  .nav {
    position: fixed; inset: 63px 0 auto 0; z-index: 49;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 24px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav.open { opacity: 1; transform: none; visibility: visible; }
  .nav ul { flex-direction: column; }
  .nav a { font: 600 1.6rem/1.2 var(--font-display); padding: 12px 0; background: none !important; color: var(--ink); }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 999px; border: 1px solid transparent;
  font: 600 0.92rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.btn svg { font-size: 1.1em; transition: transform 0.3s var(--ease); }
.btn:hover svg:last-child { transform: translateX(3px); }
.btn-accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px -12px var(--accent); }
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px var(--accent); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------------------------------------------------------------- load + reveal motion */

.js .load { opacity: 0; transform: translateY(18px); animation: rise 0.9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 110ms + 120ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- hero */

.hero { padding: clamp(48px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); position: relative; overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 6vw, 80px); align-items: center; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px;
  font: 500 0.76rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink);
}
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hero-main { container-type: inline-size; min-width: 0; }
.hero-title {
  font-size: clamp(2.6rem, 16.5cqi, 8.6rem); font-weight: 800; line-height: 0.88; letter-spacing: -0.045em;
  display: flex; flex-direction: column; margin-bottom: 32px;
}
.hero-title .outline {
  color: transparent; -webkit-text-stroke: 1.5px var(--ink);
  background: linear-gradient(90deg, var(--accent), var(--accent)) no-repeat 0 100% / 0% 100%;
  -webkit-background-clip: text; background-clip: text;
  transition: background-size 1.2s var(--ease);
}
.hero-title .outline:hover { background-size: 100% 100%; }
.hero-lead { font-size: clamp(1.08rem, 1.7vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 36ch; margin-bottom: 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-side { display: flex; flex-direction: column; gap: 28px; }
.hero-mono { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; color: var(--ink); }
.hero-mono::before {
  content: ''; position: absolute; inset: -14%; border-radius: 50%;
  border: 1px dashed var(--line-2);
  animation: spin 80s linear infinite;
}
.hero-mono::after {
  content: ''; position: absolute; inset: 10%; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%); z-index: -1;
}
.mono-draw .mono-o, .mono-draw .mono-e { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s var(--ease) 0.3s forwards; }
.mono-draw .mono-e { animation-delay: 0.9s; animation-duration: 0.9s; }
.mono-draw .mono-arm { transform-origin: 35% 50%; transform: scaleX(0); animation: arm 0.9s var(--ease) forwards; }
.mono-draw .mono-arm:nth-of-type(1) { animation-delay: 1.3s; }
.mono-draw .mono-arm:nth-of-type(2) { animation-delay: 1.45s; }
.mono-draw .mono-arm:nth-of-type(3) { animation-delay: 1.6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes arm { to { transform: scaleX(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit { position: absolute; inset: -14%; animation: spin 18s linear infinite; pointer-events: none; }
.orbit svg { position: absolute; top: -9px; left: 50%; font-size: 18px; color: var(--accent); fill: var(--accent); stroke: none; transform: translateX(-50%) rotate(90deg); }

.readout { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--bg-2) 80%, transparent); overflow: hidden; }
.readout > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.readout > div:last-child { border-bottom: 0; }
.readout dt { font: 500 0.7rem/1.6 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.readout dd { margin: 0; font-size: 0.88rem; text-align: right; }
.readout .status { justify-content: flex-start; background: var(--accent-soft); }
.readout .status dd { display: flex; align-items: center; gap: 10px; color: var(--accent-ink); font-weight: 500; text-align: left; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 2s ease-out infinite; }
@keyframes ping { to { transform: scale(3.2); opacity: 0; } }

/* the route: three roles as waypoints, a plane flying between them */
.route {
  position: relative; list-style: none; padding: 0; margin: clamp(48px, 7vw, 88px) 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px dashed var(--line-2);
}
.route li { position: relative; padding: 26px 16px 0 0; display: flex; flex-direction: column; gap: 6px; }
.route li::before {
  content: ''; position: absolute; top: -7px; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.wp-code { font: 600 0.78rem/1 var(--font-mono); letter-spacing: 0.16em; color: var(--accent-ink); }
.wp-label { font: 600 clamp(1.05rem, 2vw, 1.45rem)/1.2 var(--font-display); letter-spacing: -0.01em; }
.route-plane { position: absolute; top: -10px; left: 0; color: var(--accent); font-size: 20px; animation: fly 12s var(--ease) infinite; }
.route-plane svg { fill: var(--accent); stroke: none; transform: rotate(90deg); }
@keyframes fly {
  0% { left: 0; opacity: 0; }
  6% { opacity: 1; }
  30%, 38% { left: 33.33%; }
  64%, 72% { left: 66.66%; }
  94% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* ---------------------------------------------------------------- sections */

.section { padding: clamp(72px, 10vw, 140px) 0; border-top: 1px solid var(--line); position: relative; }
.section::before, .section::after {
  content: '+'; position: absolute; top: -0.7em; font: 300 1.2rem/1 var(--font-mono); color: var(--ink-3);
}
.section::before { left: var(--gutter); }
.section::after { right: var(--gutter); }
.sec-head { margin-bottom: clamp(36px, 5vw, 64px); max-width: 760px; }
.sec-index { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; font: 500 0.74rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.sec-index span:first-child { color: var(--accent-ink); }
.sec-index .rule { width: 48px; height: 1px; background: var(--line-2); }
.sec-title { font-size: clamp(2.2rem, 5.4vw, 4.2rem); font-weight: 700; letter-spacing: -0.035em; }
.sec-lead { margin-top: 18px; color: var(--ink-2); font-size: 1.1rem; max-width: 52ch; }

/* about */
.about-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.pull { margin: 0; position: sticky; top: 110px; }
.pull p {
  font: 300 clamp(1.5rem, 2.7vw, 2.15rem)/1.25 var(--font-display); letter-spacing: -0.02em;
  padding-left: 28px; border-left: 2px solid var(--accent);
}
.prose { color: var(--ink-2); font-size: 1.08rem; }
.prose p:first-child::first-letter {
  float: left; font: 700 3.6em/0.8 var(--font-display); color: var(--accent); margin: 0.08em 0.1em 0 0;
}
.prose a { color: var(--accent-ink); }
.prose strong { color: var(--ink); }

/* cv */
.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: -24px 0 48px; }
.cv-grid { display: grid; grid-template-columns: 7fr 4fr; gap: clamp(32px, 6vw, 96px); }
.cv-h { font: 500 0.76rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 24px; }
.cv-h:not(:first-child) { margin-top: 56px; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.tl-item { position: relative; padding: 0 0 36px 28px; display: grid; grid-template-columns: 130px 1fr; gap: 20px; }
.tl-item::before {
  content: ''; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; transform: rotate(45deg);
  background: var(--bg); border: 1.5px solid var(--accent);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-period { margin: 0; font: 500 0.8rem/1.7 var(--font-mono); color: var(--ink-3); }
.tl-body h4 { font-size: 1.22rem; font-weight: 600; margin-bottom: 8px; }
.tl-body h4 a { text-decoration: none; border-bottom: 1px solid var(--accent); }
.tl-body .at { color: var(--ink-3); font-weight: 300; }
.tl-body p { color: var(--ink-2); margin: 0; }
.skill-group { margin-bottom: 26px; }
.skill-group h4 { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 0.86rem; color: var(--ink-2); }
.lang-list { list-style: none; margin: 0; padding: 0; }
.lang-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.lang-list .muted { grid-column: 1 / -1; font-size: 0.82rem; }
.meter { display: flex; gap: 4px; }
.meter i { width: 18px; height: 4px; border-radius: 2px; background: var(--accent); }
.meter i.off { background: var(--line-2); }

/* projects */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
  font: 500 0.82rem/1 var(--font-body); padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); transition: all 0.2s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden; transition: border-color 0.3s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: var(--shadow); }
.card.featured { grid-column: span 2; grid-row: span 2; }
.card[hidden] { display: none; }
.card.featured.featured-off { grid-column: auto; grid-row: auto; }
.card.featured.featured-off .card-media { aspect-ratio: 16 / 10; min-height: 0; flex: none; }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-3); }
.card.featured .card-media { aspect-ratio: auto; flex: 1; min-height: 280px; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), filter 0.6s; filter: saturate(0.85); }
.card:hover .card-img { transform: scale(1.05); filter: saturate(1.05); }
.cover-blank { display: grid; place-items: center; color: var(--line-2); background: repeating-linear-gradient(-45deg, transparent 0 12px, var(--grid) 12px 13px); }
.cover-blank .mono { width: 34%; }
.ticks { position: absolute; inset: 10px; pointer-events: none; opacity: 0; transition: opacity 0.3s, inset 0.4s var(--ease); }
.ticks, .ticks::before, .ticks::after { --c: var(--accent); }
.ticks { background:
  linear-gradient(var(--c), var(--c)) 0 0 / 14px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) 0 0 / 1.5px 14px no-repeat,
  linear-gradient(var(--c), var(--c)) 100% 0 / 14px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) 100% 0 / 1.5px 14px no-repeat,
  linear-gradient(var(--c), var(--c)) 0 100% / 14px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) 0 100% / 1.5px 14px no-repeat,
  linear-gradient(var(--c), var(--c)) 100% 100% / 14px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) 100% 100% / 1.5px 14px no-repeat; }
.card:hover .ticks { opacity: 1; inset: 14px; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.card-meta { display: flex; align-items: center; gap: 12px; margin: 0; font: 500 0.74rem/1 var(--font-mono); color: var(--ink-3); letter-spacing: 0.06em; }
.tag { padding: 5px 9px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.1em; }
.card-title { font-size: 1.4rem; font-weight: 650; }
.card.featured .card-title { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.card-title a { text-decoration: none; }
.card-title a::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.card-text { color: var(--ink-2); margin: 0; font-size: 0.97rem; }
.card-link { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--accent-ink); }
.card-link .mono-label { color: inherit; text-transform: none; letter-spacing: 0.02em; }

/* news log */
.log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.log-row a {
  display: grid; grid-template-columns: 180px 1fr 48px; gap: 24px; align-items: baseline;
  padding: 28px 0; border-bottom: 1px solid var(--line); text-decoration: none; position: relative;
}
.log-row a::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease);
}
.log-row a:hover::before { transform: scaleX(1); }
.log-row time { font: 500 0.8rem/1.6 var(--font-mono); color: var(--ink-3); }
.log-main { display: flex; flex-direction: column; gap: 6px; }
.log-title { font: 600 clamp(1.2rem, 2.2vw, 1.6rem)/1.2 var(--font-display); letter-spacing: -0.015em; transition: color 0.2s; }
.log-row a:hover .log-title { color: var(--accent-ink); }
.log-excerpt { color: var(--ink-2); }
.log-go { justify-self: end; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 18px; transition: all 0.3s var(--ease); }
.log-row a:hover .log-go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: rotate(-45deg); }
.more { margin-top: 36px; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 96px); }
.direct ul { list-style: none; margin: 14px 0 0; padding: 0; }
.direct a { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 1.1rem; }
.direct a:hover span:last-child { color: var(--accent-ink); }
.form { display: flex; flex-direction: column; gap: 18px; padding: clamp(22px, 3vw, 36px); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); background: var(--bg-2); }
.hp { position: absolute; left: -9999px; }
.topics { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.topics legend { font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; padding: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: 0.88rem; color: var(--ink-2); transition: all 0.2s; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 12px 14px; transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.was-validated .field :invalid { border-color: #f87171; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.88rem; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.was-validated .check input:invalid + span { color: #f87171; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-status { margin: 0; font-size: 0.92rem; }
.form-status.ok { color: var(--accent-ink); }
.form-status.err { color: #f87171; }
.form.sent > :not(.form-foot) { display: none; }
.form.sent { min-height: 260px; justify-content: center; text-align: center; }
.form.sent .form-foot { justify-content: center; }
.form.sent .form-status { font: 600 clamp(1.2rem, 2.4vw, 1.6rem)/1.35 var(--font-display); max-width: 26ch; }
.form.sent .form-status::before { content: '✓'; display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 1.6rem; }

/* inner pages */
.page-top { border-top: 0; padding-top: clamp(40px, 6vw, 80px); }
.page-top::before, .page-top::after { display: none; }
.crumbs { font: 500 0.78rem/1 var(--font-mono); color: var(--ink-3); margin-bottom: 40px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }
.article-head { margin-bottom: 40px; }
.article-head .card-meta { margin-bottom: 20px; }
.article-title { font-size: clamp(2.2rem, 6vw, 4.4rem); font-weight: 750; letter-spacing: -0.035em; margin-bottom: 20px; }
.article-lead { font-size: 1.25rem; color: var(--ink-2); }
.article-cover { position: relative; margin: 0 0 48px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.article-cover .ticks { opacity: 1; }
.article-body { font-size: 1.12rem; }
.article-body p:first-child::first-letter { float: none; font: inherit; color: inherit; margin: 0; }
.article-body h2, .article-body h3 { color: var(--ink); margin: 1.8em 0 0.6em; }
.article-body h2 { font-size: 1.8rem; }
.article-body h3 { font-size: 1.35rem; }
.article-body img { border-radius: 10px; margin: 1.6em 0; }
.article-body blockquote { margin: 1.5em 0; padding-left: 22px; border-left: 2px solid var(--accent); color: var(--ink); font-size: 1.2rem; }
.article-body code { font-family: var(--font-mono); font-size: 0.88em; background: var(--bg-3); padding: 2px 6px; border-radius: 5px; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li::marker { color: var(--accent); }
.article-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.nf-code { font: 800 clamp(6rem, 22vw, 14rem)/0.9 var(--font-display); color: transparent; -webkit-text-stroke: 1.5px var(--accent); margin-bottom: 24px; letter-spacing: -0.05em; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 48px var(--gutter) 56px; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.footer-mono { width: 52px; color: var(--ink-3); }
.footer-name { margin: 0; font: 600 1rem/1.3 var(--font-display); }
.footer .muted { margin: 0; font-size: 0.86rem; }
.footer-langs { list-style: none; display: flex; gap: 18px; margin: 0 0 0 auto; padding: 0; font-size: 0.88rem; }
.footer-langs a { color: var(--ink-2); text-decoration: none; }
.footer-langs a:hover { color: var(--accent-ink); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1020px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .card.featured { grid-row: auto; }
}
@media (max-width: 860px) {
  .hero-grid, .about-grid, .cv-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; align-items: center; }
  .hero-mono { width: 132px; margin: 0 12px; flex: none; }
  .readout { flex: 1; }
  .pull { position: static; }
  .log-row a { grid-template-columns: 1fr 44px; gap: 8px 16px; }
  .log-row time { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero-side { flex-direction: column; align-items: stretch; }
  .hero-mono { width: 150px; margin: 8px auto 0; }
  .route { grid-template-columns: 1fr; border-top: 0; border-left: 1px dashed var(--line-2); margin-left: 6px; }
  .route li { padding: 0 0 26px 26px; }
  .route li::before { top: 3px; left: -7px; }
  .route-plane { display: none; }
  .project-grid { grid-template-columns: 1fr; }
  .card.featured { grid-column: auto; }
  .row2 { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; gap: 4px; padding-left: 22px; }
  .langs a { padding: 6px 7px; }
  .footer-langs { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .js .load, .js .reveal { opacity: 1; transform: none; }
  .route-plane, .orbit { display: none; }
}

/* ---------------------------------------------------------------- print: the page becomes the CV */

@media print {
  :root { --bg: #fff; --bg-2: #fff; --ink: #000; --ink-2: #333; --ink-3: #666; --line: #ddd; --line-2: #ccc; --accent: #0f766e; --accent-ink: #0f766e; }
  body { font-size: 11pt; }
  .grid-bg, .topbar, .footer, .about, .projects, .news, .contact, .hero-cta, .hero-mono, .route-plane, .cv-actions, .skip { display: none !important; }
  .hero { padding: 0 0 12pt; }
  .hero-title { font-size: 34pt; margin-bottom: 8pt; }
  .hero-title .outline { -webkit-text-stroke: 0; color: #000; }
  .hero-grid { grid-template-columns: 1fr 200px; }
  .route { margin-top: 12pt; }
  .section { padding: 16pt 0; border: 0; }
  .section::before, .section::after { display: none; }
  .sec-index { display: none; }
  .sec-title { font-size: 20pt; }
  .js .load, .js .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
  .tl-item { break-inside: avoid; }
}
