:root {
  --bg: #f6f6f4;
  --card: #fff;
  --ink: #111;
  --muted: #666;
  --line: #e5e5e5;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: #111;
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus { left: 8px; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 15px; }
.brand-tag { font-size: 11px; font-weight: 500; color: #555; }
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.topbar-nav a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  color: #444;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.topbar-nav a:hover { background: #f0f0f0; color: #111; }
.topbar-nav a.is-on {
  color: #111;
  background: #f0f0f0;
  font-weight: 800;
}
.topbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.lang-switch, .nav-link {
  border: 1px solid #ccc;
  color: #111;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}
.lang-switch:hover, .nav-link:hover { background: #f0f0f0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 20px 16px 48px;
  flex: 1;
  width: 100%;
}

.hero {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  padding: 0;
}
.hero-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: min(62vh, 560px);
  min-height: 240px;
  background: #111;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}
.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: 28px 20px 48px;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}
.hero-phrase {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  max-width: 18em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.hero-nav--prev { left: 10px; }
.hero-nav--next { right: 10px; }
.hero-nav:hover { background: rgba(0,0,0,0.7); }
.hero-dots {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 0;
}
.hero-dot.is-active { background: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  background: #111;
  color: #fff;
  font-family: inherit;
}
.btn:hover { background: #222; }
.btn-on-hero {
  background: rgba(255,255,255,0.92);
  color: #111;
}
.btn-on-hero:hover { background: #fff; }
.btn-secondary {
  background: #fff;
  color: #111;
  border-color: #ccc;
}
.btn-secondary:hover { background: #f0f0f0; }

.section { margin: 28px 0; }
.section h2 {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.phrases {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.phrase {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}
.phrase span { display: block; }

.how {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}
.steps {
  display: grid;
  gap: 12px;
}
.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.step-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.step h3 { margin: 0 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.how-visual {
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 240px;
  max-height: 420px;
}
.how-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pains {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pain {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.pain h3 { margin: 0 0 6px; font-size: 15px; }
.pain p { margin: 0; color: var(--muted); font-size: 14px; }

.worlds {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.world {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.world h3 { margin: 0 0 4px; font-size: 15px; }
.world p { margin: 0; color: var(--muted); font-size: 14px; }

.cta-band {
  background: #111;
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.cta-band h2 {
  margin: 0 0 6px;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  text-transform: none;
  letter-spacing: 0;
  color: #fff;
  font-weight: 800;
}
.cta-band p { margin: 0; color: #cfcfcf; max-width: 36em; }
.cta-band .btn { background: #fff; color: #111; }
.cta-band .btn:hover { background: #eee; }
.cta-band .btn-ghost {
  background: transparent;
  color: #fff;
  border-color: #555;
}
.cta-band .btn-ghost:hover { background: #222; }

.footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
}
.footer img { width: 28px; height: 28px; border-radius: 4px; }

.lib-head h1 {
  margin: 0 0 14px;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 800;
}
.lib-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  color: #333;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 650;
}
.chip:hover { background: #f0f0f0; }
.chip.is-on {
  background: #111;
  color: #fff;
  border-color: #111;
}
.lib-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: lib;
}
.lib-list ol,
ol.lib-list { list-style: none; }
.lib-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.lib-row-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.lib-row-link:hover { border-color: #bbb; background: #fafafa; }
.lib-k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.lib-text {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}
.lib-empty { color: var(--muted); }
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.lib-card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.lib-card:hover { border-color: #bbb; }
.lib-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #ececec;
}
.lib-card .lib-cap {
  display: block;
  padding: 8px 10px 10px;
  font-size: 12px;
  color: #444;
  line-height: 1.3;
}
.lib-detail { max-width: 820px; }
.lib-detail .btn { margin-bottom: 16px; }
.lib-detail h1 {
  margin: 8px 0 8px;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}
.lib-hero {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  height: auto;
  object-fit: contain;
  background: #111;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.lib-body {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0;
  overflow-x: auto;
}

@media (max-width: 800px) {
  .phrases, .pains, .worlds, .how { grid-template-columns: 1fr; }
  .how-visual { max-height: 360px; }
  .brand-tag { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .hero-nav { display: none; }
  .hero-overlay {
    position: static;
    background: #111;
    padding: 16px 16px 18px;
  }
  .hero-phrase {
    font-size: 1.15rem;
    max-width: none;
    text-shadow: none;
  }
  .hero-actions { width: 100%; flex-direction: column; }
  .hero-actions .btn {
    width: 100%;
    background: #fff;
    color: #111;
  }
  .hero-actions .btn:hover { background: #f0f0f0; }
  .hero-actions .btn.btn-on-hero {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.45);
  }
  .hero-actions .btn.btn-on-hero:hover { background: rgba(255,255,255,0.12); color: #fff; }
  .cta-band { padding: 22px 18px; }
  .topbar-nav {
    flex-basis: 100%;
    order: 3;
    padding-top: 2px;
  }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 520px) {
  .topbar-inner { padding: 8px 12px; }
  .nav-link { display: none; }
  .topbar-nav { display: flex; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); }
}
