:root {
  --paper: #fbfcfd;
  --ink: #141414;
  --muted: #5f6670;
  --line: #dce3e8;
  --soft: #eef4f7;
  --accent: #1f6fb2;
  --accent-soft: rgba(31, 111, 178, 0.1);
  --glow: rgba(25, 164, 201, 0.2);
  --green: #1f6f7a;
  --gold: #a77b24;
  --max: 1180px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(240, 249, 252, 0.78) 0%, var(--paper) 22rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 20, 20, 0.022) 1px, transparent 1px),
    linear-gradient(115deg, transparent 0%, transparent 58%, rgba(25, 164, 201, 0.04) 58.2%, transparent 70%);
  background-size: 100% 44px;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

button,
input,
textarea {
  font: inherit;
}

button,
.button-link {
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  background: var(--accent);
  border-color: var(--accent);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  background: var(--ink);
  color: white;
  padding: 0.75rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 0.85rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(31, 111, 178, 0.22);
  box-shadow: 0 10px 28px -28px var(--glow);
}

.wordmark {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wordmark-avatar {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  object-position: 48% 32%;
  border-radius: 8px;
  filter: saturate(0.92);
}

.wordmark-text {
  display: grid;
  gap: 0.06rem;
}

.wordmark-name {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1;
  font-weight: 750;
  text-decoration: none;
}

.wordmark-role {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.15;
  font-weight: 750;
  text-transform: uppercase;
}

.wordmark-affiliation {
  font-size: 0.78rem;
  line-height: 1.15;
}

.wordmark-affiliation a {
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(31, 111, 178, 0.18);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: flex-end;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 160ms ease;
}

.site-nav a:hover {
  color: var(--accent);
}

main {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.home-mast {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3rem);
}

.eyebrow,
.item-kicker {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0;
  font-weight: 700;
}

.mast-copy h1,
.page-intro h1,
.detail h1 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 0.98;
  margin: 0;
}

.mast-copy h1 {
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  max-width: 13ch;
}

.lede,
.page-intro p,
.dek {
  color: #3b3b37;
  font-size: clamp(1.25rem, 2vw, 1.95rem);
  line-height: 1.45;
  max-width: 720px;
}

.identity-line {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 620px;
  margin-top: 1.75rem;
  color: var(--muted);
}

.identity-line img {
  width: 4.6rem;
  height: 4.6rem;
  object-fit: cover;
  object-position: 48% 32%;
  border-radius: 8px;
  filter: saturate(0.9);
}

.section-heading,
.page-intro,
.admin-heading {
  padding: 2.1rem 0 1rem;
  border-top: 1px solid var(--line);
}

.heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2,
.section-heading h1,
.page-intro h1,
.admin-heading h1,
.admin-wrap h1 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  line-height: 1.08;
  font-weight: 750;
  margin: 0;
}

.source-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.source-filter a,
.source-profile-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1;
  padding: 0.48rem 0.72rem;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.source-filter a:hover,
.source-filter a.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #11385f, var(--accent));
  color: var(--paper);
  box-shadow: 0 8px 22px -18px var(--glow);
}

.source-profile-link {
  display: inline-flex;
  margin-top: 0.85rem;
  color: var(--accent);
}

.source-profile-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.feed-list {
  display: grid;
  gap: 0;
  padding-bottom: 4rem;
}

.feed-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.25rem);
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
  transition: border-color 160ms ease, transform 160ms ease;
}

.feed-item:hover {
  border-color: rgba(31, 111, 178, 0.42);
}

.feed-item-update {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 0;
}

.feed-item-thread {
  grid-template-columns: minmax(0, 1fr);
}

.feed-item-thread .feed-copy {
  max-width: none;
}

.feed-item-thread .item-kicker,
.detail-thread.detail-source-x .item-kicker {
  font-size: 0.98rem;
  gap: 0.62rem;
}

.feed-item-thread .source-pill,
.detail-thread.detail-source-x .source-pill {
  width: 2rem;
  height: 2rem;
  font-size: 0.82rem;
}

.feed-image {
  min-height: 210px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
}

.feed-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease, filter 260ms ease;
}

.feed-item:hover .feed-image img {
  transform: scale(1.025);
  filter: saturate(1.05);
}

.feed-copy {
  max-width: 900px;
}

.item-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.source-pill {
  display: inline-flex;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.12rem 0.46rem;
  color: var(--ink);
}

.source-kut {
  color: var(--accent);
}

.source-x {
  color: var(--green);
}

.source-youtube {
  color: #8f2d24;
}

.feed-copy h2,
.admin-row h2 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 2.25rem);
  line-height: 1.12;
  font-weight: 680;
  margin: 0.55rem 0;
}

.feed-copy h2 a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 180ms ease;
}

.feed-copy h2 a:hover {
  background-size: 100% 1px;
  color: #164f82;
}

.feed-copy p {
  color: #3d3d39;
  font-size: 1rem;
  margin: 0 0 0.8rem;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.visually-subtle {
  font-size: 1.15rem;
}

.detail {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 4rem) 0;
}

.detail-header {
  display: grid;
  gap: 1.2rem;
}

.detail h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.detail-image {
  margin: 3rem 0;
}

.detail-image img {
  width: 100%;
  max-height: 640px;
  object-fit: cover;
  border-radius: 8px;
}

figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.6rem;
}

.video-panel {
  margin: 2rem 0 3rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ink);
}

.video-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.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;
}

.audio-panel {
  display: grid;
  gap: 1.2rem;
  margin: 2rem 0 3rem;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.audio-panel h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1;
  margin: 0.25rem 0 0;
}

.custom-audio {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.audio-toggle {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 0.84rem;
  font-weight: 800;
}

.audio-main {
  min-width: 0;
}

.audio-visualizer {
  height: 76px;
  display: grid;
  grid-template-columns: repeat(28, minmax(3px, 1fr));
  align-items: end;
  gap: 4px;
  padding: 0.3rem 0 0.8rem;
}

.audio-visualizer span {
  display: block;
  height: var(--level);
  min-height: 12%;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(to top, var(--green), var(--accent));
  opacity: 0.62;
  transform-origin: bottom;
  transition: height 130ms ease, opacity 160ms ease;
}

.audio-panel.is-playing .audio-visualizer span {
  opacity: 0.9;
}

.audio-scrubber {
  width: 100%;
  accent-color: var(--accent);
}

.audio-time {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.audio-source {
  display: none;
}

.prose,
.thread {
  font-family: var(--serif);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.55;
}

.thread {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.thread-post {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
  scroll-margin-top: 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.thread-number {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 111, 178, 0.72);
  border-radius: 999px;
  color: var(--green);
  font-family: var(--sans);
  font-size: 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(25, 164, 201, 0.06), 0 0 18px -14px var(--glow);
}

.thread-post-time {
  display: block;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.feed-thread-meta,
.thread-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.thread-post-meta {
  margin-bottom: 0.8rem;
}

.post-source-link {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: none;
}

.post-source-link:hover {
  text-decoration: underline;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, min(100%, 460px)));
  gap: 0.75rem;
  margin: 1rem 0;
}

.media-grid img,
.media-grid video,
.media-placeholder {
  border-radius: 8px;
  max-height: 360px;
  width: 100%;
  object-fit: cover;
  background: var(--soft);
}

.media-grid video {
  aspect-ratio: 16 / 9;
}

.feed-thread-preview {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.85rem;
}

.feed-thread-post {
  padding: 1rem 1rem 1rem 1.15rem;
  border: 1px solid rgba(31, 111, 178, 0.16);
  border-left: 3px solid rgba(31, 111, 178, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 32px -32px var(--glow);
}

.feed-thread-post p {
  max-width: 760px;
  margin: 0 0 0.65rem;
  color: #242421;
  font-size: 1rem;
  line-height: 1.55;
}

.feed-thread-post p:last-of-type {
  margin-bottom: 0.35rem;
}

.link-card-list {
  display: grid;
  gap: 0.7rem;
  margin: 0.85rem 0;
}

.link-card {
  display: grid;
  grid-template-columns: minmax(110px, 0.34fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.link-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.link-card img {
  width: 100%;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  background: var(--soft);
}

.link-card-copy {
  display: grid;
  gap: 0.28rem;
  align-content: center;
  padding: 0.85rem;
  min-width: 0;
}

.link-card-source,
.link-card-description {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.link-card strong {
  font-size: 1rem;
  line-height: 1.22;
}

.link-card-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.feed-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, min(100%, 420px)));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.feed-media-grid img,
.feed-media-grid video {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--soft);
}

.feed-media-grid video {
  aspect-ratio: 16 / 9;
}

.media-placeholder {
  display: grid;
  place-items: center;
  padding: 1rem;
  text-decoration: none;
  border: 1px solid var(--line);
}

.two-column,
.contact-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 2rem 0 5rem;
  border-top: 1px solid var(--line);
}

.contact-intro h1 {
  font-family: var(--sans);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 750;
  letter-spacing: 0;
}

.contact-panel a {
  display: grid;
  grid-template-columns: minmax(110px, 0.28fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: color 160ms ease, padding-left 160ms ease;
}

.contact-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-panel strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 3.2vw, 2.6rem);
  font-weight: 650;
  line-height: 1.05;
}

.contact-panel a:hover {
  color: var(--accent);
  padding-left: 0.45rem;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}

.about-hero .page-intro {
  border-top: 0;
}

.portrait {
  margin: 4rem 0 1.5rem;
}

.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 48% 32%;
  border-radius: 8px;
  filter: saturate(0.92) contrast(1.02);
}

.two-column h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
}

.site-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  font-size: 0.9rem;
}

.site-footer a {
  text-decoration: none;
}

.empty-state {
  padding: 3rem 0;
  color: var(--muted);
}

.admin-wrap {
  padding: 3rem 0 5rem;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-list {
  border-top: 1px solid var(--line);
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-actions button {
  padding: 0.55rem 0.75rem;
  background: transparent;
  color: var(--ink);
}

.edit-form {
  display: grid;
  gap: 1rem;
  max-width: 760px;
  padding-top: 2rem;
}

.edit-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.edit-form input,
.edit-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.8rem;
  background: white;
  color: var(--ink);
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.6rem !important;
}

.checkbox-line input {
  width: auto;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 820px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

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

  .source-filter {
    justify-content: flex-start;
  }

  .home-mast {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .custom-audio {
    grid-template-columns: 1fr;
  }

  .audio-toggle {
    width: 100%;
    height: auto;
    min-height: 3rem;
    border-radius: 6px;
  }

  .feed-item,
  .feed-item-update,
  .about-hero,
  .two-column,
  .contact-panel,
  .admin-row {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .contact-panel a {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .thread-post {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .link-card {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
