:root {
  color-scheme: dark;
  --bg0: #07111f;
  --bg1: #101c33;
  --bg2: #1b2d4f;
  --panel: rgba(10, 16, 30, 0.78);
  --panel-strong: rgba(12, 18, 33, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f3f5fb;
  --muted: #b8bfd1;
  --soft: #8b94aa;
  --accent: #8ff6c6;
  --accent-2: #ffd56a;
  --warn: #ff9b76;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-head: "Avenir Next", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Avenir Next", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(143, 246, 198, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 213, 106, 0.14), transparent 28%),
    radial-gradient(circle at bottom center, rgba(92, 127, 255, 0.2), transparent 36%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 54%, var(--bg2));
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.2;
}

body::before {
  width: 22rem;
  height: 22rem;
  left: -8rem;
  top: 8rem;
  background: rgba(143, 246, 198, 0.3);
}

body::after {
  width: 26rem;
  height: 26rem;
  right: -9rem;
  bottom: -6rem;
  background: rgba(255, 213, 106, 0.22);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

.app {
  min-height: 100vh;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-card,
.gate-card,
.panel,
.post-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 24, 44, 0.88), rgba(6, 11, 20, 0.95));
  box-shadow: 0 30px 85px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.boot-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 28px;
  text-align: center;
}

.boot-kicker,
.eyebrow,
.post-meta,
.status {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}

.boot-title {
  margin-top: 14px;
  font-family: var(--font-head);
  font-size: clamp(2rem, 6vw, 3.3rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(760px, 100%);
  border-radius: 32px;
  padding: clamp(22px, 5vw, 38px);
  display: grid;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.gate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0%, rgba(143, 246, 198, 0.08) 30%, transparent 58%),
    linear-gradient(300deg, transparent 0%, rgba(255, 213, 106, 0.08) 36%, transparent 64%);
  pointer-events: none;
}

.gate-head {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.clock-wrap {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.clock {
  font-family: var(--font-head);
  font-size: clamp(3rem, 12vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
  font-variant-numeric: tabular-nums;
}

.clock-sub {
  max-width: 50ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.pill,
.btn,
.ghost {
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.pill {
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.page-head {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.hero {
  border-radius: 36px;
  padding: clamp(26px, 5vw, 46px);
  background:
    radial-gradient(circle at top right, rgba(255, 213, 106, 0.14), transparent 32%),
    radial-gradient(circle at bottom left, rgba(143, 246, 198, 0.11), transparent 28%),
    linear-gradient(180deg, rgba(15, 22, 40, 0.94), rgba(7, 11, 20, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.42);
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -46% auto;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(143, 246, 198, 0.18), transparent 58%);
  pointer-events: none;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  text-transform: lowercase;
  max-width: 100%;
  text-wrap: balance;
}

.hero-mini {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.9rem;
  justify-self: center;
}

.panel {
  margin-top: 18px;
  border-radius: 30px;
  padding: clamp(20px, 3vw, 28px);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.post-card {
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.07), transparent 32%);
  pointer-events: none;
}

.post-card:hover,
.post-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.28);
}

.post-button {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.post-button:focus-visible {
  outline: 2px solid rgba(143, 246, 198, 0.65);
  outline-offset: -2px;
}

.post-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.post-card h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 2.6vw, 1.75rem);
  letter-spacing: -0.04em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
  color: var(--soft);
  max-width: 100%;
}

.post-action {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(143, 246, 198, 0.12);
  border: 1px solid rgba(143, 246, 198, 0.18);
  color: #d8ffe9;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.post-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--soft);
  font-size: 0.9rem;
}

.post-chevron {
  font-size: 1.2rem;
  color: var(--accent);
}

.empty,
.error {
  border-radius: 20px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 14, 0.7);
  backdrop-filter: blur(16px);
  z-index: 40;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(860px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 213, 106, 0.12), transparent 30%),
    radial-gradient(circle at bottom left, rgba(143, 246, 198, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(17, 24, 43, 0.98), rgba(7, 10, 18, 0.98));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  padding: clamp(22px, 4vw, 34px);
  position: relative;
}

.modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-kicker {
  margin-top: 14px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--soft);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal h2 {
  margin: 14px 0 18px;
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 0.98;
  letter-spacing: -0.08em;
}

.modal-body {
  max-width: 72ch;
  font-size: 1.03rem;
}

.prose {
  position: relative;
  z-index: 1;
  color: var(--text);
  line-height: 1.7;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin: 1.4em 0 0.45em;
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.08rem; }
.prose h5,
.prose h6 {
  font-size: 1rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose blockquote {
  padding: 14px 18px;
  border-left: 3px solid rgba(143, 246, 198, 0.55);
  background: rgba(143, 246, 198, 0.06);
  border-radius: 0 14px 14px 0;
  color: #dcefe4;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.94em;
}

.prose :not(pre) > code,
.prose > code {
  padding: 0.18em 0.42em;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.prose pre {
  overflow: auto;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(4, 9, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.prose pre code {
  display: block;
  white-space: pre;
  color: #d9e4ff;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 246, 198, 0.4);
}

.prose a:hover,
.prose a:focus-visible {
  border-bottom-color: currentColor;
}

.line-granter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  background:
    radial-gradient(circle at top right, rgba(143, 246, 198, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(17, 24, 44, 0.88), rgba(6, 11, 20, 0.95));
}

.btn {
  padding: 13px 18px;
  background: linear-gradient(135deg, rgba(143, 246, 198, 0.2), rgba(255, 213, 106, 0.18));
  color: var(--text);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 10px 30px rgba(143, 246, 198, 0.08);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.line-granter-btn {
  min-width: min(100%, 240px);
  padding: 16px 22px;
  border-radius: 22px;
  border: 1px solid rgba(143, 246, 198, 0.18);
  background:
    linear-gradient(180deg, rgba(143, 246, 198, 0.16), rgba(255, 255, 255, 0.03));
  color: var(--text);
  text-transform: lowercase;
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  justify-content: center;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.line-granter-btn:hover,
.line-granter-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(143, 246, 198, 0.34);
  background:
    linear-gradient(180deg, rgba(143, 246, 198, 0.2), rgba(255, 255, 255, 0.05));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(143, 246, 198, 0.1);
}

.error {
  color: #ffd1c0;
  border-color: rgba(255, 155, 118, 0.36);
  background: rgba(255, 155, 118, 0.08);
}

.loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1080px);
    padding-top: 12px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .ghost {
    width: 100%;
  }

  .modal {
    max-height: 92vh;
    border-radius: 28px;
  }

  .modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
  }
}
