:root {
  color-scheme: light;
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #20313a;
  --muted: #66757d;
  --paper: #fffdf7;
  --page: #f7f1e3;
  --blue: #2b6f89;
  --blue-dark: #1f5368;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

.catalog-shell {
  width: min(1040px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(26px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
}

.catalog-header {
  margin-bottom: 24px;
}

.eyebrow,
.story-level {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1.08;
}

.catalog-header > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.story-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 3px solid white;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 7px 22px rgb(69 67 57 / 15%);
}

.story-thumbnail {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.story-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  justify-content: flex-start;
  padding: 20px;
}

.story-details h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.1;
}

.story-description {
  flex: 1;
  margin: 9px 0 18px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.45;
}

.read-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 12px 24px;
  border-radius: 16px;
  background: var(--blue);
  box-shadow: 0 3px 0 var(--blue-dark);
  color: white;
  font-size: 21px;
  font-weight: 800;
  text-decoration: none;
  touch-action: manipulation;
}

.read-button:focus-visible {
  outline: 4px solid #f2c94c;
  outline-offset: 4px;
}

.read-button:active {
  box-shadow: none;
  transform: translateY(2px);
}

.loading-message,
.catalog-error {
  padding: 28px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--muted);
  font-size: 18px;
}

.catalog-error {
  color: #7a3e31;
}

@media (max-width: 720px) {
  .story-grid {
    grid-template-columns: 1fr;
  }
}
