/* ============================================================
   The AI-SEO Book companion, shared public-site layout.
   Tokens come from brand.css. This file owns the chrome
   (header, nav, footer) and the components every public page
   uses, so pages stop carrying their own copies.
   ============================================================ */

body.site { background: var(--deep-black); color: var(--white); font-weight: 300; }
body.site a { color: var(--bright-aqua); }
body.site ::selection { background: rgba(1,255,255,.25); }
:focus-visible { outline: 2px solid var(--bright-aqua); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bright-aqua); color: #000; padding: 8px 14px; border-radius: 8px; z-index: 50; font-weight: 600; }
.skip:focus { left: 12px; }

/* ---------- header + nav ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(0,0,0,.86); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid rgba(255,255,255,.08); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.brandmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white) !important; flex-shrink: 0; }
.brandmark img { height: 22px; width: auto; display: block; }
.brandmark .sep { width: 1px; height: 20px; background: rgba(255,255,255,.25); }
.brandmark .book { font-family: var(--font-head); font-weight: 600; font-size: .98rem; letter-spacing: .01em; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a.nl { color: rgba(255,255,255,.78); text-decoration: none; font-weight: 400; font-size: .95rem; padding: 8px 13px; border-radius: 999px; transition: background .15s, color .15s; }
.site-nav a.nl:hover { color: var(--white); background: rgba(255,255,255,.07); }
.site-nav a.nl[aria-current="page"] { color: var(--bright-aqua); background: rgba(1,255,255,.08); }
.site-nav .btn { margin-left: 10px; color: var(--deep-black) !important; }
.menu-btn { display: none; background: transparent; border: 1px solid rgba(255,255,255,.25); color: var(--white); border-radius: 999px; padding: 8px 14px; font: 600 .9rem var(--font-body); cursor: pointer; }
@media (max-width: 1024px) {
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; align-items: stretch; gap: 2px; background: #050505; border-bottom: 1px solid rgba(255,255,255,.1); padding: 10px 16px 18px; }
  .site-nav.open { display: flex; }
  .site-nav a.nl { padding: 12px 14px; font-size: 1rem; }
  .site-nav .btn { margin: 8px 0 0; text-align: center; }
  .brandmark .book { font-size: .9rem; }
}
@media (max-width: 380px) { .brandmark .sep, .brandmark .book { display: none; } }

/* ---------- page head ---------- */
.page-head { position: relative; overflow: hidden; padding: 64px 0 44px; border-bottom: 1px solid rgba(255,255,255,.06); }
.page-head h1 { font-size: clamp(2rem, 4.6vw, 3rem); margin: 0 0 .3em; max-width: 22ch; }
.page-head .lead { font-size: 1.12rem; opacity: .84; max-width: 680px; margin: 0; }
.page-head .meta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .85rem; }
.stamp { display: inline-block; padding: 5px 12px; border: 1px solid rgba(1,255,255,.35); border-radius: 999px; color: var(--bright-aqua); }
.crumbs { font-size: .88rem; opacity: .8; margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.ring { position: absolute; border-radius: 50%; border: 1.5px solid rgba(1,255,255,.16); pointer-events: none; }
.ring.r1 { width: 340px; height: 340px; right: -110px; top: -120px; }
.ring.r2 { width: 160px; height: 160px; right: 150px; top: 40px; border-color: rgba(173,186,255,.16); }

/* ---------- layout ---------- */
.main { padding: 40px 0 72px; }
.narrow { max-width: 780px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
h2.sec { font-size: 1.5rem; margin: 44px 0 14px; }
h2.sec:first-child { margin-top: 0; }
p.intro { opacity: .82; max-width: 680px; margin: 0 0 18px; }

/* ---------- cards ---------- */
.card { background: #0b0b0b; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 24px 26px; }
.card + .card { margin-top: 16px; }
.grid .card + .card { margin-top: 0; }
.card h2, .card h3 { font-size: 1.15rem; margin: 0 0 8px; }
.card p { opacity: .84; margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
a.card { display: block; text-decoration: none; color: var(--white) !important; transition: transform .15s, border-color .15s, box-shadow .15s; }
a.card:hover, a.card:focus-visible { transform: translateY(-2px); border-color: rgba(1,255,255,.4); box-shadow: 0 10px 30px rgba(1,255,255,.06); }
a.card .go { color: var(--bright-aqua); font-weight: 600; font-size: .92rem; }
.card .ch { color: rgba(255,255,255,.6); font-size: .85rem; margin-bottom: 6px; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(1,255,255,.45); color: var(--bright-aqua); font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.letter { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: var(--blue-gradient); color: var(--deep-black); font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; flex-shrink: 0; }

/* ---------- task pages ---------- */
.from-book { background: rgba(1,255,255,.05); border: 1px solid rgba(1,255,255,.22); border-left: 3px solid var(--bright-aqua); border-radius: 12px; padding: 16px 20px; margin: 0 0 26px; }
.from-book p { margin: 0 0 6px; opacity: .9; }
.from-book .line { font-size: 1.02rem; opacity: 1; }
.from-book .line + .line { margin-top: 10px; }
.from-book .src { font-size: .85rem; opacity: .7; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 16px 48px; line-height: 1.55; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(1,255,255,.5); color: var(--bright-aqua); font-weight: 600; font-size: .88rem; display: flex; align-items: center; justify-content: center; }
.done { display: flex; gap: 14px; align-items: flex-start; background: #0b0b0b; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 16px 20px; margin-top: 26px; }
.done .tick { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-gradient); color: #000; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.done p { margin: 0; }
.note { font-size: .92rem; opacity: .74; margin-top: 12px; }
.card ul, .card ol:not(.steps) { padding-left: 22px; margin: 8px 0 0; opacity: .9; }
.card li { margin-bottom: 8px; line-height: 1.5; }
code { background: rgba(1,255,255,.08); border: 1px solid rgba(1,255,255,.2); border-radius: 6px; padding: 1px 7px; font-size: .88em; color: var(--bright-aqua); font-family: var(--font-mono); }
pre { background: #050505; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: .84rem; line-height: 1.45; color: #d6fbfb; margin: 12px 0 0; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
th { color: var(--bright-aqua); font-weight: 600; font-size: .78rem; }
td { opacity: .9; }
td code { overflow-wrap: anywhere; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.pager a { text-decoration: none; }

/* ---------- hub list ---------- */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { border-top: 1px solid rgba(255,255,255,.08); }
.task-list li:last-child { border-bottom: 1px solid rgba(255,255,255,.08); }
.task-list a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; text-decoration: none; color: var(--white) !important; }
.task-list a:hover .t, .task-list a:focus-visible .t { color: var(--bright-aqua); }
.task-list .t { font-weight: 400; }
.task-list .u { color: rgba(255,255,255,.5); font-family: var(--font-mono); font-size: .82rem; white-space: nowrap; }
@media (max-width: 600px) { .task-list a { flex-direction: column; gap: 2px; } }

/* ---------- framework ---------- */
.formula { font-family: var(--font-head); font-size: clamp(1.4rem, 3.4vw, 2.1rem); font-weight: 600; letter-spacing: .01em; padding: 22px 26px; border: 1px solid rgba(1,255,255,.3); border-radius: 16px; background: rgba(1,255,255,.04); }
.pillar { display: flex; gap: 18px; align-items: flex-start; }
.pillar h3 { margin: 4px 0 6px; font-size: 1.2rem; }
.pillar .links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .92rem; }
.pillar .links a { text-decoration: none; font-weight: 600; }
.pillar .links a:hover { text-decoration: underline; }
ol.qs { padding-left: 22px; }
ol.qs li { margin-bottom: 10px; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--blue-gradient); color: var(--deep-black); border-radius: 20px; padding: 40px; margin-top: 48px; }
.cta-band h2 { color: var(--deep-black); margin: 0 0 6px; }
.cta-band p { margin: 0 0 20px; max-width: 560px; opacity: .85; }
.cta-band .btn { background: var(--deep-black); color: #fff !important; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid rgba(255,255,255,.08); padding: 48px 0 36px; margin-top: 24px; font-size: .92rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.site-footer h3 { font-size: .95rem; margin: 0 0 10px; color: var(--white); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: rgba(255,255,255,.72) !important; text-decoration: none; }
.site-footer a:hover { color: var(--white) !important; text-decoration: underline; }
.site-footer .blurb { opacity: .65; max-width: 320px; margin: 10px 0 0; }
.site-footer .base { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; opacity: .55; font-size: .85rem; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .site-footer .cols > div:first-child { grid-column: 1 / -1; } }

@media (max-width: 600px) {
  .page-head { padding: 44px 0 32px; }
  .card { padding: 20px 18px; }
  .cta-band { padding: 28px 22px; }
  th, td { padding: 7px 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
