
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #202020;
  --muted: #707070;
  --border: #e5e5e5;
  --reader-size: 19px;
}

body.dark {
  --bg: #171717;
  --surface: #252525;
  --text: #ededed;
  --muted: #aaaaaa;
  --border: #393939;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

.container {
  width: min(1100px, 92%);
  margin: auto;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
}

.logo {
  color: var(--text);
  font-size: 23px;
  font-weight: bold;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 15px;
  border-radius: 8px;
}

button:hover {
  opacity: 0.8;
}

.hero {
  text-align: center;
  padding: 65px 10px;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
}

.hero p {
  color: var(--muted);
}

.story-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 70px;
}

.story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
}

.story-card:hover {
  border-color: #999;
}

.story-card h3 {
  margin-top: 0;
}

.story-card p {
  color: var(--muted);
  line-height: 1.6;
}

.reader {
  max-width: 760px;
  margin: 30px auto 80px;
  padding: 35px;
  background: var(--surface);
  border-radius: 12px;
}

.reader-controls {
  display: flex;
  gap: 10px;
  margin: 25px 0;
}

#storyContent {
  font-size: var(--reader-size);
  line-height: 1.9;
}

#storyContent p {
  margin-bottom: 1.5em;
}

.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  padding: 30px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .reader {
    padding: 20px;
  }

  .hero {
    padding: 40px 10px;
  }
}
