/* sergeisysoev.com — personal professional site of Sergei Sysoev.
 * Component system shared with apluxor.com (same behavioural law: >=44px
 * controls, 3px focus, reduced-motion and forced-colors fallbacks, safe-area
 * gutters); its own identity: graphite field, warm amber accent, Archivo heads.
 *
 * (Inherited header notes from apluxor.com follow.)
 *
 * Owner decision 2026-09-27: apluxor.com stopped being the maker shelf and
 * became the publisher/service site the book already prints on its title
 * verso. Its visual identity therefore comes from the book, not from the
 * four-site shelf sheet: the cover's navy (#001434 → #02306A, mark #013A77),
 * its copper rule (#C2622C / #E8A33D on dark) and Inter. The estate's
 * behavioural law is kept unchanged: ≥44px controls, 3px focus ring,
 * 120/180/360ms motion only where it explains something, reduced-motion and
 * forced-colors fallbacks, safe-area gutters, nothing scrolls sideways.
 *
 * The second half of this file is the book's own reading system, ported from
 * the kit's print stylesheet (head.html) class by class. Box labels that the
 * print sheet generates with ::before are copied verbatim — they are part of
 * the author's text.
 */

/* ---------- fonts ---------- */
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }

@font-face { font-family: "Archivo"; src: url("/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f5f5f3;
  --surface-2: #ebebe7;
  --ink: #14161a;
  --ink-2: #3a3f48;
  --muted: #5f6672;
  --rule: #e0e0db;
  --rule-strong: #a3a7ad;
  --link: #1d4ed8;
  --action: #16181d;
  --action-ink: #ffffff;
  --action-hover: #000000;
  --copper: #c8541f;
  --copper-text: #a8441a;
  --focus: #0a66d8;
  --night-1: #0e1014;
  --night-2: #171a21;
  --night-3: #20242d;
  --night-ink: #ffffff;
  --night-ink-2: #e4e7ec;
  --night-muted: #a7afbd;
  --night-rule: #2e3340;
  --night-copper: #f0a24a;
  --night-link: #f6c27a;
  --page: 1184px;
  --measure: 42rem;
  --gutter: max(16px, min(5vw, 56px));
  --radius: 10px;
  --radius-s: 6px;
  --t-fast: 120ms;
  --t-mid: 180ms;
  --t-slow: 360ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12;
    --surface: #15181d;
    --surface-2: #1d2128;
    --ink: #eceef1;
    --ink-2: #c9cdd4;
    --muted: #9aa1ac;
    --rule: #262a31;
    --rule-strong: #444a54;
    --link: #93b4ff;
    --action: #f0a24a;
    --action-ink: #1a1206;
    --action-hover: #f6b871;
    --copper: #f0a24a;
    --copper-text: #f3b469;
    --focus: #93b4ff;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;             /* 17px — Apple's body default */
  line-height: 1.6;
  font-feature-settings: "calt", "kern";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: "Archivo", var(--font); line-height: 1.1; letter-spacing: -.012em; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--gutter); top: -100px; z-index: 50; background: var(--action); color: var(--action-ink);
  padding: 12px 18px; border-radius: var(--radius-s); font-weight: 600; text-decoration: none; min-height: 44px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }

/* ---------- header ---------- */
.masthead { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand .word { font-weight: 800; letter-spacing: .2em; font-size: .95rem; }
.brand .mark, .brand .mark img { display: block; width: 32px; height: 32px; flex: none; }
.foot-mark, .foot-mark img { display: block; width: 40px; height: 40px; }
.brand .sub { white-space: nowrap; font-size: .8125rem; color: var(--muted); letter-spacing: 0; font-weight: 500; border-left: 1px solid var(--rule); padding-left: 12px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--ink-2);
  text-decoration: none; font-weight: 500; font-size: .9375rem; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
@media (hover: hover) { .nav a:hover { background: var(--surface); color: var(--ink); } }
.nav a[aria-current="page"], .nav a[aria-current="true"] { color: var(--ink); background: var(--surface-2); }
.nav a.cta { background: var(--action); color: var(--action-ink); margin-left: 6px; padding: 0 16px; font-weight: 600; }
.nav a.cta:hover { background: var(--action-hover); }
.menu { display: none; }
@media (max-width: 1279px) { .brand .sub { display: none; } }
@media (max-width: 1080px) {
  .nav { display: none; }
  .menu { display: block; position: relative; }
  .menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
    padding: 0 14px; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .9375rem; color: var(--ink); }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu[open] > summary { background: var(--surface-2); }
  .menu .sheet { position: absolute; right: 0; top: calc(100% + 8px); width: min(86vw, 320px); background: var(--bg); border: 1px solid var(--rule);
    border-radius: 14px; padding: 8px; box-shadow: 0 18px 48px rgba(0, 10, 30, .18); display: grid; gap: 2px;
    transform-origin: top right; transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
  /* The sheet grows out of the button that opened it. */
  @starting-style { .menu[open] .sheet { opacity: 0; transform: scale(.96) translateY(-4px); } }
  .menu .sheet a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
  .menu .sheet a:hover, .menu .sheet a[aria-current="page"] { background: var(--surface-2); }
  .menu .sheet a.cta { background: var(--action); color: var(--action-ink); font-weight: 600; margin-top: 4px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; border: 1.5px solid transparent;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.btn-primary { background: var(--action); color: var(--action-ink); }
@media (hover: hover) { .btn-primary:hover { background: var(--action-hover); } }
.btn-ghost { border-color: var(--rule-strong); color: var(--ink); background: transparent; }
@media (hover: hover) { .btn-ghost:hover { border-color: var(--ink); } }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
/* Feedback on press, not on release (Apple fluid-interface principle); only transform, 100ms. */
.btn:active, .nav a:active, .menu .sheet a:active, .pager a:active { transform: scale(.97); transition: transform 100ms ease-out; }

/* ---------- night band (the cover's field) ---------- */
.night { background: linear-gradient(168deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%); color: var(--night-ink); }
.night a:not(.btn) { color: var(--night-link); }
.night .btn-primary { background: var(--night-copper); color: #1a1206; }
.night .btn-primary:hover { background: #f3b85c; }
.night .btn-ghost { border-color: rgba(219, 230, 244, .45); color: var(--night-ink); }
.night .btn-ghost:hover { border-color: var(--night-ink); }
.night :focus-visible { outline-color: #ffffff; }
.kicker-line { display: flex; align-items: center; gap: 12px; font-size: .8125rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.night .kicker-line { color: var(--night-muted); }
.kicker-line::before { content: ""; width: 10px; height: 10px; background: var(--copper); flex: none; }
.night .kicker-line::before { background: var(--night-copper); }

.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(56px, 9vw, 104px); }
.hero h1 { font-size: clamp(2.25rem, 1.2rem + 4.6vw, 4.5rem); font-weight: 800; letter-spacing: -.028em; line-height: 1.02; margin: 22px 0 0; max-width: 16ch; }
.hero .rule { width: 96px; height: 4px; background: var(--night-copper); margin: 28px 0; }
.hero .lede { font-size: clamp(1.125rem, 1rem + .55vw, 1.375rem); line-height: 1.5; color: var(--night-ink-2); max-width: 40rem; margin: 0 0 32px; }
.hero .fine { margin: 22px 0 0; color: var(--night-muted); font-size: .9375rem; }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section.tint { background: var(--surface); border-top: 0; }
.section-head { max-width: 46rem; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); font-weight: 750; margin-top: 14px; }
.section-head p { color: var(--ink-2); font-size: 1.125rem; margin: 16px 0 0; }
.prose { max-width: var(--measure); }
.prose h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin: 48px 0 12px; }
.prose h3 { font-size: 1.1875rem; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 1.2em; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }
.page-head { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(24px, 4vw, 40px); }
.page-head h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.5rem); font-weight: 800; letter-spacing: -.024em; margin-top: 16px; max-width: 20ch; }
.page-head .lede { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--ink-2); max-width: 42rem; margin: 18px 0 0; }

/* symptom cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.tint .card { background: var(--bg); }
.card h3 { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-2); font-size: 1rem; }
.card .meta { margin-top: auto; padding-top: 10px; font-size: .9375rem; }
.card .meta a { font-weight: 600; }
.card .lang { color: var(--muted); font-weight: 400; }

/* numbered process */
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; counter-reset: s; max-width: 52rem; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--rule); }
.steps-list li:last-child { border-bottom: 1px solid var(--rule); }
.steps-list li::before { content: counter(s, decimal-leading-zero); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--copper-text); font-size: 1.0625rem; padding-top: 1px; }
.steps-list h3 { font-size: 1.125rem; margin-bottom: 6px; }
.steps-list p { margin: 0; color: var(--ink-2); }

/* two columns: list + boundary */
.split { display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 1.25fr 1fr; } }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding: 12px 0 12px 30px; border-top: 1px solid var(--rule); color: var(--ink-2); }
.checks li:last-child { border-bottom: 1px solid var(--rule); }
.checks li::before { content: ""; position: absolute; left: 2px; top: 20px; width: 12px; height: 6px; border-left: 2px solid var(--copper); border-bottom: 2px solid var(--copper); transform: rotate(-45deg); }
.checks.no li::before { width: 12px; height: 2px; border: 0; background: var(--muted); transform: none; top: 24px; }
.checks strong { color: var(--ink); }
.note-box { border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 24px; background: var(--surface); }
.note-box h3 { font-size: 1.0625rem; margin-bottom: 8px; }
.note-box p { margin: 0 0 10px; color: var(--ink-2); }
.note-box p:last-child { margin: 0; }

/* book promo on the English side */
.book-promo { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 820px) { .book-promo { grid-template-columns: minmax(220px, 340px) 1fr; } }
.cover-img { width: 100%; max-width: 340px; aspect-ratio: 17 / 22; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 18px 40px rgba(0, 20, 52, .22); background: var(--night-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border-top: 1px solid var(--rule); margin: 24px 0; }
.facts div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: .8125rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.facts dd { margin: 4px 0 0; font-weight: 600; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }

/* contact */
.contact-card { border: 1px solid var(--rule); border-radius: 14px; padding: clamp(22px, 4vw, 36px); background: var(--bg); max-width: 46rem; }
.contact-card .addr { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem); font-weight: 700; word-break: break-word; }
.template { font-family: var(--mono); font-size: .9375rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 18px; white-space: pre-wrap; color: var(--ink-2); margin: 16px 0 0; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .9375rem; }
.foot .wrap { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .foot .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h2 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink); margin-bottom: 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.foot li a:hover { color: var(--ink); text-decoration: underline; }
.foot p { margin: 0 0 8px; }


/* ---------- personal layer ---------- */
.brand .name { font-family: "Archivo", var(--font); font-weight: 750; font-size: 1.0625rem; letter-spacing: -.01em; }
.hero .title { font-size: clamp(1.125rem, 1rem + .6vw, 1.375rem); color: var(--night-copper); font-weight: 600; margin: 14px 0 0; letter-spacing: .01em; }
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 0; margin-top: 40px; border-top: 1px solid var(--night-rule); }
.proof div { padding: 18px 20px 4px 0; }
.proof dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--night-muted); font-weight: 700; }
.proof dd { margin: 6px 0 0; color: var(--night-ink); font-weight: 600; font-size: 1.0625rem; line-height: 1.35; }
.work-card .kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--copper-text); font-weight: 700; }
.work-card h3 a { color: var(--ink); text-decoration: none; }
.work-card h3 a::after { content: ""; position: absolute; inset: 0; }
.work-card { position: relative; transition: border-color var(--t-fast) var(--ease); }
@media (hover: hover) { .work-card:hover { border-color: var(--rule-strong); } .work-card:hover h3 a { text-decoration: underline; } }
.project { display: grid; gap: clamp(20px, 4vw, 56px); grid-template-columns: 1fr; padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--rule); scroll-margin-top: 88px; }
@media (min-width: 900px) { .project { grid-template-columns: minmax(220px, 1fr) 2fr; } }
.project .kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--copper-text); font-weight: 700; }
.project h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); margin: 10px 0 8px; }
.project .role { color: var(--muted); font-weight: 600; margin: 0; }
.project .summary { font-size: 1.125rem; color: var(--ink-2); margin: 0 0 16px; }
.cv-item { display: grid; gap: 6px 32px; grid-template-columns: 1fr; padding: 22px 0; border-top: 1px solid var(--rule); }
@media (min-width: 760px) { .cv-item { grid-template-columns: 220px 1fr; } }
.cv-item .area { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--copper-text); font-weight: 700; padding-top: 4px; }
.cv-item h3 { font-size: 1.1875rem; }
.cv-item .org { color: var(--muted); margin: 2px 0 8px; font-weight: 500; }
.cv-item ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); }
.cv-item li { margin-bottom: 4px; }
.skills { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.skills h3 { font-size: 1rem; margin-bottom: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tags li { border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; font-size: .9375rem; color: var(--ink-2); background: var(--bg); }
.book-feature { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 820px) { .book-feature { grid-template-columns: minmax(220px, 320px) 1fr; } }

/* ---------- quiet presentation (2026-10-01, second rebuild) ---------- */
.intro { padding: clamp(64px, 12vw, 152px) 0 clamp(36px, 6vw, 64px); }
.intro h1 { font-size: clamp(2.75rem, 1.4rem + 6vw, 6rem); font-weight: 800; letter-spacing: -.035em; line-height: .98; }
.identity { font-size: clamp(1.25rem, 1rem + 1.1vw, 1.75rem); line-height: 1.35; color: var(--ink); font-weight: 500; margin: 22px 0 0; max-width: 34ch; letter-spacing: -.01em; }
.intro .lede { font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); color: var(--ink-2); max-width: 44rem; margin: 22px 0 0; }
.h2s { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); margin: 0 0 12px; }
.body-l { font-size: 1.0625rem; line-height: 1.65; color: var(--ink-2); margin: 0 0 14px; }
.small-line { color: var(--muted); font-size: .9375rem; margin: 10px 0 0; }
.promise { font-style: italic; color: var(--ink); margin: 14px 0 18px; font-size: 1.0625rem; }
.company-line { margin: 22px 0 0; color: var(--ink-2); font-size: 1.0625rem; max-width: 46rem; }
.company-line a { font-weight: 600; }
.nav.quiet a { color: var(--ink-2); }
.page-head h1 { max-width: 24ch; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 10px 0; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.plain-list li:last-child { border-bottom: 1px solid var(--rule); }
