:root {
  --ground: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #0369a1;
  --accent-hover: #0369a1;
  --accent-pressed: #075985;
  --wash: #f0f9ff;
  --sans: "Plus Jakarta Sans", "Noto Sans Hebrew", "Noto Sans Arabic", "Noto Sans SC", "Noto Sans Devanagari", "Nirmala UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--ground);
  font: 18px/1.5 var(--sans);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
}

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

.wrap {
  width: min(52rem, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

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

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  font-size: 20px;
}

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  direction: ltr;
}

.langs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.langs a[aria-current="true"] {
  color: var(--text);
  font-weight: 700;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

h1 {
  margin: 6px 0 8px;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.slogan {
  margin: 0 0 24px;
  color: var(--muted);
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 12px;
}

.step h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
}

.step p { margin: 0 0 10px; }

.step p:last-child { margin-bottom: 0; }

.face {
  width: 168px;
  height: auto;
  display: block;
  margin: 8px 0 12px;
}

.secrets, .hub {
  display: grid;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.secrets a, .hub a, .play {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.play {
  margin-top: 20px;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
  text-align: center;
}

.play:hover {
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
}

footer {
  margin-top: 56px;
  color: var(--muted);
  font-size: 14px;
}

footer .legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}

footer .legal a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}

.draft,
.operator {
  color: var(--muted);
  font-size: 14px;
}

.cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.4);
}

.cookie-banner[hidden] { display: none; }

.cookie-card {
  width: min(26rem, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 20px 18px;
}

.cookie-card p { margin: 0 0 16px; }

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

.cookie-banner button {
  border-radius: 3px;
  min-height: 40px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cookie-banner .yes {
  border: 0;
  background: var(--accent-hover);
  color: white;
}

.cookie-banner .yes:hover {
  background: var(--accent-pressed);
}

.cookie-banner .later {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
}

.step-guide {
  margin: 0 0 28px;
  padding-top: 8px;
}

.step-guide h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.3;
}

.step-guide h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.35;
}

.step-guide p {
  margin: 0 0 10px;
}

.guide-way {
  margin: 18px 0 8px;
}

.guide-row,
.flower-case {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.guide-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guide-steps b {
  display: block;
  font-size: 18px;
  line-height: 1.3;
}

.guide-steps span {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.iso-cube {
  max-width: 100%;
  height: auto;
}

.crumbs {
  margin: 0 0 16px;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-inline: 8px;
}

.crumbs a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.ad-slot:empty {
  display: none;
}

main h2 {
  margin: 28px 0 8px;
  font-size: 22px;
  line-height: 1.3;
}

article h3 {
  margin: 16px 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.alg {
  margin: 8px 0;
}

.alg code {
  display: inline-block;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 16px;
  background: var(--wash);
  padding: 4px 8px;
  border-radius: 6px;
}

.alg-words {
  margin: 0 0 12px;
  padding-inline-start: 1.25em;
}

.notation-wrap {
  overflow-x: auto;
  margin: 8px 0 16px;
}

.notation {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.notation th,
.notation td {
  border-bottom: 1px solid var(--line);
  text-align: start;
  padding: 6px 8px;
  vertical-align: top;
}

.secret-jump {
  margin: 0 0 8px;
  padding-inline-start: 1.25em;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: 12px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #0369a1;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
