:root {
  color-scheme: light;
  --ink: #17201a;
  --muted: #68736f;
  --line: #dfe4df;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --accent: #1f7a5b;
  --accent-strong: #145942;
  --coral: #d8614b;
  --gold: #c99a2e;
  --shadow: 0 18px 40px rgba(23, 32, 26, 0.1);
  --radius: 8px;
  font-family:
    Inter, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(31, 122, 91, 0.06), transparent 420px),
    var(--paper);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(223, 228, 223, 0.8);
  background: rgba(251, 250, 246, 0.88);
  backdrop-filter: blur(18px);
}

.header-inner,
.hero-inner,
.toolbar-inner,
.article-section,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
}

.brand-title,
.brand-subtitle {
  display: block;
  line-height: 1.15;
}

.brand-title {
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-links a {
  text-decoration: none;
}

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

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.site-header.is-menu-open .menu-button span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.is-menu-open .menu-button span:nth-child(2) {
  opacity: 0;
}

.site-header.is-menu-open .menu-button span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: min(620px, calc(100vh - 68px));
  border-bottom: 1px solid var(--line);
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 12, 38, 0.86) 0%, rgba(7, 24, 72, 0.72) 48%, rgba(5, 21, 56, 0.54) 100%),
    url("https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=1800&q=82")
      center / cover;
  transform: scale(1.02);
}

.hero-inner {
  position: relative;
  display: grid;
  min-height: min(620px, calc(100vh - 68px));
  align-content: center;
  padding: 88px 0 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #68d8ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero h1 span {
  display: block;
}

.lead {
  max-width: 600px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.85;
}

.progress-block {
  display: grid;
  width: min(460px, 100%);
  gap: 12px;
  margin-top: 44px;
  padding: 18px;
  border: 1px solid rgba(223, 228, 223, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(2, 8, 28, 0.25);
}

.progress-block > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.progress-label,
.progress-total {
  color: var(--muted);
  font-size: 0.92rem;
}

#read-count {
  color: var(--accent-strong);
  font-size: 2rem;
  line-height: 1;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5ff 0%, #2563eb 50%, #22d3ee 100%);
  transition: width 420ms ease;
}

.toolbar {
  padding: 44px 0 18px;
}

.toolbar-inner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
}

.filters {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.filter-button {
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-button.is-active {
  background: var(--ink);
  color: #fff;
}

.article-section {
  padding: 10px 0 80px;
}

.article-grid {
  display: grid;
  gap: 46px;
}

.level-group {
  display: grid;
  gap: 16px;
}

.level-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.level-heading span {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.level-heading h3 {
  margin: 0;
  color: #35413b;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.article-card {
  display: grid;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid rgba(223, 228, 223, 0.94);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(23, 32, 26, 0.03);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.article-card:hover {
  border-color: rgba(31, 122, 91, 0.34);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.article-card.is-coming {
  color: #7b837f;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14) 0,
      rgba(255, 255, 255, 0.14) 2px,
      transparent 2px,
      transparent 13px
    ),
    linear-gradient(135deg, #071544 0%, #082a75 54%, #05365f 100%);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 10px;
  object-fit: contain;
  transition: transform 360ms ease;
}

.article-card:hover .thumb img {
  transform: scale(1.02);
}

.card-open {
  display: block;
  color: inherit;
  text-decoration: none;
}

.day-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  align-items: center;
  padding: 0 12px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 6px;
  background: #ffe15a;
  color: #071544;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.read-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #073663;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(7, 21, 68, 0.24);
}

.thumbnail-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.13) 0,
      rgba(255, 255, 255, 0.13) 2px,
      transparent 2px,
      transparent 13px
    ),
    linear-gradient(135deg, #071544 0%, #082a75 54%, #05365f 100%);
}

.thumbnail-fallback span {
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 900;
}

.card-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

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

.card-body h3 {
  min-height: 4.65em;
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.title-link:hover {
  color: var(--accent-strong);
}

.read-toggle {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #c8d4df;
  border-radius: 6px;
  background: #fff;
  color: #68736f;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.read-toggle:hover {
  border-color: #0ea5ff;
  color: #073663;
  transform: translateY(-1px);
}

.read-toggle.is-read {
  border-color: rgba(14, 165, 255, 0.38);
  background: #e8f7ff;
  color: #075985;
}

.check-mark {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1;
}

.read-toggle:not(.is-read) .check-mark {
  color: transparent;
  border-color: #a8b3bd;
}

.coming-label {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #d7ded8;
  border-radius: 6px;
  color: #8b948f;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 900px) {
  .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-media {
    background:
      linear-gradient(180deg, rgba(4, 12, 38, 0.9) 0%, rgba(7, 24, 72, 0.76) 52%, rgba(5, 21, 56, 0.58) 100%),
      url("https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=1100&q=82")
        center / cover;
  }
}

@media (max-width: 680px) {
  .header-inner,
  .hero-inner,
  .toolbar-inner,
  .article-section,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .header-inner {
    position: relative;
    min-height: 62px;
  }

  .menu-button {
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    width: min(220px, calc(100vw - 24px));
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 34px rgba(7, 21, 68, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity 160ms ease,
      transform 160ms ease;
    visibility: hidden;
  }

  .site-header.is-menu-open .nav-links {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }

  .nav-links a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--ink);
  }

  .hero,
  .hero-inner {
    min-height: 560px;
  }

  .hero-inner {
    padding: 60px 0 46px;
  }

  .toolbar-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .filters {
    width: 100%;
    justify-content: space-between;
  }

  .filter-button {
    flex: 1;
    padding: 0 10px;
  }

  .level-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .level-heading h3 {
    text-align: left;
  }

  .level-grid {
    grid-template-columns: 1fr;
  }

  .card-body h3 {
    min-height: auto;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
