/* Pi the AI Guy — house style. Warm, plain, a wee bit cheeky.
   Palette matches the AI Made Simple cheat sheet (Edinburgh-night navy,
   Pi electric blue, tartan red, Pi's ginger). No frameworks, no build step. */

:root {
  --navy: #0c1430;        /* Edinburgh night sky */
  --navy-2: #16224d;
  --accent: #1e9bff;      /* Pi electric blue */
  --accent-dark: #0d7fdb;
  --blue-glow: #5cc2ff;
  --accent-soft: #e6f3ff; /* light blue */
  --tartan: #c8102e;      /* tartan red */
  --ginger: #d2691e;      /* Pi's hair */
  --ink: #1d2333;
  --muted: #5a6275;
  --paper: #ffffff;
  --line: #d6e4f5;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ── Nav ── */
nav {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; max-width: 880px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.pi-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 155, 255, 0.25);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; font-family: Georgia, serif;
  flex-shrink: 0;
}
.brand b { font-size: 15px; letter-spacing: 0.04em; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: 0.02em; }
nav a.nav-link {
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
nav a.nav-link:hover, nav a.nav-link.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ── Hero ── */
.hero { padding: 48px 0 36px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.hero-text { flex: 1 1 380px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 14px; }
.hero h1 .o { color: var(--accent); }
.hero p.lead {
  font-size: 1.15rem; color: var(--muted); max-width: 560px; margin-bottom: 24px;
  border-left: 3px solid var(--tartan); padding-left: 12px;
}
.pi-portrait {
  width: 180px; height: 180px; border-radius: 14px; object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 155, 255, 0.25);
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  background: var(--accent); color: #fff; border: none;
  padding: 13px 26px; border-radius: 999px;
  font-size: 15px; font-weight: 700; font-family: var(--sans);
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Cards & sections ── */
section { padding: 30px 0; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
h2.kicker { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 10px; }
h3 { font-size: 1.25rem; margin-bottom: 8px; letter-spacing: -0.01em; }
p.muted, .muted { color: var(--muted); }
.small { font-size: 14px; }

/* Fire-alarm explainer — blue detector/siren, tartan-red panel (the human bit) */
.alarm { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 14px; }
.alarm .card { border-top: 4px solid var(--accent); }
.alarm .card.panel { border-top-color: var(--tartan); }
.alarm .emoji { font-size: 26px; margin-bottom: 6px; }

/* ── Signup form ── */
.signup {
  background: var(--accent-soft); border: 1px solid var(--line); border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px;
}
.signup form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.signup input[type="email"], .signup input[type="text"] {
  flex: 1 1 220px; padding: 12px 16px; font-size: 15px; font-family: var(--sans);
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
  outline: none;
}
.signup input:focus { border-color: var(--accent); }
.form-note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.form-msg { font-weight: 600; margin-top: 12px; }
.form-msg.ok { color: #2b7a3e; }
.form-msg.err { color: var(--tartan); }

/* ── Cheat-sheet lead-magnet extras (PDF thumbnail + social proof) ── */
.pdf-cover {
  width: 138px; margin: 0 auto 16px; transform: rotate(-2deg);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 24px rgba(12,20,48,0.16); overflow: hidden;
}
.pdf-cover .pdf-top { background: var(--accent); color: #fff; padding: 11px 11px 9px; }
.pdf-cover .pdf-pi { display: block; font-family: Georgia, serif; font-size: 17px; line-height: 1; }
.pdf-cover .pdf-title { display: block; font-weight: 800; font-size: 12.5px; line-height: 1.15; margin-top: 5px; }
.pdf-cover .pdf-sub { display: block; font-size: 8.5px; line-height: 1.25; opacity: 0.92; margin-top: 3px; }
.pdf-cover .pdf-body { padding: 10px 11px 12px; }
.pdf-cover .pdf-line { display: block; height: 5px; border-radius: 3px; background: var(--accent-soft); margin-bottom: 5px; }
.pdf-cover .pdf-line.short { width: 60%; }
.pdf-cover .pdf-tag {
  display: inline-block; margin-top: 5px; font-size: 8px; font-weight: 800; letter-spacing: 0.03em;
  color: var(--accent-dark); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}
.proof { font-size: 13px; color: var(--ink); margin-top: 10px; line-height: 1.5; }
.proof::before { content: "✓ "; color: var(--accent-dark); font-weight: 800; }

/* ── Free guides hub (guides.html) ── */
.guides-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.guide-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--accent); border-radius: 999px; padding: 3px 12px; margin-bottom: 10px;
}
.guide-points { list-style: none; margin: 8px 0 4px; padding: 0; }
.guide-points li { padding: 3px 0; font-size: 14px; color: var(--ink); }
.guide-card.soon { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; border-style: dashed; }

/* ── Blog ── */
.post-card { display: block; text-decoration: none; color: var(--ink); transition: border-color 0.15s; }
.post-card:hover { border-color: var(--accent); }
.post-meta { font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.post-body { white-space: pre-wrap; }
article.post { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; margin-top: 10px; }

/* ── Products ── */
.tier { display: flex; flex-direction: column; }
.tier .price { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.tier .price small { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.tier ul { list-style: none; margin: 12px 0 18px; }
.tier li { padding: 4px 0 4px 24px; position: relative; font-size: 15px; color: var(--muted); }
.tier li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.tier .btn { margin-top: auto; text-align: center; }
.tier.featured { border: 2px solid var(--accent); position: relative; }
.tag {
  position: absolute; top: -12px; left: 20px; background: var(--tartan); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; padding: 3px 12px; border-radius: 999px;
}

/* ── Footer — Edinburgh night sky, like the cheat-sheet header ── */
footer {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 70%, #1b2f6e 100%);
  border-top: 4px solid var(--accent);
  margin-top: 40px; padding: 26px 20px 80px;
  font-size: 13.5px; color: #c8d8f2; text-align: center;
}
footer a { color: var(--blue-glow); }

/* Social links row — pill chips in the footer */
.pi-socials { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pi-socials a {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  color: #fff; background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(92, 194, 255, 0.35); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.pi-socials a:hover { background: rgba(30, 155, 255, 0.22); border-color: var(--accent); }
.pi-socials svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

/* ── Support widget ── */
#pi-support-btn {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  background: var(--navy); color: #fff; border: 1px solid var(--accent); cursor: pointer;
  border-radius: 999px; padding: 12px 18px; font-size: 14px; font-weight: 700; font-family: var(--sans);
  box-shadow: 0 4px 14px rgba(12, 20, 48, 0.35);
}
#pi-support-modal {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(12, 20, 48, 0.5); padding: 20px;
  align-items: center; justify-content: center;
}
#pi-support-modal.open { display: flex; }
#pi-support-modal .box { background: var(--paper); border-radius: var(--radius); padding: 24px; max-width: 440px; width: 100%; }
#pi-support-modal input, #pi-support-modal textarea {
  width: 100%; padding: 10px 12px; margin-top: 10px; font-size: 14px; font-family: var(--sans);
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); outline: none;
}
#pi-support-modal textarea { min-height: 90px; resize: vertical; }
#pi-support-modal .row { display: flex; gap: 10px; margin-top: 14px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 32px 0 24px; }
  .pi-portrait { width: 130px; height: 130px; }
  article.post { padding: 22px; }
}

/* ── Consent checkbox (signup form) ── */
.consent {
  display: flex; gap: 9px; align-items: flex-start;
  flex: 1 1 100%; margin-top: 4px;
  font-size: 13px; color: var(--muted); line-height: 1.45; text-align: left;
}
.consent input { margin-top: 3px; flex-shrink: 0; }
.linkbtn {
  color: var(--accent-dark); font-weight: 600; text-decoration: underline;
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
}

/* ── Footer legal links ── */
.flegal { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 12px 0 4px; }
.flegal button {
  background: none; border: none; color: var(--blue-glow);
  text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; padding: 0;
}
.flegal button:hover { color: #fff; }

/* ── Legal modal: Privacy / Cookies / Terms ── */
.modal-back {
  position: fixed; inset: 0; z-index: 9999; display: none;
  background: rgba(12, 20, 48, 0.55); padding: 20px;
  align-items: center; justify-content: center;
}
.modal-back.open { display: flex; }
.modal {
  position: relative; background: var(--paper); color: var(--ink);
  border-radius: var(--radius); border-top: 4px solid var(--accent);
  max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
  padding: 26px 26px 14px; box-shadow: 0 20px 60px rgba(12, 20, 48, 0.4);
}
.modal h3 { font-size: 1.3rem; margin-bottom: 12px; }
.modal p { font-size: 14.5px; color: var(--ink); margin-bottom: 12px; line-height: 1.55; }
.modal p.muted { color: var(--muted); }
.modal p.small { font-size: 12.5px; }
.modal a { color: var(--accent-dark); }
.ltabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ltab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 12px; margin-bottom: -1px; font: inherit; font-size: 14px; font-weight: 700;
  color: var(--muted); cursor: pointer;
}
.ltab.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.lbody { display: none; }
.lbody.show { display: block; }
.mclose {
  position: absolute; top: 12px; right: 14px; background: none; border: none;
  font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1;
}
.mclose:hover { color: var(--ink); }

/* ══════════════════════════════════════════════════════════════════════════
   WORKSITE THEME (site-wide) — Concept C "pegboard + construction yellow".
   Cream dot-grid background, hi-vis yellow accents, hard ink shadows on chunky
   cards/buttons. Layered over the house palette; Pi blue stays the brand.
   Bump ?v= on the /css/style.css <link> in every page whenever this changes.
   ══════════════════════════════════════════════════════════════════════════ */
:root { --pi-cream:#fff7ec; --pi-yellow:#ffd23f; --pi-ink:#141019; }
body {
  background-color: var(--pi-cream);
  background-image: radial-gradient(var(--pi-ink) 1.1px, transparent 1.1px);
  background-size: 26px 26px;
  background-attachment: fixed;
}
nav { background: var(--pi-cream); border-bottom: 3px solid var(--pi-ink); }
/* Chunky cards + buttons */
.card { border: 2px solid var(--pi-ink); box-shadow: 4px 4px 0 var(--pi-ink); }
article.post { border: 2px solid var(--pi-ink); box-shadow: 4px 4px 0 var(--pi-ink); }
.btn { border: 3px solid var(--pi-ink); box-shadow: 4px 4px 0 var(--pi-ink); }
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--pi-ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--pi-ink); }
.btn.ghost { background: #fff; }
.signup { box-shadow: 5px 5px 0 var(--pi-ink); }
/* Hi-vis chip label */
.chip { display:inline-block; font-weight:800; font-size:12px; text-transform:uppercase; letter-spacing:.06em;
  border:2px solid var(--pi-ink); border-radius:999px; padding:5px 12px; background:var(--pi-yellow); color:var(--pi-ink);
  box-shadow:3px 3px 0 var(--pi-ink); margin-bottom:14px; }
/* Boxed highlight word (hero) */
.hero h1 .box { background:var(--pi-yellow); color:var(--pi-ink); border:3px solid var(--pi-ink); border-radius:8px;
  padding:0 10px; box-shadow:4px 4px 0 var(--pi-ink); display:inline-block; transform:rotate(-1.5deg); }
/* Portrait + stickers */
.hero-portrait-wrap { position:relative; flex-shrink:0; }
.sticker { position:absolute; z-index:2; font-weight:800; text-transform:uppercase; font-size:12px;
  border:2px solid var(--pi-ink); border-radius:10px; padding:6px 11px; box-shadow:3px 3px 0 var(--pi-ink); white-space:nowrap; }
.sticker.s1 { top:-12px; left:-12px; background:var(--pi-yellow); color:var(--pi-ink); transform:rotate(-8deg); }
.sticker.s2 { bottom:-12px; right:-12px; background:var(--tartan); color:#fff; transform:rotate(6deg); }
/* Ticker tape — hazard / construction tape */
.marquee { margin:8px 0 20px; border:3px solid var(--pi-ink); border-radius:10px; background:var(--pi-ink);
  color:var(--pi-yellow); overflow:hidden; white-space:nowrap; box-shadow:4px 4px 0 rgba(20,16,25,.2); }
.marquee > div { display:inline-block; padding:10px 0; font-weight:800; text-transform:uppercase;
  letter-spacing:.05em; font-size:14px; animation:pi-scroll 26s linear infinite; }
.marquee span { margin:0 20px; }
.marquee .star { color:var(--pi-yellow); }
@keyframes pi-scroll { from{transform:translateX(0)} to{transform:translateX(-50%)} }
@media (prefers-reduced-motion: reduce) { .marquee > div { animation:none; } }
/* Fire-alarm cards: keep the colour-coded top border, position for the badge */
.alarm .card { position:relative; }
.alarm .num { position:absolute; top:-14px; right:-10px; width:34px; height:34px; border-radius:50%;
  border:3px solid var(--pi-ink); background:var(--pi-yellow); color:var(--pi-ink); display:grid; place-items:center;
  font-weight:800; font-size:15px; box-shadow:3px 3px 0 var(--pi-ink); }
/* Info-card hover-lift */
.grid .card { transition: transform .12s, box-shadow .12s; }
.grid .card:hover { transform: translate(-3px,-3px); box-shadow: 7px 7px 0 var(--pi-ink); }

/* ══════════════════════════════════════════════════════════════════════════
   ARTICLE READING LAYOUT (post.html only, PI-CONTENT-001, 21/10/2026).
   A calm reading surface inside the worksite theme: the theme stays on the nav
   and the rest of the site. Scoped to body.post-page, so no other page changes.
   ══════════════════════════════════════════════════════════════════════════ */
.post-page { --read-link: #0a5fa8; } /* darker than --accent-dark: ~6.5:1 on white, WCAG AA for small text */
body.post-page {
  background-image: radial-gradient(rgba(20, 16, 25, 0.22) 1px, transparent 1px);
  background-attachment: scroll;   /* static: the dots no longer slide under the text */
}
.post-page article.post {
  border: 1px solid var(--line); box-shadow: none;
  max-width: 44rem; margin: 10px auto 0; padding: 40px 48px;
  font-size: 18px; line-height: 1.65;
}
.post-page .post-body { white-space: normal; max-width: 65ch; }
.post-page .post-head { margin-bottom: 26px; }
.post-page .post-head h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.2; margin: 6px 0 10px; color: var(--navy); }
.post-page .post-meta { margin: 0; }
.post-badge {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--navy); background: var(--accent-soft); border-radius: 999px; padding: 2px 12px;
}
.post-page .post-body p { margin: 0 0 1.1em; }
.post-page .post-body h2 { font-size: 24px; line-height: 1.3; color: var(--navy); margin: 1.8em 0 0.5em; }
.post-page .post-body h3 { font-size: 19px; line-height: 1.35; color: var(--navy); margin: 1.5em 0 0.4em; padding-top: 1.1em; border-top: 1px solid var(--line); }
.post-page .post-body h2 + h3 { border-top: 0; padding-top: 0; }
.post-page .post-body a, .post-back a { color: var(--read-link); font-weight: 600; text-underline-offset: 3px; }
.post-page a:focus-visible { outline: 3px solid var(--read-link); outline-offset: 2px; border-radius: 3px; }
.post-takeaway {
  background: var(--accent-soft); color: var(--navy); border-left: 4px solid var(--accent);
  border-radius: 6px; padding: 14px 18px; margin: 1.4em 0; font-weight: 700;
}
.post-takeaway p { margin: 0 !important; }
.post-prompt { margin: 1.2em 0 1.4em; border: 1px solid var(--line); border-radius: 8px; background: #f6f9fd; }
.post-prompt figcaption { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 10px 16px 0; }
.post-prompt pre {
  font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere; padding: 6px 16px 14px; margin: 0;
  user-select: text;
}
.post-back { margin: 20px auto; max-width: 44rem; }
.post-back a { text-decoration: none; }
.post-preview-banner {
  max-width: 44rem; margin: 16px auto 0; padding: 8px 14px; border-radius: 6px;
  background: var(--pi-yellow); color: var(--pi-ink); font-weight: 700; font-size: 15px;
}
@media (max-width: 560px) {
  .post-page .wrap { padding: 0 16px; }
  .post-page article.post { padding: 24px 18px; font-size: 17px; }
}
