/* ==========================================================================
   Muhiddin Turonov — studio site
   Design tokens first; everything below reads from them.
   ========================================================================== */

:root {
  color-scheme: light;
  /* Light theme (default). Dark values live in the block below. */
  --bg: #f5f7fb;
  --bg-raised: #eceff6;
  --card: #ffffff;
  --card-hover: #f2f5fc;
  --line: rgba(22, 38, 74, 0.11);
  --line-strong: rgba(22, 38, 74, 0.2);
  --line-hover: rgba(22, 38, 74, 0.34);
  --text: #0c1424;
  --muted: #46536b;
  --dim: #5b6880;
  --primary: #3563ff;
  --primary-hover: #2550ee;
  --primary-text: #2346d6; /* blue that passes AA as text on --bg */
  --primary-soft: rgba(53, 99, 255, 0.09);
  --primary-line: rgba(53, 99, 255, 0.28);
  --glow: rgba(53, 99, 255, 0.12);
  --glow-strong: rgba(53, 99, 255, 0.16);
  --ok: #0d7a4f;
  --ok-soft: rgba(13, 122, 79, 0.1);
  --ok-line: rgba(13, 122, 79, 0.3);
  --warn: #965600;
  --warn-soft: rgba(214, 140, 20, 0.1);
  --warn-line: rgba(184, 110, 0, 0.38);
  --warn-text: #5e3700;
  --info-text: #1d3aa8;
  --danger: #c02f2f;
  --danger-soft: rgba(192, 47, 47, 0.07);
  --danger-line: rgba(192, 47, 47, 0.3);
  --danger-text: #8a1d1d;
  --tint: rgba(22, 38, 74, 0.02);
  --tint-hover: rgba(22, 38, 74, 0.05);
  --header-bg: rgba(245, 247, 251, 0.82);
  --overlay: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.94);
  --role-bg: rgba(255, 255, 255, 0.65);
  --portrait-fade: rgba(245, 247, 251, 0.7);
  --monogram-stroke: rgba(35, 70, 214, 0.38);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235b6880' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 24px 48px -24px rgba(22, 38, 74, 0.28);
  --shadow-glow: 0 10px 30px -12px rgba(53, 99, 255, 0.45);
  /* Placeholder artwork */
  --pa-bg: #e4e9f4;
  --pa-panel: #ffffff;
  --pa-side: #f0f3fa;
  --pa-tile: #eef2fa;
  --pa-line: rgba(22, 38, 74, 0.14);
  --pa-bar: rgba(22, 38, 74, 0.16);
  --pa-bar-strong: rgba(22, 38, 74, 0.24);
  --pa-text: rgba(12, 20, 36, 0.6);

  /* Type */
  --font-sans: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-hand: "Caveat", "Segoe Print", cursive;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.5rem;
  --fs-xl: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
  --fs-2xl: clamp(2.25rem, 1.4rem + 3vw, 3.5rem);
  --fs-hero: clamp(2.4rem, 1.2rem + 3.9vw, 4rem);

  /* Space (8pt) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* Shape — radii follow hierarchy: surfaces > controls > chips */
  --r-surface: 22px;
  --r-card: 16px;
  --r-control: 12px;
  --r-pill: 999px;

  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dark theme: chosen explicitly (data-theme, set by theme.js) or by the OS when nothing is chosen.
   The two blocks must stay identical. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080d16;
  --bg-raised: #0b1322;
  --card: #101b2d;
  --card-hover: #13213a;
  --line: rgba(160, 182, 226, 0.12);
  --line-strong: rgba(160, 182, 226, 0.22);
  --line-hover: rgba(160, 182, 226, 0.4);
  --text: #f3f6fc;
  --muted: #a3b0c7;
  --dim: #7c8aa3;
  --primary-hover: #4a74ff;
  --primary-text: #7f9cff;
  --primary-soft: rgba(53, 99, 255, 0.14);
  --primary-line: rgba(53, 99, 255, 0.28);
  --glow: rgba(53, 99, 255, 0.22);
  --glow-strong: rgba(53, 99, 255, 0.28);
  --ok: #45d39a;
  --ok-soft: rgba(69, 211, 154, 0.12);
  --ok-line: rgba(69, 211, 154, 0.35);
  --warn: #f2b84b;
  --warn-soft: rgba(242, 184, 75, 0.07);
  --warn-line: rgba(242, 184, 75, 0.35);
  --warn-text: #f4dcae;
  --info-text: #c8d4ff;
  --danger: #ff7a7a;
  --danger-soft: rgba(255, 122, 122, 0.08);
  --danger-line: rgba(255, 122, 122, 0.35);
  --danger-text: #ffc9c9;
  --tint: rgba(255, 255, 255, 0.02);
  --tint-hover: rgba(255, 255, 255, 0.05);
  --header-bg: rgba(8, 13, 22, 0.78);
  --overlay: rgba(8, 13, 22, 0.72);
  --glass: rgba(16, 27, 45, 0.92);
  --role-bg: rgba(16, 27, 45, 0.5);
  --portrait-fade: rgba(8, 13, 22, 0.85);
  --monogram-stroke: rgba(127, 156, 255, 0.45);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a3b0c7' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 10px 30px -10px rgba(53, 99, 255, 0.55);
  --pa-bg: #0b1322;
  --pa-panel: #101b2d;
  --pa-side: #0d1726;
  --pa-tile: #13213a;
  --pa-line: rgba(160, 182, 226, 0.18);
  --pa-bar: rgba(160, 182, 226, 0.18);
  --pa-bar-strong: rgba(160, 182, 226, 0.3);
  --pa-text: rgba(243, 246, 252, 0.62);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #080d16;
    --bg-raised: #0b1322;
    --card: #101b2d;
    --card-hover: #13213a;
    --line: rgba(160, 182, 226, 0.12);
    --line-strong: rgba(160, 182, 226, 0.22);
    --line-hover: rgba(160, 182, 226, 0.4);
    --text: #f3f6fc;
    --muted: #a3b0c7;
    --dim: #7c8aa3;
    --primary-hover: #4a74ff;
    --primary-text: #7f9cff;
    --primary-soft: rgba(53, 99, 255, 0.14);
    --primary-line: rgba(53, 99, 255, 0.28);
    --glow: rgba(53, 99, 255, 0.22);
    --glow-strong: rgba(53, 99, 255, 0.28);
    --ok: #45d39a;
    --ok-soft: rgba(69, 211, 154, 0.12);
    --ok-line: rgba(69, 211, 154, 0.35);
    --warn: #f2b84b;
    --warn-soft: rgba(242, 184, 75, 0.07);
    --warn-line: rgba(242, 184, 75, 0.35);
    --warn-text: #f4dcae;
    --info-text: #c8d4ff;
    --danger: #ff7a7a;
    --danger-soft: rgba(255, 122, 122, 0.08);
    --danger-line: rgba(255, 122, 122, 0.35);
    --danger-text: #ffc9c9;
    --tint: rgba(255, 255, 255, 0.02);
    --tint-hover: rgba(255, 255, 255, 0.05);
    --header-bg: rgba(8, 13, 22, 0.78);
    --overlay: rgba(8, 13, 22, 0.72);
    --glass: rgba(16, 27, 45, 0.92);
    --role-bg: rgba(16, 27, 45, 0.5);
    --portrait-fade: rgba(8, 13, 22, 0.85);
    --monogram-stroke: rgba(127, 156, 255, 0.45);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a3b0c7' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 10px 30px -10px rgba(53, 99, 255, 0.55);
    --pa-bg: #0b1322;
    --pa-panel: #101b2d;
    --pa-side: #0d1726;
    --pa-tile: #13213a;
    --pa-line: rgba(160, 182, 226, 0.18);
    --pa-bar: rgba(160, 182, 226, 0.18);
    --pa-bar-strong: rgba(160, 182, 226, 0.3);
    --pa-text: rgba(243, 246, 252, 0.62);
  }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--primary); color: #fff; }

:focus-visible {
  outline: 2px solid var(--primary-text);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--primary); color: #fff; padding: var(--s-2) var(--s-4); border-radius: var(--r-control);
}
.skip-link:focus { top: var(--s-4); }

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

/* ---------- Layout ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2 * var(--gutter), 760px); margin-inline: auto; }
.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section + .section { border-top: 1px solid var(--line); }
.section--raised { background: var(--bg-raised); }
.stack > * + * { margin-top: var(--s-4); }

.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: var(--s-5); margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.section-head__text { max-width: 640px; }
.kicker {
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: var(--primary-text); font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s-3);
}
.kicker::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.h-section { font-size: var(--fs-2xl); }
.lead { color: var(--muted); font-size: var(--fs-md); line-height: 1.55; margin-top: var(--s-4); max-width: 62ch; }
.muted { color: var(--muted); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3);
  min-height: 52px; padding: 0 var(--s-5);
  border-radius: var(--r-control); border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-sm); line-height: 1; white-space: nowrap;
  cursor: pointer; transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn .icon { flex: none; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-glow); }
.btn--primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: var(--tint); }
.btn--ghost:hover { border-color: var(--line-hover); background: var(--tint-hover); }
.btn--sm { min-height: 42px; padding: 0 var(--s-4); }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: var(--primary-text); font-weight: 600; font-size: var(--fs-sm);
}
.link-arrow .icon { transition: transform 0.2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); font-weight: 600; letter-spacing: -0.01em; }
.brand__mark { width: 40px; height: 26px; color: var(--primary); flex: none; }
.brand__name { font-size: 1rem; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: var(--s-1); }
.site-nav li a {
  display: block; padding: var(--s-2) var(--s-3); border-radius: 10px;
  color: var(--muted); font-size: var(--fs-sm); font-weight: 500; transition: color 0.15s, background-color 0.15s;
}
.site-nav li a:hover { color: var(--text); background: var(--tint-hover); }
.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; margin-top: 4px; border-radius: 2px; background: var(--primary);
}
.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border-radius: var(--r-control);
  border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }
.nav-open .nav-toggle .icon-menu { display: none; }

.site-nav__cta { display: none !important; }
.site-nav__langs { display: none; }

/* Header tools: language menu + theme toggle */
.header-tools { display: flex; align-items: center; gap: var(--s-2); }
.icon-btn, .lang-menu summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 40px; border-radius: var(--r-control);
  border: 1px solid var(--line-strong); background: var(--tint); color: var(--muted);
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.icon-btn:hover, .lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); border-color: var(--line-hover); background: var(--tint-hover); }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
.no-js .theme-toggle { display: none; }

.lang-menu { position: relative; }
.lang-menu summary { list-style: none; padding: 0 10px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu form {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 180px;
  padding: 6px; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: var(--shadow-lift);
}
.lang-menu ul { list-style: none; display: grid; gap: 2px; }
.lang-menu button {
  width: 100%; display: flex; align-items: center; gap: var(--s-3); padding: 9px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); font-size: var(--fs-sm); text-align: left; cursor: pointer;
}
.lang-menu button span { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--dim); width: 22px; }
.lang-menu button:hover { background: var(--tint-hover); color: var(--text); }
.lang-menu button[aria-current="true"] { color: var(--text); background: var(--primary-soft); }
.lang-menu button[aria-current="true"] span { color: var(--primary-text); }

@media (max-width: 1180px) {
  .site-header__cta { display: none; }
}

@media (max-width: 980px) {
  .header-tools { margin-left: auto; }
  .nav-toggle { display: inline-flex; margin-left: 0; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: var(--s-4) var(--gutter) var(--s-6);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li a { font-size: var(--fs-md); padding: var(--s-4) 0; border-radius: 0; border-bottom: 1px solid var(--line); color: var(--text); }
  .site-nav a[aria-current="page"]::after { display: none; }
  .site-nav a[aria-current="page"] { color: var(--primary-text); }
  .site-nav__cta { display: flex !important; margin-top: var(--s-5); }
  .site-nav__langs { display: block; margin-top: var(--s-5); }
  .no-js .site-nav { position: static; opacity: 1; visibility: visible; transform: none; }
}
@media (max-width: 520px) {
  .site-header__inner { gap: var(--s-3); }
  .lang-menu { display: none; } /* the language list moves into the menu panel */
  .icon-btn { width: 44px; height: 44px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem); }
.hero::before {
  /* one restrained light source behind the visual */
  content: ""; position: absolute; right: -10%; top: -20%; width: 70%; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none;
}
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
.hero__role { color: var(--primary-text); font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--s-5); display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.hero__role .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.hero__role .avail { color: var(--muted); font-weight: 400; }
.hero h1 { font-size: var(--fs-hero); letter-spacing: -0.04em; line-height: 1.04; font-weight: 700; }
.hero h1 .accent { color: var(--primary); display: block; }
.hero__sub { margin-top: var(--s-5); color: var(--muted); font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem); line-height: 1.55; max-width: 34em; }
.hero__actions { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-3); }
.capabilities { margin-top: clamp(2.5rem, 5vw, 3.5rem); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; }
.capabilities li { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--muted); font-size: var(--fs-sm); }
.capabilities .icon { color: var(--primary-text); }

/* Signature: the build log — idea to launch, as it actually happens */
.hero__visual { position: relative; min-height: 440px; display: grid; align-items: end; }
.portrait {
  position: absolute; inset: 0 0 64px 18%; border-radius: var(--r-surface); overflow: hidden;
  border: 1px solid var(--line); background: var(--card);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.portrait::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, var(--portrait-fade)); }
.portrait--empty { display: grid; place-items: center; }
.portrait--empty .monogram {
  font-size: clamp(5rem, 10vw, 8rem); font-weight: 700; letter-spacing: -0.06em; color: transparent;
  -webkit-text-stroke: 1.5px var(--monogram-stroke);
}
.portrait--empty::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: radial-gradient(closest-side, #000, transparent);
}
.hand-note {
  position: absolute; top: -6px; right: 0; z-index: 3;
  font-family: var(--font-hand); font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem); line-height: 1;
  color: var(--primary-text); transform: rotate(-8deg); text-align: right;
}
.hand-note svg { width: 110px; margin: 4px 0 0 auto; color: var(--primary-text); }

.buildlog {
  position: relative; z-index: 2; width: min(100%, 440px);
  background: var(--glass); border: 1px solid var(--line-strong);
  border-radius: var(--r-card); box-shadow: var(--shadow-lift);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: 0.8125rem; overflow: hidden;
}
.buildlog__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--dim); }
.buildlog__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.buildlog__bar span { margin-left: 8px; }
.buildlog ol { list-style: none; padding: 14px 16px 6px; }
.buildlog li { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: baseline; padding: 6px 0; color: var(--muted); }
.buildlog li b { font-weight: 500; color: var(--text); }
.buildlog li em { font-style: normal; color: var(--dim); font-size: 0.75rem; }
.buildlog .ok { color: var(--ok); }
.buildlog .run { color: var(--primary-text); }
.buildlog__progress { margin: 6px 16px 16px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.buildlog__progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-text)); border-radius: inherit; transform-origin: left; }

@media (prefers-reduced-motion: no-preference) {
  .js .buildlog li { opacity: 0; transform: translateY(4px); animation: log-in 0.45s var(--ease) forwards; }
  .js .buildlog li:nth-child(1) { animation-delay: 0.25s; }
  .js .buildlog li:nth-child(2) { animation-delay: 0.65s; }
  .js .buildlog li:nth-child(3) { animation-delay: 1.05s; }
  .js .buildlog li:nth-child(4) { animation-delay: 1.45s; }
  .js .buildlog li:nth-child(5) { animation-delay: 1.85s; }
  .js .buildlog__progress span { transform: scaleX(0); animation: log-bar 2.1s var(--ease) 0.25s forwards; }
  .buildlog .run-dot { animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes log-in { to { opacity: 1; transform: none; } }
@keyframes log-bar { to { transform: scaleX(1); } }
@keyframes pulse { 50% { opacity: 0.35; } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { min-height: 380px; }
  .portrait { inset: 0 0 56px 12%; }
}
@media (max-width: 520px) {
  .hero__visual { min-height: 340px; }
  .portrait { inset: 0 0 72px 0; }
  .hand-note { right: 8px; top: 8px; }
  .buildlog li em { display: none; }
}

/* ---------- Chips & badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; }
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px;
  border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--tint);
  font-size: var(--fs-xs); color: var(--muted); white-space: nowrap;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 0.75rem; font-weight: 600;
  background: var(--overlay); border: 1px solid var(--line-strong); color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--live { color: var(--ok); }
.badge--development { color: var(--primary-text); }
.badge--review { color: var(--warn); border-color: var(--warn-line); }
.badge--private { color: var(--muted); }

/* ---------- Project cards ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.project-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-surface);
  overflow: hidden; transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.project-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.project-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--bg-raised); overflow: hidden; border-bottom: 1px solid var(--line); }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.project-card:hover .project-card__media img { transform: scale(1.03); }
.project-card__badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; }
.project-card__body { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); flex: 1; }
.project-card__title { position: relative; padding-right: 32px; font-size: var(--fs-md); }
.project-card__title .icon { position: absolute; right: 0; top: 3px; color: var(--muted); transition: transform 0.2s var(--ease), color 0.2s; }
.project-card:hover .project-card__title .icon { color: var(--primary-text); transform: translate(2px, -2px); }
.project-card__title small { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 4px; }
.project-card__summary { color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.project-card .chips { margin-top: auto; padding-top: var(--s-2); }
.project-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }

/* Placeholder artwork: an abstract interface sketch, never presented as a screenshot */
.placeholder-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.placeholder-art .pa-bg { fill: var(--pa-bg); }
.placeholder-art .pa-fade { stop-color: var(--pa-bg); }
.placeholder-art .pa-panel { fill: var(--pa-panel); stroke: var(--pa-line); }
.placeholder-art .pa-side { fill: var(--pa-side); }
.placeholder-art .pa-tile { fill: var(--pa-tile); }
.placeholder-art .pa-bar { fill: var(--pa-bar); }
.placeholder-art .pa-bar-strong { fill: var(--pa-bar-strong); }
.placeholder-art .pa-text { fill: var(--pa-text); }
.placeholder-note {
  position: absolute; right: 12px; bottom: 10px; z-index: 2;
  font-size: 0.6875rem; color: var(--muted); background: var(--overlay); padding: 3px 8px; border-radius: var(--r-pill);
}

/* ---------- Service tiles ---------- */
.services-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.service-tile {
  position: relative; display: grid; grid-template-columns: 48px 1fr; gap: var(--s-4);
  padding: var(--s-5); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.service-tile:hover { border-color: var(--line-strong); background: var(--card-hover); }
.service-tile h3 { font-size: 1.0625rem; letter-spacing: -0.01em; display: flex; justify-content: space-between; gap: var(--s-2); }
.service-tile h3 .icon { color: var(--dim); flex: none; }
.service-tile:hover h3 .icon { color: var(--primary-text); }
.service-tile p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-2); line-height: 1.5; }
.service-tile a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.icon-box {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-text); border: 1px solid var(--primary-line);
}
.service-tile--support { grid-template-columns: 40px 1fr; padding: var(--s-4); background: transparent; }
.service-tile--support .icon-box { width: 40px; height: 40px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-surface); padding: var(--s-6);
}
.panel h3 { font-size: var(--fs-md); }
.checklist { list-style: none; margin-top: var(--s-5); display: grid; gap: var(--s-4); }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); color: var(--muted); font-size: var(--fs-sm); }
.checklist li strong { color: var(--text); font-weight: 600; display: block; }
.check-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; }

@media (max-width: 1024px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .project-grid, .project-grid--two, .service-grid { grid-template-columns: 1fr; }
}

/* ---------- Problems ---------- */
.problem-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.problem { display: grid; grid-template-columns: 1fr; gap: var(--s-2); padding: var(--s-5) var(--s-5) var(--s-5) 0; border-bottom: 1px solid var(--line); }
.problem:nth-child(odd) { border-right: 1px solid var(--line); }
.problem:nth-child(even) { padding-left: var(--s-5); }
.problem__pain { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.015em; }
.problem__fix { color: var(--muted); font-size: var(--fs-sm); }
.problem__fix b { color: var(--primary-text); font-weight: 600; }
@media (max-width: 760px) {
  .problem-list { grid-template-columns: 1fr; }
  .problem:nth-child(odd) { border-right: 0; }
  .problem:nth-child(even) { padding-left: 0; }
}

/* ---------- Process (a real sequence → numbered) ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; counter-reset: step; }
.step { position: relative; padding: var(--s-5) var(--s-5) var(--s-5) 0; }
.step__num { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--primary-text); display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.step__num::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.step:last-child .step__num::after { background: linear-gradient(90deg, var(--line-strong), transparent); }
.step h3 { font-size: var(--fs-md); }
.step p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-2); }

.timeline { list-style: none; display: grid; gap: var(--s-4); }
.timeline-item {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--s-5);
  padding: var(--s-6); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-surface);
}
.timeline-item__num { font-size: var(--fs-2xl); font-weight: 600; color: var(--primary-text); letter-spacing: -0.04em; line-height: 1; }
.timeline-item h2 { font-size: var(--fs-lg); }
.timeline-item__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); margin-top: var(--s-5); }
.timeline-item h3 { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; margin-bottom: var(--s-2); }
@media (max-width: 720px) {
  .timeline-item { grid-template-columns: 1fr; gap: var(--s-3); padding: var(--s-5); }
  .timeline-item__cols { grid-template-columns: 1fr; }
}

/* ---------- Lists ---------- */
.ticks { list-style: none; display: grid; gap: var(--s-3); }
.ticks li { display: grid; grid-template-columns: 20px 1fr; gap: var(--s-3); color: var(--muted); }
.ticks li .icon { color: var(--primary-text); margin-top: 4px; }
.ticks--two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-6); }
@media (max-width: 680px) { .ticks--two { grid-template-columns: 1fr; } }

/* ---------- Team ---------- */
.team-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s-7); align-items: center; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.role { padding: var(--s-4) var(--s-5); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--role-bg); }
.role h3 { font-size: 1rem; letter-spacing: -0.01em; }
.role p { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.founder-card { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); margin-top: var(--s-5); }
.avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); font-weight: 600; border: 1px solid var(--primary-line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 88px; height: 88px; font-size: 1.5rem; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-4); }
.member { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--card); }
.member h3 { font-size: var(--fs-md); margin-top: var(--s-4); }
.member .role-label { color: var(--primary-text); font-size: var(--fs-sm); margin-top: 2px; }
.member p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-3); }
@media (max-width: 900px) { .team-strip { grid-template-columns: 1fr; gap: var(--s-6); } }
@media (max-width: 520px) { .role-grid { grid-template-columns: 1fr; } }

/* ---------- Tech ---------- */
.tech-rows { display: grid; border-top: 1px solid var(--line); }
.tech-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-5); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.tech-row h3 { font-size: var(--fs-md); }
.tech-row p { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.tech-detail { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-3); }
.tech-item { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-control); background: var(--card); }
.tech-item b { display: block; font-weight: 600; }
.tech-item span { display: block; color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
@media (max-width: 720px) { .tech-row { grid-template-columns: 1fr; gap: var(--s-3); } }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--s-4); align-items: center;
  padding: var(--s-5) 0; font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { flex: none; color: var(--primary-text); transition: transform 0.25s var(--ease); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq__answer { color: var(--muted); padding-bottom: var(--s-5); max-width: 68ch; }
.faq__answer p + p { margin-top: var(--s-3); }
.faq-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s-7); }
@media (max-width: 900px) { .faq-layout { grid-template-columns: 1fr; gap: var(--s-5); } }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden; border-radius: var(--r-surface);
  padding: clamp(2rem, 5vw, 4rem); background: var(--card); border: 1px solid var(--line-strong);
  display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: var(--s-6); align-items: center;
}
.cta-band::before {
  content: ""; position: absolute; inset: auto -10% -60% auto; width: 60%; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--glow-strong), transparent); pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 { font-size: var(--fs-xl); }
.cta-band p { color: var(--muted); margin-top: var(--s-3); max-width: 52ch; }
.cta-band__actions { display: flex; flex-direction: column; gap: var(--s-3); align-items: stretch; }
.cta-band__meta { color: var(--dim); font-size: var(--fs-xs); text-align: center; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } }

/* ---------- Page header & breadcrumbs ---------- */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: var(--fs-2xl); max-width: 22ch; letter-spacing: -0.035em; }
.page-head .lead { margin-top: var(--s-4); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: var(--fs-sm); color: var(--dim); margin-bottom: var(--s-5); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--s-2); }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current] { color: var(--text); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-6); }
.filter {
  min-height: 40px; display: inline-flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-4);
  border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
}
.filter:hover { color: var(--text); border-color: var(--line-hover); }
.filter[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.filter small { opacity: 0.7; }

/* ---------- Detail pages ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.detail-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: var(--s-4); }
.facts { display: grid; gap: var(--s-4); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--card); }
.facts dt { color: var(--dim); font-size: var(--fs-xs); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.content-block + .content-block { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.content-block > h2 { font-size: var(--fs-lg); margin-bottom: var(--s-4); }
.content-block > p, .content-block .prose { color: var(--muted); max-width: 68ch; }
.content-block > p + p { margin-top: var(--s-3); }
.note {
  display: grid; grid-template-columns: 22px 1fr; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); border-radius: var(--r-card);
  background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-text); font-size: var(--fs-sm);
}
.note .icon { color: var(--warn); margin-top: 2px; }
.note--info { background: var(--primary-soft); border-color: var(--primary-line); color: var(--info-text); }
.note--info .icon { color: var(--primary-text); }
.cover-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-surface); overflow: hidden; border: 1px solid var(--line); background: var(--bg-raised); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.cover-frame img, .cover-frame iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.gallery figure { margin: 0; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.gallery figcaption { padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); color: var(--muted); }
.stage-list { list-style: none; display: grid; gap: 0; border-left: 1px solid var(--line-strong); margin-left: 8px; }
.stage-list li { position: relative; padding: 0 0 var(--s-5) var(--s-5); }
.stage-list li::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--bg); }
.stage-list b { display: block; font-weight: 600; }
.stage-list span { color: var(--muted); font-size: var(--fs-sm); }
.next-link { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding: var(--s-5) var(--s-6); border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--card); }
.next-link:hover { border-color: var(--line-strong); }
.next-link small { color: var(--dim); display: block; }
.next-link b { font-size: var(--fs-lg); letter-spacing: -0.02em; }
@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
}
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr; } }

/* ---------- Prose (blog) ---------- */
.prose { color: var(--muted); font-size: 1.125rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { color: var(--text); font-size: var(--fs-lg); margin-top: 2em; }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--primary-text); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.post-card { position: relative; display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--card); transition: border-color 0.2s; }
.post-card:hover { border-color: var(--line-strong); }
.post-card__meta { color: var(--dim); font-size: var(--fs-xs); display: flex; gap: var(--s-3); flex-wrap: wrap; }
.post-card h3 { font-size: var(--fs-md); }
.post-card p { color: var(--muted); font-size: var(--fs-sm); }
.post-card a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card__cover { margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-2); aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-surface) var(--r-surface) 0 0; }
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-7); align-items: center; }
.about-photo { aspect-ratio: 4 / 5; border-radius: var(--r-surface); overflow: hidden; border: 1px solid var(--line); background: var(--card); position: relative; display: grid; place-items: center; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s-7); }
.split + .split { margin-top: clamp(3rem, 6vw, 5rem); }
.split h2 { font-size: var(--fs-xl); }
.pair-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.pair { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.pair b { display: block; font-size: 1.0625rem; font-weight: 600; }
.pair span { display: block; color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-2); }
.milestones { list-style: none; border-left: 1px solid var(--line-strong); margin-left: 6px; }
.milestones li { position: relative; padding: 0 0 var(--s-6) var(--s-6); }
.milestones li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--primary); background: var(--bg); }
.milestones time { color: var(--primary-text); font-size: var(--fs-sm); font-weight: 600; }
.milestones h3 { font-size: var(--fs-md); margin-top: 2px; }
.milestones p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-2); }
@media (max-width: 900px) {
  .about-hero, .split { grid-template-columns: 1fr; gap: var(--s-5); }
  .about-photo { max-width: 360px; }
}
@media (max-width: 600px) { .pair-grid { grid-template-columns: 1fr; } }

.placeholder-flag {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--warn);
  border: 1px dashed var(--warn-line); border-radius: var(--r-pill); padding: 2px 10px;
}

/* ---------- Forms ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.form { display: grid; gap: var(--s-5); }
.form-card { padding: clamp(1.25rem, 3vw, 2.25rem); border: 1px solid var(--line); border-radius: var(--r-surface); background: var(--card); }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
.form legend { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--s-4); padding: 0; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 600; }
.field .optional { color: var(--dim); font-weight: 400; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-control);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field select { appearance: none; background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(53, 99, 255, 0.25); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: var(--fs-sm); }
.field__help { color: var(--dim); font-size: var(--fs-xs); }
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.segmented label {
  position: relative; display: flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px;
  border: 1px solid var(--line-strong); border-radius: var(--r-control); cursor: pointer; font-weight: 500; font-size: var(--fs-sm); background: var(--bg);
}
.segmented label > span { display: inline-flex; align-items: center; gap: var(--s-2); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span { color: var(--text); }
.segmented label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--primary-text); outline-offset: 2px; }
.contact-fields .field[hidden] { display: none; }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: var(--s-3); align-items: start; font-size: var(--fs-sm); color: var(--muted); }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); }
.consent a { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.form-errors { padding: var(--s-4) var(--s-5); border-radius: var(--r-control); background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger-text); font-size: var(--fs-sm); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-submit { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.form-submit p { color: var(--dim); font-size: var(--fs-xs); flex: 1; min-width: 200px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; display: none; }
.is-submitting .spinner { display: inline-block; animation: spin 0.8s linear infinite; }
.is-submitting .btn-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.contact-aside { display: grid; gap: var(--s-4); }
.contact-line { display: grid; grid-template-columns: 44px 1fr; gap: var(--s-4); align-items: center; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.contact-line:is(a):hover { border-color: var(--line-strong); }
.contact-line small { display: block; color: var(--dim); font-size: var(--fs-xs); }
.contact-line b { font-weight: 600; word-break: break-word; }
@media (max-width: 960px) { .contact-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .segmented label { font-size: var(--fs-xs); }
}

.success { text-align: left; }
.success__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); margin-bottom: var(--s-5); }

/* ---------- 404 ---------- */
.not-found { min-height: 60vh; display: grid; align-content: center; }
.not-found__code { font-family: var(--font-mono); color: var(--primary-text); font-size: var(--fs-sm); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-8) var(--s-6); margin-top: 0; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
.footer-grid h2 { font-size: var(--fs-sm); color: var(--dim); font-weight: 600; margin-bottom: var(--s-4); letter-spacing: 0; }
.footer-grid ul { list-style: none; display: grid; gap: var(--s-3); }
.footer-grid a, .footer-grid li span { color: var(--muted); font-size: var(--fs-sm); }
.footer-grid a:hover { color: var(--text); }
.footer-about p { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s-4); max-width: 36ch; }
.socials { display: flex; gap: var(--s-2); margin-top: var(--s-5); list-style: none; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--muted); }
.socials a:hover { color: var(--text); border-color: var(--line-hover); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); color: var(--dim); font-size: var(--fs-xs); }
.footer-bottom a:hover { color: var(--text); }
.lang-switch { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; }
.site-nav .lang-switch { flex-direction: row; gap: var(--s-2); }
.lang-switch button { min-height: 40px; background: none; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 0 14px; cursor: pointer; color: var(--muted); font-size: var(--fs-sm); }
.lang-switch button[aria-current="true"] { color: var(--text); border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-about { grid-column: 1 / -1; } }

/* ---------- Pagination & empty ---------- */
.pagination { display: flex; gap: var(--s-2); justify-content: center; margin-top: var(--s-7); }
.empty { padding: var(--s-7) var(--s-5); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-surface); color: var(--muted); }
.empty h2 { color: var(--text); font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.empty .btn { margin-top: var(--s-5); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.prose a { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.detail-aside .btn { white-space: normal; text-align: center; line-height: 1.3; padding-block: 14px; }
.cover-frame--placeholder { aspect-ratio: 21 / 8; }
