/*
  case-shared.css
  Общие стили для navigation.html, account.html, rating.html
  Apple-style: воздух, крупная типографика, чистые белые секции
*/

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

:root {
  --bg:      #f5f5f7;
  --white:   #ffffff;
  --dark:    #0e0e19;
  --text:    #1d1d1f;
  --muted:   #6e6e73;
  --light:   #e8e8ed;
  --divider: rgba(0, 0, 0, 0.08);
  --border:  rgba(0, 0, 0, 0.08);
  --accent:  #1d1d1f;
  --radius:  20px;
  --max-w:   1520px;

--space-xs:  12px;   /* было 8  — мелкие детали: метка под цифрой */
--space-s:   20px;   /* было 16 — между абзацами, пунктами списка */
--space-m:   32px;   /* было 24 — заголовок → его контент */
--space-l:   64px;   /* было 48 — между подблоками внутри секции */
--space-xl:  96px;   /* было 80 — между секциями */
--space-2xl: 140px;  /* было 120 — между крупными блоками */
}

html { scroll-behavior: smooth; }
body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* NAV */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
}
.nav-logo { display: flex; flex-direction: column; text-decoration: none; }
.nav-logo-name { font-size: 31px; font-weight: 700; color: var(--text); line-height: 1; }
.nav-logo-role { font-size: 16px; color: var(--muted); line-height: 1.3; }
.nav-links { display: flex; gap: 8px; }
.nav-links a {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  transition: background 0.2s;
}
.nav-links a:hover { background: rgba(0, 0, 0, 0.11); }
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.burger span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

/* MOBILE OVERLAY */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--dark);
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 40px 48px;
}
.mobile-overlay.open { display: flex; }
.overlay-top { display: flex; justify-content: flex-end; }
.overlay-close { background: none; border: none; color: #fff; font-size: 36px; cursor: pointer; line-height: 1; opacity: 0.7; }
.overlay-links { display: flex; flex-direction: column; gap: 16px; }
.overlay-links a { font-size: 30px; font-weight: 700; color: #fff; text-decoration: none; }
.overlay-contacts { display: flex; flex-direction: column; gap: 8px; }
.overlay-contacts a { font-size: 14px; color: var(--muted); text-decoration: none; }

/* HERO COVER */
.case-cover { width: 100%; height: 420px; overflow: hidden; background: var(--light); }
.case-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

/* HERO COVER с UI поверх фона */
.case-cover--ui {
  position: relative;
  width: 110%;
  height: 420px;
  overflow: hidden;
  background: var(--dark);
}

.case-cover--ui .cover-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0.5; /* фон приглушён */
}

.case-cover--ui .cover-ui {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 960px;
  display: block;
  object-fit: contain;
  object-position: bottom center;
}

@media (max-width: 800px) {
  .case-cover--ui { height: 320px; }
  .case-cover--ui .cover-ui { width: 95%; }
}

/* CASE HEADER */
.case-header-wrap { background: var(--white); border-bottom: 1px solid var(--divider); }
.case-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 48px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}
.case-header--left { grid-template-columns: 1.4fr 1fr; }
.case-header--left .case-header-right { display: none; }

/* ТИПОГРАФИКА — clamp для плавного масштабирования */
.case-h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-m);
}
.case-subtitle {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0;
}
.case-meta { border-top: 1px solid var(--divider); }
.meta-item { padding: 16px 0; border-bottom: 1px solid var(--divider); }
.meta-item:last-child { border-bottom: none; }
.meta-label { font-size: 11px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.meta-value { font-size: 15px; line-height: 1.65; color: var(--text); }

h2.section-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-m);
}
h3.sub-title {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 600;
  line-height: 1.3;
  margin-top: var(--space-l);
  margin-bottom: var(--space-s);
}
h3.sub-title:first-child { margin-top: 0; }

h2.section-title + .split,
h2.section-title + .brief-grid,
h2.section-title + p,
h2.section-title + figure,
h2.section-title + .full-media,
h2.section-title + .criteria-wrapper { margin-top: var(--space-l); }

p { font-size: 17px; line-height: 1.8; margin-bottom: var(--space-s); }
p:last-child { margin-bottom: 0; }
p + p { margin-top: var(--space-s); }
ul, ol { padding-left: 22px; margin-top: var(--space-s); margin-bottom: var(--space-s); }
li { font-size: 17px; line-height: 1.8; margin-bottom: var(--space-xs); }
li:last-child { margin-bottom: 0; }
strong { font-weight: 600; }

/* STATS */
.stats-row { display: flex; gap: 0; margin-top: var(--space-l); margin-bottom: 0; }
.stat-item { flex: 1; position: relative; }
.stat-value {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  margin-bottom: var(--space-xs);
}
.stat-label { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* CONTENT */
.case-content { max-width: var(--max-w); margin: 0 auto; padding: var(--space-xl) 48px; }
.case-content section { margin-top: var(--space-xl); }
.case-content section:first-child { margin-top: 0; }
.section-white { background: var(--white); margin-left: -48px; margin-right: -48px; padding: 80px 48px; }
.context-block { max-width: 560px; margin-bottom: var(--space-l); }
.context-block p { font-size: 17px; color: var(--muted); line-height: 1.75; }

/* SPLIT */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); align-items: center; }
.split-image { overflow: hidden; border-radius: var(--radius); }
.split-image img { width: 100%; display: block; border-radius: var(--radius); }
figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.brief-grid { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-xl); align-items: start; }

/* FULL MEDIA */
.full-media { border-radius: var(--radius); overflow: hidden; background: var(--light); }
.full-media img, .full-media video { width: 100%; display: block; }
.full-media video { background: #000; }

/* HIGHLIGHT */
.highlight { font-style: normal; font-weight: 500; border-left: 3px solid var(--accent); padding-left: 20px; margin: var(--space-l) 0; color: var(--text); }

/* RESEARCH PHOTO */
.research-photo { margin: 0; overflow: visible; width: 100%; }
.research-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center; border-radius: var(--radius); display: block; }
.research-photo figcaption { font-size: 14px; font-style: normal; font-weight: 400; color: var(--muted); margin-top: var(--space-xs); line-height: 1.5; text-align: center; width: 100%; display: block; }

/* TAKEAWAY */
.takeaway-section { background: var(--dark); border-radius: 24px; padding: 72px 80px; color: #fff; }
.takeaway-label { font-size: 14px; font-weight: 400; color: rgba(255, 255, 255, 0.35); margin-bottom: var(--space-m); }
.takeaway-body { display: flex; gap: 28px; align-items: flex-start; }
.takeaway-icon { width: 40px; flex-shrink: 0; margin-top: 4px; opacity: 0.4; }
.takeaway-icon img { width: 100%; display: block; }
.takeaway-text { font-size: clamp(20px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.4; color: #fff; }
.takeaway-sub { margin-top: var(--space-l); padding-top: var(--space-m); border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 16px; line-height: 1.75; color: rgba(255, 255, 255, 0.6); }

/* SCENARIO DIAGRAM */
.scenario-diagram { margin-bottom: var(--space-xl); }

/* CRITERIA TABLE */
.criteria-wrapper { overflow-x: auto; margin: var(--space-l) 0; }
.criteria-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.criteria-table th { padding: 12px 16px; text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--divider); }
.criteria-table td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--divider); color: var(--text); }
.criteria-table .row-label { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; border-right: 1px solid var(--divider); writing-mode: vertical-lr; text-align: center; width: 32px; padding: 16px 8px; }
.score-0  { color: #c0392b; background: #fff5f5; }
.score-05 { color: #92660a; background: #fffbf0; }
.score-1  { color: #1a6b3c; background: #f0faf4; }

/* RESULT CARDS */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result-card { display: flex; align-items: center; gap: 20px; background: var(--white); border: 1px solid var(--divider); border-radius: var(--radius); padding: 28px; }
.result-icon-box { width: 64px; height: 64px; flex-shrink: 0; background: #f0edff; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.result-icon-box img { width: 48px; height: 48px; object-fit: contain; }
.result-text { font-size: 16px; line-height: 1.55; margin: 0; }

/* PROCESS STEPS */
.process-steps { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--divider); }
.process-step { padding: 36px 32px 48px; border-right: 1px solid var(--divider); position: relative; }
.process-step:last-child { border-right: none; }
.step-accent { font-size: 17px; font-weight: 600; color: var(--accent); line-height: 1.3; margin-bottom: 6px; }
.step-desc { font-size: 15px; line-height: 1.55; color: var(--muted); }
.step-bar { height: 3px; background: var(--accent); border-radius: 2px; margin-top: 28px; }
.step-num { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ROLE BOXES */
.role-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: var(--space-m) 0 var(--space-l); }
.role-box { background: var(--text); color: #fff; padding: 32px 24px; border-radius: 16px; font-size: 20px; font-weight: 600; line-height: 1.2; }

/* HYPOTHESES */
.hypotheses { border: 1px solid var(--divider); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.hypothesis { padding: 24px 28px; border-bottom: 1px solid var(--divider); }
.hypothesis:last-child { border-bottom: none; }
.hyp-num { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.hyp-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.hyp-desc { font-size: 15px; line-height: 1.65; color: var(--muted); }

/* CAPABILITIES */
.capabilities { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.capability-tag { padding: 8px 18px; border-radius: 100px; background: var(--text); color: #fff; font-size: 14px; font-weight: 500; }

/* MVP SECTIONS */
.mvp-section { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; padding: 64px 0; border-bottom: 1px solid var(--divider); }
.mvp-section:last-child { border-bottom: none; }
.mvp-section.img-left .mvp-text { order: 2; }
.mvp-section.img-left .mvp-image { order: 1; }
.mvp-image { border-radius: var(--radius); overflow: hidden; background: var(--light); }
.mvp-image img { width: 100%; display: block; }
.mvp-num { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.mvp-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
.mvp-desc { font-size: 17px; line-height: 1.8; margin-bottom: 12px; }
.mvp-hypothesis { font-size: 15px; color: var(--muted); line-height: 1.65; }
.mvp-hypothesis::before { content: "→ "; }

/* CYCLE / METRICS / PROTO */
.cycle-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 28px 0; }
.cycle-item { background: var(--white); border: 1px solid var(--divider); border-radius: 14px; padding: 20px 18px; }
.cycle-step { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.cycle-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.cycle-metric { font-size: 13px; color: var(--muted); }
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.metric-item { background: var(--white); border: 1px solid var(--divider); border-radius: 14px; padding: 22px 24px; }
.metric-kind { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.metric-val { font-size: 17px; font-weight: 600; }
.proto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.proto-wrap { border-radius: var(--radius); overflow: hidden; background: var(--light); }
.proto-wrap img { width: 100%; display: block; }

/* CASE NAV */
.case-nav-wrap { border-top: 1px solid var(--divider); background: var(--white); }
.case-nav { max-width: var(--max-w); margin: 0 auto; padding: 56px 48px 80px; display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; }
.case-nav-link { text-decoration: none; color: var(--text); max-width: 360px; }
.case-nav-link.next { text-align: right; }
.case-nav-direction { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.case-nav-title { font-size: 20px; font-weight: 600; line-height: 1.3; }
.case-nav-link:hover .case-nav-title { text-decoration: underline; }

/* FOOTER */
footer { background: var(--dark); color: #fff; padding: 80px 48px; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.footer-cta { font-size: clamp(24px, 3.5vw, 36px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; max-width: 520px; }
.footer-links { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.footer-links a { color: rgba(255, 255, 255, 0.55); text-decoration: none; font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.arr { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 700; opacity: 0.6; flex-shrink: 0; }
.footer-links a:hover .arr { opacity: 1; }

/* FADE-UP */
.fade-up { opacity: 0; transform: translateY(32px); transition: opacity 0.75s ease, transform 0.75s ease; }
.fade-up.visible { opacity: 1; transform: none; }

/* Средний экран — ноутбук 1024-1280px */
@media (max-width: 1280px) {
  .case-header {
    grid-template-columns: 1fr 2fr; /* меньше пустого места слева */
  }

  .case-header--left {
    grid-template-columns: 2fr 1fr; /* для навигации */
  }
}


/* ноутбук — контент на всю ширину */
@media (max-width: 1400px) {
  .case-header {
    grid-template-columns: 1fr; /* одна колонка */
    padding: 48px 48px;
  }
  .case-header-right {
    grid-column: 1; /* явно в первую колонку */
  }

  .case-header-left {
    display: none; /* прячем пустую колонку */
  }

  .case-header--left {
    grid-template-columns: 1fr;
  }

  .case-header--left .case-header-left {
    display: block;
  }

  .case-header--left .case-header-right {
    display: none;
  }
}

/* ══════════════════════════════════════════
   MOBILE — один блок, без вложений
   ══════════════════════════════════════════ */
@media (max-width: 800px) {
  html, body { width: 100%; overflow-x: hidden; }

  /* Nav */
  #nav { padding: 12px 20px; }
  .nav-links { display: none; }
  .burger { display: flex; }
  .nav-logo-name { font-size: 22px; }
  .nav-logo-role { font-size: 14px; }

  /* Hero */
  .case-cover { height: 260px; }

  /* Header */
  .case-header { grid-template-columns: 1fr; padding: 40px 20px; gap: 24px; }
  .case-header-left { display: none; }
  .case-header--left { grid-template-columns: 1fr; }
  .case-header--left .case-header-left { display: block; width: 100%; }
  .case-header--left .case-header-right { grid-template-columns: 1fr; padding: 40px 20px; gap: 24px;  }

  /* Content */
  .case-content { padding: 48px 20px 64px; overflow-x: hidden; }
  .case-content * { max-width: 100%; word-break: break-word; }
  .case-content section { margin-top: 64px; }
  .section-white { margin-left: -20px; margin-right: -20px; padding: 48px 20px; }

  /* Stats — два в ряд */
  .stats-row { flex-wrap: wrap; gap: 28px 0; margin-top: 32px; }
  .stat-item { flex: 0 0 50%; padding-right: 0; border-bottom: none; }
  .stat-item:not(:last-child)::after { display: none; }
  .stat-value { font-size: clamp(2rem, 10vw, 3rem); }

  /* Split */
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split .split-image { order: 2; }
  .split > div:not(.split-image) { order: 1; }
  .brief-grid { grid-template-columns: 1fr; gap: 24px; }
  .research-photo img { aspect-ratio: 4 / 3; }

  /* Takeaway */
  .takeaway-section { padding: 40px 24px; border-radius: 16px; }
  .takeaway-body { gap: 16px; }
  .takeaway-text { font-size: clamp(18px, 5vw, 22px); }
  .takeaway-sub { font-size: 15px; margin-top: 24px; padding-top: 20px; }

  /* Grids */
  .result-grid { grid-template-columns: 1fr; }
  .result-card { flex-direction: column; padding: 20px; }
  .proto-grid { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr; }
  .process-step { border-right: none; border-bottom: 1px solid var(--divider); }
  .process-step:last-child { border-bottom: none; }
  .role-boxes { grid-template-columns: repeat(2, 1fr); }
  .role-box { font-size: 16px; padding: 24px 16px; }
  .cycle-list { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: 1fr; }
  .mvp-section { grid-template-columns: 1fr; gap: 28px; padding: 40px 0; }
  .mvp-section.img-left .mvp-text { order: 2; }
  .mvp-section.img-left .mvp-image { order: 1; }

  /* Nav / Footer */
  .case-nav { padding: 40px 20px 60px; flex-direction: column; }
  .case-nav-link.next { text-align: left; }
  footer { grid-template-columns: 1fr; padding: 56px 20px; }
  .footer-links { align-items: flex-start; }
  
  }

  /* Воздух после фото перед заголовком */
figure + h2.section-title,
figure + h3.sub-title,
img + h2.section-title,
img + h3.sub-title { margin-top: 48px; }

/* Заголовок ближе к своему контенту, дальше от предыдущего */
h2.section-title { margin-top: 0; margin-bottom: 16px; }
h3.sub-title { margin-top: 40px; margin-bottom: 8px; }

/* Радиус на inline-картинках внутри контента */
.case-content figure img,
.case-content ol img,
.case-content li img { border-radius: 8px !important; }

/* ══════ RESULTS SPLIT ══════ */
.results-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}
.results-image { margin: 0; }
.results-image img { width: 100%; display: block; border-radius: var(--radius); }
.results-image figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.results-stats { display: flex; flex-direction: column; gap: var(--space-l); }
.result-stat-item { border-top: 1px solid var(--divider); padding-top: var(--space-m); }
.result-stat-item:first-child { border-top: none; padding-top: 0; }
.result-stat-value { font-size: clamp(2.5rem, 4vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--text); margin-bottom: 8px; }
.result-stat-label { font-size: 15px; color: var(--muted); line-height: 1.5; }

@media (max-width: 800px) {
  .results-split { grid-template-columns: 1fr; gap: 48px; }
}

