/* Batch 2: shared visual refinements; loaded after the existing page styles. */
:root { --reading-bg: #10231b; --reading-muted: #b2c4b6; }
html { background: var(--reading-bg); }
body.home-site { background: radial-gradient(ellipse at 50% 0, #203e2d 0, #13291e 45%, #10231b 100%); }
a:focus-visible, button:focus-visible { outline: 2px solid #efd38f; outline-offset: 5px; }

/* A shorter introduction lets the featured story share the first screen. */
.home-header { max-width: 1180px; padding: 22px 24px 14px; }
.home-hero { max-width: 900px; padding: 24px 24px 26px; }
.home-hero-label { margin-bottom: 10px; color: #d9c28a; font-size: .65rem; letter-spacing: .16em; }
.home-hero-title { font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.12; margin-bottom: 10px; text-wrap: balance; }
.home-hero-sub { color: #c4d1c5; font-size: .94rem; margin: 0; font-weight: 400; }
.home-welcome-card { justify-content: center; background: none; border: 0; border-radius: 0; margin-top: 9px; padding: 0; min-height: 22px; transform: none; }
.home-welcome-text { text-align: center; font-size: .78rem; font-weight: 400; line-height: 1.5; color: #adc1af; }
.home-welcome-text span { overflow-wrap: anywhere; }
.home-date { color: #b2c4b6; font-size: .72rem; text-transform: none; letter-spacing: 0; white-space: nowrap; margin-left: auto; }
.home-feed-heading { gap: 16px; }
.home-feed-heading::after { display: none; }
.home-feed-heading h2, .home-sidebar-heading { font-size: 1.4rem; }
.home-feed { gap: 32px; padding-bottom: 48px; }
.home-feed-featured, .home-feed-featured-body { min-height: 310px; }
.home-feed-featured { border-radius: 14px; border: 1px solid #ffffff14; }
.home-feed-featured-body { padding: 26px; gap: 10px; }
.home-feed-featured-title { font-size: clamp(1.5rem, 2.6vw, 2rem); max-width: 28ch; text-wrap: balance; }
.home-feed-featured-overlay { background: linear-gradient(0deg, #08170ff5 0%, #0b1b12bf 42%, #08170f12 100%); }
.home-feed-featured-teaser { color: #e0e6da; font-weight: 400; }
.home-feed-featured-meta { font-size: .77rem; }
.home-feed-list { gap: 20px; }
.home-feed-item { border-radius: 12px; border-color: #bfd0bd22; background: #ffffff04; }
.home-feed-item-img, .home-feed-item-img-empty { aspect-ratio: 16 / 9; height: auto; }
.home-feed-item-body { flex: 1; gap: 9px; padding: 17px 18px 18px; }
.home-feed-item-title { font-size: 1.3rem; line-height: 1.23; font-weight: 700; -webkit-line-clamp: 3; line-clamp: 3; }
.home-feed-item-date { color: #b2c4b6; font-size: .75rem; margin-top: auto; padding-top: 3px; }
.home-feed-item-tag { font-size: .67rem; }
.home-sidebar-item { padding: 11px; border-radius: 10px; background: #ffffff04; gap: 12px; }
.home-sidebar-item-title { font-size: .87rem; line-height: 1.4; -webkit-line-clamp: 3; line-clamp: 3; }
.home-sidebar-item-tag { font-size: .61rem; }
.home-sidebar-item-date { color: #b2c4b6; font-size: .72rem; }
.home-desktop-nav a { color: #c4d1c5; }
.home-footer p, .home-footer a { color: #b2c4b6; font-size: .77rem; }
.menu-toggle { width: 44px; height: 44px; }
.mobile-nav { visibility: hidden; }
.mobile-nav.open { visibility: visible; }

/* Decoration stays in the wide outer margins, clear of all text and cards. */
#feather-canvas { z-index: 0; }
.home-site::after { display: none; }
.margin-leaf { position: absolute; top: -28px; width: 13px; height: 21px; border: 1px solid #d7bd7377; border-radius: 90% 0 90% 0; background: #b3c48218; animation: margin-drift 34s linear infinite; }
@keyframes margin-drift { from { transform: translateY(-30px) rotate(-20deg); } to { transform: translateY(110vh) rotate(100deg); } }
@media(max-width: 1279px) { #feather-canvas { display: none; } }
@media(hover: hover) {
  .home-feed-item:hover { border-color: #d7bd7366; background: #ffffff08; }
}

/* Shared reading surface and metadata contrast. */
body.article-page, body.ds-page, body.cat-wild, body.cat-knowledge, body.cat-onthisday { background: var(--reading-bg); --text-muted: #b2c4b6; --muted: #b2c4b6; }
.fs-header, .ds-header, .ed-header { background: #10231bf5; border-bottom: 1px solid #d2c79420; }
.fs-footer, .ds-footer, .ed-footer { background: #0d2018; }
.fs-main, .ds-main { padding-left: 24px; padding-right: 24px; }
.fs-article { padding-top: 36px; width: 100%; min-width: 0; }
.fs-article-title, .ds-teaser { line-height: 1.16; letter-spacing: -.015em; }
.fs-article-hook { color: #e5d39f; font-size: 1.04rem; line-height: 1.7; }
.fs-article-meta, .ds-meta { color: #b2c4b6; gap: 10px 16px; flex-wrap: wrap; font-size: .79rem; }
.fs-article-brand, .ds-brand-tag { color: #90d8b7; }
.fs-article-divider, .ds-divider { margin: 25px 0; }
.fs-article-body, .ds-body { color: #e1e8df; font-size: 1.075rem; line-height: 1.85; overflow-wrap: break-word; }
.fs-article-body p, .ds-body p { margin-bottom: 1.35em; }
.fs-article-image-wrap, .ds-image-wrap { background: #172e22; border-color: #bcccb322; border-radius: 12px; }
.fs-article-image-credit, .ds-image-credit { font-size: .75rem; line-height: 1.5; font-weight: 400; color: #b8c9bc; padding: 8px 12px; overflow-wrap: anywhere; }
.fs-sidebar-card-date { color: #b2c4b6; }
.fs-sidebar-card { background: #ffffff05; border: 1px solid #bfd0bd22; border-radius: 10px; }
.fs-sidebar-card-title { color: #f5f0e8; line-height: 1.4; }
.fs-nav-link, .ds-nav-link, .ed-nav-link { color: #c3d1c5; }
.ed-grid-card-date, .ed-featured-date, .ed-page-info { color: #b2c4b6; }
.ed-grid-card-title { font-size: 1.2rem; line-height: 1.3; }
.ed-grid-card-img { aspect-ratio: 16 / 9; height: auto; object-fit: cover; }
.ds-year { color: #b4c1a9; font-size: 2.8rem; }
.ds-today-pill { animation: none; }
@media(min-width: 1024px) {
  .fs-main-grid, .ds-main-grid { grid-template-columns: minmax(0, 740px) 280px; gap: 40px; }
}
@media(max-width: 900px) {
  .home-feed { gap: 30px; }
  .home-feed-sidebar { border-top: 1px solid #bfd0bd22; padding-top: 24px; }
}
@media(max-width: 600px) {
  .home-header { padding: 14px 18px 7px; }
  .home-brand-logo { width: 34px; height: 34px; }
  .home-brand-name { font-size: 1.25rem; }
  .home-hero { padding: 17px 20px 22px; }
  .home-hero-title { font-size: 2.15rem; max-width: 360px; margin-left: auto; margin-right: auto; }
  .home-hero-label { font-size: .59rem; margin-bottom: 8px; }
  .home-hero-sub { font-size: .86rem; max-width: 310px; margin: auto; }
  .home-welcome-card { margin-top: 6px; }
  .home-welcome-text { font-size: .74rem; }
  .home-feed { padding: 0 18px 32px; }
  .home-feed-heading h2 { font-size: 1.3rem; }
  .home-date { font-size: .66rem; }
  .home-feed-featured, .home-feed-featured-body { min-height: 270px; }
  .home-feed-featured-body { padding: 19px; gap: 8px; }
  .home-feed-featured-title { font-size: 1.55rem; }
  .home-feed-featured-teaser { font-size: .82rem; }
  .home-feed-list { grid-template-columns: 1fr; gap: 12px; }
  .home-feed-item { flex-direction: row; align-items: stretch; }
  .home-feed-item-img, .home-feed-item-img-empty { width: 108px; height: auto; aspect-ratio: auto; min-height: 128px; object-fit: cover; }
  .home-feed-item-body { padding: 12px; gap: 6px; min-width: 0; }
  .home-feed-item-title { font-size: 1.15rem; line-height: 1.25; -webkit-line-clamp: 4; line-clamp: 4; }
  .home-feed-item-tag { font-size: .6rem; letter-spacing: .025em; }
  .home-feed-item-date { font-size: .69rem; }
  .fs-main, .ds-main { padding-left: 20px; padding-right: 20px; padding-bottom: 40px; }
  .fs-article { padding-top: 27px; }
  .ds-main { padding-top: 27px; }
  .fs-header-inner, .ds-header-inner { padding-left: 18px; padding-right: 18px; }
  .fs-article-title, .ds-teaser { font-size: 1.9rem; text-wrap: pretty; }
  .fs-article-hook { font-size: 1rem; }
  .fs-article-body, .ds-body { font-size: 1rem; line-height: 1.85; }
  .fs-article-meta, .ds-meta { font-size: .75rem; }
  .fs-article-badge, .ds-badge { margin-bottom: 16px; }
  .fs-article-image-wrap, .ds-image-wrap { margin-bottom: 26px; }
  .fs-article-image-credit, .ds-image-credit { font-size: .7rem; }
}
@media(max-width: 360px) {
  .home-feed-item-img, .home-feed-item-img-empty { width: 90px; }
  .home-feed-item-title { font-size: 1.07rem; }
  .home-hero-title { font-size: 1.95rem; }
  .home-feed-heading { gap: 8px; }
}
@media(prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #feather-canvas { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Verified Pi welcome: compact, distinctive, and independent of public rendering. */
.pi-welcome { align-items: center; gap: 13px; text-align: left; max-width: 420px; width: 100%; box-sizing: border-box; padding: 14px 18px; margin-top: 7px; border: 1px solid #d9bc7066; border-radius: 15px; background: linear-gradient(120deg, #d7bb7314, #79cbb512); box-shadow: 0 5px 22px #00000018; }
.pi-welcome-icon { display: grid; place-items: center; flex: 0 0 48px; height: 48px; color: #efd38f; border-radius: 50%; background: #d7bb7317; animation: welcome-sway 3s ease-in-out 3; }
.pi-welcome-copy { display: grid; gap: 3px; min-width: 0; }
.pi-welcome-label { color: #c7cfae; font-size: .59rem; letter-spacing: .12em; text-transform: uppercase; }
.pi-welcome-heading { color: #f4eee0; font-size: 1.02rem; line-height: 1.35; }
#home-welcome-name { color: #efd38f; font-weight: 700; overflow-wrap: anywhere; }
.pi-welcome-sub { color: #b9ccbd; font-size: .72rem; line-height: 1.45; }
.welcome-spark { transform-origin: 6px 9px; animation: welcome-glint 3s ease-in-out 3; }
@keyframes welcome-sway { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(-9deg); } 65% { transform: rotate(6deg); } }
@keyframes welcome-glint { 0%, 100% { opacity: .4; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@media(max-width: 600px) { .pi-welcome { padding: 12px 14px; gap: 11px; } }
@media(prefers-reduced-motion: reduce) { .pi-welcome-icon, .welcome-spark { animation: none; } }

.pi-auth-retry { border: 1px solid #d9bc7066; background: #d7bb7314; color: #efd38f; border-radius: 12px; padding: 12px 18px; min-height: 44px; font: inherit; font-size: .85rem; cursor: pointer; }
.pi-auth-retry:disabled { opacity: .7; cursor: wait; }
