*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
}

body {
  background-color: #EDE8DC;
  color: #1C1C1A;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.5rem 5rem;
}

.page {
  max-width: 660px;
  width: 100%;
}

/* ── Mac window chrome ── */

.window {
  border: 2px solid #1C1C1A;
  margin-bottom: 2.5rem;
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #1C1C1A;
}

/* Horizontal stripe pattern — classic Mac window decoration */
.window-titlebar::before,
.window-titlebar::after {
  content: '';
  flex: 1;
  height: 11px;
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 1px,
    #1C1C1A 1px,
    #1C1C1A 2px
  );
}

.window-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0 0.4rem;
}

.window-body {
  padding: 0.55rem 1rem;
  font-size: 0.75rem;
  color: #666;
  letter-spacing: 0.02em;
}

/* ── Date bar ── */

.date-bar {
  font-size: 0.78rem;
  color: #555;
  margin-bottom: 2.5rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed #1C1C1A;
  letter-spacing: 0.02em;
}

/* ── Story ── */

.story {
  display: flex;
  flex-direction: column;
}

.headline {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 2rem;
}

.summary {
  font-size: 1rem;
  line-height: 1.95;
}

.summary p {
  margin-bottom: 1.3rem;
}

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

/* ── Pull quote — boxed, like an old Mac dialog ── */

blockquote {
  margin: 2.2rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid #1C1C1A;
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.7;
  position: relative;
}

blockquote::before {
  content: '"';
  font-size: 2.5rem;
  line-height: 1;
  font-style: normal;
  position: absolute;
  top: 0.3rem;
  left: 0.7rem;
  opacity: 0.18;
}

/* ── Source footer ── */

.story-footer {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-top: 2.8rem;
  padding-top: 1.2rem;
  border-top: 2px solid #1C1C1A;
  font-size: 0.82rem;
}

.source-label {
  font-size: 0.82rem;
  color: #666;
  flex-shrink: 0;
}

.source-link {
  color: #1C1C1A;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-link:hover {
  background-color: #1C1C1A;
  color: #EDE8DC;
}

.pub-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
}

/* ── Loading state — blinking cursor ── */

.loading {
  font-style: italic;
  color: #888;
  font-size: 0.9rem;
}

.loading::after {
  content: '█';
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Error ── */

.error-msg {
  font-style: italic;
  color: #888;
  font-size: 0.9rem;
}

/* ── Responsive ── */

@media (max-width: 520px) {
  html {
    font-size: 15px;
  }

  .headline {
    font-size: 1.5rem;
  }

  body {
    padding: 1.5rem 1rem 4rem;
  }

  .window-titlebar {
    padding: 0.45rem 0.6rem;
  }
}
