/*
 * Homepage — compact classical layout.
 * The learning path was introduced with modern-only layout rules; these
 * styles give the default classical view a complete, bounded presentation.
 */
body.home-page {
  --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html:not(.view-modern) body.home-page .home-path-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, .65fr);
  gap: 14px;
  margin: 22px 0 42px;
}

html:not(.view-modern) body.home-page .featured-path {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr);
  gap: 22px;
  min-width: 0;
  padding: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: color-mix(in srgb, var(--paper) 95%, white 5%);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 22%, transparent);
}

html:not(.view-modern) body.home-page .featured-path .path-copy {
  min-width: 0;
}

html:not(.view-modern) body.home-page .home-section-kicker {
  margin-bottom: 12px;
  font-size: 9px;
}

html:not(.view-modern) body.home-page .featured-path h2 {
  max-width: 24ch;
  margin: 0 0 12px;
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1.08;
  letter-spacing: -.03em;
}

html:not(.view-modern) body.home-page .featured-path .path-copy > p:not(.home-section-kicker) {
  max-width: 66ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

html:not(.view-modern) body.home-page .path-cta {
  margin-top: 16px;
  font-size: 9px;
}

html:not(.view-modern) body.home-page .path-cta span {
  width: 30px;
  height: 30px;
}

html:not(.view-modern) body.home-page .path-map {
  align-self: center;
}

html:not(.view-modern) body.home-page .path-map li {
  grid-template-columns: 32px 1fr;
  column-gap: 10px;
  padding: 9px 0 10px;
}

html:not(.view-modern) body.home-page .path-map li:not(:last-child)::after {
  left: 15px;
  top: 40px;
}

html:not(.view-modern) body.home-page .path-map li > span {
  width: 32px;
  height: 32px;
  border-radius: 5px;
}

html:not(.view-modern) body.home-page .path-map b {
  font-size: 11px;
}

html:not(.view-modern) body.home-page .path-map em {
  font-size: 8px;
}

html:not(.view-modern) body.home-page .discovery-tip {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 260px;
  padding: 18px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 22%, transparent);
}

html:not(.view-modern) body.home-page .discovery-tip::after {
  content: "";
  position: absolute;
  right: -65px;
  bottom: -65px;
  width: 155px;
  height: 155px;
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 24px color-mix(in srgb, var(--yellow) 6%, transparent),
    0 0 0 48px color-mix(in srgb, var(--yellow) 3%, transparent);
}

html:not(.view-modern) body.home-page .tip-body {
  margin: auto 0;
}

html:not(.view-modern) body.home-page .tip-body p {
  margin-bottom: 16px;
  color: color-mix(in srgb, var(--paper) 84%, transparent);
  font-size: 16px;
  line-height: 1.35;
}

html:not(.view-modern) body.home-page .tip-body a {
  font-size: 9px;
}

/*
 * Discover shelf — bring the site's practical reference library into the
 * homepage journey instead of leaving it behind a single navigation link.
 */
body.home-page .discover-showcase {
  margin: 8px 0 50px;
}

body.home-page .discover-showcase-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

body.home-page .discover-showcase-head > div {
  min-width: 0;
}

body.home-page .discover-showcase-head .home-section-kicker {
  margin-bottom: 10px;
}

body.home-page .discover-showcase-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: .98;
  letter-spacing: -.045em;
}

body.home-page .discover-showcase-head p:not(.home-section-kicker) {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

body.home-page .discover-all {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font: 800 9px/1 var(--font-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

body.home-page .discover-all:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

body.home-page .discover-showcase-grid {
  display: grid;
  grid-template-columns: 1.45fr repeat(3, 1fr);
  gap: 12px;
}

body.home-page .discover-feature-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 300px;
  padding: 20px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  background: color-mix(in srgb, var(--paper) 94%, white 6%);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 15%, transparent);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

body.home-page .discover-feature-card:hover {
  transform: translateY(-5px);
  background: var(--yellow-soft);
  box-shadow: 5px 8px 0 color-mix(in srgb, var(--ink) 16%, transparent);
}

body.home-page .discover-feature-card:focus-visible,
body.home-page .discover-all:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

body.home-page .discover-feature-primary {
  color: var(--paper);
  background:
    radial-gradient(circle at 110% -10%, color-mix(in srgb, var(--yellow) 22%, transparent), transparent 52%),
    var(--ink);
}

body.home-page .discover-feature-primary:hover {
  color: var(--paper);
  background:
    radial-gradient(circle at 110% -10%, color-mix(in srgb, var(--yellow) 34%, transparent), transparent 54%),
    var(--ink);
}

body.home-page .discover-feature-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 42px;
}

body.home-page .discover-feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
  font: 800 17px/1 var(--font-mono);
  transform: rotate(-3deg);
}

body.home-page .discover-feature-count {
  color: var(--ink-faint);
  font: 800 26px/1 var(--font-mono);
  letter-spacing: -.08em;
}

body.home-page .discover-feature-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  font: 700 8px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.home-page .discover-feature-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow) 14%, transparent);
}

body.home-page .discover-feature-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font: 800 8px/1 var(--font-mono);
  letter-spacing: .12em;
}

body.home-page .discover-feature-primary .discover-feature-label {
  color: var(--yellow);
}

body.home-page .discover-feature-card h3 {
  margin: 0 0 11px;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1;
  letter-spacing: -.035em;
}

body.home-page .discover-feature-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

body.home-page .discover-feature-primary p {
  max-width: 45ch;
  color: color-mix(in srgb, var(--paper) 72%, transparent);
}

body.home-page .discover-feature-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--ink);
  font: 800 9px/1 var(--font-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.home-page .discover-feature-primary .discover-feature-action {
  color: var(--paper);
}

body.home-page .discover-feature-action b {
  font-size: 17px;
  transition: transform .18s ease;
}

body.home-page .discover-feature-card:hover .discover-feature-action b {
  transform: translateX(5px);
}

html.view-modern body.home-page .discover-showcase {
  margin-bottom: 66px;
}

html.view-modern body.home-page .discover-showcase-grid {
  gap: 16px;
}

html.view-modern body.home-page .discover-feature-card {
  min-height: 330px;
  padding: 24px;
  border-color: color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--paper) 70%, white 30%);
  box-shadow: 0 16px 42px color-mix(in srgb, var(--ink) 6%, transparent);
}

html.view-modern body.home-page .discover-feature-card:hover {
  background: var(--yellow-soft);
  box-shadow: 0 24px 46px color-mix(in srgb, var(--ink) 11%, transparent);
  transform: translateY(-7px) rotate(-.2deg);
}

html.view-modern body.home-page .discover-feature-primary,
html.view-modern body.home-page .discover-feature-primary:hover {
  border-color: transparent;
  color: #eff8ef;
  background:
    radial-gradient(circle at 110% -10%, rgba(183, 243, 75, .24), transparent 52%),
    #102016;
}

html.view-modern body.home-page .discover-feature-icon {
  border: 0;
  border-radius: 12px;
}

/*
 * Key Papers shelf — a curated four-card reading doorway. The full research
 * index remains on papers.html; this homepage shelf mirrors Discover and Latest.
 */
body.home-page .papers-showcase {
  margin: 58px 0 48px;
}

body.home-page .papers-showcase-head {
  margin-bottom: 20px;
}

body.home-page .papers-showcase-grid {
  grid-template-columns: 1.45fr repeat(3, minmax(0, 1fr));
}

body.home-page .paper-feature-card {
  min-height: 300px;
}

body.home-page .paper-feature-year {
  font-size: 11px;
  letter-spacing: .04em;
}

body.home-page .paper-feature-cite {
  color: var(--ink-faint);
  font: 800 8px/1 var(--font-mono);
  letter-spacing: .09em;
}

html.view-modern body.home-page .papers-showcase {
  margin-top: 66px;
}

html.view-modern body.home-page .paper-feature-card {
  min-height: 330px;
}

/*
 * Latest Archive shelf — the same editorial card language as Discover, with
 * the first item promoted and the remaining three kept compact and scannable.
 */
body.home-page .feed .latest-archive-grid {
  display: grid;
  grid-template-columns: 1.45fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}

html:not(.view-modern) body.home-page .feed-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

body.home-page .feed .latest-article-card {
  min-height: 310px;
}

body.home-page .feed .latest-article-card h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body.home-page .feed .latest-article-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

body.home-page .latest-article-icon {
  font-size: 10px;
  letter-spacing: .04em;
}

body.home-page .latest-article-meta {
  color: var(--ink-faint);
  font: 700 8px/1 var(--font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

body.home-page .discover-feature-primary .latest-article-meta {
  color: color-mix(in srgb, var(--paper) 68%, transparent);
}

html.view-modern body.home-page .feed .latest-archive-grid {
  grid-template-columns: 1.45fr repeat(3, minmax(0, 1fr));
  gap: 16px;
}

html.view-modern body.home-page .feed .latest-article-card {
  grid-column: auto;
  min-height: 330px;
}

@media (max-width: 980px) {
  html:not(.view-modern) body.home-page .home-path-grid {
    grid-template-columns: 1fr;
  }

  html:not(.view-modern) body.home-page .discovery-tip {
    min-height: 210px;
  }

  body.home-page .discover-showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.home-page .papers-showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.home-page .feed .latest-archive-grid,
  html.view-modern body.home-page .feed .latest-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html:not(.view-modern) body.home-page .featured-path {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 17px;
  }

  html:not(.view-modern) body.home-page .featured-path h2 {
    font-size: 24px;
  }

  html:not(.view-modern) body.home-page .feed-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 26px;
  }

  body.home-page .discover-showcase-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  body.home-page .discover-showcase-grid {
    grid-template-columns: 1fr;
  }

  body.home-page .papers-showcase-grid {
    grid-template-columns: 1fr;
  }

  body.home-page .feed .latest-archive-grid,
  html.view-modern body.home-page .feed .latest-archive-grid {
    grid-template-columns: 1fr;
  }

  body.home-page .discover-feature-card,
  html.view-modern body.home-page .discover-feature-card,
  body.home-page .paper-feature-card,
  html.view-modern body.home-page .paper-feature-card,
  body.home-page .feed .latest-article-card,
  html.view-modern body.home-page .feed .latest-article-card {
    min-height: 270px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page .discover-feature-card,
  body.home-page .discover-feature-action b,
  body.home-page .discover-all {
    transition: none;
  }
}

/* This Week in AI — homepage editorial briefing */
  .week-ai {
    --week-bg: #102017;
    --week-panel: #172b20;
    --week-line: rgba(239, 247, 241, 0.17);
    --week-text: #f2f7f3;
    --week-muted: #b5c4b9;
    --week-signal: #c5f36b;
    --week-warm: #ff8063;
    position: relative;
    overflow: hidden;
    margin: 22px 0 30px;
    color: var(--week-text);
    background:
      radial-gradient(circle at 88% 12%, rgba(197, 243, 107, 0.1), transparent 27%),
      var(--week-bg);
    border: 1px solid #09150f;
    border-radius: 10px;
    box-shadow: 7px 7px 0 rgba(16, 32, 23, 0.12);
  }
  .week-ai::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--week-signal) 0 42%, var(--week-warm) 42% 68%, #78a8ff 68%);
  }
  .week-ai-topline {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 24px 15px;
    border-bottom: 1px solid var(--week-line);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  .week-ai-edition,
  .week-ai-window {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .week-ai-edition { color: var(--week-signal); }
  .week-ai-edition b {
    padding-left: 10px;
    color: var(--week-text);
    border-left: 1px solid var(--week-line);
    font-weight: 600;
  }
  .week-ai-pulse {
    width: 7px;
    height: 7px;
    background: var(--week-signal);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(197, 243, 107, 0.13);
  }
  .week-ai-window { color: var(--week-muted); }
  .week-ai-window span + span {
    padding-left: 10px;
    border-left: 1px solid var(--week-line);
  }
  .week-ai-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
    gap: 34px;
    padding: clamp(24px, 3.2vw, 40px);
  }
  .week-ai-label {
    margin: 0 0 12px;
    color: var(--week-warm);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.11em;
  }
  .week-ai h2 {
    max-width: 680px;
    margin: 0 0 15px;
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.02;
    letter-spacing: -0.035em;
  }
  .week-ai h2 a { color: inherit; text-decoration: none; }
  .week-ai h2 a:hover { color: var(--week-signal); }
  .week-ai-summary {
    max-width: 650px;
    margin: 0;
    color: var(--week-muted);
    font-size: 15px;
    line-height: 1.7;
  }
  .week-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
  }
  .week-ai-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid var(--week-line);
    color: var(--week-text);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
  }
  .week-ai-actions .week-ai-primary {
    color: #102017;
    background: var(--week-signal);
    border-color: var(--week-signal);
  }
  .week-ai-actions a:hover { transform: translateY(-2px); }
  .week-ai-signals {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--week-line);
  }
  .week-ai-signals li {
    display: grid;
    grid-template-columns: 33px 1fr;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--week-line);
  }
  .week-ai-signals > li > span {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    color: var(--week-bg);
    background: var(--week-signal);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
  }
  .week-ai-signals small {
    display: block;
    margin-bottom: 4px;
    color: var(--week-warm);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.09em;
  }
  .week-ai-signals strong {
    display: block;
    color: var(--week-text);
    font-size: 13px;
    line-height: 1.5;
  }
  .week-ai-takeaway {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 15px 24px;
    color: var(--week-text);
    background: var(--week-panel);
    border-top: 1px solid var(--week-line);
    text-decoration: none;
  }
  .week-ai-takeaway span {
    color: var(--week-signal);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
  }
  .week-ai-takeaway strong { font-size: 13px; line-height: 1.45; }
  .week-ai-takeaway i {
    color: var(--week-signal);
    font-size: 20px;
    font-style: normal;
    transition: transform 0.2s ease;
  }
  .week-ai-takeaway:hover i { transform: translateX(4px); }
  .week-ai a:focus-visible {
    outline: 2px solid var(--week-signal);
    outline-offset: 3px;
  }
  html.view-modern .week-ai { border-radius: 22px; box-shadow: 0 18px 48px rgba(11, 26, 17, 0.18); }
  html.view-modern .week-ai-actions a { border-radius: 999px; }
  body.searching .week-ai { display: none; }
  @media (max-width: 780px) {
    .week-ai { margin-top: 18px; box-shadow: 4px 4px 0 rgba(16, 32, 23, 0.12); }
    .week-ai-topline { align-items: flex-start; padding: 17px 18px 14px; }
    .week-ai-window { justify-content: flex-end; flex-wrap: wrap; gap: 6px 9px; text-align: right; }
    .week-ai-window span:first-child { flex-basis: 100%; }
    .week-ai-window span + span { padding-left: 9px; }
    .week-ai-grid { grid-template-columns: 1fr; gap: 30px; padding: 27px 20px 24px; }
    .week-ai h2 { font-size: clamp(30px, 9vw, 39px); }
    .week-ai-takeaway { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 16px 19px; }
    .week-ai-takeaway span { grid-column: 1 / -1; }
  }
  @media (max-width: 480px) {
    .week-ai-topline { display: block; }
    .week-ai-window { justify-content: flex-start; margin-top: 12px; text-align: left; }
    .week-ai-window span:first-child { flex-basis: auto; }
    .week-ai-window span + span { padding-left: 0; border-left: 0; }
    .week-ai-window span + span::before { content: "·"; margin-right: 8px; color: var(--week-signal); }
    .week-ai-actions a { width: 100%; justify-content: center; }
  }

/* Give the homepage resource doorway its own column without affecting other strips. */
body.home-page .explore-strip { grid-template-columns: 1.25fr repeat(5, 1fr); }
@media (max-width: 1050px) {
  body.home-page .explore-strip { grid-template-columns: repeat(2, 1fr); }
  body.home-page .explore-strip > div { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body.home-page .explore-strip { grid-template-columns: 1fr; }
  body.home-page .explore-strip > div { grid-column: auto; }
}
