:root {
  --bg: lab(2.75% 0 0);
  --fg: #f2f2f2;
  --card: lab(7.78% 0 0);
  --muted: lab(15.2% 0 0);
  --muted-fg: lab(66.13% 0 0);
  --border: #2e2e2e;
  --danger: lab(63.7% 60.7 31.3);
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-sans: "Bai Jamjuree", ui-sans-serif, system-ui, sans-serif;
  --shell: 72rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #000;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.nav, .hero, .band, .wrap, .footer {
  width: min(100%, var(--shell));
  max-width: 100%;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  border-right: 1px solid var(--border);
  font-weight: 500;
}

.brand img {
  width: 1.75rem;
  height: 1.75rem;
}

.nav-links {
  display: flex;
  align-items: stretch;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-right: 1px solid var(--border);
}

.nav-links a:hover,
.brand:hover {
  background: var(--muted);
}

.nav-end {
  display: flex;
  align-items: stretch;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: var(--fg);
  color: var(--bg);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-solid {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn-solid:hover:not(:disabled) {
  background: transparent;
  color: var(--fg);
}

.btn-icon {
  width: 2.5rem;
  padding: 0;
  letter-spacing: 0;
  font-size: 1rem;
}

.nav-end .btn {
  border: 0;
  border-left: 1px solid var(--border);
  height: 100%;
}

.hero {
  position: relative;
  min-height: 28rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-admin {
  min-height: 16rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 2px,
      rgba(0, 0, 0, 0.45) 2px 3px
    ),
    radial-gradient(circle at 70% 40%, #3a3a3a 0, transparent 42%),
    linear-gradient(180deg, #1a1a1a, #070707);
  opacity: 0.9;
}

.hero-copy, .hero-card {
  position: relative;
  z-index: 1;
}

.hero-copy {
  padding: 4.5rem 2.5rem 6rem;
}

.kicker {
  margin: 0 0 1rem;
  color: var(--muted-fg);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  line-height: 0.95;
  color: #f2f2f2;
  max-width: 14ch;
}

.hero-card {
  align-self: end;
  background: var(--card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.6rem 1.7rem;
  max-width: 28rem;
  justify-self: end;
  width: 100%;
}

.hero-card p {
  margin: 0 0 1.25rem;
  color: var(--fg);
  font-size: 0.92rem;
}

.band {
  display: flex;
  align-items: stretch;
  min-height: 3.6rem;
  border-bottom: 1px solid var(--border);
}

.band h2 {
  margin: 0;
  padding: 0.95rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--muted);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.band-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.1rem;
  padding: 0.7rem 1.2rem;
  color: var(--muted-fg);
  font-size: 0.82rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.band-meta a { color: var(--fg); }

.wrap { padding: 2rem 1.5rem 2.5rem; }

.prose {
  font-size: 0.98rem;
  color: #e8e8e8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 1.8rem 0 0.7rem;
}

.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin: 0.25rem 0; }
.prose code, .prose pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--muted);
  border: 1px solid var(--border);
}
.prose code { padding: 0.05rem 0.3rem; overflow-wrap: anywhere; word-break: break-word; }
.prose pre {
  padding: 0.9rem 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.prose pre code { border: 0; background: transparent; padding: 0; white-space: inherit; }
.prose a { color: #fff; overflow-wrap: anywhere; }

.source-link {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.claims { padding-top: 0; padding-bottom: 0; min-width: 0; }
.empty { color: var(--muted-fg); padding: 2rem 0; }

.claim {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
  max-width: 100%;
}

.claim.ranked {
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 22rem);
}

.claim > *,
.admin-card > * {
  min-width: 0;
}

.claim-index {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--muted-fg);
}

.claim-body,
.claim-art,
.admin-main,
.admin-art {
  min-width: 0;
  max-width: 100%;
}

.claim-body,
.claim-body h3,
.claim-meta,
.claim-meta a,
.source-link,
.source-link a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.claim-body h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.claim-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0 0 1rem;
  color: var(--muted-fg);
  font-size: 0.78rem;
}

.claim-meta a { color: var(--fg); }

.claim-art {
  margin: 0;
  border: 1px solid var(--border);
  background: #000;
  align-self: start;
  width: 100%;
}

.claim-art a {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.claim-art img {
  width: 100%;
  max-width: 100%;
  height: 16rem;
  object-fit: cover;
  object-position: top;
}

.note {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1rem 1.1rem;
}

.note-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.admin-list { display: grid; gap: 0; padding-top: 0; }

.admin-card {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) minmax(10rem, 16rem);
  gap: 1.2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.admin-rank {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

.admin-rank span {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--muted-fg);
}

.admin-main h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 500;
}

.comment-form label {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

textarea {
  width: 100%;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.8rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  resize: vertical;
  min-height: 7rem;
}

textarea:focus {
  outline: 1px solid var(--fg);
}

.admin-art {
  margin: 0;
  border: 1px solid var(--border);
  overflow: hidden;
}

.admin-art img {
  width: 100%;
  max-width: 100%;
  height: 9rem;
  object-fit: cover;
  object-position: top;
}

.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  color: var(--muted-fg);
  font-size: 0.75rem;
}

.htmx-request .btn-solid { opacity: 0.6; }

@media (max-width: 900px) {
  .nav-inner {
    display: flex;
    flex-wrap: wrap;
    min-height: 0;
  }

  .nav-links {
    display: flex;
    flex: 1 1 100%;
    border-top: 1px solid var(--border);
  }

  .nav-links a {
    flex: 1;
    justify-content: center;
    padding: 0.65rem 0.4rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    border-right: 1px solid var(--border);
  }

  .nav-links a:last-child { border-right: 0; }

  .hero,
  .claim,
  .claim.ranked,
  .admin-card {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hero-copy { padding: 2.25rem 1.15rem 1.4rem; }

  .hero-card {
    justify-self: stretch;
    max-width: none;
    border-left: 0;
  }

  h1 {
    font-size: clamp(2.2rem, 11vw, 3.4rem);
    max-width: none;
  }

  .wrap { padding: 1.25rem 1rem 1.75rem; }

  .claim,
  .admin-card {
    gap: 0.85rem;
    padding: 1.25rem 0;
  }

  .claim-art img { height: 12rem; }

  .claim-index,
  .admin-rank {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }

  .band { flex-direction: column; }
  .band h2 { border-right: 0; border-bottom: 1px solid var(--border); }
  .footer-inner { flex-direction: column; }
}
