/* PHOENIX'S GUIDE (phoenix/guide/, phoenix/ARCHITECTURE.md): the long read on what Phoenix is and how it works. Loaded
   after phoenix.css and built on its tokens, buttons, chips and footer. Each page: the bar, a painted page hero, the
   chapter strip, the chapters, the next and previous links, the footer. Phones get the art on top and the words
   below; a phone held sideways gets a short hero with the words on the left. The entry page (phoenix/index.html)
   loads it too, for its "Phoenix, explained" band: the logo, the four chapter tiles and the footer links. */

/* ------------------------------------------------------------------ the bar's chapter links */
.bar nav a.plain[aria-current="page"] { color: var(--gold); }
@media (max-width: 1080px) { .bar nav a.plain.wide { display: none; } }

/* ------------------------------------------------------------------ the page hero */
.page-hero { position: relative; min-height: 78vh; min-height: 78svh; display: flex; align-items: center; overflow: hidden; isolation: isolate; }
.page-hero .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 66% 40%; z-index: -2; animation: rise 2s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.page-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(11, 6, 8, 0.94) 0%, rgba(11, 6, 8, 0.74) 34%, rgba(11, 6, 8, 0.08) 64%, rgba(11, 6, 8, 0) 100%),
    linear-gradient(0deg, var(--ink) 0%, rgba(11, 6, 8, 0) 30%);
}
.page-hero .copy { max-width: 680px; padding: 120px max(24px, 6vw) 70px; }
.page-hero h1 {
  margin: 0; font: 700 clamp(38px, 6.6vw, 78px)/1.02 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  background: linear-gradient(180deg, #fffaf0 0%, #ffe3a0 40%, #ffb23e 66%, #ff6a1a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 120, 40, 0.4)) drop-shadow(0 3px 0 rgba(90, 14, 4, 0.6));
  animation: fadeUp 1s 0.4s both;
}
.page-hero .lede { margin: 18px 0 0; animation: fadeUp 1s 0.6s both; }
.page-hero .eyebrow { animation-delay: 0.2s; }
.page-hero .cta { margin-top: 26px; animation-delay: 0.8s; }

/* The hub's hero: the logo, large, beside the words. */
.page-hero.hub { min-height: 86vh; min-height: 86svh; }
.page-hero.hub .copy { display: grid; grid-template-columns: auto 1fr; gap: 10px 26px; align-items: center; max-width: 920px; }
.page-hero.hub .logo { grid-row: span 2; width: clamp(120px, 15vw, 190px); max-width: none; height: auto; filter: drop-shadow(0 0 30px rgba(255, 120, 40, 0.55)); animation: reborn 1.4s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.page-hero.hub .lede, .page-hero.hub .cta { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .page-hero { align-items: flex-end; min-height: 0; padding-top: 40vh; }
  .page-hero .art { inset: 0 0 auto 0; height: 56vh; object-position: 68% 40%; }
  .page-hero::before { background: linear-gradient(180deg, rgba(11, 6, 8, 0.5) 0%, rgba(11, 6, 8, 0) 14%, rgba(11, 6, 8, 0) 34%, rgba(11, 6, 8, 0.86) 54%, var(--ink) 66%); }
  .page-hero .copy { padding: 0 20px 34px; }
  .page-hero.hub { min-height: 0; }
  .page-hero.hub .copy { grid-template-columns: 1fr; justify-items: start; }
  .page-hero.hub .logo { grid-row: auto; width: 116px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .page-hero, .page-hero.hub { align-items: center; min-height: 100vh; min-height: 100svh; padding-top: 0; }
  .page-hero .art { inset: 0; height: 100%; object-position: 70% 35%; }
  .page-hero::before { background: linear-gradient(90deg, rgba(11, 6, 8, 0.95) 0%, rgba(11, 6, 8, 0.8) 42%, rgba(11, 6, 8, 0.06) 72%, rgba(11, 6, 8, 0) 100%); }
  .page-hero .copy { max-width: 60%; padding: 58px 20px 16px max(20px, env(safe-area-inset-left)); }
  .page-hero h1 { font-size: clamp(30px, 11vh, 52px); }
  .page-hero .lede { margin-top: 10px; font-size: 14px; line-height: 1.45; }
  .page-hero .cta { margin-top: 14px; }
  .page-hero.hub .copy { grid-template-columns: auto 1fr; max-width: 64%; }
  .page-hero.hub .logo { width: 84px; grid-row: span 2; }
}

/* ------------------------------------------------------------------ the chapter strip */
.chapters { position: relative; z-index: 2; display: flex; gap: 8px; margin: 0; padding: 0 max(24px, 6vw); max-width: 1240px; overflow-x: auto; scrollbar-width: none; }
.chapters::-webkit-scrollbar { display: none; }
.chapters a { flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; background: rgba(28, 12, 18, 0.7); }
.chapters a:hover { color: var(--text); border-color: var(--line-hot); }
.chapters a[aria-current="page"] { color: var(--ink); border-color: transparent; background: linear-gradient(180deg, var(--gold), var(--flame)); }
@media (max-width: 760px) { .chapters { padding: 0 20px; } .chapters a { padding: 8px 13px; font-size: 13px; } }

/* ------------------------------------------------------------------ the long read */
.read { max-width: 1240px; margin: 0; padding: 56px max(24px, 6vw) 30px; }
.read > section { padding: 34px 0 30px; border-bottom: 1px solid rgba(255, 170, 90, 0.08); }
.read > section:last-of-type { border-bottom: 0; }
.read h2 { margin: 0 0 14px; font: 700 clamp(26px, 3.4vw, 38px)/1.15 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: #ffe9c4; }
.read h3 { margin: 26px 0 8px; font-size: 19px; color: #fff; }
.read p, .read li { color: #ecd9cb; font-size: 17px; line-height: 1.65; }
.read p { max-width: 46em; margin: 0 0 14px; }
.read ul, .read ol { max-width: 44em; margin: 0 0 16px; padding-left: 22px; }
.read li { margin: 6px 0; }
.read li::marker { color: var(--flame); }
.read b, .read strong { color: var(--gold); font-weight: 700; }
.read code { padding: 2px 6px; border-radius: 6px; background: rgba(255, 170, 90, 0.1); color: #ffe0c2; font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.read .kicker { margin-bottom: 8px; }
.read .chip { vertical-align: 2px; margin-left: 6px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 44px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }

/* A numbered walk-through: the number in a flame, the words beside it. */
.walk { list-style: none; margin: 10px 0 0; padding: 0; max-width: 52em; counter-reset: walk; }
.walk > li { position: relative; margin: 0; padding: 4px 0 26px 66px; counter-increment: walk; }
.walk > li::before {
  content: counter(walk); position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font: 700 20px/1 var(--display); color: #2a0a02;
  background: radial-gradient(circle at 50% 30%, #fff1c2 0%, var(--flame) 55%, var(--ember) 100%);
  box-shadow: 0 0 18px rgba(255, 120, 40, 0.5);
}
.walk > li::after { content: ''; position: absolute; left: 22px; top: 52px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--line-hot), rgba(255, 150, 60, 0)); }
.walk > li:last-child::after { display: none; }
.walk > li > b:first-child { display: block; margin-bottom: 4px; color: #fff; font-size: 18px; }
.walk p { margin: 0 0 8px; }

/* A note set apart: what is built, what is next, a warning. */
.callout { display: flex; gap: 14px; align-items: flex-start; max-width: 52em; margin: 18px 0; padding: 18px 20px; border-radius: 14px; background: linear-gradient(160deg, rgba(255, 140, 50, 0.08), rgba(28, 12, 18, 0.6) 50%); border: 1px solid var(--line); }
.callout svg { flex: none; width: 24px; height: 24px; margin-top: 2px; stroke: var(--flame); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.callout p { margin: 0; font-size: 16px; }
.callout.next { border-color: rgba(255, 207, 107, 0.3); }
.callout.next svg { stroke: var(--warn); }
.callout.warn { border-color: rgba(255, 122, 107, 0.4); background: linear-gradient(160deg, rgba(255, 122, 107, 0.08), rgba(28, 12, 18, 0.6) 50%); }
.callout.warn svg { stroke: var(--bad); }

/* The hub's chapter tiles, each with its painting. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 10px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 250px; padding: 22px; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); border: 1px solid var(--line); isolation: isolate; transition: transform 0.25s ease, border-color 0.25s; }
.tile:hover { transform: translateY(-4px); border-color: var(--line-hot); color: var(--text); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; z-index: -2; transition: transform 0.6s ease; }
.tile:hover img { transform: scale(1.04); }
.tile::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(11, 6, 8, 0.96) 0%, rgba(11, 6, 8, 0.6) 46%, rgba(11, 6, 8, 0.1) 100%); }
.tile .kicker { margin-bottom: 6px; }
.tile b { display: block; font: 700 24px/1.15 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: #ffe9c4; }
.tile span.what { display: block; margin-top: 6px; color: var(--muted); font-size: 15px; }

/* Words you will see. */
.glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; }
@media (max-width: 760px) { .glossary { grid-template-columns: 1fr; } }
.glossary div { padding: 14px 0; border-bottom: 1px solid rgba(255, 170, 90, 0.08); }
.glossary dt { color: var(--gold); font-weight: 700; }
.glossary dd { margin: 4px 0 0; color: #ecd9cb; font-size: 16px; }

/* Questions that open. */
.faq { max-width: 52em; }
.faq details { border-bottom: 1px solid rgba(255, 170, 90, 0.1); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 34px 16px 0; position: relative; color: #fff; font-weight: 600; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 6px; top: 12px; font: 400 24px/1 var(--sans); color: var(--flame); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; }

/* What the signed message looks like. */
pre.sample { max-width: 40em; margin: 12px 0 18px; padding: 16px 18px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; border-radius: 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line); color: #f3d8c4; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* The stages list from the entry page, reused. */
.read .rollout { max-width: 640px; }

/* ------------------------------------------------------------------ next and previous */
.pages { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; max-width: 1240px; margin: 0; padding: 20px max(24px, 6vw) 70px; }
.pages a { flex: 1 1 260px; display: block; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--text); }
.pages a:hover { border-color: var(--line-hot); color: var(--text); }
.pages a small { display: block; color: var(--dim); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.pages a b { display: block; margin-top: 4px; font: 700 19px/1.2 var(--display); letter-spacing: 0.05em; color: #ffe9c4; }
.pages a.next { text-align: right; }
@media (max-width: 760px) { .read { padding: 34px 20px 20px; } .pages { padding: 10px 20px 50px; } .pages a.next { text-align: left; } }

/* ------------------------------------------------------------------ the entry page's guide band */
.guide-head { display: flex; align-items: center; gap: 34px; margin-bottom: 30px; }
.guide-head .sub { margin-bottom: 0; }
.guide-logo { flex: none; width: clamp(120px, 14vw, 200px); max-width: none; height: auto; filter: drop-shadow(0 0 30px rgba(255, 120, 40, 0.5)); }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .tiles.four { grid-template-columns: 1fr; }
  .guide-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .guide-logo { width: 116px; }
}
@media (orientation: landscape) and (max-height: 520px) { .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles.four .tile { min-height: 190px; } .guide-logo { width: 96px; } }
.guide-cta { margin-top: 26px; animation: none; }

footer.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer.foot nav a { color: var(--muted); text-decoration: none; }
footer.foot nav a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .page-hero .art, .page-hero h1, .page-hero .lede, .page-hero .cta, .page-hero .eyebrow, .page-hero.hub .logo { animation: none !important; }
  .tile, .tile img { transition: none; }
}
