/* Визуальная система st8dom.ru: тёмная тема, Inter + JetBrains Mono. */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --bg: #0b0f1a;
  --bg2: #111827;
  --bg3: #1a2235;
  --accent: #3b82f6;
  --accent2: #818cf8;
  --green: #34d399;
  --orange: #f59e0b;
  --text: #e2e8f0;
  --muted: #64748b;
  --border: #1e2d45;
  --card: #131c2e;
  --danger: #f87171;
  --focus: #93c5fd;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent2);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 200;
}

.skip-link:focus {
  top: 12px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container--wide {
  max-width: 1080px;
}

/* NAV */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 26, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 14px;
}

.nav-logo {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--accent2);
  text-decoration: none;
  display: grid;
  line-height: 1.15;
  gap: 3px;
  flex-shrink: 0;
}

.nav-logo strong {
  color: var(--text);
  font-size: 13px;
}

.nav-logo span {
  color: var(--orange);
  font-size: 9px;
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-cta {
  color: var(--orange) !important;
}

/* HERO */
.hero {
  padding: 80px 0 64px;
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
  width: min(1132px, calc(100vw - 48px));
  max-width: none;
  margin-left: calc((100% - min(1132px, calc(100vw - 48px))) / 2);
  margin-right: calc((100% - min(1132px, calc(100vw - 48px))) / 2);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 72% 42%, #000 12%, transparent 72%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: 52%;
  height: 120%;
  right: 0;
  top: -12%;
  background:
    radial-gradient(circle at 60% 40%, rgba(245, 158, 11, 0.16), transparent 58%),
    radial-gradient(circle at 30% 60%, rgba(59, 130, 246, 0.18), transparent 62%);
  animation: hero-drift 22s ease-in-out infinite;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 1 1 420px;
  min-width: 0;
  max-width: 640px;
}

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--green);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.eyebrow::before {
  content: "> ";
  opacity: 0.5;
}

.hero h1 {
  font-size: clamp(32px, 3.6vw, 54px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  max-width: 100%;
  overflow-wrap: break-word;
  background: linear-gradient(135deg, #e2e8f0 0%, #818cf8 76%, #f59e0b 118%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 17px;
  color: #8fa0ba;
  max-width: min(560px, 100%);
  margin-bottom: 20px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 500;
}

.trust-line {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  font-family: "JetBrains Mono", monospace;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar-wrap {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PORTAL PREVIEW */
.portal-identity {
  width: min(440px, 42vw);
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow:
    0 22px 70px rgba(37, 99, 235, 0.24),
    0 0 28px rgba(245, 158, 11, 0.12);
}

.portal-identity::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  z-index: 0;
  pointer-events: none;
  border-radius: 40%;
  background:
    radial-gradient(circle at 35% 55%, rgba(59, 130, 246, 0.45), transparent 62%),
    radial-gradient(circle at 70% 48%, rgba(245, 158, 11, 0.32), transparent 58%);
  opacity: 0.9;
}

.mascot-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 28px;
  overflow: hidden;
  pointer-events: none;
}

.mascot-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px solid rgba(125, 211, 252, 0.45);
  animation: mascot-spin 32s linear infinite;
}

.mascot-orbit--a {
  width: 90%;
  height: 90%;
  margin: -45% 0 0 -45%;
  border-color: rgba(245, 158, 11, 0.55);
}

.mascot-orbit--b {
  width: 74%;
  height: 74%;
  margin: -37% 0 0 -37%;
  border-style: dashed;
  animation-duration: 44s;
  animation-direction: reverse;
}

.mascot-orbit--c {
  width: 58%;
  height: 58%;
  margin: -29% 0 0 -29%;
  border-color: rgba(45, 212, 191, 0.4);
  animation-duration: 26s;
}

.mascot-orbit::before,
.mascot-orbit::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  left: 50%;
  margin-left: -3.5px;
  pointer-events: none;
}

.mascot-orbit--a::before {
  top: 0;
  background: #f59e0b;
  box-shadow: 0 0 10px 3px rgba(245, 158, 11, 0.85);
}

.mascot-orbit--a::after {
  bottom: 0;
  background: #7dd3fc;
  box-shadow: 0 0 10px 3px rgba(125, 211, 252, 0.85);
}

.mascot-orbit--b::before {
  top: 0;
  background: #2dd4bf;
  box-shadow: 0 0 10px 3px rgba(45, 212, 191, 0.85);
}

.mascot-orbit--b::after {
  bottom: 8%;
  left: 0;
  margin-left: -3.5px;
  background: #c4b5fd;
  box-shadow: 0 0 10px 3px rgba(196, 181, 253, 0.85);
}

.mascot-orbit--c::after {
  top: 0;
  background: #fb7185;
  box-shadow: 0 0 10px 3px rgba(251, 113, 133, 0.8);
}

.mascot-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(125, 211, 252, 0.8);
  animation: mascot-float 8s ease-in-out infinite;
}

.mascot-particle--1 { top: 12%; left: 18%; background: #f59e0b; }
.mascot-particle--2 { top: 20%; right: 14%; animation-delay: -2s; }
.mascot-particle--3 { bottom: 18%; left: 16%; animation-delay: -4s; background: #2dd4bf; }
.mascot-particle--4 { bottom: 24%; right: 18%; animation-delay: -1.5s; background: #f59e0b; }
.mascot-particle--5 { top: 46%; left: 8%; animation-delay: -3s; }
.mascot-particle--6 { top: 58%; right: 8%; animation-delay: -5s; background: #7dd3fc; }

.portal-mascots {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  box-shadow: none;
  transition: transform 0.45s ease;
}

.portal-identity:hover,
.portal-identity:focus-within {
  box-shadow:
    0 26px 70px rgba(37, 99, 235, 0.32),
    0 0 36px rgba(245, 158, 11, 0.2);
}

.hero .btn {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hero .btn:hover,
.hero .btn:focus-visible {
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.28), 0 0 22px rgba(245, 158, 11, 0.22);
}

@keyframes hero-drift {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.75; }
  50% { transform: translate3d(-16px, 10px, 0); opacity: 1; }
}

@keyframes mascot-spin {
  to { transform: rotate(360deg); }
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(-5px); opacity: 0.9; }
}

.author-profile {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 28px;
}

.author-photo {
  flex: 0 0 190px;
}

.author-photo img {
  display: block;
  width: 190px;
  height: 190px;
  object-fit: cover;
  border-radius: 22px;
  border: 2px solid rgba(245, 158, 11, 0.8);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.35);
}

.author-copy { flex: 1; }
.author-role {
  margin-bottom: 12px;
  color: var(--orange);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.direction-card {
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(19, 28, 46, 0.96), rgba(12, 18, 31, 0.96));
  min-height: 225px;
  display: flex;
  flex-direction: column;
}

.direction-card:nth-child(2),
.direction-card:nth-child(4) { border-top-color: rgba(245, 158, 11, 0.7); }

.direction-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  color: var(--orange);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 13px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

.direction-card h3 { margin-bottom: 10px; }
.direction-card p { color: #8fa0ba; margin-bottom: 18px; }
.direction-card a { margin-top: auto; font-size: 13px; color: var(--orange); text-decoration: none; }

/* PORTAL SECTIONS */
.direction-hero {
  max-width: 760px;
}

.topic-grid,
.portal-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.topic-card,
.portal-project-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(19, 28, 46, 0.98), rgba(11, 15, 26, 0.96));
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.topic-card {
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.topic-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 85% 15%, rgba(245, 158, 11, 0.15), transparent 42%);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.topic-card:hover,
.topic-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(245, 158, 11, 0.78);
  box-shadow: 0 20px 48px rgba(1, 8, 24, 0.45), 0 0 0 1px rgba(59, 130, 246, 0.25), 0 0 28px rgba(37, 99, 235, 0.16);
  outline: none;
}

.topic-card:hover::after,
.topic-card:focus-visible::after { opacity: 1; }

.topic-card:hover .content-status,
.topic-card:focus-visible .content-status { color: var(--orange); }

.rubric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.rubric-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 20px;
  color: inherit;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.rubric-card:hover,
.rubric-card:focus-visible { transform: translateX(4px); border-color: var(--accent2); background: rgba(24, 36, 60, .96); outline: none; }
.rubric-card h3, .rubric-card p { margin: 0; }
.rubric-card p { grid-column: 2; color: var(--muted); font-size: 13px; }
.rubric-card__count { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--orange); background: rgba(245, 158, 11, .1); font-family: "JetBrains Mono", monospace; }
.rubric-card__arrow { color: var(--accent2); font-size: 22px; }

.clinical-track-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.clinical-track {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(19, 28, 46, .98), rgba(11, 15, 26, .96));
}

.clinical-track__header {
  display: flex;
  gap: 16px;
  min-height: 124px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.clinical-track__header h3 { margin: 0 0 8px; font-size: 23px; }
.clinical-track__header p { margin: 0; color: var(--muted); font-size: 14px; }
.clinical-track__index { color: var(--orange); font-family: "JetBrains Mono", monospace; font-size: 12px; padding-top: 5px; }
.clinical-track__rubrics { display: grid; gap: 10px; padding-top: 18px; }

.clinical-rubric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(115, 136, 170, .2);
  border-radius: 12px;
  background: rgba(10, 18, 33, .56);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.clinical-rubric span:first-child { display: grid; gap: 4px; }
.clinical-rubric small { color: var(--muted); font-size: 12px; font-weight: 400; }
.clinical-rubric__arrow { color: var(--accent2); font-size: 20px; }
.clinical-rubric:hover,
.clinical-rubric:focus-visible { transform: translateX(4px); border-color: var(--orange); background: rgba(26, 38, 62, .9); outline: none; }
.clinical-rubric:hover .clinical-rubric__arrow,
.clinical-rubric:focus-visible .clinical-rubric__arrow { color: var(--orange); }

.guideline-hero { padding-bottom: 34px; border-bottom: 0; }
.source-notice {
  margin: 24px 0 34px;
  padding: 18px 20px;
  border: 1px solid rgba(245, 158, 11, .38);
  border-radius: 16px;
  background: rgba(245, 158, 11, .08);
  color: var(--muted);
  line-height: 1.55;
}
.source-notice strong { color: var(--orange); }
.guideline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.guideline-grid--catalog { margin-bottom: 70px; }
.guideline-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 260px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}
.guideline-card h2,
.guideline-card h3 { margin: 0; line-height: 1.28; }
.guideline-card h2 { font-size: clamp(1.12rem, 2vw, 1.4rem); }
.guideline-card h3 { font-size: 1.18rem; }
.guideline-card > p { margin: 0; color: var(--muted); }
.guideline-card > a:not(.btn) { margin-top: auto; color: var(--accent); font-weight: 700; }
.guideline-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.guideline-card__meta span { color: var(--orange); }
.guideline-card__details { margin: 0; display: grid; gap: 10px; }
.guideline-card__details div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; }
.guideline-card__details dt { color: var(--muted); }
.guideline-card__details dd { margin: 0; overflow-wrap: anywhere; }
.guideline-card .btn { margin-top: auto; align-self: flex-start; }

@media (max-width: 760px) {
  .guideline-grid { grid-template-columns: 1fr; }
  .guideline-card { min-height: 0; }
  .guideline-card__details div { grid-template-columns: 1fr; gap: 3px; }
}

.topic-search { display: flex; gap: 10px; max-width: 720px; margin-top: 26px; }
.topic-search input { flex: 1; min-width: 0; padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; }
.topic-search input:focus { border-color: var(--accent2); outline: 2px solid rgba(59,130,246,.2); }
.prompt-selected { border-color: var(--accent2); background: rgba(24, 36, 60, .96); }
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; margin-top: 22px; }
.prompt-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.prompt-card h3, .prompt-card p { margin: 0; }
.prompt-card h3 a { color: var(--text); text-decoration: none; }
.prompt-card p { color: var(--muted); flex: 1; }
.prompt-card > a { align-self: flex-start; color: var(--accent2); }
.prompt-card__meta { color: var(--orange); font-size: 13px; }
.prompt-detail { max-width: 1000px; }
.prompt-copy-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.prompt-copy-heading h2 { margin: 0; }
.prompt-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 65vh; overflow: auto; padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); line-height: 1.65; font: inherit; user-select: text; }
.prompt-copy-status { min-height: 1.5em; color: var(--accent2); }
.prompt-note { color: var(--muted); font-size: 14px; }
.topic-hero .eyebrow a { color: var(--orange); }
.placeholder-page { min-height: 62vh; }

@media (max-width: 720px) {
  .rubric-grid { grid-template-columns: 1fr; }
  .clinical-track-grid { grid-template-columns: 1fr; }
  .clinical-track { padding: 18px; }
  .clinical-track__header { min-height: 0; }
  .topic-search { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .topic-card, .topic-card::after, .rubric-card, .clinical-rubric { transition: none; }
}

.portal-project-card:hover,
.portal-project-card:focus-within {
  transform: translateY(-8px);
  border-color: rgba(129, 140, 248, 0.85);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.topic-card h3,
.portal-project-card h2,
.portal-project-card h3 {
  margin-bottom: 10px;
}

.topic-card p,
.portal-project-card p {
  color: #8fa0ba;
}

.topic-number,
.project-index,
.project-kind,
.content-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topic-number,
.project-index { color: var(--accent2); margin-bottom: 16px; }
.project-kind { color: var(--orange); }
.content-status { color: var(--green); margin-top: auto; padding-top: 20px; }

.principles-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 24px;
  list-style: none;
}

.principles-list li {
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--card);
  color: var(--text);
}

.principles-list li::before {
  content: "✓";
  margin-right: 10px;
  color: var(--green);
}

.editorial-notice,
.portfolio-note {
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.07);
  color: #d8b36d;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.repository-pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.repository-pending::before {
  content: "●";
  color: var(--orange);
  font-size: 9px;
}

.project-actions .btn {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.project-actions .btn:hover,
.project-actions .btn:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.portal-project-card--flagship {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: inset 0 3px 0 var(--accent);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.portfolio-summary div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.portfolio-summary strong { color: var(--orange); font-size: 28px; }
.portfolio-summary span { color: var(--muted); font-size: 13px; }
.portfolio-grid { padding-bottom: 36px; }
.portfolio-grid .portal-project-card.case-hidden { display: none; }

.project-video-modal {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid rgba(129, 140, 248, 0.7);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
}

.project-video-modal::backdrop {
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(5px);
}

.project-video-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.project-video-modal__head h2 { font-size: 18px; }

.project-video-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-video-close:hover,
.project-video-close:focus-visible {
  transform: translateY(-3px);
  border-color: var(--orange);
}

.project-video-player {
  display: block;
  width: 100%;
  max-height: calc(100vh - 110px);
  background: #000;
}

.portal-next-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 48px 0 72px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}

.portal-next-step p { max-width: 600px; color: var(--muted); }

@media (max-width: 760px) {
  .portal-identity { margin: 8px auto 0; width: min(320px, 100%); max-width: 320px; flex-basis: auto; }
  .portal-identity::before { opacity: 0.55; }
  .mascot-particle--5,
  .mascot-particle--6 { display: none; }
  .direction-grid { grid-template-columns: 1fr; }
  .author-profile { align-items: flex-start; flex-direction: column; }
  .author-photo { flex-basis: auto; }
  .author-photo img { width: 150px; height: 150px; }
  .topic-grid,
  .portal-project-grid { grid-template-columns: 1fr; }
  .portfolio-summary { grid-template-columns: 1fr; }
  .portal-next-step { align-items: flex-start; flex-direction: column; }
}

.avatar-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#avatarCanvas,
.avatar-img {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 28px rgba(59, 130, 246, 0.65))
    drop-shadow(0 0 8px rgba(129, 140, 248, 0.5))
    drop-shadow(0 4px 32px rgba(0, 0, 0, 0.7));
}

.avatar-status {
  position: absolute;
  bottom: 18px;
  right: 14px;
  z-index: 3;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--bg);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

.btn-tg {
  background: linear-gradient(135deg, #2aabee, #229ed9);
  color: #fff;
}

.btn-tg:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.btn-sm {
  padding: 8px 14px;
  min-height: 40px;
  font-size: 13px;
}

/* SECTIONS */
section.s {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.s-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.s-label span {
  color: var(--accent);
  margin-right: 8px;
}

.s h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.lead {
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 640px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 26px;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card p,
.card li {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.card-pain {
  font-size: 12px;
  color: var(--orange);
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.card-meta {
  margin: 12px 0;
  padding: 0 0 0 16px;
}

.card-cta {
  margin-top: 16px;
}

.benefit-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 6px;
  font-family: "JetBrains Mono", monospace;
}

/* PROCESS */
.process {
  display: grid;
  gap: 12px;
}

.process-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.process-num {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent2);
  font-size: 22px;
  font-weight: 700;
}

.process-item h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.process-item p {
  color: var(--muted);
  font-size: 14px;
}

/* PROJECTS */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: start;
  gap: 16px;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.project-thumb {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg3);
  border: 1px solid var(--border);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.project-status {
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  color: var(--green);
  margin-top: 8px;
}

.badge {
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.badge-ai {
  background: rgba(129, 140, 248, 0.15);
  color: var(--accent2);
}

.badge-py {
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
}

.badge-bot {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
}

.badge-rag {
  background: rgba(251, 146, 60, 0.12);
  color: var(--orange);
}

.tag {
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  background: var(--bg3);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 4px;
}

.arrow {
  color: var(--muted);
  font-size: 18px;
  margin-top: 2px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: 8px 14px;
  min-height: 40px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}

.filter-btn.is-active,
.filter-btn:hover {
  border-color: var(--accent2);
  color: var(--text);
}

.case-hidden {
  display: none !important;
}

/* TRUST / STACK */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.trust-badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--muted);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.stack-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.stack-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* PRICING / FORMATS */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.price-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.price-card--popular {
  border-color: var(--orange);
  box-shadow: 0 12px 36px rgba(245, 158, 11, 0.08);
}

.price-card--popular::before {
  content: "Частый старт";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--orange);
  color: #0b0f1a;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 14px;
  border-radius: 20px;
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
}

.price-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--orange);
  margin: 12px 0;
  font-family: "JetBrains Mono", monospace;
}

.price-card ul {
  margin: 0 0 16px 16px;
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}

.price-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

.pricing-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 20px;
  font-style: italic;
}

@media (max-width: 820px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* FAQ */
.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 18px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 0;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details p {
  color: var(--muted);
  font-size: 14px;
  padding-bottom: 16px;
}

/* ABOUT */
.about-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.author-details { margin-top: 18px; }
.author-details summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.author-details summary::-webkit-details-marker { display: none; }
.author-details[open] summary { margin-bottom: 18px; }
.author-article {
  padding: 20px 22px;
  border-left: 3px solid var(--orange);
  border-radius: 0 12px 12px 0;
  background: rgba(7, 13, 24, .48);
}
.author-article h3 { margin-bottom: 14px; font-size: 20px; }
.author-article p { color: var(--muted); font-size: 15px; line-height: 1.75; }
.author-article p + p { margin-top: 12px; }

/* CTA / CONTACT */
.cta-block {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(129, 140, 248, 0.08));
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
}

.cta-block h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
}

.cta-block p {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 16px;
}

.cta-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.contact-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
  min-height: 72px;
}

.contact-item:hover {
  border-color: var(--accent2);
}

.contact-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.contact-value {
  font-size: 14px;
  font-weight: 500;
}

/* FORMS */
.product-buy-form {
  display: grid;
  gap: 16px;
}

.product-buy-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 16px;
}

.product-buy-fields .field { min-width: 0; }
.product-buy-fields input { box-sizing: border-box; }
.product-buy-form .pricing-note { margin: 0; }
.product-buy-form .btn { justify-self: start; }
.product-name-explanation { font-size: 0.8em; font-weight: 500; }
.portal-project-card .product-title-link { color: inherit; text-decoration: none; transition: color 0.18s ease; }
.portal-project-card .product-title-link:hover,
.portal-project-card .product-title-link:focus-visible { color: #ffb347; text-decoration: underline; text-underline-offset: 4px; }
.product-preview-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }

@media (max-width: 640px) {
  .product-buy-fields { grid-template-columns: minmax(0, 1fr); }
}

.form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}

.req {
  color: var(--orange);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  min-height: 44px;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field .error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
}

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
}

.consent input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
}

.form-status {
  font-size: 14px;
  color: var(--muted);
}

.flash {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

.flash-success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.flash-error,
.flash-danger {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.flash-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* CASE DETAIL */
.case-hero {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

.case-cover {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
}

.case-cover img {
  width: 100%;
  display: block;
}


.case-hero--corporate {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.case-title--corporate span {
  white-space: normal;
}

.case-title--corporate {
  font-size: clamp(34px, 3vw, 48px);
}

.case-title--corporate .case-title-line {
  white-space: normal;
}

.case-cover--corporate {
  width: 100%;
  max-width: 520px;
  justify-self: end;
  border-radius: 18px;
  box-shadow: 0 22px 58px rgba(2, 8, 23, 0.42), 0 0 26px rgba(59, 130, 246, 0.12);
}

.case-cover--corporate img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

@media (max-width: 980px) {
  .case-hero--corporate {
    grid-template-columns: 1fr;
  }

  .case-cover--corporate {
    max-width: 760px;
    justify-self: stretch;
  }
}

.case-video {
  margin: 8px 0 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #05070d;
}

.case-video video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
}

.case-video-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}

/* FAQ demo reel */
.faq-demo {
  border-top: 1px solid var(--border);
}

.faq-demo__lead {
  color: var(--muted);
  font-size: 15px;
  max-width: 62ch;
  margin-bottom: 16px;
}

.faq-reel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #05070d;
  overflow: hidden;
}

.faq-reel:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.faq-reel__viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0f1a;
  overflow: hidden;
}

.faq-reel__poster,
.faq-reel__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.faq-reel__storyboard {
  position: absolute;
  inset: 0;
  padding: clamp(16px, 4vw, 40px);
}

.faq-scene {
  display: none;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.faq-scene.is-active {
  display: flex;
}

.faq-scene__kicker {
  color: var(--orange);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.faq-scene__title {
  color: #fff;
  font-size: clamp(20px, 3.4vw, 36px);
  line-height: 1.25;
  max-width: 18ch;
}

.faq-scene__sub,
.faq-scene__sign {
  color: #cbd5e1;
  font-size: 15px;
}

.faq-scene__cta {
  display: inline-flex;
  align-self: flex-start;
  background: var(--orange);
  color: #111827;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
}

.faq-inbox,
.faq-features,
.faq-results {
  list-style: none;
  display: grid;
  gap: 8px;
  max-width: 520px;
}

.faq-inbox li,
.faq-features li,
.faq-results li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}

.faq-inbox span {
  display: inline-block;
  margin-right: 8px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
}

.faq-features strong {
  display: block;
  color: #fff;
}

.faq-features span {
  color: var(--muted);
}

.faq-results li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.faq-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
}

.faq-chat__meta,
.faq-chat__note {
  color: #94a3b8;
  font-size: 12px;
}

.faq-bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.45;
}

.faq-bubble--user {
  align-self: flex-start;
  background: #1a2235;
  color: #e2e8f0;
  border: 1px solid var(--border);
}

.faq-bubble--bot {
  align-self: flex-end;
  background: #1e3a8a;
  color: #fff;
}

.faq-reel__captions {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(11, 15, 26, 0.82);
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.faq-reel__captions:empty {
  display: none;
}

.faq-reel__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: #111827;
  border-top: 1px solid var(--border);
}

.faq-reel__btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.faq-reel__btn:hover,
.faq-reel__btn.is-active {
  border-color: var(--orange);
  color: #fff;
}

.faq-reel__time {
  margin-left: auto;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.faq-reel__progress {
  height: 4px;
  background: #1e2d45;
}

.faq-reel__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
}

.faq-transcript {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--card);
}

.faq-transcript summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-transcript__body {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.faq-transcript__body ol {
  margin: 8px 0 0 18px;
}

.faq-demo__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 720px) {
  .faq-reel__viewport {
    min-height: 280px;
  }

  .faq-scene__title {
    max-width: none;
  }

  .faq-reel__time {
    margin-left: 0;
    width: 100%;
  }
}

/* PUBLICATIONS */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.materials-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.material-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.08), var(--card) 44%);
}

.material-card__meta,
.publication__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.material-card__meta {
  justify-content: space-between;
  margin-bottom: 14px;
}

.material-card h3 {
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.material-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.material-card p {
  color: #8fa0ba;
  margin-bottom: 18px;
}

.material-card .project-stack {
  margin-top: auto;
}

.material-card__link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--orange);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.material-card .tag {
  text-decoration: none;
}

/* LIBRARY */
.library-hero {
  padding-bottom: 46px;
  border-bottom: 1px solid var(--border);
}

.library-explainer {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  gap: 34px;
  align-items: start;
  margin: 34px 0;
  padding: 24px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(59, 130, 246, 0.06));
}

.library-explainer h2 {
  margin-top: 6px;
}

.library-explainer p {
  color: #a9b7cc;
}

.editorial-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 28px 0 10px;
  padding: 28px;
  border: 1px solid rgba(59, 130, 246, .42);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(18, 10, 143, .22), rgba(245, 158, 11, .08));
}

.editorial-entry__copy { max-width: 760px; }
.editorial-entry h2 { margin: 6px 0 10px; }
.editorial-entry p:not(.eyebrow) { margin-bottom: 20px; color: #a9b7cc; }
.editorial-entry img {
  flex: 0 0 150px;
  border-radius: 22px;
  border: 2px solid rgba(245, 158, 11, .72);
  object-fit: cover;
}

/* EDITORIAL WORKSHOP */
.editorial-workshop { padding-bottom: 80px; }
.editorial-workshop__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: center;
}
.editorial-workshop__mascot { text-align: center; }
.editorial-workshop__mascot img {
  display: block;
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 30px;
  border: 2px solid var(--orange);
  box-shadow: 0 22px 60px rgba(18, 10, 143, .32);
}
.editorial-workshop__mascot span {
  display: block;
  margin-top: 12px;
  color: var(--orange);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.editorial-process,
.editorial-sources { padding-top: 54px; }
.editorial-process__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.editorial-step {
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}
.editorial-step > span {
  color: var(--orange);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.editorial-step h3 { margin: 28px 0 10px; font-size: 19px; }
.editorial-step p { color: #8fa0ba; font-size: 14px; }
.editorial-source {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(59, 130, 246, .42);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(59, 130, 246, .09), var(--card) 38%);
}
.editorial-source__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  color: #8fa0ba;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}
.editorial-status {
  padding: 6px 9px;
  border: 1px solid rgba(245, 158, 11, .5);
  border-radius: 999px;
  color: var(--orange);
  background: rgba(245, 158, 11, .08);
}
.editorial-source h3 { margin: 22px 0 8px; font-size: clamp(26px, 4vw, 38px); }
.editorial-source__original { color: #8b9cff; font-style: italic; }
.editorial-source__facts { display: grid; gap: 10px; margin: 24px 0; }
.editorial-source__facts div { display: grid; grid-template-columns: 90px 1fr; gap: 16px; }
.editorial-source__facts dt { color: #718096; }
.editorial-source__facts dd { margin: 0; overflow-wrap: anywhere; }
.editorial-evidence,
.editorial-note {
  padding: 18px 20px;
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 14px;
  color: #a9b7cc;
  background: rgba(245, 158, 11, .07);
}
.editorial-evidence strong,
.editorial-note strong { color: var(--orange); }
.editorial-draft { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.editorial-draft h4 { margin: 7px 0 16px; font-size: 22px; }
.editorial-draft ol { display: grid; gap: 8px; padding-left: 22px; color: #a9b7cc; }
.editorial-source__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 26px;
}
.editorial-source__actions span { color: #8fa0ba; font-size: 13px; }
.editorial-note { margin-top: 32px; }

@media (max-width: 900px) {
  .editorial-process__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .editorial-entry { align-items: flex-start; }
  .editorial-entry img { width: 96px; height: 96px; flex-basis: 96px; }
  .editorial-workshop__hero { grid-template-columns: 1fr; }
  .editorial-workshop__mascot { justify-self: start; }
  .editorial-workshop__mascot img { width: 180px; height: 180px; }
  .editorial-process__grid { grid-template-columns: 1fr; }
  .editorial-step { min-height: 0; }
  .editorial-source__facts div { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 520px) {
  .editorial-entry img { display: none; }
}

.library-categories {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 10px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.library-categories a {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #a9b7cc;
  text-decoration: none;
  font-size: 14px;
}

.library-categories a:hover,
.library-categories a.is-active {
  border-color: var(--orange);
  color: #fff;
  background: rgba(245, 158, 11, 0.1);
}

.library-group {
  padding: 54px 0 14px;
  border-bottom: 1px solid var(--border);
}

.library-group:last-child {
  border-bottom: 0;
}

.library-group__head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
}

.library-group__head p {
  max-width: 680px;
  color: #8fa0ba;
}

.library-group__count {
  flex: none;
  color: var(--orange);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.library-grid--preview {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.library-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(18, 10, 143, 0.2), rgba(19, 28, 46, 0.94) 50%),
    var(--card);
}

.library-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #8b9cff;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.library-card h3 {
  margin: 16px 0 12px;
  font-size: 21px;
  line-height: 1.3;
}

.library-card > p {
  color: #8fa0ba;
}

.library-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 22px;
}

.library-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.library-card__actions .btn-sm {
  padding-inline: 12px;
}

.library-reader {
  max-width: 900px;
  margin-inline: auto;
}

.library-reader__bottom-actions {
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.library-status {
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.library-status--draft {
  color: var(--orange);
}

.library-card__pending {
  max-width: 150px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

@media (max-width: 720px) {
  .library-explainer {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .library-group__head {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .library-grid,
  .library-grid--preview {
    grid-template-columns: 1fr;
  }

  .library-card__actions {
    width: 100%;
    justify-content: stretch;
  }

  .library-card__actions .btn {
    flex: 1 1 140px;
  }
}

.section-actions,
.admin-toolbar,
.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.material-filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.material-filters label,
.editor-form label {
  display: grid;
  gap: 7px;
  color: #9fb0c8;
  font-size: 13px;
  font-weight: 600;
}

.material-filters input,
.material-filters select,
.editor-form input:not([type="checkbox"]),
.editor-form select,
.editor-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}

.empty-state,
.topic-follow,
.medical-notice,
.preview-banner {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  background: var(--card);
}

.topic-follow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 42px;
}

.topic-follow p {
  color: var(--muted);
  margin-top: 4px;
}

.publication {
  padding: 62px 0 20px;
}

.publication__header h1 {
  margin: 12px 0 18px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.16;
}

.publication__facts {
  margin: 22px 0 18px;
}

.publication__cover {
  margin: 30px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}

.publication__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.publication__cover--contain img {
  aspect-ratio: auto;
  object-fit: contain;
}

.verified-mark {
  color: var(--green);
}

.publication__body {
  margin-top: 38px;
  font-size: 18px;
  line-height: 1.82;
}

.publication__body p + p {
  margin-top: 22px;
}

.publication__body h2 {
  margin: 46px 0 18px;
  font-size: clamp(25px, 3.2vw, 34px);
  line-height: 1.25;
}

.publication__body h3 {
  margin: 34px 0 14px;
  font-size: clamp(21px, 2.6vw, 27px);
  line-height: 1.3;
}

.publication__body ul {
  display: grid;
  gap: 9px;
  margin: 18px 0 24px 24px;
}

.publication__body li::marker {
  color: var(--blue);
}

.publication-table-wrap {
  overflow-x: auto;
  margin: 22px 0 30px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.publication-table-wrap:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.publication__body table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--card);
  font-size: 16px;
  line-height: 1.5;
}

.publication__body th,
.publication__body td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.publication__body th {
  color: var(--text);
  background: rgba(59, 130, 246, 0.09);
}

.publication__body tbody tr:last-child td {
  border-bottom: 0;
}

.medical-notice {
  border-left: 4px solid var(--orange);
}

.medical-notice p {
  color: #a9b6c9;
  margin-top: 7px;
}

.publication__sources {
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.publication__sources ol {
  margin: 16px 0 0 22px;
}

.publication__sources li + li {
  margin-top: 10px;
}

.reviewer-line,
.revision-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.preview-banner {
  border-color: var(--orange);
  color: var(--orange);
  font-weight: 600;
}

/* EDITORIAL ADMIN */
.admin-article-list {
  display: grid;
  gap: 12px;
  padding: 30px 0 60px;
}

.admin-article-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.admin-article-row h2 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.admin-article-row p {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.status-published { color: var(--green); border-color: rgba(52, 211, 153, 0.35); }
.status-review { color: var(--orange); border-color: rgba(245, 158, 11, 0.35); }

.editor-form {
  padding: 28px 0;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.editor-span {
  grid-column: 1 / -1;
}

.check-row {
  display: flex !important;
  align-items: center;
  grid-template-columns: auto 1fr;
  gap: 8px !important;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 400;
}

.publication-actions {
  padding: 0 0 60px;
  border-top: 1px solid var(--border);
}

@media (max-width: 820px) {
  .material-filters,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-span {
    grid-column: auto;
  }

  .topic-follow,
  .admin-article-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 320px) {
  .faq-reel__btn {
    flex: 1 1 calc(50% - 8px);
  }
}

.prose h2 {
  font-size: 20px;
  margin: 28px 0 10px;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 15px;
}

.prose ul {
  margin-left: 18px;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* ADMIN */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th,
table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  background: var(--bg2);
}

table.data tr.is-unread td {
  background: rgba(129, 140, 248, 0.06);
}

.inquiries-table {
  table-layout: fixed;
}

.inquiries-table th:nth-child(1) { width: 11%; }
.inquiries-table th:nth-child(2) { width: 12%; }
.inquiries-table th:nth-child(3) { width: 18%; }
.inquiries-table th:nth-child(4) { width: 9%; }
.inquiries-table th:nth-child(5) { width: 27%; }
.inquiries-table th:nth-child(6) { width: 10%; }
.inquiries-table th:nth-child(7) { width: 13%; }

.inquiries-table th,
.inquiries-table td,
.inquiries-table td a {
  overflow-wrap: anywhere;
}

.inquiries-table .row-actions {
  flex-direction: column;
  align-items: stretch;
}

.inquiries-table .row-actions .btn {
  width: 100%;
  padding-inline: 6px;
}

@media (max-width: 900px) {
  .inquiries-table,
  .inquiries-table tbody {
    display: block;
  }

  .inquiries-table thead {
    display: none;
  }

  .inquiries-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
  }

  .inquiries-table td {
    min-width: 0;
    border-bottom: 0;
  }

  .inquiries-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }

  .inquiries-table td:nth-child(5),
  .inquiries-table td:nth-child(7) {
    grid-column: 1 / -1;
  }

  .inquiries-table .row-actions {
    flex-direction: row;
  }

  .inquiries-table .row-actions .btn {
    width: auto;
    padding-inline: 14px;
  }
}

@media (max-width: 520px) {
  .inquiries-table tr {
    grid-template-columns: minmax(0, 1fr);
  }

  .inquiries-table td:nth-child(5),
  .inquiries-table td:nth-child(7) {
    grid-column: auto;
  }
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.login-box {
  max-width: 420px;
  margin: 64px auto;
}

/* LEGAL */
.legal p,
.legal li {
  color: var(--muted);
  margin-bottom: 12px;
}

.legal h2 {
  font-size: 20px;
  margin: 28px 0 10px;
}

.notice {
  background: rgba(251, 146, 60, 0.08);
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--orange);
  font-size: 13px;
  margin-bottom: 24px;
}

/* FOOTER */
footer.foot {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
}

footer.foot p,
footer.foot a {
  font-size: 13px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  text-decoration: none;
}

footer.foot span {
  color: var(--accent2);
}

footer.foot .visit-counter {
  margin: 8px 0 12px;
}

.visit-counter strong {
  color: var(--accent2);
  font-size: 18px;
}

.visit-dashboard {
  padding: 20px 24px;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.visit-dashboard h2 { margin: 0 0 8px; }
.visit-dashboard p { color: var(--muted); margin: 0 0 18px; }
.visit-dashboard__numbers { display: flex; gap: 32px; flex-wrap: wrap; }
.visit-dashboard__numbers div { display: grid; gap: 4px; }
.visit-dashboard__numbers strong { font-size: 28px; color: var(--accent2); }
.visit-dashboard__numbers span { color: var(--muted); }
.visit-range { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.visit-range label { display: grid; gap: 6px; font-size: 13px; }
.visit-range input { color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.visit-dashboard .visit-range__result, .visit-dashboard .visit-range__error { margin: 14px 0 0; }
.visit-range__result strong { color: var(--accent2); }
.visit-range__error { color: var(--orange); }

.foot-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(11, 15, 26, 0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 20px;
    gap: 0;
  }

  .nav-links.is-open {
    display: flex;
  }

  .hero-inner,
  .case-hero,
  .form-row,
  .project-card {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 28px;
  }

  .hero {
    padding: 40px 0 48px;
  }

  .eyebrow {
    letter-spacing: 0.06em;
  }

  .hero-text {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .avatar-wrap {
    width: 160px;
    height: 160px;
  }

  #avatarCanvas,
  .avatar-img {
    width: 140px;
    height: 140px;
  }

  .cta-block {
    padding: 32px 20px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .project-thumb {
    width: 100%;
    height: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    animation: none !important;
    transition: none !important;
  }

  .portal-project-card:hover,
  .portal-project-card:focus-within,
  .project-actions .btn:hover,
  .project-actions .btn:focus-visible,
  .project-video-close:hover,
  .project-video-close:focus-visible {
    transform: none;
  }

  .hero::after,
  .mascot-orbit,
  .mascot-particle,
  .portal-identity::before {
    animation: none;
  }
}

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

.site-chat {
  position: relative;
  z-index: 120;
}

body:has(.site-chat) .foot {
  padding-bottom: 88px;
}

.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--bg2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.35), 0 0 0 2px var(--orange);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(59, 130, 246, 0.42), 0 0 0 2px var(--orange);
}

.chat-launcher-mascot {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(1.08);
  object-position: center;
}

.chat-launcher.is-hidden {
  display: none;
}

.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 480px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.chat-widget[hidden] {
  display: none;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(245, 158, 11, 0.1), var(--bg2));
  border-bottom: 1px solid var(--border);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--bg);
  color: #0b0f1a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid var(--orange);
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  object-position: center;
}

.chat-title {
  font-size: 14px;
  font-weight: 600;
}

.chat-subtitle {
  font-size: 11px;
  color: var(--muted);
}

.chat-close {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.chat-close:hover {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.06), transparent);
}

.chat-message {
  max-width: 86%;
  border-radius: 14px;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-message-text {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-message.user {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-message.bot {
  margin-right: auto;
  background: rgba(11, 15, 26, 0.72);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat-results {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.chat-result {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  color: var(--text);
  text-decoration: none;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 10px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.chat-result:hover,
.chat-result:focus-visible {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.chat-result-kind {
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-result-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.chat-footer {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.chat-input {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
}

.chat-input::placeholder {
  color: var(--muted);
}

.chat-send {
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 16px;
}

.typing-indicator .dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--muted);
  animation: chat-blink 1s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chat-blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@media (max-width: 720px) {
  .chat-launcher,
  .chat-widget {
    right: 12px;
  }

  .chat-launcher {
    bottom: 12px;
  }

  .chat-widget {
    bottom: 76px;
    height: min(520px, calc(100vh - 96px));
  }
}


/* Medicine direction: personal expert portrait in the hero */
.direction-hero--medicine {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.96fr);
  align-items: center;
  gap: 44px;
}

.direction-hero--medicine .direction-hero__copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.direction-hero__visual {
  position: relative;
  z-index: 2;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(59, 130, 246, 0.58);
  background: #0d1729;
  box-shadow:
    0 24px 64px rgba(2, 8, 23, 0.46),
    0 0 32px rgba(59, 130, 246, 0.16);
}

.direction-hero__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.08);
  border-radius: inherit;
}

.direction-hero__visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 266;
  object-fit: cover;
}

@media (max-width: 900px) {
  .direction-hero--medicine {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .direction-hero__visual {
    width: min(100%, 720px);
  }
}

@media (max-width: 720px) {
  .direction-hero--medicine {
    gap: 22px;
  }

  .direction-hero__visual {
    border-radius: 16px;
  }
}


/* Medicine landing page: align live page with approved visual mockup */
.container--medicine {
  max-width: 1180px;
}

.direction-hero--medicine {
  grid-template-columns: minmax(0, .88fr) minmax(480px, 1.12fr);
  gap: 54px;
  padding-top: 68px;
  padding-bottom: 54px;
  min-height: 480px;
}

.direction-hero--medicine .direction-hero__copy {
  align-self: center;
}

.direction-hero--medicine h1 {
  font-size: clamp(46px, 5vw, 70px);
  margin-bottom: 20px;
}

.direction-hero--medicine .hero-sub {
  max-width: 620px;
  font-size: 18px;
  line-height: 1.72;
  margin-bottom: 28px;
}

.direction-hero--medicine .hero-cta {
  gap: 14px;
}

.direction-hero--medicine .btn {
  min-height: 52px;
  padding-inline: 24px;
  font-weight: 700;
}

.direction-hero__visual {
  align-self: center;
  border-radius: 22px;
}

.direction-hero__visual img {
  aspect-ratio: 720 / 399;
  object-fit: cover;
  object-position: center;
}

.medicine-proof {
  grid-column: 1 / 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: -34px;
  padding-top: 18px;
  position: relative;
  z-index: 3;
}

.medicine-proof span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9fb0c8;
  font-size: 13px;
  line-height: 1.35;
}

.medicine-proof strong {
  color: var(--orange);
  font-size: 22px;
  line-height: 1;
}

.container--medicine > .s:first-of-type {
  padding-top: 56px;
}

.container--medicine .s > h2 {
  font-size: clamp(28px, 3vw, 38px);
}

.materials-grid--medicine {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.materials-grid--medicine .material-card {
  min-height: 285px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  border-color: rgba(59, 130, 246, .28);
  background:
    linear-gradient(180deg, rgba(20, 35, 58, .88), rgba(11, 20, 36, .98));
}

.materials-grid--medicine .material-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .7;
  background:
    radial-gradient(circle at 88% 18%, rgba(59,130,246,.26), transparent 28%),
    linear-gradient(135deg, transparent 45%, rgba(125,211,252,.07));
}

.materials-grid--medicine .material-card:nth-child(2)::before {
  background:
    radial-gradient(circle at 86% 20%, rgba(245,158,11,.23), transparent 29%),
    linear-gradient(135deg, transparent 46%, rgba(245,158,11,.06));
}

.materials-grid--medicine .material-card:nth-child(3)::before {
  background:
    radial-gradient(circle at 84% 16%, rgba(45,212,191,.20), transparent 30%),
    linear-gradient(135deg, transparent 46%, rgba(45,212,191,.05));
}

.materials-grid--medicine .material-card > * {
  position: relative;
  z-index: 1;
}

.materials-grid--medicine .material-card h3 {
  font-size: 23px;
  line-height: 1.25;
}

.materials-grid--medicine .material-card p {
  color: #92a3ba;
}

@media (max-width: 980px) {
  .container--medicine {
    max-width: 900px;
  }

  .direction-hero--medicine {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
  }

  .medicine-proof {
    grid-column: 1;
    margin-top: 0;
  }

  .materials-grid--medicine {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .direction-hero--medicine h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .direction-hero--medicine .hero-sub {
    font-size: 16px;
  }

  .medicine-proof {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .materials-grid--medicine {
    grid-template-columns: 1fr;
  }
}


/* AI direction: Human-in-the-loop hero */
.container--ai {
  max-width: 1180px;
}

.direction-hero--ai {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(430px, .78fr) minmax(560px, 1.22fr);
  align-items: center;
  gap: 42px;
  padding-top: 68px;
  padding-bottom: 54px;
  min-height: 440px;
}

.direction-hero--ai .direction-hero__copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.direction-hero--ai h1 {
  font-size: clamp(42px, 3.8vw, 54px);
  white-space: nowrap;
}

.direction-hero--ai .hero-sub {
  max-width: 560px;
  font-size: 17px;
}

.direction-hero__visual--ai {
  width: 100%;
  border-color: rgba(59, 130, 246, .48);
  box-shadow:
    0 24px 64px rgba(2, 8, 23, .48),
    0 0 34px rgba(59, 130, 246, .14),
    0 0 18px rgba(245, 158, 11, .08);
}

.direction-hero__visual--ai img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 980px) {
  .container--ai {
    max-width: 900px;
  }

  .direction-hero--ai {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
  }

  .direction-hero--ai h1 {
    white-space: normal;
  }

  .direction-hero__visual--ai {
    width: min(100%, 900px);
  }
}

@media (max-width: 720px) {
  .direction-hero--ai {
    padding-top: 44px;
    gap: 24px;
  }

  .direction-hero--ai h1 {
    font-size: clamp(38px, 11vw, 54px);
  }

  .direction-hero__visual--ai {
    border-radius: 16px;
  }
}


/* Longevity: conversation with KnightCat and a path into the clouds. */
.container--longevity {
  max-width: 1180px;
}

.direction-hero--longevity {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 42px;
  padding-top: 68px;
  padding-bottom: 54px;
}

.direction-hero--longevity .direction-hero__copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.direction-hero--longevity h1 {
  font-size: clamp(38px, 3.8vw, 54px);
}

.direction-hero--longevity .hero-sub {
  max-width: 560px;
  font-size: 17px;
}

.direction-hero__visual--longevity {
  width: 100%;
}

.direction-hero__visual--longevity img {
  aspect-ratio: 1672 / 941;
  object-fit: contain;
}

@media (max-width: 980px) {
  .direction-hero--longevity {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .direction-hero__visual--longevity {
    width: min(100%, 900px);
  }
}

@media (max-width: 720px) {
  .direction-hero--longevity {
    padding-top: 44px;
    gap: 24px;
  }

  .direction-hero--longevity h1 {
    font-size: clamp(34px, 9vw, 48px);
  }
}

/* AI hero: resilient Human-in-the-loop scene built from verified site assets */
.ai-hero-scene {
  position: relative;
  min-height: 400px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(59, 130, 246, .58);
  background:
    linear-gradient(180deg, rgba(8, 18, 35, .18), rgba(8, 18, 35, .78)),
    #0c1628;
  box-shadow:
    0 24px 64px rgba(2, 8, 23, .48),
    0 0 34px rgba(59, 130, 246, .14),
    0 0 18px rgba(245, 158, 11, .08);
}

.ai-hero-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(125,211,252,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,211,252,.045) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 1;
}

.ai-hero-scene__portrait {
  position: absolute;
  inset: 0 0 0 auto;
  width: 58%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: .78;
  filter: saturate(.86) brightness(.72) contrast(1.08);
}

.ai-hero-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8,18,35,.98) 0%, rgba(8,18,35,.78) 35%, rgba(8,18,35,.18) 70%, rgba(8,18,35,.22) 100%),
    radial-gradient(circle at 74% 34%, rgba(59,130,246,.22), transparent 38%);
  z-index: 1;
  pointer-events: none;
}

.ai-hero-scene__mascot {
  position: absolute;
  top: 18px;
  left: 22px;
  z-index: 3;
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(245,158,11,.68);
  box-shadow: 0 10px 26px rgba(2,8,23,.42), 0 0 18px rgba(59,130,246,.20);
}

.ai-hero-flow {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 70px;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1.15fr auto 1.12fr auto 1.25fr auto .95fr;
  gap: 8px;
  align-items: stretch;
}

.ai-flow-card {
  min-width: 0;
  padding: 12px 12px 11px;
  border: 1px solid rgba(59,130,246,.55);
  border-radius: 12px;
  background: rgba(8,18,35,.76);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(125,211,252,.05);
}

.ai-flow-card strong,
.ai-flow-card span {
  display: block;
}

.ai-flow-card strong {
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
}

.ai-flow-card span {
  margin-top: 5px;
  color: #93a6c2;
  font-size: 9px;
  line-height: 1.35;
}

.ai-flow-card--human,
.ai-flow-card--decision {
  border-color: rgba(245,158,11,.74);
}

.ai-flow-card--review {
  border-color: rgba(45,212,191,.60);
}

.ai-flow-arrow {
  align-self: center;
  color: var(--orange);
  font-size: 20px;
  font-weight: 700;
}

.ai-hero-scene__caption {
  position: absolute;
  left: 28px;
  bottom: 22px;
  z-index: 4;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  letter-spacing: .08em;
  text-shadow: 0 2px 18px rgba(0,0,0,.7);
}

@media (max-width: 1180px) {
  .ai-hero-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-flow-arrow {
    display: none;
  }

  .ai-hero-scene {
    min-height: 430px;
  }
}

@media (max-width: 720px) {
  .ai-hero-scene {
    min-height: 520px;
    border-radius: 16px;
  }

  .ai-hero-scene__portrait {
    width: 100%;
    opacity: .52;
  }

  .ai-hero-scene::after {
    background: linear-gradient(180deg, rgba(8,18,35,.30), rgba(8,18,35,.96) 62%);
  }

  .ai-hero-flow {
    left: 16px;
    right: 16px;
    bottom: 58px;
    grid-template-columns: 1fr 1fr;
  }

  .ai-hero-scene__mascot {
    width: 72px;
    height: 72px;
    top: 14px;
    left: 14px;
  }

  .ai-hero-scene__caption {
    left: 16px;
    bottom: 18px;
    font-size: 11px;
  }
}


/* Life-OS global source map */
.lifeos-source-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.lifeos-source-item + .lifeos-source-item {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 16px;
  padding-top: 16px;
}
.lifeos-source-item h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}
.lifeos-source-item p {
  margin: 0 0 8px;
}

/* Постоянная кнопка рядом с помощником портала. */
.back-to-top {
  position: fixed;
  right: 88px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--orange);
  border-radius: 50%;
  background: var(--bg2);
  color: var(--orange);
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.back-to-top:hover {
  background: var(--bg3);
  color: var(--text);
}
.back-to-top:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Life-OS: дерево знаний и хранители смыслов. */
.direction-hero--lifeos {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 40px;
}
.direction-hero--lifeos .direction-hero__copy { position: relative; z-index: 2; min-width: 0; }
.direction-hero__visual--lifeos { width: 100%; border-color: rgba(245, 158, 11, .35); }
.direction-hero__visual--lifeos img { aspect-ratio: 3 / 2; object-fit: contain; }
@media (max-width: 900px) {
  .direction-hero--lifeos { grid-template-columns: 1fr; gap: 28px; }
  .direction-hero__visual--lifeos { max-width: 680px; margin-inline: auto; }
}
