/* roflex.su — общие стили. Токены и вёрстка перенесены 1-в-1 из дизайн-макета
   (Подсистема дизайна Claude, design_handoff_personal_site). */

:root {
  --bg: light-dark(rgb(255 249 238), rgb(21 19 11));
  --text: light-dark(rgb(30 27 19), rgb(232 226 212));
  --soft: light-dark(rgb(75 71 57), rgb(205 198 180));
  --muted: light-dark(rgb(150 144 128), rgb(120 114 98));
  --accent: light-dark(rgb(109 94 15), rgb(219 198 110));
  --accent-hover: light-dark(rgb(83 70 0), rgb(248 226 135));
  --fill: light-dark(rgb(238 226 188), rgb(78 71 42));
  --on-fill: light-dark(rgb(78 71 42), rgb(238 226 188));
  --border: light-dark(rgb(205 198 180), rgb(75 71 57));
  --border-weak: light-dark(rgb(232 224 207), rgb(52 49 38));
  --card: light-dark(rgb(244 237 223), rgb(34 32 23));
  --card-hover: light-dark(rgb(238 232 218), rgb(45 42 33));
  --knob: light-dark(rgb(255 249 238), rgb(232 226 212));
  --mono: ui-monospace, 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;
}

html, body { margin: 0; padding: 0; color-scheme: light dark; background: var(--bg); font-family: 'Noto Sans', sans-serif; transition: background 0.35s ease; }
* { transition-property: background, background-color, color, border-color; transition-duration: 0.35s; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.msym { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 18px; }

.page { min-height: 100vh; display: flex; flex-direction: column; color: var(--text); }

/* ── Навигация ── */
.topnav { max-width: 920px; width: 100%; margin: 0 auto; box-sizing: border-box; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
/* padding+отрицательный margin: позиции плашек не меняются, но край клиппинга
   отодвинут на 10px наружу — запас, чтобы при быстрой прокрутке отставшая от
   пересчёта плашка не обрезалась жёстко; overflow-y:hidden гасит вертикальный люфт */
.nav-pills { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 0 10px; margin: 0 -10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav-pills::-webkit-scrollbar { display: none; }
/* капсула пилюли собрана слоями (снизу вверх): заливка .pill-bg → текст .pill-t →
   градиентный «туман» .pill-fade-l/r цвета внутренности → обводка .pill-line.
   При сжатии у края скролла заливка и обводка сужаются, текст тает под туманом.
   Масок нет намеренно: mask-image на композитном скролле Chrome не перерисовывается. */
/* вместо прозрачной рамки — +1px в паддинге: размер тот же, но padding-box
   совпадает с границей капсулы, и absolute-слои ложатся на неё пиксель в пиксель */
a.pill { position: relative; white-space: nowrap; flex-shrink: 0; padding: 9px 19px; border-radius: 100px; font-size: 16px; font-family: var(--mono); border: none; color: var(--accent); --pillbg: var(--bg); will-change: transform; }
.pill-bg { position: absolute; inset: 0; border-radius: 100px; pointer-events: none; }
.pill-line { position: absolute; inset: 0; border-radius: 100px; border: 1px solid var(--border); pointer-events: none; }
/* .pill-t — невидимая копия текста в потоке (размер пилюли + доступность),
   видимый текст — .pill-tv внутри клипа: вне капсулы глифов не существует */
.pill-t { display: inline-block; position: relative; color: transparent; }
.pill-clip { position: absolute; inset: 0; border-radius: 100px; overflow: hidden; pointer-events: none; }
.pill-tv { position: absolute; left: 0; top: 0; box-sizing: border-box; white-space: nowrap; }
.pill-fade-l, .pill-fade-r { position: absolute; top: 0; bottom: 0; width: 28px; display: none; }
.pill-fade-r { right: 0; background: linear-gradient(to right, transparent, var(--pillbg) 14px); }
.pill-fade-l { left: 0; background: linear-gradient(to left, transparent, var(--pillbg) 14px); }
a.pill:hover { color: var(--accent); --pillbg: var(--card); }
a.pill:hover .pill-bg { background: var(--card); }
a.pill--active, a.pill--active:hover { font-weight: 600; padding: 8px 18px; color: var(--on-fill); --pillbg: var(--fill); }
a.pill--active .pill-bg { background: var(--fill); }
a.pill--active .pill-line { border-color: transparent; }

.theme-toggle { position: relative; flex-shrink: 0; display: flex; gap: 4px; align-items: center; border: 1px solid var(--border); border-radius: 100px; padding: 3px; }
.theme-pill { position: absolute; top: 3px; left: 3px; width: 32px; height: 32px; border-radius: 100px; background: var(--fill); transition: left 0.25s ease, width 0.25s ease; }
/* стартовая позиция таблетки до запуска JS — по data-theme, который ставит ранний скрипт в <head> */
:root[data-theme="dark"] .theme-pill { left: 75px; }
:root[data-theme="auto"] .theme-pill { width: 68px; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-pill { left: 39px; }
}
.theme-toggle button { position: relative; width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; background: transparent; color: var(--soft); padding: 0; }

/* ── Главная: hero + маятник ── */
.hero { min-height: calc(100vh - 180px); display: flex; align-items: center; justify-content: center; gap: 24px; padding: 48px 24px; box-sizing: border-box; flex-wrap: wrap; }
.hero-text-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; flex: 1 1 320px; min-width: 0; max-width: 560px; }
.hero-text { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.hero-text h1 { margin: 0; font-size: 42px; font-weight: 700; letter-spacing: -0.5px; }
.hero-text p { margin: 0; font-size: 18px; line-height: 1.6; color: var(--soft); }
.hero-text p a { text-decoration: underline; text-underline-offset: 4px; }

.pend-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; max-width: 100%; margin-bottom: -34px; transform: translateY(-52px); }
#pend { touch-action: pan-y; width: min(419px, 100%); height: auto; }

.pend-ctl { position: relative; display: flex; align-items: center; gap: 10px; }
.settings-btn { position: relative; display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; font-size: 16px; color: var(--muted); }
.settings-chev { position: relative; width: 14px; height: 14px; display: inline-flex; transform: rotate(0deg); transition: transform 0.2s; }
.settings-chev svg { position: absolute; inset: 0; }
.settings-chev .chev-base { color: var(--muted); }
.settings-chev .chev-hl { color: var(--accent); opacity: 0; transition: opacity 0.94s ease; }
.settings-word { transition: color 0.94s ease; }

.mode-btn { display: none; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; padding: 0; cursor: pointer; border: 1px solid var(--border); background: light-dark(rgb(243 236 221), rgb(38 35 26)); color: var(--muted); }
.mode-btn:hover { color: var(--accent); }
.mode-btn.on { display: flex; }

.flash { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 13px; pointer-events: none; opacity: 0; color: var(--accent); transition: opacity 1.6s ease; }

.settings-panel { overflow: hidden; max-height: 0; opacity: 0; transition: max-height 0.3s ease, opacity 0.3s ease; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.e-row { display: flex; align-items: center; gap: 10px; width: 300px; flex-shrink: 0; }
.e-row > span { font-size: 12.5px; color: var(--soft); }
.e-track { flex: 1; position: relative; height: 20px; cursor: pointer; touch-action: none; }
.e-line { position: absolute; left: 0; right: 0; top: 9px; height: 2px; border-radius: 2px; background: var(--border); }
.e-fill { position: absolute; left: 0; top: 9px; height: 2px; border-radius: 2px; background: var(--accent); width: 0px; }
.e-knob { position: absolute; top: 2px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.e-val { font-size: 12.5px; min-width: 34px; text-align: left; font-variant-numeric: tabular-nums; color: var(--soft); }

.fp-row { display: flex; gap: 24px; align-items: center; flex-shrink: 0; padding-bottom: 26px; }
.f-wrap { position: relative; height: 20px; width: 110px; font-size: 13px; color: var(--soft); user-select: none; }
.f-ctl { position: relative; width: 34px; height: 20px; cursor: pointer; transition: width 0.25s; touch-action: none; }
.f-track { position: absolute; inset: 0; border-radius: 100px; background: var(--border); opacity: 1; transition: opacity 0.25s; }
.f-line { position: absolute; left: -12px; right: 9px; top: 9px; height: 2px; border-radius: 2px; background: var(--border); opacity: 0; transition: opacity 0.25s; }
.f-fill { position: absolute; left: -12px; top: 9px; height: 2px; border-radius: 2px; background: var(--accent); width: 0px; opacity: 0; transition: opacity 0.25s; }
.f-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--knob); transform: translateX(0px); transition: transform 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.f-label { position: absolute; left: 42px; top: 1px; transition: left 0.25s, top 0.25s; white-space: nowrap; }
.p-ctl { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; color: var(--soft); user-select: none; }
.p-track { width: 34px; height: 20px; border-radius: 100px; background: var(--border); position: relative; transition: background 0.15s; }
.p-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--knob); transform: translateX(0px); transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

/* ── Главная: контент ── */
.content { max-width: 920px; width: 100%; margin: 0 auto; box-sizing: border-box; padding: 0 24px 56px; display: flex; flex-direction: column; gap: 52px; }
.content section { display: flex; flex-direction: column; gap: 16px; }
.content h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }

.tl { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 72px 12px 1fr; gap: 14px; }
.tl-year { font-size: 14px; font-weight: 700; color: var(--accent); text-align: right; padding-top: 1px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.tl-line { width: 2px; flex: 1; background: var(--border); }
.tl-text { font-size: 14.5px; line-height: 1.55; color: var(--text); padding-bottom: 22px; }
.tl-item:last-child .tl-text { padding-bottom: 0; }

.contacts { display: flex; flex-direction: column; gap: 18px; }
.contact-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.contact { display: flex; align-items: center; gap: 12px; padding: 9px; border-radius: 18px; border: 1px solid var(--border-weak); }
.contact-ic { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: var(--fill); color: var(--on-fill); display: flex; align-items: center; justify-content: center; }
.contact-body { display: flex; flex-direction: column; gap: 3px; }
.contact-label { font-size: 12px; line-height: 1; letter-spacing: 0.04em; color: var(--muted); }
.contact-body a { font-size: 15px; line-height: 1.1; font-family: var(--mono); }
.copy-btn { border: none; background: none; cursor: pointer; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted); padding: 0; }
.copy-btn:hover { color: var(--accent); }

.also { display: flex; flex-direction: column; gap: 10px; }
.also-title { font-size: 16px; font-weight: 600; color: var(--muted); }
.also-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.also-pill { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 100px; border: 1px solid var(--border-weak); }
.also-pill > svg { color: var(--muted); flex-shrink: 0; }
.also-name { font-size: 13.5px; color: var(--muted); }
.also-pill a { font-size: 14px; font-family: var(--mono); }

/* вебринг в самом низу главной */
.webring { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 10px 24px 0; }
a.wr-pill { white-space: nowrap; padding: 6px 14px; border-radius: 100px; font-size: 14px; font-family: var(--mono); border: 1px solid var(--border); color: var(--accent); }
a.wr-pill:hover { background: var(--card); color: var(--accent); }

.footer { padding: 26px; text-align: center; font-size: 13px; color: var(--soft); opacity: 0.75; }

/* ── Фото ── */
.pmain { flex: 1; max-width: 920px; width: 100%; margin: 0 auto; box-sizing: border-box; padding: 8px 24px 48px; }
.phead { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.ptitle { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.5px; }
.tabs { display: flex; gap: 6px; align-items: center; overflow-x: auto; overflow-y: hidden; padding: 0 10px; margin: 0 -10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; white-space: nowrap; flex-shrink: 0; padding: 8px 17px; border-radius: 100px; font-size: 14.5px; cursor: pointer; font-family: var(--mono); border: none; background: transparent; color: var(--accent); font-weight: 400; --pillbg: var(--bg); will-change: transform; }
.tab--on { color: var(--on-fill); font-weight: 600; --pillbg: var(--fill); }
.tab--on .pill-bg { background: var(--fill); }
.tab--on .pill-line { border-color: transparent; }

.story { display: flex; flex-direction: column; padding-top: 4px; }
.story-row { display: grid; grid-template-columns: 14px 1fr; gap: 12px; }
.story-rail { display: flex; flex-direction: column; align-items: center; }
.story-chev { margin-top: 4px; cursor: pointer; color: var(--accent); transform: rotate(0deg); transition: transform 0.2s; }
.story-line { width: 2px; flex: 1; background: var(--border); }
.story-headline { width: 2px; flex: 1; margin-top: 3px; background: var(--border); opacity: 0; transition: opacity 0.3s ease; }
.story-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.story-lead { font-size: 14.5px; line-height: 1.55; cursor: pointer; user-select: none; color: var(--text); padding-bottom: 0px; transition: padding-bottom 0.35s ease; }
.story-body { overflow: hidden; max-height: 0px; opacity: 0; transition: max-height 0.35s ease, opacity 0.35s ease; }
.story-text { font-size: 14.5px; line-height: 1.55; color: var(--text); padding-bottom: 22px; }
.story-body .story-row:last-child .story-text { padding-bottom: 0; }

.empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--border); border-radius: 18px; color: var(--muted); font-size: 14.5px; }
.empty-dir { font-family: ui-monospace, Menlo, Consolas, monospace; margin-bottom: 6px; }

.grid { display: flex; gap: 14px; align-items: flex-start; }
.grid-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tile { cursor: zoom-in; content-visibility: auto; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 16px; background: var(--card); }

.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(10,9,5,0.78); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 24px; box-sizing: border-box; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 16px; object-fit: contain; box-shadow: 0 24px 80px rgba(0,0,0,0.5); }
.lb-actions { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.lb-dl { cursor: pointer; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; color: rgb(232 226 212); background: rgba(255,249,238,0.12); border-radius: 100px; padding: 8px 14px; }
.lb-dl[hidden] { display: none; }
/* телефон: кнопки скачивания — под фоткой, справа, в столбик */
@media (max-width: 600px) {
  .lightbox { flex-direction: column; }
  .lightbox img { max-height: 78vh; }
  .lb-actions { position: static; align-self: flex-end; margin-top: 12px; }
}
.lb-dl:hover { color: rgb(248 226 135); background: rgba(255,249,238,0.2); }

/* ── Проекты ── */
.cards { display: flex; flex-direction: column; gap: 14px; }
a.card, a.card:hover { color: inherit; }
a.card { display: flex; flex-direction: column; gap: 10px; background: var(--card); border-radius: 24px; padding: 22px; transition: transform 0.15s ease, background 0.2s ease; }
a.card:hover { background: var(--card-hover); transform: translateY(-2px); }
.card-title { font-size: 17px; font-weight: 700; color: var(--text); }
.card-desc { font-size: 14px; line-height: 1.55; color: var(--soft); }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 100px; background: var(--fill); color: var(--on-fill); }
/* кликабельные теги (data-href) — например, ссылки на конкретные 3D-модели */
.tag[data-href] { cursor: pointer; }
.tag[data-href]:hover { text-decoration: underline; text-underline-offset: 3px; }
.card--soon { display: flex; flex-direction: column; gap: 10px; border: 1px dashed var(--border); border-radius: 24px; padding: 22px; }
.card--soon .card-desc { color: var(--muted); }
