/* Стили по дизайн-системе «Фирменный стиль»: одна светлая тема, taupe для действий,
   один жёлтый акцент на экран, шрифты TT Directors / New York (Playfair) / Futura New. */

@font-face { font-family: "TT Directors"; src: url("fonts/tt-directors-light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "TT Directors"; src: url("fonts/tt-directors-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Futura New"; src: url("fonts/futura-new-light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Futura New"; src: url("fonts/futura-new-book.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Futura New"; src: url("fonts/futura-new-demi.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Futura New"; src: url("fonts/futura-new-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- токены ---------- */
:root {
  --main-background: #fafafa;
  --main-white: #ffffff;
  --main-ink: #1f1a16;
  --main-highlight: #fbf942;
  --main-taupe: #bdada0;
  --main-taupe-dark: #a39384;
  /* производные от токенов: приглушённый текст и тонкие линии */
  --ink-muted: #6b625b;
  --taupe-soft: #efe9e4;
  --line: #e9e3de;

  --font-display: "TT Directors", Oswald, "Arial Narrow", sans-serif;
  --font-serif: "New York Extra Large", "Playfair Display", ui-serif, Georgia, serif;
  --font-sans: "Futura New", Jost, Futura, "Century Gothic", sans-serif;

  --space-xs: 5px;
  --space-s: 10px;
  --space-m: 20px;
  --space-l: 30px;
  --space-section: 60px;

  --radius-small: 20px;
  --radius-big: 50px;
  --shadow-brown: 0 1px 40px rgba(31, 26, 22, .2);
  --shadow-soft: 0 1px 20px rgba(31, 26, 22, .06);
  color-scheme: light;
}

/* ---------- основа ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--main-background);
  color: var(--main-ink);
  font: 400 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--space-m) var(--space-m) calc(var(--space-l) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.screen { display: flex; flex-direction: column; flex: 1; animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen, .opt, .seg i, .bar i, .ring-val { animation: none !important; transition: none !important; } }

h1, h2, h3 { margin: 0; font-weight: 400; }
.display { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; line-height: .95; letter-spacing: .01em; }
.serif { font-family: var(--font-serif); }
.muted { color: var(--ink-muted); }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.spacer { flex: 1; min-height: var(--space-l); }
.mark { background: var(--main-highlight); color: var(--main-ink); padding: 0 .15em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- кнопки (BigButton / SmallButton) ---------- */
.btn {
  appearance: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: var(--space-s);
  width: 100%; min-height: 56px; padding: 14px var(--space-l);
  border-radius: var(--radius-big);
  font: 500 18px/1.2 var(--font-sans);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-big { background: var(--main-taupe); color: var(--main-white); border: 0; font-weight: 700; }
.btn-big:hover, .btn-big:active { background: var(--main-taupe-dark); box-shadow: var(--shadow-brown); }
.btn-small { background: var(--main-white); color: var(--main-ink); border: 2px solid var(--main-ink); }
.btn-small:hover, .btn-small:active { background: var(--main-taupe-dark); border-color: var(--main-taupe-dark); color: var(--main-white); box-shadow: var(--shadow-brown); }
.btn-text { background: none; border: 0; color: var(--ink-muted); min-height: 44px; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; }
.btn:focus-visible, .opt:focus-visible, .tab:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--main-ink); outline-offset: 3px; }
.actions { display: grid; gap: var(--space-s); margin-top: var(--space-l); }

.topbar { display: flex; align-items: center; gap: var(--space-s); min-height: 40px; }
.icon-btn {
  appearance: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--main-white); color: var(--main-ink); box-shadow: var(--shadow-soft);
  display: grid; place-items: center; flex: none;
}
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- приветствие ---------- */
.hero { padding: var(--space-l) 0 0; }
.hero h1 { font-size: 64px; margin: var(--space-m) 0; }
.hero p { margin: 0; font-size: 17px; color: var(--ink-muted); }

.spheres { display: grid; gap: var(--space-s); margin: var(--space-l) 0 0; padding: 0; list-style: none; }
.spheres li {
  display: flex; align-items: center; gap: var(--space-m);
  background: var(--main-white); border-radius: var(--radius-small); padding: 14px var(--space-m);
  box-shadow: var(--shadow-soft);
}
.spheres .n { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--main-taupe); min-width: 34px; }
.spheres b { display: block; font-weight: 500; font-size: 16px; line-height: 1.25; }
.spheres small { display: block; color: var(--ink-muted); font-size: 13.5px; line-height: 1.35; margin-top: 2px; }

.facts { display: flex; gap: var(--space-m); margin-top: var(--space-m); color: var(--ink-muted); font-size: 14px; flex-wrap: wrap; }
.facts b { color: var(--main-ink); font-weight: 700; }

.last-result {
  margin-top: var(--space-m); padding: var(--space-m); border-radius: var(--radius-small);
  background: var(--taupe-soft); border: 0; width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-m);
  text-align: left; color: var(--main-ink); font: inherit;
}
.last-result small { display: block; color: var(--ink-muted); font-size: 13px; }
.last-result svg { width: 18px; height: 18px; flex: none; }

.fineprint { margin-top: var(--space-m); font-size: 13px; font-weight: 300; color: var(--ink-muted); text-align: center; line-height: 1.45; }

/* ---------- прогресс по 4 сферам ---------- */
.segments { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-xs); }
.seg { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.seg i { display: block; height: 100%; width: 0; background: var(--main-ink); border-radius: inherit; transition: width .4s cubic-bezier(.2, .7, .2, 1); }
.seg.skipped { background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 7px); }

/* ---------- вводный экран сферы ---------- */
.block-intro { padding-top: var(--space-section); }
.block-intro .big-num { font-family: var(--font-display); font-weight: 700; font-size: 120px; line-height: .8; color: var(--main-taupe); }
.block-intro h2 { font-family: var(--font-serif); font-weight: 700; font-size: 40px; line-height: 1.1; margin: var(--space-m) 0 var(--space-s); }
.block-intro p { margin: 0; font-size: 17px; color: var(--ink-muted); }
.block-intro .meta { margin-top: var(--space-m); display: flex; gap: var(--space-s); flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: var(--radius-big); background: var(--main-white); box-shadow: var(--shadow-soft); font-size: 14px; }
.skip-hint { margin-top: var(--space-l); padding: var(--space-m); border-radius: var(--radius-small); background: var(--taupe-soft); font-size: 15px; }

/* ---------- вопрос ---------- */
.q-head { margin: var(--space-l) 0 var(--space-s); display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-s); }
.q-count { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1; }
.q-count span { color: var(--main-taupe); }
.q-text { font-family: var(--font-serif); font-weight: 600; font-size: 28px; line-height: 1.2; margin: 0 0 var(--space-l); }

.options { display: grid; gap: var(--space-s); }
.opt {
  appearance: none; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: var(--space-m);
  padding: 14px var(--space-m); min-height: 60px;
  border-radius: var(--radius-small); border: 2px solid transparent;
  background: var(--main-white); color: var(--main-ink); box-shadow: var(--shadow-soft);
  font: 400 17px/1.2 var(--font-sans); text-align: left;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.opt:active { transform: scale(.985); }
.opt .num { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; width: 18px; text-align: center; color: var(--main-taupe); transition: color .2s ease; }
.opt.selected { background: var(--main-highlight); border-color: var(--main-ink); }
.opt.selected .num { color: var(--main-ink); }

/* ---------- загрузка ---------- */
.loading { flex: 1; display: grid; place-items: center; text-align: center; align-content: center; }
.breath { width: 76px; height: 76px; margin: 0 auto var(--space-m); border-radius: 50%; background: var(--taupe-soft); position: relative; animation: breathe 2.4s ease-in-out infinite; }
.breath::after { content: ""; position: absolute; inset: 20px; border-radius: 50%; background: var(--main-taupe); }
@keyframes breathe { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.08); } }

/* ---------- результат ---------- */
.result-top { text-align: center; padding-top: var(--space-s); }
.ring { position: relative; width: 210px; height: 210px; margin: var(--space-m) auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: var(--taupe-soft); }
.ring-val { stroke: var(--main-ink); transition: stroke-dashoffset 1.2s cubic-bezier(.2, .7, .2, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.ring-label b { font-family: var(--font-display); font-weight: 700; font-size: 80px; line-height: .85; }
.ring-label span { font-size: 14px; color: var(--ink-muted); margin-top: var(--space-xs); }

.level-range { display: inline-block; padding: 5px 14px; border-radius: var(--radius-big); background: var(--taupe-soft); font-size: 14px; margin-bottom: var(--space-s); }
.level-name { font-family: var(--font-serif); font-weight: 700; font-size: 34px; line-height: 1.1; margin: 0 0 var(--space-s); }
.focus { color: var(--ink-muted); margin: 0 auto; max-width: 400px; font-size: 17px; }
.note { font-size: 13px; font-weight: 300; color: var(--ink-muted); margin-top: var(--space-s); }

.card { margin-top: var(--space-l); padding: var(--space-m); border-radius: var(--radius-small); background: var(--main-white); box-shadow: var(--shadow-soft); }
.card-title { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 24px; line-height: 1; margin-bottom: var(--space-m); }

.sphere { display: grid; grid-template-columns: 28px 1fr; gap: 0 var(--space-s); margin-bottom: var(--space-m); }
.sphere:last-child { margin-bottom: 0; }
.sphere .n { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1; color: var(--main-taupe); grid-row: span 2; }
.sphere-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-s); font-size: 15.5px; margin-bottom: 8px; }
.sphere-row b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-big); background: var(--main-highlight); color: var(--main-ink); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: var(--taupe-soft); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--main-taupe); transition: width 1s cubic-bezier(.2, .7, .2, 1); }
.bar i.weak { background: var(--main-ink); }
.sphere.skipped .sphere-row { color: var(--ink-muted); }
.sphere.skipped .bar { background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 7px); }

/* ---------- практики ---------- */
.page-title { font-size: 56px; margin: var(--space-m) 0 var(--space-s); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); padding: var(--space-xs); margin: var(--space-m) 0 var(--space-xs); border-radius: var(--radius-big); background: var(--taupe-soft); }
.tab {
  appearance: none; border: 0; cursor: pointer; min-height: 42px; border-radius: var(--radius-big);
  background: transparent; color: var(--ink-muted); font: 500 15px/1.2 var(--font-sans);
  transition: background .2s ease, color .2s ease;
}
.tab.active { background: var(--main-white); color: var(--main-ink); box-shadow: var(--shadow-soft); }

.practice { margin-top: var(--space-m); padding: var(--space-m); border-radius: var(--radius-small); background: var(--main-white); box-shadow: var(--shadow-soft); }
.practice-time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.practice-time svg { width: 16px; height: 16px; }
.practice h3 { font-family: var(--font-serif); font-weight: 700; font-size: 25px; line-height: 1.15; margin: var(--space-s) 0; }
.practice .goal { font-size: 15px; color: var(--ink-muted); margin: 0 0 var(--space-s); }
.practice ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-s); }
.practice li { position: relative; padding-left: var(--space-m); font-size: 16px; line-height: 1.5; }
.practice li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--main-taupe); }
.practice li b { font-weight: 700; }

.error-box { margin: auto 0; text-align: center; }
