:root {
  --graphite: #111214;
  --graphite-soft: #18191d;
  --graphite-line: rgba(252, 250, 243, 0.14);
  --paper: #f2ede3;
  --paper-raised: #fcfaf3;
  --ink: #1a1b1c;
  --muted: #656762;
  --light: #fcfaf3;
  --light-muted: rgba(252, 250, 243, 0.68);
  --terracotta: #d97757;
  --terracotta-dark: #9f4b32;
  --teal: #4fb3a7;
  --warning: #e2b84c;
  --line: rgba(26, 27, 28, 0.15);
  --shadow: 0 24px 60px rgba(40, 31, 23, 0.09);
  --shell: 1180px;
  --radius: 18px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--graphite);
  color: var(--light);
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--paper-raised);
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.clipboard-helper {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - var(--shell)) / 2));
  background: rgba(17, 18, 20, 0.94);
  border-bottom: 1px solid var(--graphite-line);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-lockup img,
.footer-brand img {
  width: 34px;
  height: 34px;
}

.brand-lockup span {
  display: grid;
  line-height: 1.05;
}

.brand-lockup strong {
  font-size: 15px;
  letter-spacing: -0.03em;
}

.brand-lockup strong b {
  color: var(--terracotta);
}

.brand-lockup small {
  margin-top: 5px;
  color: var(--light-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-header nav a,
.header-link {
  color: var(--light-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.header-link:hover,
.header-link:focus-visible {
  color: var(--light);
}

.header-link {
  justify-self: end;
  color: var(--light);
}

.header-link span {
  margin-left: 6px;
  color: var(--terracotta);
}

.hero {
  position: relative;
  min-height: min(720px, calc(100vh - 72px));
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.65fr);
  align-items: center;
  gap: clamp(48px, 8vw, 112px);
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(64px, 10vh, 112px) 24px;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0 24px;
  z-index: -1;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(252, 250, 243, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(252, 250, 243, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to right, black, transparent 82%);
}

.hero-copy {
  max-width: 750px;
}

.eyebrow {
  display: inline-block;
  color: var(--terracotta);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow--dark {
  color: var(--terracotta-dark);
}

.hero h1 {
  max-width: 780px;
  margin: 20px 0 24px;
  font-size: clamp(52px, 7.2vw, 102px);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.hero h1 span {
  display: block;
  color: var(--terracotta);
}

.hero-copy > p {
  max-width: 640px;
  margin: 0;
  color: var(--light-muted);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  background: var(--terracotta);
  color: var(--graphite);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: #e58a69;
}

.button--ghost {
  border-color: var(--graphite-line);
  color: var(--light);
}

.button--ghost:hover,
.button--ghost:focus-visible {
  border-color: rgba(252, 250, 243, 0.4);
}

.issue-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(252, 250, 243, 0.2);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 12%, rgba(217, 119, 87, 0.28), transparent 34%),
    var(--graphite-soft);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.32);
}

.issue-card::after {
  content: "";
  position: absolute;
  top: 28px;
  right: 26px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--terracotta);
  transform: rotate(45deg);
}

.issue-card__top {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border-bottom: 1px solid var(--graphite-line);
  color: var(--light-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.issue-card__top i {
  width: 8px;
  height: 8px;
  margin-right: 2px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(79, 179, 167, 0.1);
}

.issue-card[data-stale="true"] .issue-card__top i {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(226, 184, 76, 0.1);
}

.issue-number {
  display: grid;
  gap: 2px;
  padding: 28px 26px 24px;
}

.issue-number small,
.issue-card dt {
  color: var(--light-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.issue-number strong {
  color: var(--terracotta);
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 1;
}

.issue-card dl {
  margin: 0;
  border-top: 1px solid var(--graphite-line);
}

.issue-card dl div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 14px 26px;
  border-bottom: 1px solid var(--graphite-line);
}

.issue-card dl div:last-child {
  border-bottom: 0;
}

.issue-card dd {
  margin: 0;
  color: var(--light);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.section-shell {
  width: min(calc(100% - 48px), var(--shell));
  margin: 0 auto;
}

.reading-method,
.feed {
  color: var(--ink);
  background: var(--paper);
}

.reading-method {
  padding: clamp(76px, 10vw, 128px) 0;
  border-radius: 34px 34px 0 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.55fr);
  gap: 48px;
  align-items: end;
}

.section-heading h2,
.feed-heading h2 {
  margin: 14px 0 0;
  font-size: clamp(38px, 5vw, 66px);
  letter-spacing: -0.055em;
  line-height: 1;
}

.section-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 18px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 52px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.method-grid article {
  min-height: 220px;
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(252, 250, 243, 0.45);
}

.method-grid article:nth-child(2) {
  transform: translateY(18px);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.method-grid span,
.story-index,
.story-category,
.story-date,
.context-label,
.prompt-label,
.feed-status > span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.method-grid span {
  color: var(--terracotta-dark);
}

.method-grid h3 {
  margin: 50px 0 10px;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.method-grid p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
}

.feed {
  padding: clamp(84px, 10vw, 132px) 0 120px;
}

.feed-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
}

.week-switcher {
  display: grid;
  grid-template-columns: 44px minmax(190px, auto) 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
}

.week-switcher button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.week-switcher button:hover:not(:disabled),
.week-switcher button:focus-visible:not(:disabled) {
  background: var(--graphite);
  color: var(--light);
}

.week-switcher button:disabled {
  color: rgba(26, 27, 28, 0.25);
  cursor: not-allowed;
}

.week-switcher strong {
  padding: 0 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.feed-status {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  align-items: center;
  min-height: 64px;
  margin-top: 42px;
  padding: 12px 18px;
  border-left: 3px solid var(--teal);
  background: rgba(79, 179, 167, 0.08);
}

.feed-status[data-stale="true"] {
  border-left-color: var(--warning);
  background: rgba(226, 184, 76, 0.1);
}

.feed-status > span {
  color: var(--muted);
}

.feed-status p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 30px;
}

.filter-button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--graphite);
  background: var(--graphite);
  color: var(--light);
}

.stories {
  display: grid;
  gap: 18px;
}

.story {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.story[hidden] {
  display: none;
}

.story-main,
.story-context {
  padding: clamp(24px, 3vw, 38px);
}

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

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.story-index {
  color: var(--terracotta-dark);
}

.story-category {
  color: var(--ink);
}

.story-date {
  margin-left: auto;
  color: var(--muted);
}

.story h3 {
  max-width: 720px;
  margin: 24px 0 14px;
  font-size: clamp(24px, 3.1vw, 38px);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.story h3 a {
  text-decoration: none;
}

.story h3 a:hover,
.story h3 a:focus-visible {
  color: var(--terracotta-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.story-summary {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.story-source-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: auto;
  padding-top: 28px;
}

.source-link {
  color: #176c63;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.source-link:hover,
.source-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.story-tag {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
}

.story-context {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(217, 119, 87, 0.1), transparent 50%),
    var(--graphite);
  color: var(--light);
}

.context-label {
  color: var(--terracotta);
}

.context-text {
  margin: 18px 0 0;
  color: var(--light-muted);
  font-size: 16px;
  line-height: 1.7;
}

.action-prompt {
  margin-top: auto;
  padding-top: 26px;
}

.prompt-box {
  padding: 16px;
  border: 1px solid rgba(217, 119, 87, 0.35);
  border-radius: 12px;
  background: rgba(217, 119, 87, 0.09);
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prompt-label {
  color: var(--terracotta);
}

.prompt-type {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(79, 179, 167, 0.13);
  color: #76d3c8;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.prompt-text {
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0 14px;
  color: var(--light-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.copy-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(252, 250, 243, 0.2);
  border-radius: 9px;
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible {
  background: var(--terracotta);
}

.copy-button[data-copied="true"] {
  background: var(--teal);
}

.loading-state,
.empty-state,
.error-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--muted);
  text-align: center;
}

.loading-state span {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(26, 27, 28, 0.16);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.loading-state p,
.empty-state p,
.error-state p {
  max-width: 520px;
  margin: 0;
}

.empty-state strong,
.error-state strong {
  color: var(--ink);
  font-size: 24px;
}

.site-footer {
  width: min(calc(100% - 48px), var(--shell));
  min-height: 180px;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 1.2fr) 1fr;
  gap: 40px;
  align-items: center;
  margin: 0 auto;
  color: var(--light-muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand div {
  display: grid;
}

.footer-brand strong {
  color: var(--light);
}

.footer-brand span {
  font-size: 11px;
}

.site-footer p {
  margin: 0;
  font-size: 12px;
}

.site-footer > a {
  justify-self: end;
  color: var(--light);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-footer > a span {
  color: var(--terracotta);
}

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

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding: 0 20px;
  }

  .site-header nav {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 72px 24px 88px;
  }

  .hero-grid {
    inset: 0 24px;
  }

  .issue-card {
    max-width: none;
    justify-self: stretch;
  }

  .section-heading,
  .method-grid,
  .story {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: 22px;
  }

  .method-grid article:nth-child(2) {
    transform: none;
  }

  .feed-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-date {
    margin-left: 0;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 40px 0;
  }

  .site-footer > a {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  html {
    scroll-padding-top: 64px;
  }

  .site-header {
    height: 64px;
  }

  .header-link {
    font-size: 0;
  }

  .header-link::before {
    content: "Citizen AI";
    font-size: 12px;
  }

  .header-link span {
    font-size: 12px;
  }

  .brand-lockup img {
    width: 30px;
    height: 30px;
  }

  .hero {
    padding-top: 58px;
  }

  .hero h1 {
    font-size: clamp(46px, 15vw, 68px);
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .section-shell,
  .site-footer {
    width: min(calc(100% - 32px), var(--shell));
  }

  .reading-method {
    border-radius: 24px 24px 0 0;
  }

  .method-grid {
    margin-top: 36px;
  }

  .method-grid article {
    min-height: auto;
  }

  .method-grid h3 {
    margin-top: 28px;
  }

  .feed-heading h2,
  .section-heading h2 {
    font-size: 40px;
  }

  .week-switcher {
    width: 100%;
    grid-template-columns: 44px 1fr 44px;
  }

  .feed-status {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .filters {
    flex-wrap: nowrap;
    margin-right: -16px;
    overflow-x: auto;
    padding-right: 16px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter-button {
    flex: 0 0 auto;
  }

  .story-main,
  .story-context {
    padding: 24px 20px;
  }

  .story h3 {
    font-size: 27px;
  }

  .story-source-row,
  .story-tags {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
