:root {
  --bg: #fbf6ec;
  --surface: #ffffff;
  --surface-2: #f3ead9;
  --ink: #1d2433;
  --muted: #6b6457;
  --line: #e4d9c4;
  --sea: #0b6e99;
  --sea-2: #1aa0c8;
  --copper: #d57800;
  --eu: #1f3fa8;
  --eu-star: #ffcc00;
  --red: #d7263d;
  --red-soft: rgba(215, 38, 61, .14);
  --orange: #e8891c;
  --green: #2a9d5c;
  --shadow: 0 10px 30px rgba(40, 30, 10, .14);
  --silence: rgba(107, 100, 87, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151f;
    --surface: #18202e;
    --surface-2: #1f2939;
    --ink: #eef1f6;
    --muted: #9aa3b2;
    --line: #2b3648;
    --sea: #3fb6e0;
    --sea-2: #6fd0f0;
    --copper: #f39a2a;
    --eu: #6d8cff;
    --red: #ff5a6e;
    --red-soft: rgba(255, 90, 110, .16);
    --orange: #ffa94d;
    --green: #4fd18b;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --silence: rgba(255, 255, 255, .04);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10151f; --surface: #18202e; --surface-2: #1f2939; --ink: #eef1f6; --muted: #9aa3b2;
  --line: #2b3648; --sea: #3fb6e0; --sea-2: #6fd0f0; --copper: #f39a2a; --eu: #6d8cff;
  --red: #ff5a6e; --red-soft: rgba(255, 90, 110, .16); --orange: #ffa94d; --green: #4fd18b;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45); --silence: rgba(255, 255, 255, .04); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sea); }
button { font: inherit; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(26, 160, 200, .22), transparent 60%),
    radial-gradient(800px 300px at 0% 120%, rgba(213, 120, 0, .16), transparent 60%);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  /* волны */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background: radial-gradient(circle at 12px -6px, transparent 14px, var(--sea) 15px, var(--sea) 17px, transparent 18px) repeat-x;
  background-size: 24px 26px;
  opacity: .25;
}
.hero-inner { max-width: 1100px; margin: 0 auto; padding: 48px 16px 56px; }
.kicker { margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
h1 {
  font-family: "Unbounded", sans-serif; font-weight: 900;
  font-size: clamp(32px, 6vw, 68px); line-height: 1.02; margin: 0 0 16px; letter-spacing: -.02em;
}
h1 sup { font-size: .35em; vertical-align: super; color: var(--copper); }
.almost {
  color: var(--copper);
  display: inline-block;
  animation: wobble 3.2s ease-in-out infinite;
}
@keyframes wobble {
  0%, 70%, 100% { transform: translateX(0) rotate(0); }
  75% { transform: translateX(6px) rotate(2deg); }
  80% { transform: translateX(-4px) rotate(-2deg); }
  85% { transform: translateX(2px) rotate(1deg); }
}
.lede { max-width: 720px; font-size: 18px; color: var(--muted); margin: 0 0 28px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 1px 0 var(--line);
}
.stat b { display: block; font-family: "Unbounded", sans-serif; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.zero b { color: var(--red); }
.stat.copper b { color: var(--copper); }

.loader { max-width: 560px; }
.loader-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.loader-pct { font-variant-numeric: tabular-nums; color: var(--copper); }
.loader-track { height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.loader-fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(-45deg, var(--sea) 0 10px, var(--sea-2) 10px 20px);
  background-size: 28px 28px;
  animation: stripes 1s linear infinite;
  border-radius: 999px;
  transition: width .25s ease;
}
@keyframes stripes { to { background-position: 28px 0; } }
.loader-hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* ---------- Toolbar ---------- */
main { max-width: none; }
.toolbar {
  max-width: 1100px; margin: 28px auto 12px; padding: 0 16px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { display: inline-block; font-style: normal; }
.lg-bar { width: 26px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--sea), var(--sea-2)); }
.lg-overdue { width: 26px; height: 8px; border-radius: 4px; background: repeating-linear-gradient(-45deg, var(--red) 0 4px, transparent 4px 8px); border: 1px solid var(--red); }
.lg-moved { width: 26px; height: 0; border-top: 3px dashed var(--orange); }
.lg-wait { width: 10px; height: 10px; border-radius: 50%; background: var(--sea); box-shadow: 0 0 0 4px rgba(26, 160, 200, .25); }
.nav { display: flex; gap: 8px; }
.nav button, .generator button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 14px;
}
.nav button:hover, .generator button:hover { border-color: var(--sea); color: var(--sea); }

/* ---------- Timeline ---------- */
.scroller {
  overflow-x: auto; overflow-y: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: grab;
  scrollbar-width: thin;
  outline: none;
}
.scroller.dragging { cursor: grabbing; user-select: none; }
.canvas { position: relative; }
.scroll-hint { text-align: center; font-size: 13px; color: var(--muted); margin: 8px 16px 0; }

.year {
  position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line);
}
.year span {
  position: sticky; top: 0;
  display: block; padding: 10px 6px; font-family: "Unbounded", sans-serif; font-weight: 700; font-size: 13px; color: var(--muted);
}
.year.big span { color: var(--ink); }
.silence {
  position: absolute; top: 40px; bottom: 0;
  background: repeating-linear-gradient(135deg, var(--silence) 0 12px, transparent 12px 24px);
  border-left: 2px dotted var(--line); border-right: 2px dotted var(--line);
  display: flex; align-items: center; justify-content: center;
}
.silence-label {
  font-family: "Unbounded", sans-serif; font-weight: 700; font-size: 15px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line); padding: 8px 12px; border-radius: 12px;
  cursor: help; text-align: center; line-height: 1.3;
}
.silence-label small { display: block; font-family: "Manrope", sans-serif; font-weight: 600; font-size: 11px; }

.lane-title {
  position: absolute; left: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  background: var(--surface); padding: 2px 6px; border-radius: 6px; z-index: 2;
}
.lane-sep { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }

/* events */
.ev {
  position: absolute; transform: translateX(-14px);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; cursor: pointer; z-index: 3;
  font-size: 12.5px; font-weight: 700;
}
.ev .ic {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14px;
  transition: transform .15s ease;
}
.ev:hover .ic, .ev.active .ic { transform: scale(1.18); border-color: var(--sea); }
.ev .t { background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.ev-stem { position: absolute; width: 0; border-left: 1px dotted var(--muted); opacity: .5; }

/* promises */
.row-bg { position: absolute; left: 0; right: 0; }
.row-bg:nth-child(odd) { background: transparent; }
.bar {
  position: absolute; height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, var(--sea), var(--sea-2));
  transform-origin: left center;
  animation: grow .9s cubic-bezier(.2, .8, .2, 1) both;
}
.overdue {
  position: absolute; height: 10px; border-radius: 0 5px 5px 0;
  background: repeating-linear-gradient(-45deg, var(--red) 0 5px, var(--red-soft) 5px 10px);
  border: 1px solid var(--red);
  transform-origin: left center;
  animation: grow 1.1s .5s cubic-bezier(.2, .8, .2, 1) both;
}
.moved {
  position: absolute; height: 0; border-top: 3px dashed var(--orange);
  transform-origin: left center; animation: grow .8s .4s ease both;
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.pdot {
  position: absolute; width: 22px; height: 22px; margin: -6px 0 0 -11px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--sea); cursor: pointer; z-index: 3;
  display: grid; place-items: center; font-weight: 900; font-size: 12px; color: var(--sea); font-family: Georgia, serif;
  transition: transform .15s ease;
}
.pdot:hover, .pdot.active { transform: scale(1.25); background: var(--sea); color: #fff; }
.plabel {
  position: absolute; z-index: 3; cursor: pointer;
  font-size: 13px; line-height: 1.25; white-space: nowrap;
}
.plabel b { font-weight: 700; }
.plabel em { font-style: normal; color: var(--muted); font-size: 12px; display: block; }
.plabel:hover b { color: var(--sea); }

.flag {
  position: absolute; z-index: 4; transform: translate(-4px, -100%); font-size: 18px; line-height: 1; cursor: pointer;
}
.flag-label {
  position: absolute; z-index: 3; font-size: 11px; font-weight: 800; transform: translate(-50%, 6px);
  white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums;
}
.stamp {
  position: absolute; z-index: 4; transform: translate(-50%, 0) rotate(-6deg);
  border: 2px solid var(--red); color: var(--red); background: var(--surface);
  font-family: "Unbounded", sans-serif; font-weight: 900; font-size: 11px; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 6px; white-space: nowrap; text-transform: uppercase;
  animation: stamp .45s 1.2s cubic-bezier(.2, 1.6, .4, 1) both;
}
.stamp.orange { border-color: var(--orange); color: var(--orange); }
.stamp.blue { border-color: var(--sea); color: var(--sea); }
@keyframes stamp { from { opacity: 0; transform: translate(-50%, 0) rotate(-6deg) scale(2.2); } to { opacity: 1; transform: translate(-50%, 0) rotate(-6deg) scale(1); } }

.waiting {
  position: absolute; width: 12px; height: 12px; margin: -1px 0 0 -6px; border-radius: 50%; background: var(--sea); z-index: 3;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(26, 160, 200, .5); } 100% { box-shadow: 0 0 0 14px rgba(26, 160, 200, 0); } }

/* today */
.today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--red); z-index: 5; pointer-events: none; }
.today span {
  position: absolute; top: 8px; left: 6px; white-space: nowrap;
  background: var(--red); color: #fff; font-weight: 800; font-size: 12px; padding: 3px 8px; border-radius: 999px;
}
.today span::after { content: attr(data-tail); font-weight: 600; opacity: .9; }

/* others */
.oth { position: absolute; transform: translateX(-14px); display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; font-size: 12.5px; font-weight: 700; z-index: 3; }
.oth .ic { font-size: 16px; line-height: 1; padding: 4px 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; transition: transform .15s; }
.oth:hover .ic, .oth.active .ic { transform: scale(1.12); border-color: var(--green); }
.oth .t { color: var(--green); background: var(--surface); padding: 1px 4px; border-radius: 6px; }

/* island that keeps sailing */
.boat {
  position: absolute; z-index: 6; font-size: 26px; transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .2)); pointer-events: none;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -5px; } }

/* ---------- Tooltip ---------- */
.tip {
  position: fixed; z-index: 100; width: min(380px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 14px 16px 12px; font-size: 14px;
}
.tip .tdate { font-size: 12px; font-weight: 800; color: var(--copper); text-transform: uppercase; letter-spacing: .06em; }
.tip h3 { font-family: "Unbounded", sans-serif; font-size: 15px; line-height: 1.25; margin: 4px 0 6px; }
.tip .who { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.tip .who b { color: var(--ink); }
.tip p { margin: 0 0 8px; }
.tip blockquote {
  margin: 0 0 8px; padding: 8px 10px; border-left: 3px solid var(--copper); background: var(--surface-2); border-radius: 0 8px 8px 0;
  font-style: italic;
}
.tip .note { font-size: 13px; color: var(--muted); }
.tip .status { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-bottom: 8px; }
.status.overdue-s { background: var(--red-soft); color: var(--red); }
.status.moved-s { background: rgba(232, 137, 28, .15); color: var(--orange); }
.status.wait-s { background: rgba(26, 160, 200, .15); color: var(--sea); }
.tip .src { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font-size: 12.5px; }
.tip .src a { display: block; margin-top: 2px; word-break: break-word; }
.tip .pin-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.tip-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }

/* ---------- Generator ---------- */
.generator { max-width: 760px; margin: 48px auto 24px; padding: 0 16px; text-align: center; }
.generator h2 { font-family: "Unbounded", sans-serif; font-size: clamp(20px, 3vw, 28px); margin: 0 0 6px; }
.generator p { color: var(--muted); margin: 0 0 14px; }
.generator button { font-size: 16px; padding: 12px 20px; background: var(--copper); color: #fff; border-color: transparent; }
.generator button:hover { color: #fff; filter: brightness(1.08); border-color: transparent; }
.gen-out {
  min-height: 60px; margin: 18px 0 8px; padding: 16px 18px; border-radius: 16px;
  background: var(--surface); border: 1px dashed var(--line); font-size: 18px; text-align: left;
}
.gen-out:empty { display: none; }
.gen-out cite { display: block; font-style: normal; color: var(--muted); font-size: 13px; margin-top: 6px; }
.gen-disclaimer { font-size: 12px; }

/* ---------- Language switch ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.topbar .kicker { margin: 0; }
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); flex: none; }
.langs a { padding: 5px 12px; font-size: 13px; font-weight: 800; text-decoration: none; color: var(--muted); }
.langs a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.langs a:not([aria-current]):hover { color: var(--sea); }
footer .langs { margin-top: 8px; }

/* ---------- People also ask ---------- */
.asks { max-width: 1100px; margin: 40px auto 0; padding: 0 16px; }
.asks h2, .chrono h2 { font-family: "Unbounded", sans-serif; font-size: clamp(20px, 3vw, 28px); margin: 0 0 14px; }
.asks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ask { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.ask h3 { font-size: 16px; line-height: 1.3; margin: 0 0 6px; }
.ask h3 span { font-size: 13px; margin-right: 2px; }
.ask p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Chronology (text version) ---------- */
.chrono { max-width: 1100px; margin: 40px auto 0; padding: 0 16px; }
.chrono summary { cursor: pointer; list-style: none; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 16px; background: var(--surface); }
.chrono summary::-webkit-details-marker { display: none; }
.chrono summary h2 { display: inline; margin: 0; font-size: clamp(16px, 2.4vw, 20px); }
.chrono summary h2::before { content: "▸ "; color: var(--copper); }
.chrono details[open] summary h2::before { content: "▾ "; }
.chrono summary .section-lede { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.chrono details > h2 { margin-top: 28px; font-size: 20px; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 16px; }
.ch-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sea); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.ch-item.ch-overdue { border-left-color: var(--red); }
.ch-item.ch-moved { border-left-color: var(--orange); }
.ch-item h3 { font-size: 15px; margin: 0 0 4px; }
.ch-item p { margin: 0 0 6px; }
.ch-item blockquote { margin: 0 0 6px; padding: 4px 10px; border-left: 3px solid var(--copper); font-style: italic; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.ch-meta, .ch-note { color: var(--muted); font-size: 13px; }
.ch-src { font-size: 12.5px; color: var(--muted); }
.chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.chip-overdue { background: var(--red-soft); color: var(--red); }
.chip-moved { background: rgba(232, 137, 28, .15); color: var(--orange); }
.chip-waiting { background: rgba(26, 160, 200, .15); color: var(--sea); }
.ch-list { padding-left: 18px; font-size: 14px; }
.ch-list li { margin-bottom: 8px; }
.ch-list .ch-src { display: block; }

/* ---------- 404 ---------- */
.nf { max-width: 640px; margin: 0 auto; padding: 80px 16px; text-align: center; }
.nf-code { font-family: "Unbounded", sans-serif; font-size: 96px; font-weight: 900; color: var(--copper); margin: 0; line-height: 1; }
.nf h1 { font-size: 32px; margin: 12px 0; }

footer { max-width: 1100px; margin: 32px auto 0; padding: 24px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .hero-inner { padding: 32px 16px 44px; }
  .lede { font-size: 16px; }
  .stat b { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
