/* InPower design tokens — «Горн» (engineering forge). The single source of truth.
   Dark only: the brand lives on warm coal next to the shield and Verse. [data-theme] stays a harmless
   hook: nothing overrides the palette. Fonts are self-hosted woff2 subsets (Latin + Cyrillic, ~69 KB);
   Sofia Sans needs lang="ru" on Russian text, otherwise its locl feature shows Bulgarian letterforms. */

@font-face {
  font-family: "IP Sofia Sans XC";
  src: url("../fonts/sofia-sans-extra-condensed-900.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IP Onest";
  src: url("../fonts/onest-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IP Onest";
  src: url("../fonts/onest-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IP Martian Mono";
  src: url("../fonts/martian-mono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  color-scheme: dark;

  /* Grounds: depth comes from these steps and warm glow, never from shadows */
  --ip-ground: #110a09;          /* Окалина — page */
  --ip-surface: #1c1311;         /* Чугун — window, doors, fields, chat panel */
  --ip-raised: #2a1d1a;          /* Наковальня — hover, launcher, bubbles */
  --ip-seam: #4a3530;            /* Шов — dividers, stamp frames, outline numbers (decor only) */
  --ip-field: #8c7168;           /* Кромка — borders of fields and controls, 4.1:1 on surface */
  --ip-verse: #07060b;           /* Verse band, no tone jump into the 3D portfolio */
  --ip-visitor: #3a2723;         /* visitor chat bubble */
  --ip-veil: rgb(17 10 9 / .86); /* plate under stamps and controls on top of media */

  /* Text */
  --ip-text: #fbf2e8;            /* Белый накал — 17.7:1 */
  --ip-text-2: #c2aea3;          /* Пепел — secondary, eyebrows, field labels, «paused», 9.2:1 */

  /* Accents — per 900px frame: one gold button, one orange word, one gold tab or chip */
  --ip-gold: #ffc23d;            /* Накал — primary button, active tab/chip, focus, status «live» */
  --ip-on-gold: #110a09;         /* text on gold, 12.2:1 */
  --ip-orange: #ff6a1f;          /* Горн — one H1 word, link underlines, «in progress», prototype outline */
  --ip-cold: #9c7fe0;            /* AI and system only */
  --ip-red: #e2303a;             /* Жар — inside the gradient and sparks only, never text */
  --ip-err: #ff8f87;             /* errors, always with «!» */

  /* Heat */
  --ip-heat: linear-gradient(90deg, #5b2a9e 0%, #9b1b6e 22%, #e2303a 45%, #ff6a1f 70%, #ffc23d 92%, #fff3c4 100%);
  --ip-white-heat: #fff3c4;      /* end of the heat scale: glint, edge flash */
  --ip-gold-bar: linear-gradient(180deg, #ffd36a 0%, #ffc23d 35%, #ff8a2a 100%);
  --ip-gold-glint: inset 0 1px 0 var(--ip-white-heat);
  --ip-shield-glow: radial-gradient(closest-side, rgb(255 194 61 / .55), rgb(226 48 58 / .25) 55%, transparent);
  --ip-window-glow: radial-gradient(120% 60% at 50% 0%, rgb(255 106 31 / .14), transparent 70%);
  --ip-door-glow: radial-gradient(420px 220px at 30% 0%, rgb(255 106 31 / .12), transparent 70%);
  --ip-scrim: linear-gradient(180deg, transparent 45%, rgb(17 10 9 / .92));
  --ip-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .8 0 0 0 0 .6 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --ip-focus-ring: 0 0 0 2px var(--ip-ground), 0 0 0 4px var(--ip-gold);

  /* Type */
  --ip-font-display: "IP Sofia Sans XC", "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --ip-font-sans: "IP Onest", "Onest", "Segoe UI", Roboto, Arial, sans-serif;
  --ip-font-mono: "IP Martian Mono", "Martian Mono", Consolas, Menlo, monospace;
  --ip-fs-h1: clamp(52px, 38.4px + 4vw, 104px);      /* 54 @390 → 96 @1440, line-height .9 */
  --ip-fs-h2: clamp(44px, 33.6px + 2.667vw, 72px);
  --ip-fs-h3: clamp(30px, 26.9px + 1.048vw, 44px);    /* card and case titles */
  --ip-fs-fact: clamp(28px, 25.8px + .571vw, 34px);   /* big fact */
  --ip-fs-fact-xl: clamp(44px, 33.6px + 2.667vw, 72px); /* number in the load race */
  --ip-fs-num: clamp(40px, 22.2px + 4.571vw, 88px);   /* outline section number */
  --ip-fs-lead: clamp(17px, 15.5px + .38vw, 21px);
  --ip-fs-body: clamp(16px, 15.3px + .19vw, 18px);
  --ip-fs-ui: 16px;              /* buttons, tabs, fields */
  --ip-fs-small: 14px;
  --ip-fs-mono: 12px;            /* Martian labels: uppercase, never smaller */
  --ip-lh-display: .9;
  --ip-lh-text: 1.55;
  --ip-track-mono: .08em;

  /* Spacing (4px base, layout on an 8px step) and grid */
  --ip-space-1: 4px;
  --ip-space-2: 8px;
  --ip-space-3: 12px;
  --ip-space-4: 16px;
  --ip-space-6: 24px;
  --ip-space-8: 32px;
  --ip-space-12: 48px;
  --ip-space-16: 64px;
  --ip-space-24: 96px;
  --ip-content: 1280px;
  --ip-gutter: 40px;             /* page side padding; 16px on phones */
  --ip-col-gap: 24px;            /* 16px on phones */

  /* Form: square corners; a 10px cut (top-left + bottom-right) only on buttons, launcher, selected chip */
  --ip-radius: 0;
  --ip-cut: 10px;
  --ip-chamfer: polygon(var(--ip-cut) 0, 100% 0, 100% calc(100% - var(--ip-cut)), calc(100% - var(--ip-cut)) 100%, 0 100%, 0 var(--ip-cut));
  /* 2px outline that follows the cut (secondary button), drawn on a layer at inset 0 */
  --ip-chamfer-outline: polygon(evenodd,
    var(--ip-cut) 0, 100% 0, 100% calc(100% - var(--ip-cut)), calc(100% - var(--ip-cut)) 100%, 0 100%, 0 var(--ip-cut), var(--ip-cut) 0,
    calc(var(--ip-cut) + .83px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) calc(100% - var(--ip-cut) - .83px),
    calc(100% - var(--ip-cut) - .83px) calc(100% - 2px), 2px calc(100% - 2px), 2px calc(var(--ip-cut) + .83px), calc(var(--ip-cut) + .83px) 2px);
  /* 2px focus ring with a 2px gap, drawn on a layer at inset -4px: clip-path never eats the focus */
  --ip-chamfer-focus: polygon(evenodd,
    calc(var(--ip-cut) + 2.34px) 0, 100% 0, 100% calc(100% - var(--ip-cut) - 2.34px), calc(100% - var(--ip-cut) - 2.34px) 100%, 0 100%, 0 calc(var(--ip-cut) + 2.34px), calc(var(--ip-cut) + 2.34px) 0,
    calc(var(--ip-cut) + 3.17px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) calc(100% - var(--ip-cut) - 3.17px),
    calc(100% - var(--ip-cut) - 3.17px) calc(100% - 2px), 2px calc(100% - 2px), 2px calc(var(--ip-cut) + 3.17px), calc(var(--ip-cut) + 3.17px) 2px);

  /* Motion: transform and opacity only; everything is 0 under reduced motion */
  --ip-ease: cubic-bezier(.2, .8, .2, 1);
  --ip-dur-fast: 150ms;
  --ip-dur-base: 250ms;
  --ip-dur-slow: 400ms;
  --ip-dur-stamp: 170ms;         /* impression 1.15 → 1 at −3° */
  --ip-dur-flash: 200ms;         /* window edge flash on tab change */
  --ip-dur-edge: 400ms;          /* door edge heat, sparks */
  --ip-dur-num: 600ms;           /* section number heats up */
  --ip-dur-heat: 1200ms;         /* anvil line on first load */

  /* Layers: consent is always above the assistant */
  --ip-z-nav: 50;
  --ip-z-assistant: 2147483000;
  --ip-z-consent: 2147483600;

  /* Legacy names (pre-«Горн») mapped onto the new palette so older markup keeps rendering */
  --ip-ground-900: var(--ip-ground);
  --ip-ground-800: var(--ip-surface);
  --ip-surface-raised: var(--ip-raised);
  --ip-hairline: var(--ip-seam);
  --ip-field-border: var(--ip-field);
  --ip-ink: var(--ip-text);
  --ip-ink-muted: var(--ip-text-2);
  --ip-ink-dim: var(--ip-text-2);
  --ip-flame: var(--ip-orange);
  --ip-flame-action: var(--ip-gold);
  --ip-flame-action-hover: var(--ip-gold);
  --ip-flame-ink: var(--ip-text-2);
  --ip-on-flame: var(--ip-on-gold);
  --ip-ember: var(--ip-gold);
  --ip-on-ember: var(--ip-on-gold);
  --ip-plasma: var(--ip-cold);
  --ip-plasma-ink: var(--ip-cold);
  --ip-violet: var(--ip-cold);
  --ip-ok: var(--ip-gold);
  --ip-error: var(--ip-err);
  --ip-gradient-brand: var(--ip-heat);
  --ip-glow-flame: none;
  --ip-glow-plasma: none;
  --ip-elev-panel: none;
  --ip-text-hero: var(--ip-fs-h1);
  --ip-text-h2: var(--ip-fs-h2);
  --ip-text-h3: var(--ip-fs-h3);
  --ip-text-lead: var(--ip-fs-lead);
  --ip-text-body: var(--ip-fs-body);
  --ip-text-small: var(--ip-fs-small);
  --ip-text-eyebrow: var(--ip-fs-mono);
  --ip-radius-sm: 0;
  --ip-radius-md: 0;
  --ip-radius-lg: 0;
  --ip-radius-pill: 0;
}

@media (max-width: 599px) {
  :root { --ip-gutter: 16px; --ip-col-gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ip-dur-fast: 0ms; --ip-dur-base: 0ms; --ip-dur-slow: 0ms; --ip-dur-stamp: 0ms;
    --ip-dur-flash: 0ms; --ip-dur-edge: 0ms; --ip-dur-num: 0ms; --ip-dur-heat: 0ms;
  }
}


/* InPower «Горн» components — only tokens, no literal colours.
   Cut corners live on a ::before layer, never on the control itself, so the ::after focus ring is not clipped. */

/* ---------- Root and type ---------- */
.ip-root {
  background: var(--ip-grain), var(--ip-ground);
  color: var(--ip-text);
  font: 400 var(--ip-fs-body)/var(--ip-lh-text) var(--ip-font-sans);
}
.ip-h1, .ip-h2, .ip-h3 { margin: 0; font-family: var(--ip-font-display); font-weight: 900; letter-spacing: -.005em; color: var(--ip-text); text-wrap: balance; }
.ip-h1 { font-size: var(--ip-fs-h1); line-height: var(--ip-lh-display); }
.ip-h2 { font-size: var(--ip-fs-h2); line-height: .92; }
.ip-h3 { font-size: var(--ip-fs-h3); line-height: .95; }
.ip-hot { color: var(--ip-orange); font-style: normal; } /* the one orange word of the H1 */
.ip-lead { margin: 0; max-width: 36em; font-size: var(--ip-fs-lead); line-height: 1.5; color: var(--ip-text-2); }
.ip-mono, .ip-eyebrow, .ip-badge-type, .ip-badge-status, .ip-badge-tech, .ip-secnum__label, .ip-passport__label,
.ip-case__credit, .ip-launch__ai, .ip-panel__state, .ip-bubble__who, .ip-bubble--system, .ip-field__label, .ip-tray__label,
.ip-service__code, .ip-service__more > summary, .ip-form-success__title, .ip-consent__title, .ip-frame__ctl, .ip-case__play {
  font: 500 var(--ip-fs-mono)/1.4 var(--ip-font-mono);
  letter-spacing: var(--ip-track-mono);
  text-transform: uppercase;
}
.ip-eyebrow { color: var(--ip-text-2); }
.ip-data { margin: 0; font: 900 var(--ip-fs-fact)/1 var(--ip-font-display); color: var(--ip-text); font-variant-numeric: tabular-nums; }

/* Plain focus for everything without a cut */
:is(.ip-link, .ip-chip, .ip-panel__close, .ip-context-chip button, .ip-service__more > summary, .ip-frame__ctl, .ip-case__play, .ip-segmented button):focus-visible {
  outline: 2px solid var(--ip-gold); outline-offset: 3px;
}

/* ---------- Button: «заготовка» (primary) and cut outline (secondary) ---------- */
.ip-btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ip-space-2);
  min-height: 56px; padding: 0 28px; box-sizing: border-box;
  background: none; border: 0; border-radius: 0; color: var(--ip-text);
  font: 600 var(--ip-fs-ui)/1.2 var(--ip-font-sans); text-align: center; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ip-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; clip-path: var(--ip-chamfer); }
.ip-btn::after, .ip-launch::after {
  content: ""; position: absolute; inset: -4px; pointer-events: none;
  background: var(--ip-gold); clip-path: var(--ip-chamfer-focus); opacity: 0;
}
.ip-btn:focus-visible, .ip-launch:focus-visible { outline: none; }
.ip-btn:focus-visible::after, .ip-launch:focus-visible::after { opacity: 1; }
.ip-btn--primary { color: var(--ip-on-gold); }
.ip-btn--primary::before { background: var(--ip-gold-bar); box-shadow: var(--ip-gold-glint); }
.ip-btn--primary:hover::before { filter: brightness(1.06); }
.ip-btn--secondary::before { background: var(--ip-text); clip-path: var(--ip-chamfer-outline); }
.ip-btn--secondary:hover::before { background: var(--ip-orange); }
.ip-btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.ip-btn--icon { min-width: 48px; padding: 0 12px; }
.ip-btn--block { display: flex; width: 100%; }
.ip-btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.ip-btn:disabled, .ip-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* Sparks: at most 6 square 3px sparks, once, on hover/focus */
.ip-sparks {
  position: absolute; left: 18%; top: 0; width: 3px; height: 3px; opacity: 0; pointer-events: none;
  background: var(--ip-gold);
  box-shadow: 14px -3px 0 var(--ip-orange), 29px 1px 0 var(--ip-gold), 45px -2px 0 var(--ip-red),
    61px 0 0 var(--ip-orange), 77px -4px 0 var(--ip-white-heat);
}
:is(.ip-btn, .ip-launch):is(:hover, :focus-visible) .ip-sparks { animation: ip-spark var(--ip-dur-edge) var(--ip-ease) 1; }
@keyframes ip-spark { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-16px); } }

/* ---------- Links ---------- */
.ip-link {
  padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--ip-text); font: 600 var(--ip-fs-ui)/1.3 var(--ip-font-sans);
  text-decoration: underline; text-decoration-color: var(--ip-orange);
  text-decoration-thickness: 2px; text-underline-offset: 5px;
}
.ip-link:hover { color: var(--ip-orange); }
.ip-link--quiet { color: var(--ip-text-2); text-decoration-color: var(--ip-seam); }
.ip-link--quiet:hover { color: var(--ip-text); text-decoration-color: var(--ip-text-2); }

/* ---------- Stamp (project type): figure + caps in a thin frame ---------- */
.ip-badge-type {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px;
  border: 1px solid var(--ip-text); background: var(--ip-veil); color: var(--ip-text);
}
.ip-badge-type::before {
  content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--ip-fig) center / contain no-repeat; mask: var(--ip-fig) center / contain no-repeat;
}
.ip-badge-type, .ip-badge-type--client_work { --ip-fig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Crect x='1.3' y='1.3' width='13.4' height='13.4'/%3E%3C/svg%3E"); }
.ip-badge-type--own_product, .ip-stamp { --ip-fig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M2 2.6 8 1.2l6 1.4V8c0 3.5-2.6 5.5-6 6.8C4.6 13.5 2 11.5 2 8z'/%3E%3C/svg%3E"); }
.ip-badge-type--participation { --ip-fig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Ccircle cx='8' cy='8' r='6.7'/%3E%3C/svg%3E"); }
.ip-badge-type--prototype { --ip-fig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-dasharray='2.6 1.8'%3E%3Crect x='1.3' y='1.3' width='13.4' height='13.4'/%3E%3C/svg%3E"); }
.ip-badge-type--demo { --ip-fig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='miter'%3E%3Cpath d='M8 1.8 14.8 14.2H1.2z'/%3E%3C/svg%3E"); }

/* ---------- Status sign (always with its text): ● ◐ ○ ⊘ ◇ ---------- */
.ip-badge-status { display: inline-flex; align-items: center; gap: 8px; color: var(--ip-text); }
.ip-badge-status::before {
  content: ""; flex: none; box-sizing: border-box; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--ip-text-2);
  background: linear-gradient(135deg, transparent calc(50% - .8px), var(--ip-text-2) calc(50% - .8px) calc(50% + .8px), transparent calc(50% + .8px));
}
.ip-badge-status--live::before { border-color: var(--ip-gold); background: var(--ip-gold); }
.ip-badge-status--wip::before { border-color: var(--ip-orange); background: linear-gradient(90deg, var(--ip-orange) 50%, transparent 50%); }
.ip-badge-status--proto::before { border-color: var(--ip-orange); background: none; }
.ip-badge-status--demo::before { width: 8px; height: 8px; margin: 0 1px; border-radius: 0; border-color: var(--ip-gold); background: none; transform: rotate(45deg); }
.ip-legend { display: flex; flex-wrap: wrap; gap: var(--ip-space-3) var(--ip-space-6); margin: 0; padding: var(--ip-space-4) 0; list-style: none; border-block: 1px solid var(--ip-seam); }

.ip-badge-tech { display: inline-flex; padding: 5px 8px; border: 1px solid var(--ip-seam); color: var(--ip-text); }

/* ---------- Section rail number and anvil line ---------- */
.ip-secnum { display: flex; flex-direction: column; gap: var(--ip-space-2); color: var(--ip-text-2); }
.ip-secnum__n {
  position: relative; align-self: flex-start;
  font: 900 var(--ip-fs-num)/1 var(--ip-font-display); font-variant-numeric: tabular-nums;
  color: transparent; -webkit-text-stroke: 1.5px var(--ip-seam);
}
.ip-secnum__n::after { content: attr(data-n); position: absolute; inset: 0; color: var(--ip-gold); -webkit-text-stroke: 0; opacity: 0; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ip-secnum__n::after { animation: ip-num-heat linear both; animation-timeline: view(); animation-range: entry 30% cover 45%; }
  }
}
@keyframes ip-num-heat { to { opacity: 1; } }
@media (max-width: 599px) { .ip-secnum { flex-direction: row; align-items: baseline; gap: var(--ip-space-3); } }

.ip-anvil { display: block; height: 6px; background: var(--ip-heat); transform-origin: left center; }
.ip-anvil--heat { animation: ip-heat var(--ip-dur-heat) var(--ip-ease) both; }
@keyframes ip-heat { from { transform: scaleX(0); } }

/* ---------- Passport: cells with seams ---------- */
.ip-passport {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
  gap: 1px; padding: 1px; margin: 0;
}
.ip-passport__cell { min-width: 0; padding: 10px 12px; box-shadow: 0 0 0 1px var(--ip-seam); }
.ip-passport__label { margin: 0 0 4px; color: var(--ip-text-2); }
.ip-passport__value { margin: 0; font: 600 var(--ip-fs-small)/1.35 var(--ip-font-sans); color: var(--ip-text); overflow-wrap: anywhere; }
.ip-passport--master .ip-passport__value { font: 500 var(--ip-fs-mono)/1.4 var(--ip-font-mono); letter-spacing: var(--ip-track-mono); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.ip-passport--fact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.ip-passport--fact .ip-passport__value { font-weight: 400; color: var(--ip-text-2); }

/* ---------- Emblem: the shield with its warm glow ---------- */
.ip-emblem { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; color: var(--ip-text); }
.ip-emblem::before { content: ""; position: absolute; inset: -35%; background: var(--ip-shield-glow); opacity: .8; transition: opacity var(--ip-dur-fast) var(--ip-ease); }
.ip-emblem > img, .ip-emblem > svg { position: relative; width: 100%; height: 100%; object-fit: contain; }
.ip-emblem--lg { width: 72px; height: 72px; }
.ip-emblem--heat::before { animation: ip-glow var(--ip-dur-heat) var(--ip-ease) both; }
@keyframes ip-glow { from { opacity: 0; } }

/* ---------- Media frame: 16:10, bottom scrim, grain, Verse corner ticks ---------- */
.ip-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ip-grain), var(--ip-raised); }
.ip-frame--video { aspect-ratio: 16 / 9; }
.ip-frame > img, .ip-frame > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ip-frame::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--ip-grain), var(--ip-scrim); }
.ip-frame::after {
  --l: 12px; --t: 1.5px;
  content: ""; position: absolute; inset: 4px; pointer-events: none;
  background:
    linear-gradient(var(--ip-gold) 0 0) left top / var(--l) var(--t), linear-gradient(var(--ip-gold) 0 0) left top / var(--t) var(--l),
    linear-gradient(var(--ip-gold) 0 0) right top / var(--l) var(--t), linear-gradient(var(--ip-gold) 0 0) right top / var(--t) var(--l),
    linear-gradient(var(--ip-gold) 0 0) left bottom / var(--l) var(--t), linear-gradient(var(--ip-gold) 0 0) left bottom / var(--t) var(--l),
    linear-gradient(var(--ip-gold) 0 0) right bottom / var(--l) var(--t), linear-gradient(var(--ip-gold) 0 0) right bottom / var(--t) var(--l);
  background-repeat: no-repeat;
}
.ip-frame__stamp { position: absolute; left: 18px; top: 18px; z-index: 1; }
.ip-frame__ctl, .ip-case__play {
  position: absolute; right: 16px; bottom: 16px; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 32px; padding: 0 10px;
  background: var(--ip-veil); border: 1px solid var(--ip-text); border-radius: 0; color: var(--ip-text); cursor: pointer;
}
.ip-frame__ctl svg { width: 12px; height: 12px; }

/* ---------- ProofWindow («окно горна») ---------- */
.ip-proof { position: relative; min-width: 0; color: var(--ip-text); }
.ip-proof__head { display: flex; justify-content: flex-end; padding-right: var(--ip-space-4); margin-bottom: var(--ip-space-3); }
.ip-proof__win { position: relative; background: var(--ip-window-glow), var(--ip-surface); border: 1px solid var(--ip-seam); border-top: 3px solid var(--ip-orange); }
.ip-proof__win + * { margin-top: var(--ip-space-3); }
.ip-proof__flash {
  position: absolute; left: -1px; right: -1px; top: -3px; height: 3px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, var(--ip-gold), var(--ip-white-heat) 50%, var(--ip-gold));
  animation: ip-flash var(--ip-dur-flash) ease-out both;
}
@keyframes ip-flash { from { opacity: 1; } to { opacity: 0; } }
.ip-proof__tabs {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  contain: inline-size; /* the tab strip scrolls instead of widening the hero column */
  border-bottom: 1px solid var(--ip-seam);
}
.ip-proof__tabs::-webkit-scrollbar { display: none; }
.ip-proof__tab {
  flex: 1 0 auto; scroll-snap-align: start; padding: 12px 14px;
  background: none; border: 0; border-right: 1px solid var(--ip-seam); border-radius: 0;
  color: var(--ip-text-2); font: 600 14px/1.2 var(--ip-font-sans); white-space: nowrap; cursor: pointer;
}
.ip-proof__tab:last-child { border-right: 0; }
.ip-proof__tab:hover { color: var(--ip-text); background: var(--ip-raised); }
.ip-proof__tab[aria-selected="true"] { background: var(--ip-gold); color: var(--ip-on-gold); }
.ip-proof__tab:focus-visible { outline: 2px solid var(--ip-gold); outline-offset: -4px; }
.ip-proof__tab[aria-selected="true"]:focus-visible { outline-color: var(--ip-on-gold); }
.ip-proof__panel { animation: ip-fade var(--ip-dur-flash) ease-out both; }
@keyframes ip-fade { from { opacity: 0; } }
.ip-proof__body { display: grid; gap: var(--ip-space-3); justify-items: start; padding: var(--ip-space-4) var(--ip-space-4) var(--ip-space-6); }
.ip-proof__body .ip-passport { justify-self: stretch; }
@media (max-width: 599px) {
  .ip-proof__head { display: none; }
  .ip-proof__tab { flex: 0 0 auto; }
  .ip-proof .ip-frame { max-height: 28vh; }
}

/* ---------- ServiceCard: doors of different weight ---------- */
.ip-service {
  position: relative; display: flex; flex-direction: column; gap: var(--ip-space-3);
  padding: var(--ip-space-6); background: var(--ip-surface); color: var(--ip-text);
}
.ip-service::before, .ip-service::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--ip-seam); }
.ip-service::after { background: var(--ip-heat); transform: scaleX(0); transform-origin: left center; transition: transform var(--ip-dur-edge) var(--ip-ease); }
.ip-service:hover::after, .ip-service:focus-within::after { transform: scaleX(1); }
.ip-service--major { padding: var(--ip-space-8); background: var(--ip-door-glow), var(--ip-surface); }
.ip-service--calm { background: transparent; border: 1px solid var(--ip-seam); }
.ip-service--calm::before, .ip-service--calm::after, .ip-service--invite::before, .ip-service--invite::after { display: none; }
.ip-service__code { color: var(--ip-text-2); }
.ip-service__title { margin: 0; font: 900 var(--ip-fs-fact)/.95 var(--ip-font-display); }
.ip-service--major .ip-service__title { font-size: var(--ip-fs-h3); }
.ip-service__line { margin: 0; color: var(--ip-text-2); font-size: 16px; line-height: 1.5; }
.ip-service__tasks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.45; }
.ip-service__tasks li { position: relative; padding-left: 16px; }
.ip-service__tasks li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--ip-text-2); }
.ip-service__proof { display: grid; gap: var(--ip-space-2); padding: var(--ip-space-3) 0; border-block: 1px solid var(--ip-seam); }
.ip-service__example { font-size: var(--ip-fs-small); color: var(--ip-text-2); }
.ip-service__example a { color: var(--ip-text); text-decoration-color: var(--ip-orange); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ip-service__more { border-top: 1px solid var(--ip-seam); padding-top: var(--ip-space-3); }
.ip-service__more > summary { display: inline-flex; gap: 6px; color: var(--ip-text-2); cursor: pointer; list-style: none; }
.ip-service__more > summary::-webkit-details-marker { display: none; }
.ip-service__more > summary::after { content: "↓"; display: inline-block; transition: transform var(--ip-dur-fast) var(--ip-ease); }
.ip-service__more[open] > summary::after { transform: rotate(180deg); }
.ip-service__more > summary:hover { color: var(--ip-text); }
.ip-service__more-body { display: grid; gap: var(--ip-space-2); padding-top: var(--ip-space-3); color: var(--ip-text-2); font-size: 15px; }
.ip-service > .ip-btn { margin-top: auto; align-self: flex-start; }
.ip-service--invite { background: transparent; border: 2px solid var(--ip-seam); }

/* ---------- CaseCard («изделие») ---------- */
.ip-case { position: relative; display: flex; flex-direction: column; background: var(--ip-surface); color: var(--ip-text); }
.ip-case__body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--ip-space-3); margin-top: -44px; padding: 0 var(--ip-space-6) var(--ip-space-6); }
.ip-case__title { margin: 0; font: 900 var(--ip-fs-h3)/.95 var(--ip-font-display); }
.ip-case__line { margin: 0; color: var(--ip-text-2); font-size: 16px; line-height: 1.5; }
.ip-case__fact { display: grid; gap: 4px; }
.ip-case__fact .ip-data { font-size: var(--ip-fs-fact); }
.ip-case__source { margin: 0; color: var(--ip-text-2); font-size: 13px; }
.ip-case__role { margin: 0; color: var(--ip-text-2); font-size: var(--ip-fs-small); }
.ip-case__credit { margin: 0; color: var(--ip-text-2); }
.ip-case__badges, .ip-case__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ip-space-4); }

/* ---------- AssistantLauncher ---------- */
.ip-launch {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; box-sizing: border-box;
  padding: 10px 22px 10px 12px; background: none; border: 0; border-radius: 0;
  color: var(--ip-text); font: 600 var(--ip-fs-ui)/1.2 var(--ip-font-sans); text-align: left; cursor: pointer;
}
.ip-launch::before {
  content: ""; position: absolute; inset: 0; z-index: -1; clip-path: var(--ip-chamfer);
  border: 1px solid var(--ip-seam); border-bottom: 0;
  background: var(--ip-heat) left bottom / 100% 2px no-repeat, var(--ip-raised);
}
.ip-launch:is(:hover, :focus-visible) .ip-emblem::before { opacity: 1; }
.ip-launch__text { display: flex; flex-direction: column; gap: 2px; }
.ip-launch__ai { color: var(--ip-cold); }
.ip-launch__spark { color: var(--ip-text); }
.ip-launch--compact { width: 56px; height: 56px; min-height: 0; padding: 0; justify-content: center; }

/* ---------- AssistantPanel ---------- */
.ip-panel {
  display: flex; flex-direction: column; width: 400px; max-width: 100%; max-height: 640px; box-sizing: border-box;
  background: var(--ip-surface); border: 1px solid var(--ip-seam); border-top: 3px solid var(--ip-orange); color: var(--ip-text);
}
.ip-panel__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--ip-seam); }
.ip-panel__title { margin: 0; font: 900 26px/1 var(--ip-font-display); }
.ip-panel__note { margin: 4px 0 0; color: var(--ip-text-2); font-size: 13px; line-height: 1.4; }
.ip-panel__close { align-self: flex-start; width: 36px; height: 36px; margin-left: auto; background: none; border: 0; color: var(--ip-text-2); font-size: 22px; line-height: 1; cursor: pointer; }
.ip-panel__close:hover { color: var(--ip-text); }
.ip-panel__about { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--ip-seam); color: var(--ip-text-2); font-size: 14px; line-height: 1.45; }
.ip-panel__about .ip-link { font-size: 14px; }
.ip-panel__log { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; }
.ip-bubble { max-width: 88%; padding: 12px 14px; background: var(--ip-raised); font-size: 15px; line-height: 1.45; }
.ip-bubble--ai { box-shadow: inset 3px 0 0 var(--ip-cold); }
.ip-bubble--operator { box-shadow: inset 3px 0 0 var(--ip-gold); }
.ip-bubble--visitor { align-self: flex-end; max-width: 80%; background: var(--ip-visitor); }
.ip-bubble--system { align-self: stretch; max-width: none; padding: 7px 0; background: none; color: var(--ip-cold); text-align: center; border-block: 1px dashed var(--ip-seam); }
.ip-bubble__who { display: table; margin-bottom: 6px; padding: 1px 6px; border: 1px solid var(--ip-gold); color: var(--ip-gold); }
.ip-panel__status { padding: 0 16px 12px; }
.ip-panel__state { display: inline-flex; align-items: center; gap: 8px; color: var(--ip-text-2); }
.ip-panel__state--ai { color: var(--ip-cold); }
.ip-panel__state--handoff { color: var(--ip-orange); }
.ip-panel__state--connected { color: var(--ip-gold); }
.ip-panel__state--error { color: var(--ip-err); }
.ip-panel__state--error::before { content: "!"; }
.ip-panel__state--stamp { padding: 3px 8px; border: 1px solid currentColor; animation: ip-stamp-sm var(--ip-dur-stamp) var(--ip-ease) both; }
@keyframes ip-stamp-sm { from { opacity: 0; transform: scale(1.15) rotate(-3deg); } }
.ip-panel__quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }
.ip-chip {
  padding: 8px 10px; background: none; border: 1px solid var(--ip-field); border-radius: 0;
  color: var(--ip-text); font: 600 14px/1.2 var(--ip-font-sans); cursor: pointer;
}
.ip-chip:hover { background: var(--ip-raised); }
.ip-panel__input { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--ip-seam); }
.ip-panel__input input, .ip-panel__input textarea {
  flex: 1; min-width: 0; box-sizing: border-box; padding: 10px 12px;
  background: var(--ip-ground); color: var(--ip-text); border: 0; border-bottom: 2px solid var(--ip-field); border-radius: 0;
  font: 400 15px/1.4 var(--ip-font-sans);
}
.ip-panel__input :is(input, textarea):focus { outline: none; border-bottom-color: var(--ip-gold); box-shadow: inset 3px 0 0 var(--ip-gold); }
.ip-panel__input :is(input, textarea)::placeholder { color: var(--ip-text-2); opacity: 1; }
@media (max-width: 599px) { .ip-panel { width: 100%; max-height: 90dvh; } }

/* ---------- Form fields, tray, type chips ---------- */
.ip-field { display: flex; flex-direction: column; gap: 8px; }
.ip-field__label { color: var(--ip-text-2); }
.ip-field__label small { font: inherit; }
.ip-field:focus-within .ip-field__label { color: var(--ip-gold); }
.ip-field__input {
  width: 100%; box-sizing: border-box; padding: 14px;
  background: var(--ip-surface); color: var(--ip-text);
  border: 0; border-bottom: 2px solid var(--ip-field); border-radius: 0;
  font: 400 var(--ip-fs-ui)/1.45 var(--ip-font-sans);
}
.ip-field__input::placeholder { color: var(--ip-text-2); opacity: 1; }
.ip-field__input:focus { outline: none; border-bottom-color: var(--ip-gold); box-shadow: inset 3px 0 0 var(--ip-gold); }
.ip-field__hint { color: var(--ip-text-2); font-size: var(--ip-fs-small); line-height: 1.45; }
.ip-field--error .ip-field__input { border-bottom-color: var(--ip-err); }
.ip-field--error .ip-field__hint { color: var(--ip-err); }
.ip-field--error .ip-field__hint::before { content: "! "; font-weight: 600; }

.ip-tray {
  display: block; padding: 12px 16px 14px;
  background: var(--ip-surface); border-bottom: 2px solid var(--ip-field); box-shadow: inset 3px 0 0 var(--ip-field);
}
.ip-tray:focus-within { border-bottom-color: var(--ip-gold); box-shadow: inset 3px 0 0 var(--ip-gold); }
.ip-tray__label { display: block; margin-bottom: 6px; color: var(--ip-text-2); }
.ip-tray__input {
  display: block; width: 100%; min-height: 48px; box-sizing: border-box; padding: 0; resize: vertical;
  background: none; border: 0; color: var(--ip-text); font: 400 var(--ip-fs-ui)/1.5 var(--ip-font-sans);
}
.ip-tray__input:focus { outline: none; }
.ip-tray__input::placeholder { color: var(--ip-text-2); opacity: 1; }

.ip-segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.ip-segmented button {
  position: relative; isolation: isolate; padding: 10px 16px;
  background: none; border: 1px solid var(--ip-field); border-radius: 0;
  color: var(--ip-text); font: 600 15px/1.2 var(--ip-font-sans); cursor: pointer;
}
.ip-segmented button:not([aria-checked="true"]):hover { background: var(--ip-raised); }
.ip-segmented button[aria-checked="true"] { border-color: transparent; color: var(--ip-on-gold); }
.ip-segmented button[aria-checked="true"]::before { content: ""; position: absolute; inset: -1px; z-index: -1; background: var(--ip-gold); clip-path: var(--ip-chamfer); }

.ip-context-chip {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px;
  background: var(--ip-raised); border: 1px solid var(--ip-seam); color: var(--ip-text); font-size: var(--ip-fs-small);
}
.ip-context-chip button { width: 28px; height: 28px; background: none; border: 0; color: var(--ip-text-2); font-size: 16px; cursor: pointer; }

/* Success: the impression «№ IP-…» */
.ip-form-success { display: grid; justify-items: start; gap: var(--ip-space-3); padding: 20px 22px; background: var(--ip-surface); border-top: 3px solid var(--ip-gold); color: var(--ip-text); }
.ip-form-success__title { margin: 0; color: var(--ip-text-2); }
.ip-form-success__text { margin: 0; color: var(--ip-text-2); font-size: 15px; }
.ip-stamp {
  display: inline-flex; align-items: center; gap: 10px; margin: 4px 0; padding: 6px 14px 8px;
  border: 2px solid var(--ip-gold); color: var(--ip-gold);
  font: 900 clamp(32px, 28px + 1vw, 40px)/1 var(--ip-font-display); font-variant-numeric: tabular-nums;
  transform: rotate(-3deg); animation: ip-stamp var(--ip-dur-stamp) var(--ip-ease) both;
}
.ip-stamp::before { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--ip-fig) center / contain no-repeat; mask: var(--ip-fig) center / contain no-repeat; }
@keyframes ip-stamp { from { opacity: 0; transform: rotate(-3deg) scale(1.15); } }

/* ---------- ConsentBar (card; bottom sheet on phones) ---------- */
.ip-consent {
  display: grid; gap: var(--ip-space-3); width: 380px; max-width: 100%; box-sizing: border-box; padding: 16px 18px;
  background: var(--ip-raised); border-left: 3px solid var(--ip-gold);
  color: var(--ip-text); font: 400 15px/1.5 var(--ip-font-sans); z-index: var(--ip-z-consent);
}
.ip-consent p { margin: 0; }
.ip-consent__title { color: var(--ip-text-2); }
.ip-consent__text { color: var(--ip-text-2); }
.ip-consent a { color: var(--ip-text); text-decoration-color: var(--ip-orange); text-underline-offset: 3px; }
.ip-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 599px) { .ip-consent { width: 100%; border-left: 0; border-top: 3px solid var(--ip-gold); } }

/* ---------- Accessibility fallbacks ---------- */
@media (forced-colors: active) {
  .ip-btn, .ip-launch { border: 1px solid ButtonText; }
  .ip-btn:focus-visible, .ip-launch:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .ip-sparks { display: none; }
  .ip-service::after, .ip-emblem::before, .ip-service__more > summary::after { transition: none; }
}
