/* 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); }

/* ── 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); }

/* ── 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; }
}
