/* Tokens */

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft-line: #f1f5f9;
  --accent: #0f172a;
  --link: #0e7490;
  --cyan: #67e8f9;
  --blue: #93c5fd;
  --pink: #f9a8d4;
  --violet: #c4b5fd;
  --rss: #94a3b8;
  --action: #ec4899;
  --action-hover: #be185d;
  --list-marker: #94a3b8;
  --wave-blue: #4989e8;
  --wave-violet: #6159da;
  --wave-pink: #ff54ad;
  --font-title: clamp(2rem, 5vw, 3rem);
  --font-section: 1.35rem;
  --font-label: 0.875rem;
  --font-rss: 1rem;
  --font-action: 0.875rem;
  --font-body: 1rem;
  --icon-label: 0.625rem;
  --icon-section: 0.625rem;
  --icon-title: 1.5rem;
  --icon-feed: 1.5rem;
}

/* Base */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

a {
  color: var(--link);
}

/* Layout */

.wrap {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
}

/* Header */

.site-header,
.episode-header {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--line);
}

.waveform {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 80px;
  pointer-events: none;
  color: var(--wave-blue);
}

.site-header .wrap,
.episode-header .wrap {
  position: relative;
}

.episode-date,
.meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Accent icons */

h1[class^="icon-"],
h1[class*=" icon-"],
h2[class^="icon-"],
h2[class*=" icon-"] {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1[class^="icon-"]::before,
h1[class*=" icon-"]::before,
h2[class^="icon-"]::before,
h2[class*=" icon-"]::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
}

h1[class^="icon-"]::before,
h1[class*=" icon-"]::before {
  width: var(--icon-title);
  height: var(--icon-title);
}

h2[class^="icon-"]::before,
h2[class*=" icon-"]::before {
  width: var(--icon-section);
  height: var(--icon-section);
}

.icon-about::before {
  background:
    linear-gradient(var(--pink), var(--pink)) right bottom / 31% 100% no-repeat,
    linear-gradient(var(--violet), var(--violet)) left bottom / 31% 72% no-repeat;
  border-radius: 2px;
}

.icon-listen::before {
  background:
    linear-gradient(var(--blue), var(--blue)) right bottom / 31% 100% no-repeat,
    linear-gradient(var(--violet), var(--violet)) left bottom / 31% 67% no-repeat;
  border-radius: 2px;
}

.icon-sponsors::before {
  width: calc(var(--icon-section) * 0.4);
  height: var(--icon-section);
  background: var(--cyan);
  border-radius: 0 999px 999px 0;
}

/* Typography */

h1,
h2 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-size: var(--font-title);
}

h2 {
  font-size: var(--font-section);
}

.site-description,
.episode-summary {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.feed-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--text);
  font-size: var(--font-rss);
  font-weight: 500;
  text-decoration: none;
}

.feed-link::before {
  content: "";
  width: var(--icon-feed);
  height: var(--icon-feed);
  border-radius: 6px;
  background:
    radial-gradient(circle at 28% 72%, var(--surface) 0 2px, transparent 2.6px),
    radial-gradient(circle at 28% 72%, transparent 0 6px, var(--surface) 6.8px 8.4px, transparent 9.2px),
    radial-gradient(circle at 28% 72%, transparent 0 11px, var(--surface) 11.8px 14px, transparent 14.8px),
    var(--rss);
}

/* Home episode list */

.home-sections {
  padding: 32px 0 56px;
}

.home-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.home-section:last-child {
  border-bottom: 0;
}

.section-heading {
  margin-bottom: 18px;
}

.episode-card {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.episode-card.compact {
  padding: 32px 0;
}

.episode-card:last-child {
  border-bottom: 0;
}

.episode-card h2 a,
.episode-card h3 a,
.feature-card h3 a {
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.episode-title-link {
  text-decoration: none;
}

.episode-title-link:hover,
.episode-title-link:focus {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.episode-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0 0;
  font-size: var(--font-action);
  font-weight: 700;
  line-height: 1.5;
}

.episode-actions a {
  color: var(--action);
  text-decoration: none;
}

.episode-actions a:hover,
.episode-actions a:focus {
  color: var(--action-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

h3 {
  margin: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Feature and archive lists */

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

.feature-grid {
  display: grid;
}

.feature-card {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.feature-card p:last-child,
.episode-card.compact p:last-child {
  margin-bottom: 0;
}

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

.archive-group {
  border-bottom: 1px solid var(--line);
}

.archive-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}

.archive-group summary::-webkit-details-marker {
  display: none;
}

.archive-group summary::marker {
  content: "";
}

.archive-title {
  color: var(--text);
  font-weight: 700;
}

.archive-range {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.archive-toggle-icon svg {
  transition: transform 160ms ease;
}

/* CSS only reflects the browser-owned native details state here. */
.archive-group[open] .archive-toggle-icon svg {
  transform: rotate(180deg);
}

.archive-episodes {
  margin: 0;
  padding: 0 0 32px;
  list-style: none;
}

.archive-episodes li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid rgba(222, 217, 207, 0.6);
}

.archive-episodes a {
  color: var(--text);
  text-decoration: none;
}

.feature-card h3 a:hover,
.feature-card h3 a:focus,
.archive-episodes a:hover,
.archive-episodes a:focus {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.feature-card h3 a {
  text-decoration: none;
}

.archive-episodes span {
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

audio {
  width: 100%;
  margin-top: 12px;
}

/* Episode page */

.episode-body {
  padding: 32px 0 64px;
}

.episode-body h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-label);
  font-weight: 500;
  line-height: 2;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.episode-body > h2::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: calc(var(--icon-section) * 0.4);
  height: var(--icon-section);
  background: var(--violet);
  border-radius: 0 999px 999px 0;
}

.episode-body > h2:nth-of-type(2n)::before {
  background: var(--cyan);
}

.episode-body ul {
  padding-left: 0;
  list-style: none;
}

.episode-body li {
  position: relative;
  padding-left: 1.2rem;
}

.episode-body li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--list-marker);
  font-weight: 400;
}

.transcript-link {
  margin-top: 32px;
}

.transcript-body h1 {
  font-size: 1.8rem;
  margin-bottom: 24px;
}

/* Shared notices */

.site-ads {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-ads h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: var(--text);
  font-size: var(--font-label);
  font-weight: 500;
  line-height: 2;
}

.site-ads h2::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: calc(var(--icon-section) * 0.4);
  height: var(--icon-section);
  background: var(--cyan);
  border-radius: 0 999px 999px 0;
}

.site-ads p,
.site-ads ul {
  margin: 0 0 12px;
}

.site-ads ul {
  padding-left: 0;
  list-style: none;
}

.site-ads li {
  position: relative;
  padding-left: 1.2rem;
}

.site-ads li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--list-marker);
  font-weight: 400;
}

/* Navigation */

.episode-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.episode-nav.top {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin-top: 20px;
  padding-top: 0;
  border-top: 0;
}

.episode-nav.top a {
  max-width: none;
  white-space: nowrap;
}

.episode-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 48%;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.episode-nav a > span:not(.nav-icon) {
  min-width: 0;
}

.episode-nav a > span:first-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.episode-nav.top a {
  gap: 0.4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.episode-nav a:hover,
.episode-nav a:focus {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 999px;
  background: var(--action);
}

.nav-icon svg {
  width: 0.5rem;
  height: 0.5rem;
  fill: none;
  stroke: var(--surface);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Responsive */

@media (max-width: 640px) {
  .archive-group summary,
  .archive-episodes li,
  .episode-nav:not(.top) {
    display: block;
  }

  .archive-group summary small,
  .archive-episodes span {
    display: block;
    max-width: none;
  }

  .archive-group summary .archive-title {
    display: block;
  }

  .archive-group summary .archive-range {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin-top: 2px;
  }

  .episode-nav:not(.top) a {
    display: flex;
    max-width: none;
  }

  .archive-episodes span {
    margin-top: 2px;
  }

  .episode-nav:not(.top) a + a {
    margin-top: 12px;
  }
}
