:root {
  color-scheme: light;
  --bg: #f4f7f4;
  --ink: #12201f;
  --muted: #5b6d69;
  --line: #d9e2dd;
  --surface: #ffffff;
  --accent: #0f766e;
  --accent-2: #b45309;
  --soft: #e8f4f1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 22px;
  background: rgba(244, 247, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand, nav { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 800; }
nav a { color: var(--muted); font-weight: 650; }

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 68px);
  padding: clamp(28px, 6vw, 78px) clamp(18px, 5vw, 72px) 36px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1, h2 { margin: 0; line-height: 1.02; letter-spacing: 0; }
h1 { font-size: clamp(3rem, 8vw, 7rem); max-width: 860px; }
h2 { font-size: clamp(2rem, 5vw, 4rem); }

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.65;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.button, button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 750;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.ghost { background: transparent; }

.signal-panel, .tool-card, .module-card, .book-card, .app-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 32, 31, 0.06);
}

.signal-panel {
  align-self: end;
  padding: 24px;
  min-height: 260px;
}

.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.ad-slot {
  margin: 0 clamp(18px, 5vw, 72px);
  padding: 16px;
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.section {
  padding: 76px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

.section-title { max-width: 780px; margin-bottom: 26px; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.module-card { min-height: 220px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.module-card p { color: var(--muted); line-height: 1.5; }
.library-band { background: #eef6e9; }
.book-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.book-card { overflow: hidden; min-height: 360px; display: flex; flex-direction: column; }
.book-cover {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 16px;
  background: linear-gradient(145deg, #0f766e, #164e63);
  color: white;
  text-align: center;
  font-weight: 850;
}
.book-cover img { width: 100%; height: 230px; object-fit: cover; border-radius: 0; }
.book-body { padding: 14px; display: flex; flex: 1; flex-direction: column; gap: 8px; }
.book-body h3 { margin: 0; font-size: 1rem; line-height: 1.2; }
.book-body p { margin: 0; color: var(--muted); line-height: 1.4; }
.book-actions { margin-top: auto; display: flex; gap: 8px; }
.app-band { background: #f7faf8; }
.app-panel { padding: 22px; align-self: stretch; }
.app-panel span { display: inline-flex; margin-top: 16px; color: var(--accent); font-weight: 850; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 28px; align-items: start; }
.tool-card { padding: 18px; display: grid; gap: 10px; }
label { font-weight: 750; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
}
output { color: var(--muted); line-height: 1.45; }

.offline, .soft-band { background: var(--soft); }
.offline ul { display: grid; gap: 10px; padding-left: 20px; max-width: 820px; }
.download-link[aria-disabled="true"] {
  opacity: 0.68;
  pointer-events: none;
}
.meta-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  color: var(--muted);
}

@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
  nav { width: 100%; justify-content: space-between; }
  .hero, .split { grid-template-columns: 1fr; min-height: auto; }
  .module-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer { flex-direction: column; }
}

@media (max-width: 560px) {
  .book-grid { grid-template-columns: 1fr; }
}
