:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #626b74;
  --paper: #f3f4f1;
  --panel: #ffffff;
  --line: #d9ded8;
  --red: #ef0903;
  --teal: #07756f;
  --gold: #c99b2e;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(74px + var(--safe-bottom));
}

.app-topbar {
  align-items: center;
  background: rgba(243, 244, 241, .94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: calc(58px + var(--safe-top));
  padding: calc(.55rem + var(--safe-top)) 1rem .55rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand,
.topbar-actions,
.bottom-nav,
.article-meta,
.story-actions,
.tag-row,
.account-actions,
.feature-row {
  align-items: center;
  display: flex;
}

.brand {
  gap: .6rem;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--red);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 38px;
  font-size: 1.2rem;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  line-height: 1;
  object-fit: contain;
  overflow: hidden;
}

.brand-copy {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: .9;
  text-transform: uppercase;
}

.brand-copy small {
  color: var(--red);
  display: block;
  font-size: .6rem;
  letter-spacing: .08em;
}

.topbar-actions {
  gap: .55rem;
}

.icon-button,
.avatar-link,
.bottom-nav button,
.share-button {
  appearance: none;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.icon-button,
.avatar-link {
  background: var(--panel);
  border-radius: 999px;
  display: grid;
  height: 38px;
  place-items: center;
  width: 38px;
}

.avatar-link {
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
}

.app-main {
  margin: 0 auto;
  max-width: 760px;
  padding: .9rem .9rem 0;
}

.hero-strip {
  border-bottom: 3px solid var(--ink);
  display: grid;
  gap: .45rem;
  padding: .45rem 0 .9rem;
}

.eyebrow {
  color: var(--red);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .08em;
  margin: 0;
  text-transform: uppercase;
}

.hero-strip h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 14vw, 4.2rem);
  line-height: .9;
  margin: 0;
}

.hero-strip p:last-child {
  color: var(--muted);
  font-size: .95rem;
  font-weight: 700;
  margin: 0;
}

.status-panel {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: .85rem;
  margin-top: 1rem;
  padding: .9rem;
}

.status-panel[hidden],
.article-list[hidden],
.account-panel[hidden],
.toast[hidden] {
  display: none;
}

.loader {
  animation: spin .85s linear infinite;
  border: 3px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  height: 24px;
  width: 24px;
}

.article-list {
  display: grid;
  gap: .8rem;
  margin-top: 1rem;
}

.story-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: .7rem;
  overflow: hidden;
  text-decoration: none;
}

.story-card img {
  aspect-ratio: 16 / 10;
  background: #d9ded8;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.story-body {
  display: grid;
  gap: .55rem;
  padding: 0 .85rem .85rem;
}

.article-meta {
  color: var(--muted);
  flex-wrap: wrap;
  font-size: .72rem;
  font-weight: 900;
  gap: .45rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.article-meta .dot {
  background: var(--red);
  border-radius: 50%;
  height: 5px;
  width: 5px;
}

.story-card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 7vw, 2rem);
  line-height: 1.03;
  margin: 0;
}

.story-card p {
  color: var(--muted);
  font-size: .95rem;
  font-weight: 600;
  margin: 0;
}

.story-actions {
  justify-content: space-between;
  margin-top: .15rem;
}

.read-link {
  color: var(--red);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.share-button {
  background: #f8f8f6;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 900;
  padding: .42rem .7rem;
  text-transform: uppercase;
}

.tag-row {
  flex-wrap: wrap;
  gap: .35rem;
}

.tag-row span,
.account-chip {
  background: #f8f8f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  padding: .22rem .52rem;
}

.empty-state,
.account-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 1rem;
  padding: 1rem;
}

.account-panel {
  display: grid;
  gap: .9rem;
}

.account-panel h2,
.empty-state h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1;
  margin: 0;
}

.account-panel p,
.empty-state p {
  color: var(--muted);
  margin: 0;
}

.account-actions {
  flex-wrap: wrap;
  gap: .6rem;
}

.primary-action,
.secondary-action {
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
  padding: .68rem .9rem;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-action {
  background: var(--red);
  color: #ffffff;
}

.secondary-action {
  background: #f8f8f6;
  border: 1px solid var(--line);
}

.feature-row {
  border-top: 1px solid var(--line);
  justify-content: space-between;
  padding-top: .75rem;
}

.feature-row strong {
  display: block;
}

.feature-row span {
  color: var(--muted);
  font-size: .8rem;
}

.bottom-nav {
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  bottom: 0;
  gap: .45rem;
  justify-content: space-around;
  left: 0;
  padding: .5rem .7rem calc(.5rem + var(--safe-bottom));
  position: fixed;
  right: 0;
  z-index: 25;
}

.bottom-nav button {
  background: transparent;
  border-color: transparent;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  flex: 1 1 0;
  font-size: .72rem;
  font-weight: 900;
  gap: .2rem;
  max-width: 180px;
  min-height: 50px;
  place-items: center;
  text-transform: uppercase;
}

.bottom-nav button.active {
  background: #111111;
  color: #ffffff;
}

.toast {
  background: #111111;
  border-radius: 8px;
  bottom: calc(86px + var(--safe-bottom));
  color: #ffffff;
  font-size: .88rem;
  font-weight: 800;
  left: 1rem;
  padding: .7rem .85rem;
  position: fixed;
  right: 1rem;
  z-index: 40;
}

.offline-shell {
  display: grid;
  gap: .8rem;
  margin: 0 auto;
  max-width: 420px;
  min-height: 100vh;
  padding: calc(2rem + var(--safe-top)) 1rem calc(2rem + var(--safe-bottom));
  place-content: center;
}

.offline-shell h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  line-height: .95;
  margin: 0;
}

.offline-shell p {
  color: var(--muted);
  margin: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 760px) {
  .article-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-card:first-child {
    grid-column: 1 / -1;
  }

  .story-card:first-child h2 {
    font-size: 2.4rem;
  }
}