@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&display=swap');

/* KMQ Builds (Pi Tips) — shared stylesheet v5 (full redo, 2026-10-22).
   Why v5 exists: the v4.2 launch split in the wild — some visitors got
   the new HTML with a cached older style.css, so the new hero classes
   rendered unstyled. The fix is structural: ONE versioned stylesheet
   file (style-v5.css), referenced by every page on the site, so a
   future redesign ships as style-v6.css and can never half-land.
   Base layer = the v4 stylesheet verbatim (every class the guide,
   blog, article and legacy pages already use is preserved), with a
   new flat "v5 components" layer appended: simple grid/flex layouts
   only — no background-image-dependent layout, no overlays, no glass.
   Every page must read perfectly with images disabled.
   Palette: light blue-grey wash #f5f6f9, white cards, near-black #222,
   raspberry #cd2355 primary, deep blue #004881 secondary, warm yellow
   #ffb12a highlights, coral #f68583 on dark surfaces. Rubik type. */

:root {
  --ink: #222222;          /* near-black slate: headings (raspberrypi.com text) */
  --ink-soft: #374e60;     /* deep slate blue-grey: footer, dark accents */
  --text: #333333;
  --text-muted: #59636e;
  --accent: #cd2355;       /* raspberry: primary brand accent (raspberrypi.com) */
  --accent-dark: #9e1b42;  /* raspberry, dark enough for link text on white */
  --accent-tint: #fce9f0;
  --accent2: #004881;      /* deep link blue: secondary accent (raspberrypi.com links) */
  --accent2-dark: #003a68;
  --accent2-tint: #e8f1f8;
  --sun: #ffb12a;          /* warm yellow: badges, hero CTA (raspberrypi.com) */
  --sun-ink: #5f4300;
  --coral: #f68583;        /* soft coral: accent on dark surfaces only */
  --bg: #f7f3ec;           /* page wash (raspberrypi.com body background) */
  --bg-soft: #ffffff;      /* soft sections & cards: white on the wash */
  --chip: #f1e9da;         /* neutral badge fill on white cards */
  --border: #e3dac9;
  --notice-bg: #fbf7e6;
  --notice-border: #c9a227;
  --shadow: 0 1px 4px rgba(34, 34, 34, .06);
  --shadow-hover: 0 8px 24px rgba(34, 34, 34, .10);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Rubik", ui-rounded, "SF Pro Rounded", "Trebuchet MS", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); color: var(--ink); font-weight: 700; letter-spacing: -0.015em; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}
.brand {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--accent); }
.brand-tag { display: block; font-family: var(--sans); font-size: .78rem; font-weight: 500; color: var(--text-muted); letter-spacing: .01em; }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1.6rem; }
.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.site-header nav a.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  border-bottom: 0;
}
.site-header nav a.nav-cta:hover { background: var(--accent-dark); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  margin-top: .75rem;
  border: 1px solid var(--accent);
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-light:hover { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--ink); }
.btn-sun { background: var(--sun); color: #231900; border-color: var(--sun); }
.btn-sun:hover { background: #ffc233; border-color: #ffc233; color: #231900; }
/* Blue outline button for light surfaces (raspberrypi.com's
   secondary-button language). */
.btn-outline { background: transparent; color: var(--accent2-dark); border-color: var(--accent2); margin-left: .5rem; }
.btn-outline:hover { background: var(--accent2-tint); border-color: var(--accent2-dark); color: var(--accent2-dark); }
/* v4.2: ghost button for the dark photo heroes — white outline over a
   translucent fill so it stays readable on the board photos. */
.btn-ghost { background: rgba(255, 255, 255, .10); color: #fff; border-color: rgba(255, 255, 255, .65); margin-left: .5rem; }
.btn-ghost:hover { background: rgba(255, 255, 255, .24); border-color: #fff; color: #fff; }

/* ---------- Hero ---------- */
/* v4: light hero — white band on the page wash, ink headline, raspberry
   eyebrow; the "how it works" panel is a white card with a soft shadow. */
.hero {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 5rem 0 4.5rem;
}
.hero h1 {
  color: var(--ink);
  font-size: 2.9rem;
  line-height: 1.12;
  margin: 0 0 1.25rem;
  max-width: 17ch;
}
.hero p.lede { font-size: 1.2rem; max-width: 36rem; color: #444444; margin: 0 0 1.25rem; }
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 3.5rem; align-items: center; }
.hero-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--sun);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
}
.hero-panel h2 { font-family: var(--sans); color: var(--accent-dark); font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .9rem; }
.hero-panel ul { list-style: none; margin: 0; padding: 0; }
.hero-panel li { padding: .6rem 0; border-top: 1px solid var(--border); color: var(--text); font-size: 1.02rem; }
.hero-panel li:first-child { border-top: 0; }
.hero-panel li small { display: block; color: var(--text-muted); font-size: .88rem }

/* Interior page header */
.page-hero { background: var(--bg-soft); border-bottom: 1px solid var(--border); padding: 3.25rem 0 2.75rem; }
.page-hero h1 { font-size: 2.4rem; line-height: 1.2; margin: 0 0 .75rem; }
.page-hero p { max-width: 40rem; margin: 0; font-size: 1.12rem; color: var(--text-muted); }

/* ---------- Imagery (v4.1: black-board photos) ---------- */
.img-fluid { display: block; max-width: 100%; height: auto; }
.hero-visual { margin: 3rem 0 0; }
.hero-visual img,
.showcase img,
.article-hero img {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}
.showcase { margin: 2.25rem 0 0; }
.article-hero { margin: 1.75rem 0; }

/* ---------- Background imagery (v4.2) ---------- */
/* The photos carry copy now — the raspberrypi.org / Adafruit pattern:
   the image is the band's background under a dark scrim, with the
   headline, lede and buttons flowing on top. No standalone image
   blocks. The v4.1 figure rules above stay for any page still using
   them; new pages use these bands. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Any dark photo band: cover background + gradient scrim (kept on a
   pseudo-element behind the content) so white text stays readable. */
.bg-band, .article-head {
  position: relative;
  isolation: isolate;
  background-color: #14161c;
  background-size: cover;
  background-position: center;
  color: #eef1f5;
}
.bg-band::before, .article-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(9, 11, 17, .90) 0%, rgba(9, 11, 17, .68) 55%, rgba(9, 11, 17, .42) 100%);
}
/* Flatter, more even scrim for centered header bands */
.bg-band-flat::before { background: linear-gradient(180deg, rgba(9, 11, 17, .86), rgba(9, 11, 17, .64)); }
.bg-hero { background-image: url("assets/img/black-board-hero.webp"); }
.bg-flatlay { background-image: url("assets/img/black-board-flatlay.webp"); }

/* Dark photo hero — overrides the light .hero where they combine.
   Text colors flip to light; the eyebrow goes warm yellow, which
   reads on the dark photo where raspberry pink would not. */
.hero-bg { border-bottom: 0; padding: 5.5rem 0 5rem; }
.hero-bg h1 { color: #fff; }
.hero-bg p.lede { color: #dfe5ec; }
.hero-bg .eyebrow { color: var(--sun); }
.hero-compact { padding: 4.5rem 0 4rem; }
.hero-compact h1 { max-width: 22ch; }

/* "How it works" panel as a glass card floating on the hero photo */
.hero-panel-glass {
  background: rgba(15, 18, 25, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .20);
  border-left: 4px solid var(--sun);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.hero-panel-glass h2 { color: var(--sun); }
.hero-panel-glass li { color: #eef1f5; border-top-color: rgba(255, 255, 255, .16); }
.hero-panel-glass li small { color: #b9c2cd; }

/* Article header band: the title block sits on the post's header
   photo (set per-post with an inline background-image; see
   blog/_template.html step 3). */
.article-head { padding: 3.75rem 0 3rem; }
.article-head h1 { color: #fff; font-size: 2.3rem; line-height: 1.22; margin: 0 0 .5rem; max-width: 26ch; }
.article-head .byline { color: #b9c2cd; margin: 0 0 1rem; }
.article-head .badges { margin: 0 0 1.1rem; }
.article-head .lede { color: #dfe5ec; font-size: 1.15rem; margin: 0; max-width: 42rem; }

/* Card media: the photo is the card's header, with the kicker, title
   and badges attached in the card body below it — Adafruit's
   product-card pattern, never a free-floating image. */
.guide-card .card-media { display: block; margin: -1.5rem -1.5rem 1.1rem; }
.guide-card .card-media img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ---------- Sections ---------- */
.section { padding: 4.25rem 0; }
.section.soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { margin: 0 0 .4rem; font-size: 1.9rem; line-height: 1.25; }
.section-sub { color: var(--text-muted); margin: 0 0 2.25rem; max-width: 40rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section-head .section-sub { margin-bottom: 0; }
.more-link { font-weight: 700; text-decoration: none; white-space: nowrap; }
.more-link:hover { text-decoration: underline; }
.section-kicker { display: block; font-size: .82rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; }

/* Service cards (also used for homepage path cards) */
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.service {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.6rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s ease, transform .15s ease;
}
.service:hover { border-color: var(--accent2); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.service .tag { font-size: .85rem; font-weight: 700; color: var(--accent2-dark); }
.service h3 { margin: .35rem 0 .5rem; font-size: 1.25rem; line-height: 1.3; }
.service p { margin: 0; color: var(--text-muted); font-size: .98rem; }
.service .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 1.05rem;
  margin-bottom: .6rem;
}

/* Detailed services (services page) */
.service-detail { display: grid; grid-template-columns: 15rem 1fr; gap: 2.5rem; padding: 2.5rem 0; border-top: 1px solid var(--border); }
.service-detail:first-of-type { border-top: 0; }
.service-detail h2 { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.service-detail p { margin: 0 0 .9rem; max-width: 42rem; }

/* Principles / approach */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; margin-top: 2.25rem; }
.principles h3 { font-size: 1.12rem; margin: 0 0 .4rem; padding-top: .9rem; border-top: 2px solid var(--accent); }
.principles p { margin: 0; color: var(--text-muted); font-size: .98rem; }

/* Guide / project card grid */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; margin-bottom: 3rem; }
.guide-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  transition: box-shadow .15s ease, transform .15s ease;
}
.guide-card:hover { border-color: var(--accent2); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.guide-card .kicker { font-size: .85rem; color: var(--accent2-dark); font-weight: 700; }
.guide-card h3 { margin: .45rem 0 .5rem; font-size: 1.12rem; line-height: 1.4; }
.guide-card p { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* Difficulty / time / cost badges (Adafruit-style, on project cards) */
.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.badge {
  display: inline-block;
  font-size: .78rem; font-weight: 700; line-height: 1;
  padding: .38rem .6rem; border-radius: 999px;
  background: var(--chip); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-level { background: var(--accent-tint); color: var(--accent-dark); border-color: #f2c4d2; }
.badge-cost { background: #fff0c2; color: var(--sun-ink); border-color: #ecc964; }

/* Blog list */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.25rem 0; border-top: 1px solid var(--border); }
.post-list li:first-child { border-top: 0; padding-top: 0; }
.post-list time { display: block; color: var(--text-muted); font-size: .88rem; margin-bottom: .2rem; }
.post-list a { font-family: var(--display); font-size: 1.2rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.post-list a:hover { color: var(--accent-dark); text-decoration: underline; }
.post-list p { margin: .25rem 0 0; color: var(--text-muted); font-size: .98rem; }

/* Existing homepage about blurb (kept for older pages) */
.home-about { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 3rem 0; }
.home-about p { max-width: 720px; }

/* Parents & teachers trust strip */
.parents-strip {
  background: var(--accent-tint);
  border-bottom: 1px solid #f2c4d2;
  padding: 1.1rem 0;
  font-size: .95rem;
}
.parents-strip p { margin: 0; max-width: 62rem; }
.parents-strip strong { color: var(--accent-dark); }

/* Call-to-action band — stays a bold raspberry block, raspberrypi.com-style */
.cta-band { background: linear-gradient(120deg, var(--accent-dark) 0%, var(--accent) 100%); color: #fff; padding: 3.5rem 0; }
.cta-band .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem 3rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 .35rem; font-size: 1.7rem; }
.cta-band p { margin: 0; color: #f6d9e0; max-width: 34rem; }

/* ---------- Newsletter (Pi Tips) ---------- */
/* v4: light band — white with hairline borders, so the MailerLite form
   (its own light-grey wrapper, #f6f6f6) reads as a soft card inside it. */
.pi-tips-band {
  background: #ffffff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 4rem 0;
}
.pi-tips-band h2 { color: var(--ink); margin: 0 0 .5rem; font-size: 1.8rem; }
.pi-tips-band p { color: var(--text-muted); max-width: 38rem; margin: 0 0 1.5rem; }
/* Fallback box, kept for any page still showing it (the live form has
   replaced it on the homepage and blog index). */
.ml-placeholder {
  border: 2px dashed #c2cadb;
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 38rem;
  color: var(--text-muted);
  background: var(--bg);
}
.ml-placeholder strong { color: var(--ink); display: block; margin-bottom: .3rem; }
.ml-placeholder p { margin: 0; font-size: .95rem; }

/* ---------- Articles & generic pages ---------- */
.article { max-width: 780px; padding-top: 2.5rem; padding-bottom: 3.5rem; }
.article h1 { font-size: 2.2rem; line-height: 1.25; margin: .75rem 0 .5rem; }
.article .lede { font-size: 1.15rem; color: var(--text-muted); margin-top: 0; }
.article h2 { font-size: 1.5rem; margin: 2.5rem 0 .75rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.article h2:first-of-type { border-top: none; padding-top: 0; }
.article ul, .article ol { padding-left: 1.5rem; }
.article li { margin-bottom: .5rem; }
.disclosure {
  background: var(--notice-bg);
  border-left: 4px solid var(--notice-border);
  padding: .75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
  margin: 0 0 1rem;
}
.byline, .post-meta { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }

.page { max-width: 780px; padding-top: 2.5rem; padding-bottom: 3.5rem; }
.page h1 { font-size: 2.2rem; line-height: 1.25; margin: 0 0 .5rem; }
.page h2 { font-size: 1.4rem; margin: 2rem 0 .5rem; }
.page ul { padding-left: 1.5rem; }
.page li { margin-bottom: .45rem; }

.contact-card { background: var(--bg-soft); border: 1px solid var(--border); border-left: 4px solid var(--accent2); border-radius: var(--radius); padding: 1.5rem 1.75rem; margin: 1.5rem 0 2.25rem; }
.contact-card p { margin: 0; }
.contact-card .email { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }

/* ---------- Footer ---------- */
/* v4: dark slate bookend (#222 family, like raspberrypi.com's text black)
   under the light page; coral replaces the footer brand accent so it
   stays legible on dark. */
.site-footer { background: #22252d; color: #c3cad4; padding: 3.5rem 0 2rem; font-size: .94rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.25rem; border-bottom: 1px solid rgba(255,255,255,.14); }
.footer-grid .brand { color: #fff; display: inline-block; margin-bottom: .6rem; }
.footer-grid .brand span { color: var(--coral); }
.footer-grid p { margin: 0; max-width: 24rem; }
.footer-grid h2 { font-family: var(--sans); font-size: .9rem; color: #fff; margin: 0 0 .75rem; letter-spacing: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .4rem; }
.site-footer a { color: #c3cad4; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .disclosure-line { color: #e9d98f; margin: 1.5rem 0 .5rem; }
.site-footer .copyright { color: #8b95a3; margin: 0; }
/* older pages used inline links directly in the footer */
.site-footer > .wrap > a { margin-right: 1.25rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero h1 { font-size: 2.35rem; max-width: none; }
  .service-detail { grid-template-columns: 1fr; gap: .75rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 3rem 0 2.75rem; }
  .hero h1 { font-size: 1.95rem; }
  /* Phones: deepen the photo scrims and read top-to-bottom */
  .hero-bg { padding: 3.75rem 0 3.25rem; }
  .bg-band::before, .article-head::before { background: linear-gradient(180deg, rgba(9, 11, 17, .90), rgba(9, 11, 17, .72)); }
  .article-head { padding: 3rem 0 2.5rem; }
  .article-head h1 { font-size: 1.8rem; }
  .btn-outline, .btn-ghost { margin-left: 0; }
  .section { padding: 3rem 0; }
  .section-title { font-size: 1.55rem; }
  .page-hero h1, .article h1, .page h1 { font-size: 1.7rem; }
  .site-header nav { gap: .25rem 1.1rem; }
  .site-header nav a { font-size: .92rem; padding-top: .55rem; padding-bottom: .55rem; }
  .site-header nav a.nav-cta { padding: .55rem 1.1rem; }
  .btn { padding: .85rem 1.6rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .service, .guide-card { transition: none; }
  .service:hover, .guide-card:hover { transform: none; }
}


/* ================= v5 components (2026-10-22 redo) =================
   Flat grid/flex only. New pages (home, projects, Build Log, article
   template + article) use these plus the shared chrome above. */

/* Brand with the Orbit Berry logo */
.brand { display: inline-flex; align-items: center; gap: .55rem; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; display: block; }

/* --- Homepage hero: two columns, image is a plain <img> in a card --- */
.hero5 { background: #ffffff; border-bottom: 1px solid var(--border); padding: 4.5rem 0 4rem; }
.hero5-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero5 h1 { color: var(--ink); font-size: 2.9rem; line-height: 1.12; margin: 0 0 1.25rem; max-width: 15ch; }
.hero5 p.lede { font-size: 1.18rem; max-width: 34rem; color: #444444; margin: 0 0 1.25rem; }
.hero5 .btn { margin-right: .25rem; }
.steps-mini { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; padding: 0; margin: 2rem 0 0; }
.steps-mini li { font-size: .96rem; color: var(--text-muted); }
.steps-mini li strong { color: var(--ink); display: block; font-size: 1rem; }
.steps-mini li .step-num { color: var(--accent); font-family: var(--display); font-weight: 800; margin-right: .35rem; }
.hero5-card { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-hover); overflow: hidden; margin: 0; }
.hero5-card img { display: block; width: 100%; height: auto; }
.hero5-card figcaption { padding: .95rem 1.25rem; font-size: .93rem; color: var(--text-muted); border-top: 1px solid var(--border); }
.hero5-card figcaption strong { color: var(--ink); }

/* --- Pathway cards (homepage "Pick your path") --- */
.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem; }
.path-card { display: block; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0; overflow: hidden; text-decoration: none; color: var(--text); transition: box-shadow .15s ease, transform .15s ease; }
.path-card:hover { border-color: var(--accent2); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.path-art { display: flex; align-items: center; justify-content: center; height: 96px; font-size: 2.1rem; font-family: var(--display); font-weight: 800; color: #ffffff; }
.path-body { display: block; padding: 1.25rem 1.5rem 1.5rem; }
.glyph-space { background: linear-gradient(135deg, #1b2a52, #004881); }
.glyph-retro { background: linear-gradient(135deg, #7b1e5e, #cd2355); }
.glyph-home { background: linear-gradient(135deg, #0e7c86, #004881); }
.glyph-code { background: linear-gradient(135deg, #374e60, #22252d); }
.path-card h3 { margin: 0 0 .45rem; font-size: 1.2rem; line-height: 1.3; }
.path-card p { margin: 0 0 .8rem; color: var(--text-muted); font-size: .96rem; }
.path-count { font-size: .85rem; font-weight: 700; color: var(--accent-dark); }

/* --- Project cards (Instructables pattern: image/art header, title,
       meta badges attached in the same card) --- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; margin-bottom: 3rem; }
.proj-card { display: flex; flex-direction: column; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: var(--text); transition: box-shadow .15s ease, transform .15s ease; }
.proj-card:hover { border-color: var(--accent2); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.proj-art { height: 138px; display: flex; align-items: flex-end; justify-content: space-between; padding: 1rem 1.25rem; color: #ffffff; }
.proj-num { font-family: var(--display); font-size: 2.5rem; font-weight: 800; line-height: 1; }
.proj-glyph { font-size: 1.5rem; font-family: var(--display); font-weight: 800; opacity: .92; }
.art-space { background: linear-gradient(120deg, #141b3a, #004881); }
.art-retro { background: linear-gradient(120deg, #4a1042, #cd2355); }
.art-home { background: linear-gradient(120deg, #083f4d, #0e7c86); }
.art-code { background: linear-gradient(120deg, #22252d, #374e60); }
.proj-art-img { height: 150px; }
.proj-art-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.proj-body { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.proj-body .kicker { font-size: .85rem; color: var(--accent2-dark); font-weight: 700; }
.proj-body h3 { margin: .45rem 0 .5rem; font-size: 1.14rem; line-height: 1.38; }
.proj-body p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.proj-body .badges { margin-top: auto; padding-top: .95rem; }
.badge-live { background: #e3f4e5; color: #1c5c26; border-color: #a9d6ae; }
.badge-next { background: #fff0c2; color: var(--sun-ink); border-color: #ecc964; }

/* --- Featured project (two-column card, plain <img>) --- */
.feature-card { display: grid; grid-template-columns: 1fr 1.15fr; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 3rem; }
.feature-media { margin: 0; }
.feature-media img { display: block; width: 100%; height: 100%; object-fit: cover; min-height: 240px; }
.feature-body { padding: 2rem; }
.feature-body .kicker { font-size: .85rem; color: var(--accent2-dark); font-weight: 700; }
.feature-body h3 { font-size: 1.5rem; line-height: 1.3; margin: .45rem 0 .6rem; }
.feature-body p { margin: 0; color: var(--text-muted); }

/* --- Colored header bands (no photo dependency): page + article --- */
.page-band { background: linear-gradient(120deg, var(--accent-dark) 0%, var(--accent) 100%); color: #ffffff; padding: 3.5rem 0 3rem; }
.page-band h1 { color: #ffffff; font-size: 2.5rem; line-height: 1.2; margin: 0 0 .6rem; }
.page-band .eyebrow { color: var(--sun); }
.page-band p.lede { color: #f9e2ea; font-size: 1.14rem; max-width: 42rem; margin: 0; }
.article-band { background: linear-gradient(120deg, var(--accent-dark) 0%, var(--accent) 100%); color: #ffffff; padding: 3rem 0 2.5rem; }
.article-band .eyebrow { color: var(--sun); }
.article-band h1 { color: #ffffff; font-size: 2.2rem; line-height: 1.25; margin: 0 0 .5rem; max-width: 30ch; }
.article-band .byline { color: #f9e2ea; margin: 0 0 1rem; }
.article-band .badges { margin: 0; }
.article-band .badge { background: rgba(255, 255, 255, .16); color: #ffffff; border-color: rgba(255, 255, 255, .4); }
.article-band .badge-level { background: #ffffff; color: var(--accent-dark); border-color: #ffffff; }
.article-band .badge-cost { background: var(--sun); color: var(--sun-ink); border-color: var(--sun); }

/* Pathway sections on the Projects page */
.path-section { padding-top: 2.75rem; scroll-margin-top: 92px; }
.path-section h2 { font-size: 1.7rem; margin: 0 0 .35rem; }
.path-section .section-sub { margin-bottom: 1.5rem; }

@media (max-width: 860px) {
  .hero5-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .hero5 h1 { font-size: 2.35rem; max-width: none; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-media img { height: 220px; min-height: 0; }
}
@media (max-width: 640px) {
  .hero5 { padding: 3rem 0 2.75rem; }
  .hero5 h1 { font-size: 1.95rem; }
  .page-band { padding: 2.75rem 0 2.5rem; }
  .page-band h1 { font-size: 2rem; }
  .article-band h1 { font-size: 1.75rem; }
  .feature-body { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .path-card, .proj-card { transition: none; }
  .path-card:hover, .proj-card:hover { transform: none; }
}


/* --- v5.1 Instructables look-and-feel (structure only, our own copy) ---
   Adopted from studying instructables.com (homepage + Circuits
   category page): warm paper tones (tokens above), dense-but-friendly
   card grids, big category tiles, a "browse by interest" strip, and
   the card anatomy image -> title -> author line -> meta row. Their
   orange branding is NOT used; warmth is carried by the paper tones
   and our raspberry/sun palette. */

/* Denser project grid, Instructables-style */
.proj-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* "Browse by interest" category strip */
.cat-strip { background: #ffffff; border-bottom: 1px solid var(--border); padding: .85rem 0; }
.cat-strip .wrap { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cat-label { font-weight: 700; font-size: .9rem; color: var(--text-muted); margin-right: .25rem; }
.cat-pill { display: inline-block; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.cat-pill:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-tint); }

/* Author line on project cards ("by KMQ Builds", with the logo) */
.proj-author { display: flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600; color: var(--text-muted); margin: .1rem 0 .55rem; }
.proj-author img { width: 20px; height: 20px; border-radius: 50%; display: block; }

.social-row { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding: 1.25rem 0 0; }
.social-row span { color: #fff; font-weight: 700; margin-right: .25rem; }
.social-row a { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; transition: background .2s ease, transform .2s ease; }
.social-row a:hover { background: var(--accent); transform: translateY(-2px); }
.social-row svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }

/* Pi Tips side-by-side: copy left, form right on desktop; stacked on phones. */
.pi-tips-band .tips-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.pi-tips-band .tips-copy p { margin-bottom: 0; }
@media (max-width: 820px) {
  .pi-tips-band .tips-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Social row inside the JS-rendered footer (light background). */
.footer-bottom .social-row span { color: var(--ink); }
.footer-bottom .social-row a { background: var(--ink-soft); }
.footer-bottom .social-row a:hover { background: var(--accent); }

/* ---------- Nav hover: Pi-style darkening pill + 3D rolling word ---------- */
/* Raspberry Pi's menu darkens on hover; ours does that plus a rolling word:
   the label flips up like a split-flap and returns in raspberry. The label
   lives in <span aria-hidden="true"> (outgoing face) and ::after is the
   incoming raspberry face; the link's aria-label is the accessible name. */
.site-header nav a,
.site-header .nav-links a {
  position: relative;
  padding: .35rem .7rem;
  border-radius: 999px;
  border-bottom: 2px solid transparent;
  transition: background .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.site-header nav a:hover,
.site-header .nav-links a:hover {
  background: var(--ink);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.site-header nav a[aria-current="page"],
.site-header .nav-links a[aria-current="page"] {
  background: var(--accent-tint);
  color: var(--ink);
  border-bottom-color: transparent;
}
.site-header nav a[data-text],
.site-header .nav-links a[data-text] {
  overflow: hidden;
  perspective: 400px;
}
.site-header nav a[data-text] > span,
.site-header .nav-links a[data-text] > span {
  display: inline-block;
  color: var(--text-muted);
  transition: transform .3s cubic-bezier(.76, 0, .24, 1), color .25s ease;
}
.site-header nav a[data-text]:hover > span,
.site-header .nav-links a[data-text]:hover > span {
  color: #fff;
}
.site-header nav a[aria-current="page"][data-text] > span,
.site-header .nav-links a[aria-current="page"][data-text] > span { color: var(--ink); }
.site-header nav a[data-text]::after,
.site-header .nav-links a[data-text]::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  pointer-events: none;
  color: var(--coral);
  transform: translateY(105%) rotateX(-35deg);
  transition: transform .3s cubic-bezier(.76, 0, .24, 1);
}
.site-header nav a[data-text]:hover > span,
.site-header .nav-links a[data-text]:hover > span {
  transform: translateY(-105%) rotateX(35deg);
}
.site-header nav a[data-text]:hover::after,
.site-header .nav-links a[data-text]:hover::after {
  transform: translateY(0) rotateX(0deg);
}
@media (prefers-reduced-motion: reduce) {
  .site-header nav a, .site-header .nav-links a,
  .site-header nav a[data-text] > span,
  .site-header .nav-links a[data-text] > span,
  .site-header nav a[data-text]::after,
  .site-header .nav-links a[data-text]::after { transition: none; }
}
