/* The home page (design §11): what Narrative is, the epics, and sign-in. It
   uses the shared theme (theme.css, public.css). Unlike the story pages it has
   no size limit and may use JavaScript; without JavaScript every section
   shows, and the first news-to-story pair. */

body.home { background: var(--paper); color: var(--ink); font: 18px/1.65 var(--text); -webkit-font-smoothing: antialiased; }
html:has(body.home) { scroll-behavior: smooth; }
body.home .public-main { max-width: none; margin: 0; padding: 0; }
.home h1, .home h2, .home h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.012em; color: var(--ink); }
.home section[id] { scroll-margin-top: 2.5rem; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
@media (min-width: 48rem) { .wrap { padding-left: 2rem; padding-right: 2rem; } }

/* Masthead and hero */
.hero-band {
  background:
    radial-gradient(56rem 30rem at 88% 0%, rgba(168, 67, 29, .11), transparent 62%),
    radial-gradient(44rem 28rem at 0% 100%, rgba(36, 69, 59, .10), transparent 60%);
  border-bottom: 1px solid var(--line);
}
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.masthead-nav { display: flex; align-items: center; gap: 1.5rem; font: 500 .92rem/1 var(--sans); }
.home .masthead-nav a { color: var(--ink-2); text-decoration: none; }
.home .masthead-nav a:hover { color: var(--accent); }
.home .masthead-nav a.pill { padding: .6rem 1.05rem; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink); transition: background .2s, color .2s; }
.home .masthead-nav a.pill:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 44rem) { .masthead-nav a:not(.pill) { display: none; } }

.hero { display: grid; gap: 3rem; align-items: center; padding-top: 2.25rem; padding-bottom: 4rem; }
@media (min-width: 62rem) { .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 4.5rem; padding-top: 4.5rem; padding-bottom: 6rem; } }
.hero h1 { margin: 0 0 1.4rem; font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.1rem); font-weight: 560; line-height: 1.04; letter-spacing: -.012em; }
.hero h1 em { font-style: italic; font-weight: 480; color: var(--accent); }
.lede { max-width: 34em; margin: 0; font-size: clamp(1.08rem, 1rem + .35vw, 1.26rem); line-height: 1.62; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2.1rem 0 0; }

/* Real news beside the story made from it */
.showcase { position: relative; max-width: 34rem; width: 100%; justify-self: center; }
.pair { margin: 0; }
.clip { position: relative; z-index: 1; width: 90%; margin: 0; padding: 1.2rem 1.35rem 1.25rem; background: var(--news); border: 1px solid var(--news-line); border-radius: 4px; color: var(--news-ink); font-family: var(--sans); box-shadow: 0 12px 24px -18px rgba(20, 40, 30, .45); transform: rotate(-1.4deg); }
.clip .kicker { color: var(--news-ink); opacity: .8; }
.clip-title { margin: .55rem 0 .45rem; font: 700 1.16rem/1.3 var(--sans); letter-spacing: -.01em; color: #15302a; }
.clip-meta { margin: 0; font-size: .82rem; color: #4d625b; }
.home .clip-meta a { color: inherit; }
.became { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: .35rem; height: 2.4rem; margin: -.35rem 0 -.5rem 1.4rem; color: var(--accent); font: italic 500 1rem/1 var(--display); }
.became svg { width: 2.4rem; height: 1.7rem; }
.became span { padding-bottom: .15rem; }
.page { position: relative; width: 94%; margin: 0 0 0 auto; padding: 1.9rem 1.6rem 1.35rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 9px 9px 0 -1px var(--card), 9px 9px 0 0 var(--line), 0 34px 60px -32px rgba(70, 45, 20, .42); }
.page .kicker { color: var(--accent); }
.page-text { margin: .8rem 0 1.1rem; font: 400 1.14rem/1.65 var(--text); color: var(--ink); }
.page mark { padding: 0 .06em; color: inherit; background-color: transparent; background-image: linear-gradient(transparent 56%, var(--highlight) 56%); background-repeat: no-repeat; background-size: 100% 100%; }
.page figcaption { padding-top: .85rem; border-top: 1px solid var(--line); font: 500 .86rem/1.3 var(--sans); }
.home .page figcaption a { text-decoration: none; }
.home .page figcaption a:hover { text-decoration: underline; }

html:not(.js) .pair + .pair { display: none; }
.showcase-controls { display: flex; align-items: center; gap: 1rem; margin-top: 1.6rem; padding-left: .25rem; }
.showcase-controls[hidden] { display: none; }
.dots { display: flex; gap: .45rem; }
.dot { position: relative; width: .6rem; height: .6rem; padding: 0; overflow: hidden; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: width .35s ease, background .35s ease; }
.dot[aria-current="true"] { width: 2rem; background: #e8c9b6; }
.dot[aria-current="true"]::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: dot-fill var(--interval, 7s) linear forwards; }
.showcase.is-paused .dot::after { animation: none; transform: none; }
@keyframes dot-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.toggle { padding: .35rem .2rem; border: 0; background: none; color: var(--muted); font: 650 .72rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.toggle:hover { color: var(--accent); }

.js .showcase-track { display: grid; }
.js .pair { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease, visibility 0s linear .6s; }
.js .pair.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .6s ease, transform .6s ease, visibility 0s; }
.js .pair mark { background-size: 0% 100%; transition: background-size 1.2s cubic-bezier(.2, .7, .2, 1) .5s; }
.js .pair.is-active mark { background-size: 100% 100%; }

/* Sections */
.section { padding: 4.5rem 0; }
@media (min-width: 62rem) { .section { padding: 6.5rem 0; } }
.section-head { max-width: 40rem; margin-bottom: 2.6rem; }
.section-head h2 { margin: 0 0 .8rem; font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.2rem); line-height: 1.08; letter-spacing: -.008em; }
.section-sub { margin: 0; font-size: 1.1rem; color: var(--muted); }
.empty { font-size: 1.1rem; color: var(--muted); }

.epic-card { display: grid; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 1px 2px rgba(70, 45, 20, .05), 0 30px 60px -40px rgba(70, 45, 20, .45); }
.epic-card + .epic-card { margin-top: 1.75rem; }
@media (min-width: 54rem) { .epic-card.has-art { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); } }
/* The whole illustration shows, never cropped: its fiction mark is in a corner (Article V). */
.epic-art { display: flex; align-items: center; background: var(--paper-2); }
.epic-art img { display: block; width: 100%; height: auto; }
.epic-body { display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding: 1.7rem 1.5rem 1.8rem; }
@media (min-width: 54rem) { .epic-body { padding: 2.6rem 2.6rem 2.4rem; } }
.place { margin: 0; font: 650 .74rem/1.3 var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--news-ink); }
.epic-card h3 { margin: 0; font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); line-height: 1.05; letter-spacing: -.01em; }
.home .epic-card h3 a { color: var(--ink); text-decoration: none; }
.home .epic-card h3 a:hover { color: var(--accent); }
.blurb { margin: 0; font-size: 1.1rem; color: var(--ink-2); }
.facts { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.facts li { padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink-2); font: 500 .8rem/1 var(--sans); }
.home a.latest { display: block; margin-top: .35rem; padding: 1.1rem 1.25rem 1.2rem; border-left: 3px solid var(--accent); border-radius: 12px; background: var(--paper); color: var(--ink); text-decoration: none; transition: background .2s; }
.home a.latest:hover { background: var(--paper-2); }
.latest .kicker { color: var(--accent); }
.latest-title { display: block; margin: .45rem 0 .25rem; font: 600 1.35rem/1.2 var(--display); }
.latest-teaser { display: block; font-size: .98rem; line-height: 1.5; color: var(--muted); }
.home a.more { align-self: flex-start; font: 600 .92rem/1 var(--sans); text-decoration: none; }
.home a.more:hover { text-decoration: underline; }

.why { padding-bottom: 0; }
.why-lead { max-width: 54rem; margin: 0 0 1.4rem; font: 480 clamp(1.55rem, 1.1rem + 1.7vw, 2.35rem)/1.32 var(--display); letter-spacing: -.01em; color: var(--ink); }
.why-follow { max-width: 42rem; margin: 0; font-size: 1.12rem; color: var(--muted); }

.how { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how-grid { display: grid; gap: 1rem; }
@media (min-width: 60rem) { .how-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4rem; align-items: start; } .how-head { position: sticky; top: 4rem; } }
.steps { position: relative; margin: 0; padding: 0; list-style: none; }
.steps::before { content: ""; position: absolute; top: 1.5rem; bottom: 1.5rem; left: 1.45rem; width: 1px; background: var(--line); }
.steps li { position: relative; display: grid; grid-template-columns: 2.9rem minmax(0, 1fr); gap: 1.1rem; padding: 0 0 2rem; }
.steps li:last-child { padding-bottom: 0; }
.step-n { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--accent); font: 500 1.35rem/1 var(--display); }
.steps h3 { margin: .45rem 0 .4rem; font-size: 1.4rem; }
.steps p { margin: 0; font-size: 1.02rem; line-height: 1.62; color: var(--ink-2); }

.principles { background: var(--ink); color: #efe8da; }
.principles .eyebrow { color: var(--accent-soft); }
.home .principles h2, .home .principles h3 { color: #fbf6ec; }
.principle-grid { display: grid; gap: 1px; margin: 0 0 2.6rem; padding: 0; overflow: hidden; list-style: none; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; }
@media (min-width: 44rem) { .principle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 66rem) { .principle-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.principle-grid li { padding: 1.8rem 1.6rem; background: var(--ink); }
.principle-grid svg { width: 1.75rem; height: 1.75rem; margin-bottom: 1rem; color: var(--accent-soft); }
.principle-grid h3 { margin: 0 0 .55rem; font-size: 1.3rem; line-height: 1.2; }
.principle-grid p { margin: 0; font-size: .98rem; line-height: 1.6; color: #c8bfaf; }
.home .principles a.button { background: #fbf6ec; border-color: #fbf6ec; color: var(--ink); }
.home .principles a.button:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--ink); }

.editors { padding-bottom: 3rem; }
.editors-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 2rem; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.editors-card h2 { margin: 0 0 .4rem; font-size: 1.9rem; }
.editors-card p { max-width: 36rem; margin: 0; color: var(--muted); }
.home .agent-note { margin: 1.6rem 0 0; font: .88rem/1.5 var(--sans); color: var(--muted); }
.home .agent-note summary { cursor: pointer; }

body.home .site-footer { max-width: 72rem; padding-left: 1.25rem; padding-right: 1.25rem; }
@media (min-width: 48rem) { body.home .site-footer { padding-left: 2rem; padding-right: 2rem; } }

/* Sections rise into view as they are reached (home.js adds .is-visible). */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .principle-grid .reveal:nth-child(2) { transition-delay: .1s; }
.js .principle-grid .reveal:nth-child(3) { transition-delay: .2s; }
.js .why .reveal:nth-child(2) { transition-delay: .1s; }
.js .why .reveal:nth-child(3) { transition-delay: .2s; }
.js .principle-grid .reveal:nth-child(4) { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html:has(body.home) { scroll-behavior: auto; }
  .js .reveal, .js .pair, .js .pair mark { transition: none; transform: none; }
  .dot[aria-current="true"]::after { animation: none; }
}
.editors-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 0; }
