/*
 * Theme «Кобальт» (base theme, SPEC §8, §20). Mobile-first: base rules for 360px,
 * wider screens via min-width 480 / 760 / 1024. Options arrive as CSS variables in <head>.
 */
:root {
    --color-primary: #2346E8;
    --on-primary: #FFFFFF;
    --on-primary-muted: #DCE3FF;
    /* Light and dark values; the `mode` option sets color-scheme (SPEC §8). */
    --navy: #0D1530;
    --ink: light-dark(#0D1530, #E8EBF7);
    --on-ink: light-dark(#FFFFFF, #0B1022);
    --body-text: light-dark(#1B2440, #D5DAEA);
    --text-2: light-dark(#3D4766, #B9C2DE);
    --muted: light-dark(#556080, #98A2C3);
    --subtle: light-dark(#6A7491, #8A93AD);
    --border: light-dark(#E6E8F0, #26304F);
    --border-strong: light-dark(#C9CFE3, #3A4566);
    --border-soft: light-dark(#EEF0F6, #1E2745);
    --chip: light-dark(#F2F3F8, #1C2542);
    --chip-hover: light-dark(#E4E8F5, #26304F);
    --surface: light-dark(#FFFFFF, #0B1022);
    --surface-alt: light-dark(#F5F6FA, #11182F);
    --surface-glass: light-dark(rgba(255, 255, 255, .88), rgba(11, 16, 34, .88));
    --info-bg: light-dark(#EEF1FF, #1B2550);
    --info-ink: light-dark(#1A2B8F, #B7C4FF);
    --warm-bg: light-dark(#FFF1E3, #3A2414);
    --warm-bg-hover: light-dark(#FFE4CC, #4A2E19);
    --warm-ink: light-dark(#9A4410, #FFC59A);
    --dark: light-dark(#0D1530, #151D3A);
    --dark-line: #26304F;
    --dark-muted: #B9C2DE;
    --focus: #8FA2FF;
    --radius-card: 28px;
    --radius-card-md: 24px;
    --radius-card-sm: 20px;
    --radius-button: 14px;
    --font-body: 'Onest', system-ui, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --gutter: clamp(16px, 3vw, 32px);
    --section-gap: clamp(72px, 9vw, 120px);
    --block-gap: clamp(56px, 8vw, 96px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--ink); }
a:hover { color: var(--color-primary); }
:where(a, button, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link { position: absolute; left: 16px; top: -100px; z-index: 50; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--on-ink); }
.skip-link:focus { top: 12px; color: var(--on-ink); }

.container { max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 0 26px;
    border: 1.5px solid transparent; border-radius: var(--radius-button);
    font: inherit; font-size: 16px; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn--md { min-height: 48px; padding: 0 22px; }
.btn--sm { min-height: 44px; padding: 0 20px; border-radius: 12px; font-size: 15px; }
.btn--primary { background: var(--color-primary); color: var(--on-primary); }
.btn--primary:hover { filter: brightness(1.08); color: var(--on-primary); }
.btn--light { background: #FFFFFF; color: var(--navy); }
.btn--light:hover { background: #E8ECFF; color: #1A2B8F; }
.btn--ghost { border-color: rgba(255, 255, 255, .5); color: #FFFFFF; background: transparent; }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #FFFFFF; }
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: var(--on-ink); }
.btn--outline-light { border-color: rgba(255, 255, 255, .4); color: #FFFFFF; background: transparent; }
.btn--outline-light:hover { background: #FFFFFF; color: var(--navy); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 479px) {
    .btn-row--stack { flex-direction: column; align-self: stretch; }
    .btn-row--stack > .btn { width: 100%; }
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
}
.site-header__bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-height: 64px; }
.site-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; padding: 10px 0; }
.site-brand__logo { display: block; width: auto; height: 36px; }
.site-header__actions { display: flex; align-items: center; gap: 8px; }
.site-header__write { display: none; }

.menu-toggle {
    display: none;
    width: 44px; height: 44px;
    border: 0; border-radius: 12px; background: var(--chip); color: var(--ink);
    align-items: center; justify-content: center; cursor: pointer;
}

.site-nav { order: 3; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0 0 12px; font-size: 16px; font-weight: 500; }
.site-nav a { text-decoration: none; padding: 10px 0; }
.site-nav a[aria-current="page"] { color: var(--color-primary); box-shadow: inset 0 -2px 0 var(--color-primary); }
.site-nav__write { display: none; }

/* With JS (class set in <head>) the mobile nav becomes a full-width panel behind the menu button. */
.js .menu-toggle { display: inline-flex; }
.js .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 4px;
    padding: 12px var(--gutter) 24px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 40px -24px rgba(13, 21, 48, .25);
    font-size: 18px;
}
.js .site-header.is-open .site-nav { display: flex; }
.js .site-nav a { padding: 12px 0; }
.js .site-nav a[aria-current="page"] { box-shadow: none; }
.js .site-nav__write { display: inline-flex; margin-top: 12px; color: var(--on-primary); }

.lang-switch { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--chip); }
.lang-switch a {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 36px; padding: 0 8px;
    border-radius: 9px; color: var(--muted);
    text-decoration: none; font-size: 14px; font-weight: 600;
}
/* 36px pill, 44px hit area. */
.lang-switch a::after { content: ""; position: absolute; inset: -4px -2px; }
.lang-switch a:hover { color: var(--ink); background: var(--chip-hover); }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(13, 21, 48, .12); }

@media (min-width: 760px) {
    .site-header__bar { min-height: 72px; gap: 24px; flex-wrap: nowrap; }
    .site-header__write { display: inline-flex; }
    .menu-toggle, .js .menu-toggle { display: none; }
    .site-nav, .js .site-nav {
        order: 0; flex-basis: auto;
        display: flex; position: static; flex-direction: row; flex-wrap: nowrap; gap: clamp(16px, 2.4vw, 32px);
        padding: 0; background: none; border: 0; box-shadow: none; font-size: 16px;
    }
    .js .site-nav a { padding: 10px 0; }
    .js .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--color-primary); }
    .site-nav__write, .js .site-nav__write { display: none; }
}

/* ---------- Generic section ---------- */
.section { padding-top: var(--section-gap); }
.section__title { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.section__lead { margin-top: 10px; color: var(--muted); max-width: 52ch; }
.section__more { margin-top: 32px; }
.page-title { margin-top: 16px; font-size: clamp(38px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 700; }
.page-lead { margin-top: 16px; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 52ch; }
.page-intro { padding-top: clamp(40px, 6vw, 72px); }
.back-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }

/* ---------- Hero (home) ---------- */
.hero { padding-top: clamp(20px, 3vw, 32px); }
.hero__panel {
    background: var(--color-primary); color: var(--on-primary);
    border-radius: var(--radius-card);
    padding: clamp(28px, 5.5vw, 80px);
    display: flex; flex-wrap: wrap; align-items: center; gap: 32px 48px;
}
.hero__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.hero__badge {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, .14); border-radius: 999px;
    padding: 7px 16px 7px 12px; font-size: 15px; font-weight: 500;
}
.hero__badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #7CF0B4; }
.hero__title { font-size: clamp(36px, 5.2vw, 66px); line-height: 1.04; letter-spacing: -0.025em; font-weight: 700; max-width: 16ch; }
.hero__subtitle { display: block; margin-top: 18px; font-size: .4em; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; color: var(--on-primary-muted); }
.hero__lead { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--on-primary-muted); max-width: 46ch; }
.hero__photo {
    flex: 0 1 320px; width: 100%; max-width: 220px; aspect-ratio: 1 / 1; margin: 0 auto;
    border-radius: 50%; object-fit: cover; object-position: 38% 30%;
    border: 6px solid rgba(255, 255, 255, .18); display: block;
}
@media (min-width: 760px) { .hero__photo { max-width: 320px; } .hero__text { gap: 28px; } }

/* ---------- Tints ---------- */
.tint-blue { --tint-bg: light-dark(#E2E8FF, #1B2550); --tint-ink: light-dark(#1A2B8F, #B7C4FF); --tint-soft: light-dark(#F3F5FF, #141C3D); --tint-line: light-dark(#BCC8F5, #33408A); }
.tint-violet { --tint-bg: light-dark(#ECE8FF, #251D4D); --tint-ink: light-dark(#4B2FC4, #CBBEFF); --tint-soft: light-dark(#F6F4FF, #1A1638); --tint-line: light-dark(#CFC6F5, #463A8A); }
.tint-mint { --tint-bg: light-dark(#DDF4EA, #123829); --tint-ink: light-dark(#11603F, #9FE3C4); --tint-soft: light-dark(#F3FBF7, #0E2A20); --tint-line: light-dark(#B8D9C8, #285C46); }
.tint-peach { --tint-bg: light-dark(#FFEBD9, #3A2414); --tint-ink: light-dark(#9A4410, #FFC59A); --tint-soft: light-dark(#FFF6EE, #2A1A0F); --tint-line: light-dark(#E6B993, #6E4426); }
.tint-sand { --tint-bg: light-dark(#FFF4D6, #352A0E); --tint-ink: light-dark(#7A5300, #F2D58A); --tint-soft: light-dark(#FFFAEB, #261F0B); --tint-line: light-dark(#E8D49A, #665320); }
.tint-gray { --tint-bg: light-dark(#F2F3F8, #1C2542); --tint-ink: light-dark(#3D4766, #C3CAE0); --tint-soft: light-dark(#F8F9FC, #151C33); --tint-line: light-dark(#D5D9E6, #3A4566); }

.label { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 14px; background: var(--chip); color: var(--text-2); }
.label--tint { background: var(--tint-bg); color: var(--tint-ink); font-weight: 600; }
.labels { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tech-list li { border: 1px solid var(--border); border-radius: 8px; padding: 3px 10px; font-size: 14px; color: var(--text-2); }

/* ---------- Project cards (home) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; margin-top: 40px; }
.project-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--border); border-radius: var(--radius-card-md);
    overflow: hidden; text-decoration: none; background: var(--surface);
    transition: transform .2s ease, border-color .2s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: var(--border-strong); color: var(--ink); }
.project-card__media { background: var(--tint-bg); height: 220px; padding: 28px 28px 0; overflow: hidden; }
.project-card__media img {
    display: block; width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    border-radius: 12px 12px 0 0; box-shadow: 0 10px 30px -12px rgba(13, 21, 48, .3);
}
.project-card__media--phone { padding: 28px 0 0; display: flex; justify-content: center; }
.project-card__media--phone img { width: 168px; border-radius: 18px 18px 0 0; }
.project-card__body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.project-card__title { font-weight: 700; font-size: 21px; letter-spacing: -0.015em; }
.project-card__text { color: var(--muted); font-size: 16px; line-height: 1.55; }

/* ---------- Services (home) ---------- */
.services { margin-top: var(--section-gap); background: var(--surface-alt); }
.services__inner { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 104px); }
.services__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 40px 32px; margin-top: 48px; }
.service { display: flex; flex-direction: column; gap: 14px; }
.service__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--tint-bg); color: var(--tint-ink); display: flex; align-items: center; justify-content: center; }
.service__title { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.service__text { color: var(--muted); font-size: 16px; line-height: 1.55; }

/* ---------- Experience timeline (home) ---------- */
.timeline { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--border); }
.timeline__item { display: flex; flex-wrap: wrap; gap: 6px 32px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.timeline__period { flex: 0 0 150px; color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.timeline__head { flex: 1 1 260px; display: flex; flex-direction: column; }
.timeline__role { font-weight: 600; font-size: 18px; }
.timeline__org { color: var(--muted); font-size: 16px; }
.timeline__text { flex: 2 1 400px; color: var(--text-2); font-size: 16px; line-height: 1.55; }
/* Older entries (before 2017) take less room (SPEC §6.3). */
.timeline__item--compact { padding: 16px 0; }
.timeline__item--compact .timeline__role { font-size: 16px; }
.timeline__item--compact .timeline__text { font-size: 15px; color: var(--muted); }
.technologies__title { margin-top: 56px; font-size: 19px; font-weight: 600; }
.technologies { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.technologies li { background: var(--chip); border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 500; }

/* ---------- Projects list ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.filter a {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 0 20px; border-radius: 999px;
    background: var(--chip); color: var(--ink);
    font-size: 15px; font-weight: 600; text-decoration: none;
}
.filter a[aria-current="true"] { background: var(--ink); color: var(--on-ink); }
.filter__count { opacity: .7; font-weight: 500; }

.project-list { display: flex; flex-direction: column; gap: 32px; padding-top: 40px; }
.project-feature {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
    border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden;
}
.project-feature__media { background: var(--tint-bg); min-height: 260px; padding: 28px 0 0 28px; overflow: hidden; display: flex; }
.project-feature__media img {
    display: block; width: 100%; object-fit: cover; object-position: top left;
    border-radius: 14px 0 0 0; box-shadow: 0 12px 36px -14px rgba(13, 21, 48, .35);
}
.project-feature__media--phone { padding: 28px 24px 0; justify-content: center; }
.project-feature__media--phone img { width: 210px; border-radius: 22px 22px 0 0; object-position: top center; }
.project-feature__body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; gap: 18px; }
.project-feature__title { font-size: clamp(30px, 3vw, 38px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
.project-feature__title a { text-decoration: none; }
.project-feature__text { color: var(--text-2); }
.project-feature__bullets { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 16px; line-height: 1.55; display: flex; flex-direction: column; gap: 6px; }
.project-feature__actions { margin-top: auto; }
@media (min-width: 760px) {
    .project-feature__media { min-height: 360px; padding: 40px 0 0 40px; }
    .project-feature__media--phone { padding: 40px 24px 0; }
}
@media (max-width: 479px) {
    .project-feature__actions > .btn { width: 100%; }
}

/* ---------- Project page ---------- */
.breadcrumbs { display: flex; align-items: center; gap: 8px; padding-top: clamp(32px, 5vw, 56px); font-size: 15px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); text-decoration: none; padding: 8px 0; }
.breadcrumbs [aria-current="page"] { color: var(--ink); }

/* Text links keep their look but get a centred hit area of at least 44 × 44px. */
.site-nav a, .breadcrumbs a, .project-feature__title a { position: relative; }
:is(.site-nav a, .breadcrumbs a, .project-feature__title a)::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}

.project-hero { display: flex; flex-wrap: wrap; gap: 40px clamp(32px, 5vw, 72px); align-items: flex-end; padding-top: 20px; }
.project-hero__text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.project-hero__title { font-size: clamp(44px, 7vw, 88px); line-height: .98; letter-spacing: -0.035em; font-weight: 700; overflow-wrap: anywhere; }
.project-hero__lead { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5; color: var(--text-2); max-width: 40ch; }

.facts {
    flex: 1 1 320px; margin: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px;
    padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-card-sm); font-size: 15px;
}
.facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts__wide { grid-column: 1 / -1; gap: 8px !important; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #A3AAC0; }
.status--live::before { background: #1E9E62; }
.status--dev::before { background: #D99A00; }

/* Gallery: the first desktop shot spans the width, the rest are equal squares; a click opens the lightbox (site.js). */
.gallery { margin: clamp(40px, 6vw, 64px) 0 0; display: flex; flex-direction: column; gap: clamp(10px, 2vw, 20px); }
.gallery__stage { display: block; background: var(--tint-bg); border-radius: var(--radius-card); padding: clamp(24px, 5vw, 64px) clamp(16px, 5vw, 64px) 0; overflow: hidden; }
.gallery__desktop { display: block; width: 100%; max-width: 1000px; margin: 0 auto; border-radius: 16px 16px 0 0; box-shadow: 0 24px 60px -24px rgba(13, 21, 48, .4); }
.gallery__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 2vw, 20px); }
@media (min-width: 760px) { .gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gallery__item {
    position: relative; display: block; aspect-ratio: 1; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius-card-sm); background: var(--tint-bg, var(--chip));
}
.gallery__item img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .3s ease; }
.gallery__item:hover img { transform: scale(1.03); }
.gallery__zoom {
    position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(13, 21, 48, .6); color: #fff;
}

.lightbox {
    width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0;
    border: 0; background: transparent; color: #fff; overflow: hidden;
}
.lightbox::backdrop { background: rgba(8, 12, 28, .9); }
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox__figure {
    height: 100%; margin: 0; padding: 64px 16px 80px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
@media (min-width: 760px) { .lightbox__figure { padding: 72px 88px 24px; } }
.lightbox__image { display: block; min-height: 0; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 12px; touch-action: pan-y; }
.lightbox__caption { max-width: 72ch; font-size: 15px; line-height: 1.5; text-align: center; color: rgba(255, 255, 255, .85); }
.lightbox__counter { color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lightbox__btn {
    position: absolute; width: 48px; height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .24); }
.lightbox__btn[hidden] { display: none; }
.lightbox__btn--close { top: 12px; right: 12px; }
.lightbox__btn--prev, .lightbox__btn--next { top: 50%; transform: translateY(-50%); }
.lightbox__btn--prev { left: 12px; }
.lightbox__btn--next { right: 12px; }
@media (max-width: 759px) { .lightbox__btn--prev, .lightbox__btn--next { top: auto; bottom: 16px; transform: none; } }

/* ---------- Blocks ---------- */
.block { padding-top: var(--block-gap); }
.block__title { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
.block__intro { margin-top: 10px; color: var(--muted); max-width: 60ch; }
.block--split { display: flex; flex-wrap: wrap; gap: 12px 48px; }
.block--split > .block__title, .block--split > .block__aside { flex: 1 1 240px; }
.block__aside { display: flex; flex-direction: column; gap: 10px; }
.block__aside .block__intro { margin-top: 0; font-size: 16px; }
.block__main { flex: 3 1 520px; min-width: 0; }
.block--panel { margin-top: var(--block-gap); padding: clamp(24px, 5vw, 56px); background: var(--surface-alt); border-radius: var(--radius-card); }

.rich-text { display: flex; flex-direction: column; gap: 16px; max-width: 68ch; color: var(--text-2); font-size: 18px; line-height: 1.65; }
.rich-text :where(p, ul, ol, h3) { margin: 0; }
.rich-text h3 { font-size: 20px; color: var(--ink); }
.rich-text ul, .rich-text ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

.cards { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.cards__item { border: 1px solid var(--border); border-radius: var(--radius-card-sm); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.cards--plain .cards__item { border: 0; padding: 0; gap: 10px; }
.block--panel .cards { gap: 32px; }
.cards__label { font-size: 14px; color: var(--tint-ink, var(--color-primary)); font-weight: 600; overflow-wrap: anywhere; }
.cards__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--tint-bg, #E2E8FF); color: var(--tint-ink, var(--color-primary)); display: flex; align-items: center; justify-content: center; }
.cards__title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.cards--plain .cards__title { font-size: 19px; font-weight: 600; }
.cards__text { color: var(--muted); font-size: 16px; line-height: 1.55; }
.cards--plain .cards__text { color: var(--text-2); }

.steps-layout { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 32px; align-items: stretch; }
.steps { flex: 1 1 340px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 24px; counter-reset: step; }
.steps li { display: flex; gap: 16px; counter-increment: step; }
.steps li::before {
    content: counter(step); flex-shrink: 0;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--tint-bg, #E2E8FF); color: var(--tint-ink, var(--color-primary));
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.steps__body { display: flex; flex-direction: column; gap: 4px; }
.steps__title { font-weight: 600; font-size: 18px; }
.steps__text { color: var(--muted); font-size: 16px; }

.code { flex: 1 1 440px; min-width: 0; background: var(--dark); color: #E6E9F5; border-radius: var(--radius-card-sm); overflow: hidden; display: flex; flex-direction: column; }
.code__name { padding: 12px 20px; border-bottom: 1px solid var(--dark-line); font-size: 14px; color: #9AA3C2; display: flex; justify-content: space-between; gap: 12px; }
.code pre { margin: 0; padding: 20px; overflow-x: auto; font-family: var(--mono); font-size: 14px; line-height: 1.75; }
.block .code--standalone { margin-top: 24px; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.plan { border: 1px solid var(--border); border-radius: var(--radius-card-sm); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.plan--highlighted { border: 1.5px solid var(--tint-ink, var(--color-primary)); background: var(--tint-soft, #F3F5FF); }
.plan__name { font-weight: 600; }
.plan__price { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.plan__period { font-size: 16px; font-weight: 500; color: var(--muted); }
.plan__features { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 15px; }

.banner { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: center; }
.banner__text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.banner__text p { color: var(--text-2); font-size: 18px; max-width: 48ch; }
.banner__image { flex: 1 1 320px; max-width: 420px; border-radius: var(--radius-card-sm); }

.testimonial { margin: 0; max-width: 68ch; display: flex; flex-direction: column; gap: 16px; }
.testimonial blockquote { margin: 0; font-size: 20px; line-height: 1.55; color: var(--ink); }
.testimonial figcaption { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.testimonial figcaption img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.testimonial__name { color: var(--ink); font-weight: 600; }

/* ---------- Next project ---------- */
.next-projects { display: flex; flex-wrap: wrap; gap: 16px; padding-top: var(--block-gap); }
.next-project {
    flex: 1 1 320px; display: flex; align-items: center; gap: 20px;
    padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-card-sm); text-decoration: none;
}
.next-project:hover { border-color: var(--border-strong); color: var(--ink); }
.thumb { width: 96px; height: 64px; flex-shrink: 0; border-radius: 12px; background: var(--tint-bg); padding: 8px 8px 0; overflow: hidden; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; border-radius: 6px 6px 0 0; }
.thumb--phone { display: flex; justify-content: center; padding: 8px 0 0; }
.thumb--phone img { width: 32px; }
.next-project__text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.next-project__caption { font-size: 14px; color: var(--muted); }
.next-project__title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Contact panel ---------- */
.contact-panel {
    border-radius: var(--radius-card);
    padding: clamp(28px, 5.5vw, 64px);
    display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: center;
}
.contact-panel--primary { background: var(--color-primary); color: var(--on-primary); }
.contact-panel--dark { background: var(--dark); color: #FFFFFF; align-items: flex-end; gap: 40px; }
.contact-panel__text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.contact-panel__title { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
.contact-panel--dark .contact-panel__title { font-size: clamp(30px, 3.8vw, 48px); }
.contact-panel__lead { color: var(--on-primary-muted); font-size: 18px; max-width: 44ch; }
.contact-panel--dark .contact-panel__lead { color: var(--dark-muted); }
.contact-panel__email { margin-top: 8px; font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; overflow-wrap: anywhere; }
.contact-panel__aside { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.contact-panel__aside span { font-size: 15px; color: var(--on-primary-muted); overflow-wrap: anywhere; }
.contact-panel__links { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px 28px; padding-top: 24px; border-top: 1px solid var(--dark-line); font-size: 16px; }
.contact-panel__links a { color: #FFFFFF; padding: 10px 0; }
@media (max-width: 479px) {
    .contact-panel .btn-row, .contact-panel__aside { width: 100%; }
    .contact-panel .btn-row > .btn, .contact-panel__aside > .btn { width: 100%; }
}

/* ---------- 404 ---------- */
.not-found {
    background: var(--color-primary); color: var(--on-primary);
    border-radius: var(--radius-card); padding: clamp(28px, 5.5vw, 72px);
    display: flex; flex-wrap: wrap; align-items: center; gap: 40px 56px; overflow: hidden;
}
.not-found__text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.not-found__code { font-size: clamp(96px, 15vw, 200px); line-height: .82; font-weight: 700; letter-spacing: -0.06em; color: rgba(255, 255, 255, .95); }
.form-thanks__mark svg { display: block; width: clamp(72px, 12vw, 140px); height: auto; }
.not-found__title { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
.not-found__lead { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--on-primary-muted); max-width: 40ch; }
.not-found__browser { flex: 1 1 380px; min-width: 0; display: none; flex-direction: column; gap: 12px; }
@media (min-width: 760px) { .not-found__browser { display: flex; } }
.browser { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.browser__dots { display: flex; gap: 6px; }
.browser__dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.browser__address { background: #FFFFFF; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 15px; overflow: hidden; }
.browser__url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser__host { color: var(--muted); }
.browser__path { background: #FDECEC; color: #B42318; border-radius: 5px; padding: 1px 5px; text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .5); }
.browser__lines { display: flex; flex-direction: column; gap: 8px; padding: 6px 2px 2px; }
.browser__lines span { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .3); width: 72%; }
.browser__lines span:nth-child(2) { width: 54%; background: rgba(255, 255, 255, .22); }
.browser__lines span:nth-child(3) { width: 63%; background: rgba(255, 255, 255, .16); }
.not-found-page { padding-top: clamp(20px, 3vw, 32px); }
.not-found-more { padding-top: clamp(56px, 7vw, 88px); }
.not-found-more__note { margin-top: 32px; color: var(--muted); font-size: 16px; }
.browser__note { font-size: 14px; color: var(--on-primary-muted); padding-left: 4px; }

.mini-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.mini { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 18px; text-decoration: none; }
.mini:hover { border-color: var(--border-strong); color: var(--ink); }
.mini__text { display: flex; flex-direction: column; min-width: 0; }
.mini__title { font-weight: 700; font-size: 18px; }
.mini__caption { font-size: 14px; color: var(--muted); }

/* ---------- Blog (Blog.dc.html) ---------- */
.blog-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.blog-intro__text { flex: 1 1 520px; min-width: 0; }
.blog-intro__text .page-title { margin-top: 0; }
.blog-intro__text .page-lead { max-width: 56ch; }
.rss-link {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
    border-radius: 12px; background: var(--warm-bg); color: var(--warm-ink); font-size: 15px; font-weight: 600; text-decoration: none;
}
.rss-link:hover { background: var(--warm-bg-hover); color: var(--warm-ink); }
.filter a:hover { background: var(--chip-hover); color: var(--ink); }
.filter a[aria-current="true"]:hover { background: var(--ink); color: var(--on-ink); }

.post-cover { position: relative; overflow: hidden; display: flex; align-items: flex-end; background: var(--tint-bg); color: var(--tint-ink); }
.post-cover__ring { position: absolute; border-radius: 50%; border: solid currentColor; opacity: .08; }
.post-cover__glyph { position: relative; font-family: var(--mono); font-weight: 700; line-height: 1; overflow-wrap: anywhere; }
.post-cover__badge {
    position: absolute; display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
    border-radius: 999px; background: #FFFFFF; color: var(--ink); font-size: 13px; font-weight: 700;
}
.post-cover--image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-cover--card { height: 180px; padding: 24px; }
.post-cover--card .post-cover__ring { right: -30px; top: -50px; width: 180px; height: 180px; border-width: 28px; }
.post-cover--card .post-cover__glyph { font-size: 34px; letter-spacing: -0.03em; }
.post-cover--feature { min-height: 240px; padding: clamp(24px, 4vw, 40px); }
.post-cover--feature .post-cover__ring { right: -40px; top: -60px; width: 300px; height: 300px; border-width: 44px; }
.post-cover--feature .post-cover__glyph { font-size: clamp(44px, 6vw, 76px); letter-spacing: -0.04em; }
.post-cover--feature .post-cover__badge { left: clamp(24px, 4vw, 40px); top: clamp(24px, 4vw, 40px); }
@media (min-width: 760px) { .post-cover--feature { min-height: 340px; } }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.post-tags li { background: var(--chip); color: var(--text-2); border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 500; }

.blog-featured { padding-top: 40px; }
.post-feature {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
    border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden;
    text-decoration: none; background: var(--surface); transition: transform .2s ease, border-color .2s ease;
}
.post-feature:hover, .post-card:hover { transform: translateY(-3px); border-color: var(--border-strong); color: var(--ink); }
.post-feature__body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; gap: 16px; }
.post-feature__meta { font-size: 15px; color: var(--muted); }
.post-feature__title { font-size: clamp(28px, 3vw, 38px); line-height: 1.12; letter-spacing: -0.02em; }
.post-feature__text { color: var(--text-2); font-size: 18px; line-height: 1.6; }
.post-feature__more { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--color-primary); }

.blog-list { padding-top: 32px; }
.post-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.post-grid > li { display: flex; }
.post-card {
    flex: 1; display: flex; flex-direction: column;
    border: 1px solid var(--border); border-radius: var(--radius-card-sm); overflow: hidden;
    text-decoration: none; background: var(--surface); transition: transform .2s ease, border-color .2s ease;
}
.post-card__body { flex: 1; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.post-card__meta { font-size: 14px; color: var(--muted); }
.post-card__title { font-size: 21px; line-height: 1.25; letter-spacing: -0.01em; }
.post-card__text { color: var(--text-2); font-size: 16px; line-height: 1.55; }
.post-card .post-tags { margin-top: auto; padding-top: 8px; }
.blog-empty { padding: 48px 0; color: var(--muted); text-align: center; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border-soft); }
.pager__status { color: var(--muted); font-size: 15px; }
.pager__links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Article (BlogPost.dc.html) ---------- */
.post-head { padding-top: clamp(32px, 5vw, 56px); max-width: 860px; }
.post-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 18px; font-size: 15px; color: var(--muted); }
.tag-link { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--chip); color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.tag-link:hover { background: var(--chip-hover); color: var(--ink); }
/* The pill stays 32px as in the design; the tap area grows to 44px (SPEC §20). */
.tag-link { position: relative; }
.tag-link::after { content: ''; position: absolute; inset: -6px 0; }
.post-head__title { margin-top: 18px; font-size: clamp(36px, 4.6vw, 56px); line-height: 1.08; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.post-head__lead { margin-top: 20px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--text-2); max-width: 62ch; }
.post-byline { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.post-byline__text { display: flex; flex-direction: column; line-height: 1.3; }
.post-byline__name { font-weight: 600; }
.post-byline__position { font-size: 15px; color: var(--muted); }
.avatar { flex-shrink: 0; border-radius: 50%; object-fit: cover; }
.avatar--48 { width: 48px; height: 48px; }
.avatar--72 { width: 72px; height: 72px; }

.post-hero { position: relative; overflow: hidden; margin-top: 40px; border-radius: var(--radius-card); background: var(--tint-bg); color: var(--tint-ink); height: clamp(220px, 28vw, 380px); display: flex; align-items: center; justify-content: center; }
.post-hero__ring { position: absolute; border-radius: 50%; border: solid currentColor; opacity: .07; }
.post-hero__ring--a { left: -60px; bottom: -120px; width: 360px; height: 360px; border-width: 56px; }
.post-hero__ring--b { right: -40px; top: -80px; width: 260px; height: 260px; border-width: 40px; }
.post-hero__glyph { position: relative; padding: 0 16px; font-family: var(--mono); font-size: clamp(48px, 9vw, 120px); font-weight: 700; letter-spacing: -0.05em; text-align: center; overflow-wrap: anywhere; }
.post-hero--image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Text first on phones, the sticky contents panel beside it from 1024px. */
.post-layout { display: flex; flex-direction: column-reverse; gap: 40px; margin-top: 40px; }
.post-main { min-width: 0; max-width: 720px; }
.post-side { min-width: 0; display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 1024px) {
    .post-layout { flex-direction: row; align-items: flex-start; gap: 48px; margin-top: 48px; }
    .post-main { flex: 999 1 560px; }
    .post-side { flex: 1 1 240px; position: sticky; top: 96px; }
}
.post-side__title { font-size: 14px; font-weight: 600; color: var(--subtle); }
.post-toc { display: flex; flex-direction: column; gap: 10px; }
.post-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.post-toc a { display: block; padding: 10px 0 10px 14px; margin-left: -2px; border-left: 2px solid var(--border); color: var(--text-2); font-size: 15px; text-decoration: none; }
.post-toc a:hover { color: var(--color-primary); border-color: var(--color-primary); }
.post-share { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.post-share__copy { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--chip); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.post-share__copy:hover { background: var(--chip-hover); }
.post-share__copy[hidden] { display: none; }
.post-read-in { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--color-primary); }

.post-body { font-size: 18px; line-height: 1.75; color: var(--body-text); overflow-wrap: anywhere; }
.post-body > * + * { margin-top: 18px; }
.post-body h2 { margin-top: 48px; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -0.015em; scroll-margin-top: 96px; }
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { margin-top: 32px; font-size: 21px; line-height: 1.3; }
.post-body ul, .post-body ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.post-body a { color: var(--color-primary); }
.post-body code { font-family: var(--mono); font-size: .88em; background: var(--chip); border-radius: 6px; padding: 1px 6px; }
.post-body pre code { background: transparent; padding: 0; font-size: inherit; }
.post-body blockquote { margin-inline: 0; padding-left: 20px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.post-body hr { border: 0; border-top: 1px solid var(--border-soft); margin-block: 40px; }
.post-body figure { margin-inline: 0; margin-bottom: 0; }
.post-body > figure, .post-body > .tip { margin-top: 24px; }
.post-body figure img { display: block; width: 100%; height: auto; border-radius: 18px; }
.post-body figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.post-body .code { border-radius: 16px; }
.post-body .code__name { margin-top: 0; padding: 10px 18px; background: #161F3D; border-bottom: 0; color: #A9B3D6; font-family: var(--mono); font-size: 13px; }
.post-body .code pre { padding: 18px; font-size: 14px; line-height: 1.7; }
.tip { display: flex; gap: 12px; padding: 18px 20px; border-radius: 16px; background: var(--info-bg); color: var(--info-ink); font-size: 16px; }
.tip::before { content: ''; flex-shrink: 0; width: 22px; height: 22px; margin-top: 2px; background: currentColor; -webkit-mask: var(--tip-icon) center / contain no-repeat; mask: var(--tip-icon) center / contain no-repeat; }
.tip > * + * { margin-top: 10px; }
:root { --tip-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3Cpath d='M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.3 1 2.3h6c0-1 .4-1.8 1-2.3A7 7 0 0 0 12 2Z'/%3E%3C/svg%3E"); }

/* Server-side highlighting (tempest/highlight classes). */
.hl-keyword, .hl-property-access { color: #9DB0FF; }
.hl-type, .hl-generic { color: #7DD3C0; }
.hl-value { color: #F2C98A; }
.hl-variable, .hl-property { color: #E6E9F5; }
.hl-comment { color: #7C86A8; font-style: italic; }
.hl-attribute, .hl-injection { color: #F49AC2; }
.hl-number, .hl-literal { color: #F5A97F; }

.post-topics { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-soft); }
.post-topics__label { font-size: 15px; color: var(--muted); margin-right: 4px; }
.author-card { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 28px; padding: 24px; border-radius: 22px; background: var(--surface-alt); }
.author-card__text { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.author-card__name { font-weight: 700; font-size: 18px; }
.author-card__bio { font-size: 16px; color: var(--text-2); line-height: 1.55; }

.post-related { padding-top: clamp(64px, 8vw, 96px); }
.post-related__title { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 24px; }

/* ---------- Footer ---------- */
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 32px; padding-bottom: 40px; color: var(--muted); font-size: 15px; }
.site-footer a { color: var(--muted); padding: 10px 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
    .project-card:hover, .post-card:hover, .post-feature:hover { transform: none; }
}

/* ---------- Maintenance (SPEC §9, preview in AdminSettings.dc.html) ---------- */
.maintenance-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding-block: 32px; }
.maintenance {
    width: 100%; max-width: 640px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-card);
    padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 56px);
    display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.maintenance__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--info-bg); color: var(--color-primary); display: flex; align-items: center; justify-content: center; }
.maintenance__site { font-size: 15px; font-weight: 700; }
.maintenance__title { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -0.02em; }
.maintenance__message { color: var(--muted); max-width: 40ch; }
.maintenance__eta { font-size: 15px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; }
.maintenance__email { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--color-primary); }
.maintenance-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px var(--gutter); background: var(--warm-bg); color: var(--warm-ink); font-size: 14px; font-weight: 600; }
.preview-bar { flex-wrap: wrap; }
.preview-bar a { color: inherit; display: inline-flex; align-items: center; min-height: 44px; }
.maintenance-bar svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- "Write" popup (SPEC §7) ---------- */
.contact-dialog {
    width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
    margin: auto; padding: clamp(20px, 4vw, 32px);
    border: 1px solid var(--border); border-radius: var(--radius-card-sm);
    background: var(--surface); color: var(--ink);
    box-shadow: 0 24px 64px rgba(13, 21, 48, .24);
}
.contact-dialog::backdrop { background: rgba(13, 21, 48, .55); }
.contact-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.contact-dialog__title { margin: 0; font-size: clamp(22px, 4vw, 26px); line-height: 1.25; letter-spacing: -.02em; }
.contact-dialog__close {
    flex-shrink: 0; width: 44px; height: 44px; margin: -8px -8px 0 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer;
}
.contact-dialog__close:hover { background: var(--chip); color: var(--ink); }
.contact-dialog__lead { margin: 0; color: var(--muted); font-size: 15px; }
.contact-dialog__form, .contact-dialog__done { display: flex; flex-direction: column; gap: 16px; }
.contact-dialog__form[hidden], .contact-dialog__done[hidden] { display: none; }
.contact-dialog__row { display: flex; flex-wrap: wrap; gap: 16px; }
.contact-dialog__row > * { flex: 1 1 200px; min-width: 0; }
.contact-field { display: flex; flex-direction: column; gap: 6px; }
.contact-field label { font-size: 14px; font-weight: 600; }
.contact-field__optional { font-weight: 400; color: var(--subtle); }
.contact-field input, .contact-field textarea {
    width: 100%; min-height: 48px; padding: 10px 14px;
    border: 1px solid var(--border-strong); border-radius: 12px;
    background: var(--surface); color: var(--ink);
    font: inherit; font-size: 16px;
}
.contact-field textarea { resize: vertical; min-height: 120px; }
.contact-field input:focus-visible, .contact-field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--color-primary); }
.contact-dialog__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-dialog__error { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--warm-bg); color: var(--warm-ink); font-size: 15px; }
.contact-dialog__error[hidden] { display: none; }
.contact-dialog__submit:disabled { opacity: .6; cursor: progress; }
.contact-dialog__done { align-items: flex-start; }
.contact-dialog__mark { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--info-bg); color: var(--color-primary); }
.contact-dialog__done-title { margin: 0; font-size: 20px; font-weight: 700; }
@media (min-width: 480px) { .contact-dialog__submit { align-self: flex-start; } }
