/* =====================================================================
   MCGINNIS ARCHITECTURE — SITE STYLESHEET
   Shared by index.html and project1.html.

   TABLE OF CONTENTS
   -----------------
    1. Design tokens (colors, shadows) — the :root variables
    2. Global reset & base page styles
    3. Site header (logo, hearts badge, sticky + shrink-on-scroll)
    4. Links & small text elements (a, code)
    5. Page layout containers (main, .hero, .card)
    6. Contact form elements (project1.html)
    7. Buttons & button-styled links
    8. Footer
    9. Legacy unused (.logo) + success.html styles (.success-hero, etc.)
   10. Scroll-reveal animation ([data-reveal])
   11. Live status pulse dot (.status-dot)
   12. Nav menu + "Projects" dropdown
   13. Home hero blueprint-grid animation (index.html only)
   14. Projects section: grid, cards, hover, shimmer, thumbnail patterns
   15. About / practice section (index.html only)
   16. "How it works" architecture diagram (project1.html only)
   17. Use cases (project1.html only)
   18. Pricing (project1.html only)
   19. Back-to-top button (both pages)
   20. Mobile sidebar nav (mobile only, all pages)
   21. Mobile responsive overrides (max-width: 760px)
   22. Reduced-motion accessibility override

   Search for the "-----" section headers below to jump around.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. DESIGN TOKENS
   All site colors and the card shadow live here as CSS variables.
   Change a value once here and it updates everywhere that uses it —
   this is the fastest way to re-theme the whole site.
   --------------------------------------------------------------------- */
:root {
  --bg: #f6f7fb;              /* page background */
  --surface: #ffffff;         /* card / dropdown background */
  --text: #172033;            /* main navy — body text, headings, logo ink */
  --muted: #5f6b7a;           /* secondary/gray text */
  --border: #d9dee8;          /* hairline borders */
  --accent: #3454d1;          /* main blue — links, buttons, eyebrows */
  --accent-dark: #263fa0;     /* hover/pressed state of accent blue */
  --success-bg: #eaf8ef;      /* contact form success message background */
  --success-text: #17633a;
  --error-bg: #fdecec;        /* contact form error message background */
  --error-text: #982727;
  --info-bg: #eef3ff;         /* light blue used for hover states, stat tiles */
  --info-text: #2946a3;
  --shadow: 0 24px 60px rgba(23, 32, 51, 0.12); /* the soft shadow on cards */
  --grid-line: rgba(52, 84, 209, 0.14); /* faint blueprint-grid line color */
  --surface-translucent: rgba(255, 255, 255, 0.9); /* used instead of a
    hardcoded white so .card/.about-grid actually go dark in dark mode */
}

/* ---------------------------------------------------------------------
   2. GLOBAL RESET & BASE PAGE STYLES
   Affects every element on every page: box-sizing, smooth anchor
   scrolling, base font, and the body background (a subtle radial
   gradient over --bg).
   --------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* smooth-scrolls to #anchors like #projects */
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden; /* safety net: content should never force horizontal
                          scroll — if something miscalculates its width,
                          this clips it instead of widening the whole page */
  background:
    radial-gradient(circle at top left, rgba(52, 84, 209, 0.18), transparent 32rem),
    var(--bg);
}

/* ---------------------------------------------------------------------
   3. SITE HEADER
   HTML shape (both pages):
     <header class="site-header">
       <div class="site-header-inner">   <- centered 1080px row, 3-column grid
         <div class="brand-row"><a class="logo-mark"><img></a></div>  <- left
         <img class="top-mark">                                       <- center (hearts badge)
         <nav>...</nav>                                                <- right
       </div>
     </header>

   The header is "position: sticky" so it stays pinned to the top of the
   viewport while scrolling. A small inline <script> at the bottom of
   each HTML file toggles the ".is-scrolled" class on <header> once the
   user scrolls more than 12px — that's what shrinks the logo/badge and
   adds the drop shadow. To change the shrink trigger distance, edit the
   "window.scrollY > 12" check in that script, not this file.
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease;
  overflow-anchor: none;
}

/* Applied via JS once the page is scrolled — see note above. */
.site-header.is-scrolled {
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.12);
}

.site-header.is-scrolled .site-header-inner {
  padding: 0.3rem 1.25rem; /* shrinks header padding while scrolled */
}

.site-header.is-scrolled .logo-mark img {
  height: 64px; /* shrunk logo size while scrolled — normal size is below */
}

.site-header.is-scrolled .top-mark {
  height: 32px; /* shrunk hearts-badge size while scrolled */
}

/* The 3-column row that actually holds logo / hearts / nav.
   grid-template-columns: 1fr auto 1fr is what keeps the hearts badge
   perfectly centered no matter how wide the logo or nav are. */
.site-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  gap: 1rem;
  transition: padding 0.25s ease;
}

.site-header-inner .brand-row {
  justify-self: start; /* logo pinned left */
}

.site-header-inner .top-mark {
  justify-self: center; /* hearts badge pinned to true center */
}

.site-header-inner nav {
  justify-self: end; /* nav pinned right */
}

/* --- Logo (the "McGinnis Architecture" wordmark image) --- */
.logo-mark {
  display: inline-flex;
  align-items: center;
}

.logo-mark img {
  display: block;
  height: 112px;     /* <-- MAIN LOGO SIZE. Change this one number to resize it. */
  width: auto;        /* width follows automatically to keep proportions */
  transition: height 0.25s ease;
}

.logo-mark img.logo-dark {
  display: none;
}

[data-theme="dark"] .logo-mark img.logo-light {
  display: none;
}

[data-theme="dark"] .logo-mark img.logo-dark {
  display: block;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Images carry intrinsic width/height attributes so the browser reserves space
   before they load (no layout shift); :where() keeps this at zero specificity so
   any class that sets a height still wins. */
:where(img[width][height]) {
  height: auto;
}

/* --- Hearts badge (assets/heart-badge.webp, the three recolored hearts) --- */
.top-mark {
  display: block;
  height: 55px;      /* <-- HEARTS BADGE SIZE. Change this one number to resize it. */
  width: auto;
  transition: height 0.25s ease, filter 0.25s ease;
}

/* It's black ink on a transparent background, so a plain invert turns
   it into clean white line art — no hue correction needed like the
   logo required, since there's no color here to preserve, just black
   vs. white. Without this it's just invisible against a dark page. */
[data-theme="dark"] .top-mark {
  filter: invert(1);
}

/* ---------------------------------------------------------------------
   4. LINKS & SMALL TEXT ELEMENTS
   Generic <a> styling used site-wide, plus the small <code> tags used
   in the project1.html instructions ("...in config.js").
   --------------------------------------------------------------------- */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--surface);
  font-size: 0.92em;
}

/* ---------------------------------------------------------------------
   5. PAGE LAYOUT CONTAINERS
   .hero is the big intro text block under the header (used on both
   pages — index.html also layers .home-hero on top of it, see
   Section 13). .card is the two-column panel that wraps the contact
   form on project1.html.
   --------------------------------------------------------------------- */
main {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: 1.25rem 0 3rem; /* top value controls space below the header */
  max-width: 760px;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 7vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-arrow {
  color: var(--accent);
  margin-left: 0.8em;
}

/* For project titles too long to comfortably fit the default hero h1
   size on one line (e.g. "SNS Notification Fan-Out") — a smaller,
   less aggressive clamp than the homepage's big display treatment,
   which is tuned for much shorter 2-word titles. */
.hero-title-compact {
  font-size: clamp(1.7rem, 4.6vw, 2.9rem);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .hero-title-compact {
    white-space: normal;
  }
}

.hero-deployed {
  display: inline-block;
  opacity: 0;
  margin-left: 0.15em; /* space + rightward position after the dash */
  transform: translateX(-60px);
}

.hero-dot {
  display: inline-block;
  opacity: 0;
  transform: scale(0.4);
}

/* Only start these once the section's own scroll-reveal has finished
   fading in — otherwise the delay counts from page load, and part of
   the animation can silently finish while the section is still
   invisible, so what you actually see once it fades in looks abrupt
   or already-partway-done instead of a clean fade. */
.home-hero.is-visible .hero-deployed {
  animation: heroDeployedIn 3.4s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

.home-hero.is-visible .hero-dot {
  animation: heroDotIn 3.4s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

@keyframes heroDeployedIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes heroDotIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero p {
  max-width: 660px;
  font-size: 1.15rem;
  color: var(--muted);
}

.eyebrow {
  /* the small uppercase label above headings, e.g. "SELECTED WORK" */
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card {
  /* two-column panel: intro copy on the left, form on the right
     (project1.html only) */
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1fr);
  gap: 2rem;
  margin-bottom: 4rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background: var(--surface-translucent);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
}

/* Bundles a .card's intro copy together with its primary control (a
   button or a form) into ONE grid item, so the pair stacks in column 1
   instead of the control auto-placing into column 2 beside the intro
   text. Whatever comes after this wrapper in the DOM then naturally
   auto-places into column 2 on its own -- no explicit grid-column
   needed on it. Used on projects whose demo section shows result/
   status output beside the trigger instead of below it. */
.card-primary-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-primary-col > .notify-trigger {
  align-self: flex-start;
  padding-top: 0;
}

.card-primary-col > .contact-form,
.card-full-row > .contact-form {
  padding-top: 0;
}

/* Spans both of a .card's columns -- for a block of controls that needs
   full card width (e.g. product choices that must fit in a single row)
   rather than being confined to column 1. */
.card-full-row {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

.muted {
  color: var(--muted);
}

.small-note {
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------------
   6. CONTACT FORM ELEMENTS (project1.html)
   Styles the <form class="contact-form"> fields: labels, inputs,
   textarea, the character-count hint, the consent checkbox row, the
   invisible honeypot field, and the status message that appears after
   submit (info/success/error color variants).
   --------------------------------------------------------------------- */
.contact-form {
  display: grid;
  gap: 1rem;
  padding-top: 5rem; /* aligns the Email field below the "Smoke Test"
                         heading in the left column, rather than at the
                         very top of the row next to the "Demo" eyebrow */
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.55rem 1rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(52, 84, 209, 0.22);
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.hint {
  /* the "0/1000 characters" counter under the message field */
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-weight: 500;
}

.checkbox-row input {
  width: auto;
  margin-top: 0.25rem;
}

.honeypot {
  /* hides the spam-trap "Website" field from real visitors */
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  /* base style for the message shown after submit; color comes from
     one of the three modifier classes below */
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-weight: 700;
}

.form-status.info {
  color: var(--info-text);
  background: var(--info-bg);
}

.form-status.success {
  color: var(--success-text);
  background: var(--success-bg);
}

.form-status.error {
  color: var(--error-text);
  background: var(--error-bg);
}

/* ---------------------------------------------------------------------
   7. BUTTONS & BUTTON-STYLED LINKS
   Applies to <button> elements and any <a class="button-link">.
   Add class "ghost" for the outlined secondary style (see
   .button-link.ghost below) — used for secondary calls to action.
   --------------------------------------------------------------------- */
button,
.button-link {
  justify-self: start;
  display: inline-block;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font: inherit;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(52, 84, 209, 0.25);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Guarded to real hover-capable pointers only -- without this, touch
   browsers latch a tapped element's :hover state and don't clear it
   until the next tap elsewhere, which reads as the button staying
   "pressed"/selected (most noticeable on the theme toggle below). */
@media (hover: hover) and (pointer: fine) {
  button:hover,
  .button-link:hover {
    background: var(--accent-dark);
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(52, 84, 209, 0.32);
  }
}

button:active,
.button-link:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

/* A mouse or touch click still leaves the element focused after the
   click ends -- browsers already suppress the focus ring for that case
   via :focus-visible in the normal run of things, but this makes it
   explicit rather than relying on default UA behavior, so a clicked
   "View projects"/"About me" style CTA never looks like it's stuck
   "selected" once the click itself is over. Keyboard focus is
   untouched -- :focus-visible still gets its own ring further down. */
button:focus:not(:focus-visible),
.button-link:focus:not(:focus-visible) {
  outline: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

/* Secondary/outlined button style — add class="button-link ghost" */
.button-link.ghost {
  color: var(--accent);
  background: transparent;
  box-shadow: none;
  border: 1px solid var(--border);
}

.button-link.ghost:hover {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 16px 34px rgba(38, 63, 160, 0.28);
}

/* Compact variant for secondary in-form actions that shouldn't compete
   with the form's real submit button — add class="button-link small". */
.button-link.small {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: none;
}

/* ---------------------------------------------------------------------
   8. FOOTER
   The <footer><div class="footer-row">...</div></footer> at the
   bottom of every page: copyright line on the left, nav links on the
   right (wraps to stacked on narrow screens automatically via flex-wrap).
   --------------------------------------------------------------------- */
footer {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-links img {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-links a:hover img,
.social-links a:focus-visible img {
  opacity: 1;
  transform: translateY(-2px);
}

.footer-row nav {
  display: flex;
  gap: 1.25rem;
}

.footer-row nav a {
  color: var(--muted);
  font-weight: 700;
}

.footer-row nav a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------------
   9. LEGACY / CURRENTLY UNUSED
   .logo was for a plain-text wordmark, from before the header switched
   to the logo.png image. Safe to delete if you're confident you'll
   never go back to a text-only logo.
   --------------------------------------------------------------------- */
.logo {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ----- success.html: the page the contact form redirects to after a
   submit. Reuses the standard .hero layout/typography (that's why
   there's no separate heading size rule here) with a checkmark icon
   and centered actions added on top. ----- */
.success-hero {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.success-hero .hero-actions {
  justify-content: center;
}

.success-icon {
  display: inline-flex;
  margin-bottom: 1.25rem;
}

.success-icon svg {
  width: 64px;
  height: 64px;
}

.success-icon-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.35;
}

.success-icon-check {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  animation: successCheckDraw 0.6s ease-out 0.15s forwards;
}

@keyframes successCheckDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------------------------------------------------------------------
   10. SCROLL-REVEAL ANIMATION
   Any element with the HTML attribute data-reveal starts invisible and
   slides/fades up into place. A small IntersectionObserver script
   (bottom of index.html) adds the "is-visible" class when the element
   scrolls into view. data-reveal lives on .project-grid itself (not on
   each .project-card) so the whole row fades in as one unit instead of
   each card animating separately as it crosses the viewport edge.
   --------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.16,.84,.44,1), transform 0.7s cubic-bezier(.16,.84,.44,1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------------
   11. LIVE STATUS PULSE DOT
   The small pulsing dot next to "Live" on the Site Contact Form project
   card (index.html), signaling that project is actually deployed.
   --------------------------------------------------------------------- */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 84, 209, 0.45);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(52, 84, 209, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 84, 209, 0);
  }
}

/* Same dot, no pulse: signals "documented, not deployed" for a
   reference-only project card, at a glance distinct from the live pulse
   above -- static and neutral gray instead of animated and accent blue. */
.status-dot.is-reference-dot {
  background: var(--muted);
  animation: none;
  box-shadow: none;
}

/* ---------------------------------------------------------------------
   12. NAV MENU + "PROJECTS" DROPDOWN
   .site-header nav holds the top-level links (Home / About / Contact
   etc.) plus the <details class="nav-dropdown"> "Projects" menu. The
   dropdown is a native <details>/<summary> element (no JS needed to
   open/close it) — the "dropdownIn" keyframes + a tiny script handle
   the fade/slide-in animation when it opens, since browsers can't
   transition display:none on their own.
   --------------------------------------------------------------------- */
.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-weight: 700;
}

/* animated underline that sweeps in on hover, for top-level nav links */
.site-header nav > a {
  position: relative;
  padding-bottom: 0.2rem;
  transition: color 0.2s ease;
}

.site-header nav > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.site-header nav > a:focus-visible {
  text-decoration: none;
}

.site-header nav > a:focus-visible::after {
  right: 0;
}

/* Guarded like the buttons in Section 7 -- without this, a tap on a
   touch device latches the underline sweep on via :hover and it never
   retracts, since touch devices never fire a later "hover cleared"
   event the way a mouse does. */
@media (hover: hover) and (pointer: fine) {
  .site-header nav > a:hover {
    text-decoration: none;
  }

  .site-header nav > a:hover::after {
    right: 0;
  }
}

.nav-dropdown {
  position: relative;
}

/* ">" (direct-child) throughout this block on purpose: .nav-dropdown-menu
   can itself contain a nested <details class="nav-dropdown-subsection">
   with its own <summary> (the current page's expandable entry), and an
   unscoped ".nav-dropdown summary" descendant selector would also match
   that inner summary -- bleeding the outer "Projects" trigger's color,
   flex layout, and generated chevron onto it (a second, misplaced
   chevron on the right of that row). Keeping these rules to the
   immediate child summary avoids that entirely. */
.nav-dropdown > summary {
  /* the clickable "Projects" trigger text */
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none; /* hides the default browser triangle marker */
}

.nav-dropdown > summary::after {
  /* the custom chevron, drawn from two borders and rotated */
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}

.nav-dropdown[open] > summary::after {
  transform: rotate(-135deg) translateY(2px); /* flips chevron when open */
}

.nav-dropdown > summary:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 4px;
  border-radius: 6px;
}

.nav-dropdown-menu {
  /* the floating panel of project links */
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  align-content: start;
  gap: 0.1rem;
  min-width: 300px;
  max-width: calc(100vw - 2rem);
  /* the list keeps growing as projects are added, so cap the panel's
     height and let it scroll internally rather than spilling off the
     bottom of the viewport on shorter desktop windows */
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 20;
}

/* fade + slide-in animation, triggered by JS when <details> opens */
@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.nav-dropdown-menu a {
  color: var(--text);
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.nav-dropdown-menu a:hover {
  background: var(--info-bg);
  text-decoration: none;
  color: var(--accent);
  padding-left: 0.9rem;
}

.nav-dropdown-all {
  /* the "View all projects" link at the bottom of the dropdown */
  margin-top: 0.3rem;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem !important;
  color: var(--accent) !important;
}

/* The current page's own name in the list -- styled to match the
   sibling project links above it (.nav-dropdown-menu a) rather than
   standing out as a small-caps section label, since it's the same
   kind of thing they are (a project name), just rendered as an
   expand toggle instead of a plain link because you're already on
   that page. Flex + space-between puts the chevron (added via
   .nav-dropdown-subsection summary::after below) at the right edge of
   the row, with the text left-aligned and wrapping normally -- no
   indent trick needed since the chevron no longer competes with the
   text for the row's leading space. */
.nav-dropdown-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  color: var(--text);
  border-radius: 10px;
}

.nav-dropdown-menu a.nav-dropdown-sublink {
  padding-left: 1.4rem;
  font-weight: 500;
  font-size: 0.88rem;
}

.nav-dropdown-menu a.nav-dropdown-sublink:hover {
  padding-left: 1.6rem;
}

/* The current page's own on-page sections collapse behind a disclosure
   instead of always being expanded, so the rest of the project list
   stays reachable without scrolling past them. .nav-dropdown-sublink
   is a direct child of .nav-dropdown-menu's grid everywhere else, but
   once nested inside this <details> it needs `display: block` itself
   to keep stacking one per line -- <details> is a plain block box, not
   a grid, so its children fall back to inline layout otherwise. */
.nav-dropdown-subsection summary {
  cursor: pointer;
  list-style: none;
}

.nav-dropdown-subsection summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown-subsection summary::after {
  content: "";
  flex: none;
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.nav-dropdown-subsection[open] summary::after {
  transform: rotate(-135deg) translate(1px, 1px);
}

.nav-dropdown-subsection a.nav-dropdown-sublink {
  display: block;
}

/* ---------------------------------------------------------------------
   13. HOME HERO — PHOTO POSTER (index.html only)
   .home-hero is layered on top of the base .hero styles (Section 5) on
   index.html specifically. Desktop: a diagonal-clipped colored panel
   (.home-hero-copy) sits beside a full-bleed photo panel
   (.home-hero-photo-wrap), like a poster split down the middle. Below
   the 760px breakpoint that same photo becomes a small circular
   avatar stacked above plain, centered copy instead — see the
   .home-hero-copy/.home-hero-photo-wrap overrides in the mobile media
   query (Section 4/header block).
   --------------------------------------------------------------------- */
.home-hero {
  max-width: none;
  padding: 1.125rem 0 3.5rem;
}

.home-hero-grid {
  position: relative;
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 28px;
}

.home-hero-copy {
  background: var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Right padding scales with viewport width on purpose -- .home-hero
     has no max-width (it's meant to run full-bleed), and the diagonal
     clip-path below narrows by a FIXED PERCENTAGE of this box's own
     width. On a wide monitor that percentage is a lot more absolute
     pixels than the old flat 4rem padding accounted for, so the
     heading's last line (lower in the box, where the clip has already
     narrowed the most) was getting sliced off by the diagonal. A vw
     component makes the padding narrow the clip encroaches by keep
     pace with it at any width, instead of just at whatever width this
     was last tuned for. */
  padding: 3rem clamp(4rem, 6vw, 7.5rem) 3rem 1.5rem;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0% 100%);
  position: relative;
  z-index: 2;
}

.home-hero-copy .eyebrow {
  color: rgba(255, 255, 255, 0.8);
}

.home-hero-copy h1 {
  color: #fff;
  /* Smaller than the shared .hero h1 clamp on purpose -- "Built to
     Deliver" needs to fit on one line inside this column, which is
     roughly half the (full-bleed) hero's width minus the scaling
     right padding and the diagonal clip-path's narrowing, so the
     general hero heading size (tuned for a max-width:760px column)
     is too large here. */
  font-size: clamp(1.9rem, 3.6vw, 3.4rem);
  white-space: nowrap;
}

.home-hero-copy .hero-arrow {
  color: rgba(255, 255, 255, 0.75);
}

.home-hero-copy p {
  color: rgba(255, 255, 255, 0.85);
}

.home-hero-copy .button-link {
  background: #fff;
  /* Fixed navy, not var(--accent-dark) -- that token flips to a
     *light* blue in dark mode (for text-on-accent elsewhere), which
     would be low-contrast against this button's always-white fill. */
  color: #263fa0;
}

.home-hero-copy .button-link.ghost {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.65);
}

/* min-width guard keeps this scoped to the diagonal poster panel above
   -- below 760px .home-hero-copy switches to a plain solid button on a
   plain background, where the global button:hover rule already applies. */
@media (hover: hover) and (pointer: fine) and (min-width: 761px) {
  .home-hero-copy .button-link:hover {
    background: rgba(255, 255, 255, 0.85);
  }

  .home-hero-copy .button-link.ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: #fff;
  }
}

.home-hero-photo-wrap {
  background: linear-gradient(135deg, var(--accent-dark), #0e1320 130%);
  margin-left: -14%;
  position: relative;
}

.home-hero-photo-ring {
  display: none;
}

.home-hero-photo {
  display: block;
  width: 100%;
  height: 100%;
}

.home-hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Shifted right of center (not the mobile circular avatar's crop,
   which uses a separate closer-cropped source image) -- centered
   was cropping too much of the jacket/shoulder on the right side of
   the frame. */
@media (min-width: 761px) {
  .home-hero-photo img {
    object-position: 65% center;
  }
}

.hero-actions {
  /* the row of buttons under the hero heading, e.g. "Browse projects" */
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

/* ---------------------------------------------------------------------
   14. PROJECTS SECTION (index.html only)
   Covers the whole #projects section: the grid layout, each
   .project-card, its hover lift, and the "shimmer" sweep that plays on
   placeholder (not-yet-live) cards.

   Each card's .project-thumb holds an inline SVG illustration:
   - Live projects (class="is-live" on the card, e.g. Site Contact Form)
     get the .mockup-scene browser/form graphic with a blinking cursor
     and a pulsing send button.
   - Placeholder projects get the .arch-scene graphic — three simple
     service nodes connecting left to right, revealing themselves one
     at a time on a loop, like a small architecture diagram slowly
     being drawn.
   --------------------------------------------------------------------- */
.projects {
  padding: 1rem 0 3rem;
}

.projects h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
}

.section-intro {
  max-width: 620px;
  margin-bottom: 2rem;
}

.project-grid {
  /* responsive grid: as many 220px+ columns as fit, wrapping automatically.
     At this page's 1080px content width, that's 4 columns. */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* Keeps the sticky header from covering these sections/cards when the
   page jumps to them (e.g. via the nav dropdown or #about link).
   If you change the header's height, increase these values to match. */
#projects,
#about,
#contact,
#demo,
#how-it-works,
#use-cases,
#pricing,
#design-decisions {
  scroll-margin-top: 9.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 9.5rem;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 30px 70px rgba(23, 32, 51, 0.18);
  border-color: var(--accent);
}

/* Without this, the [hidden] attribute the projects filter sets on a
   non-matching card has no visible effect -- .project-card's own
   `display: flex` above ties the native [hidden] UA rule on specificity,
   and an author rule always wins that tie, so the card stayed visibly
   rendered regardless of the filter until this override was added. */
.project-card[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------
   12b. PROJECTS FILTER BAR
   Two <select>s (service, deployment status) that narrow .project-grid
   client-side -- see the "Projects filter" script at the bottom of
   index.html. Beta-only for now: this ships fine to prod too since it
   degrades to "show everything," but the deployment-status filter has
   nothing to narrow there (every project on prod is live), so it's
   being held back until there's an actual promotion decision to make.
   --------------------------------------------------------------------- */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.project-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.project-filter-label {
  color: var(--muted);
}

.project-filter select {
  appearance: none;
  min-width: 200px;
  padding: 0.55rem 2.2rem 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23697086' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.project-filter select:hover,
.project-filter select:focus-visible {
  border-color: var(--accent);
}

.project-filter-reset {
  align-self: flex-end;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.project-filter-reset:hover {
  background: var(--info-bg);
  border-color: var(--accent);
}

.project-filter-reset[hidden] {
  display: none;
}

.project-filter-empty {
  margin: -0.5rem 0 1.5rem;
}

.project-filter-empty[hidden] {
  display: none;
}

.project-thumb {
  /* the illustrated rectangle at the top of each card */
  aspect-ratio: 16 / 10;
  background-color: var(--info-bg);
  position: relative;
  overflow: hidden;
  display: flex;
}

.project-card:hover .arch-scene,
.project-card:hover .mockup-scene,
.project-card:hover .icon-scene {
  transform: scale(1.04);
}

/* Placeholder projects (any card WITHOUT class="is-live" or
   class="is-reference") get a soft build/deploy shimmer sweep to signal
   "not live yet". Add class="is-live" to a .project-card to turn the
   shimmer off once that project has a real page -- class="is-reference"
   turns it off too, since a reference-only card isn't "coming soon", it's
   deliberately never deployed (see section 14c below). */
.project-card:not(.is-live):not(.is-reference) .project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 3.4s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 160% 0;
  }
  100% {
    background-position: -60% 0;
  }
}

/* ----- "Coming soon" illustration: three simple service nodes that
   reveal themselves left to right on a loop, like a small architecture
   diagram slowly being drawn. Used on the one remaining placeholder
   project card (thumb-arch). ----- */
.thumb-arch,
.thumb-mockup,
.thumb-icons,
.thumb-envelope,
.thumb-reel {
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.arch-scene,
.mockup-scene,
.icon-scene {
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.arch-node rect {
  fill: var(--accent);
}

.arch-glyph-stroke {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arch-line line {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.arch-node-1 {
  transform-origin: 65px 110px;
  animation: archNode1 8s ease-in-out infinite;
}

.arch-line-1 {
  animation: archLine1 8s ease-in-out infinite;
}

.arch-node-2 {
  transform-origin: 160px 110px;
  animation: archNode2 8s ease-in-out infinite;
}

.arch-line-2 {
  animation: archLine2 8s ease-in-out infinite;
}

.arch-node-3 {
  transform-origin: 255px 110px;
  animation: archNode3 8s ease-in-out infinite;
}

/* ----- SNS Fan-Out thumbnail: a hub node (SNS) with two lines
   branching out to separate subscriber icons, reusing the same
   archNode/archLine pulse timing as the placeholder card above —
   just retargeted at this hub-and-spoke layout instead of a straight
   line, since this project's whole point is fanning one thing out. ----- */
/* ----- SNS Fan-Out thumbnail: SNS starts full-size and centered in
   the frame, shrinks into its hub position while the two branch icons
   fade in and hold, then the branches fade back out as SNS grows back
   to full size and re-centers — a continuous loop rather than a
   one-shot reveal, since this card sits above the fold and is worth
   more than a single first-view animation.

   The hub's normal small position is off-center (its rect sits at
   x=47 in a 320-wide viewBox, center ~72), so "full size" alone would
   just grow it in place rather than centering it — the translate
   below shifts it +88px in x exactly when it's at full scale, which
   lands its center at the frame's true midpoint (160). ----- */
.fanout-thumb-box {
  fill: var(--accent);
}

.fanout-thumb-glyph-fill {
  fill: #fff;
}

.fanout-thumb-line line {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.fanout-thumb-hub {
  transform-box: fill-box;
  transform-origin: center;
  animation: fanoutHubMove 6s ease-in-out infinite;
}

.fanout-thumb-node,
.fanout-thumb-line {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: fanoutBranchFade 6s ease-in-out infinite;
}

@keyframes fanoutHubMove {
  0%, 12%   { transform: translate(88px, 0) scale(3.4); }
  28%, 68%  { transform: translate(0, 0) scale(1); }
  84%, 100% { transform: translate(88px, 0) scale(3.4); }
}

@keyframes fanoutBranchFade {
  0%, 18%   { opacity: 0; }
  32%, 62%  { opacity: 1; }
  74%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fanout-thumb-hub,
  .fanout-thumb-node,
  .fanout-thumb-line {
    animation: none;
  }

  .fanout-thumb-node,
  .fanout-thumb-line {
    opacity: 1;
  }
}

/* ----- Contact Form thumbnail: an envelope whose flap opens and stays
   open (revealing a lighter blue interior), with the four services it
   uses (S3, API Gateway, Lambda, SES) bursting outward from that single
   opening point to an evenly-spaced row above, then fading back toward
   center as the flap closes. ----- */
.contact-thumb-box {
  fill: var(--accent);
}

.envelope-body {
  fill: var(--accent);
}

.envelope-top-quad {
  animation: envelopeQuadColor 6s ease-in-out infinite;
}

@keyframes envelopeQuadColor {
  0%, 10% { fill: var(--accent); }
  25%, 75% { fill: #7d99e3; }
  90%, 100% { fill: var(--accent); }
}

.envelope-seams {
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.5;
  fill: none;
}

.envelope-flap {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: envelopeFlap 6s ease-in-out infinite;
}

@keyframes envelopeFlap {
  0%, 10% { transform: scaleY(0); fill: var(--accent); }
  25%, 75% { transform: scaleY(1); fill: #7d99e3; }
  90%, 100% { transform: scaleY(0); fill: var(--accent); }
}

.envelope-node {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  opacity: 0;
}

.envelope-node-1 { animation: envelopeRise1 6s ease-in-out infinite; animation-delay: 0s; }
.envelope-node-2 { animation: envelopeRise2 6s ease-in-out infinite; animation-delay: 0.15s; }
.envelope-node-3 { animation: envelopeRise3 6s ease-in-out infinite; animation-delay: 0.3s; }
.envelope-node-4 { animation: envelopeRise4 6s ease-in-out infinite; animation-delay: 0.45s; }

/* Each icon bursts from the same envelope-opening point (160, 130) out
   to its own evenly-spaced resting position — the translate distance is
   simply that point minus the icon's own final center, so all four
   start exactly on top of each other at the envelope and fan out from
   there, rather than each just rising straight up from where it ends.
   The staggered delays above make sure they visibly separate one after
   another instead of moving together. */
@keyframes envelopeRise1 {
  0%, 20% { opacity: 0; transform: translate(117px, 64px) scale(0.3); }
  32%, 68% { opacity: 1; transform: translate(0, 0) scale(1); }
  80%, 100% { opacity: 0; transform: translate(117px, 64px) scale(0.3); }
}

@keyframes envelopeRise2 {
  0%, 20% { opacity: 0; transform: translate(39px, 64px) scale(0.3); }
  32%, 68% { opacity: 1; transform: translate(0, 0) scale(1); }
  80%, 100% { opacity: 0; transform: translate(39px, 64px) scale(0.3); }
}

@keyframes envelopeRise3 {
  0%, 20% { opacity: 0; transform: translate(-39px, 64px) scale(0.3); }
  32%, 68% { opacity: 1; transform: translate(0, 0) scale(1); }
  80%, 100% { opacity: 0; transform: translate(-39px, 64px) scale(0.3); }
}

@keyframes envelopeRise4 {
  0%, 20% { opacity: 0; transform: translate(-117px, 64px) scale(0.3); }
  32%, 68% { opacity: 1; transform: translate(0, 0) scale(1); }
  80%, 100% { opacity: 0; transform: translate(-117px, 64px) scale(0.3); }
}

/* ----- Movie Poll thumbnail: a continuously spinning film reel — a
   nod to the "if you were a movie" poll theme, simpler and more fitting
   here than another AWS icon row. ----- */
.film-reel {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: reelSpin 7s linear infinite;
}

@keyframes reelSpin {
  to {
    transform: rotate(360deg);
  }
}

.reel-disc {
  fill: var(--text);
}

.reel-hole,
.reel-hole-tiny {
  fill: var(--bg);
}

.reel-icon-counter {
  animation: reelSpinReverse 7s linear infinite;
}

@keyframes reelSpinReverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes archNode1 {
  0%, 8% { opacity: 0; transform: scale(0.75); }
  20% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; transform: scale(1); }
  95%, 100% { opacity: 0; transform: scale(0.75); }
}

@keyframes archLine1 {
  0%, 24% { opacity: 0; }
  32% { opacity: 1; }
  85% { opacity: 1; }
  95%, 100% { opacity: 0; }
}

@keyframes archNode2 {
  0%, 32% { opacity: 0; transform: scale(0.75); }
  40% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; transform: scale(1); }
  95%, 100% { opacity: 0; transform: scale(0.75); }
}

@keyframes archLine2 {
  0%, 44% { opacity: 0; }
  52% { opacity: 1; }
  85% { opacity: 1; }
  95%, 100% { opacity: 0; }
}

@keyframes archNode3 {
  0%, 52% { opacity: 0; transform: scale(0.75); }
  60% { opacity: 1; transform: scale(1.1); }
  66% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; transform: scale(1); }
  95%, 100% { opacity: 0; transform: scale(0.75); }
}


/* ----- Live "Site Contact Form" illustration: a small animated
   browser/form mockup. Over a 12s loop: the cursor types an email
   address, the Send button gets pressed, an envelope flies up and out
   of the form (sent), then the form fades out and a small mailbox
   fades in — the envelope reappears inside it, slides out to the side, and
   a letter slides out of it (opened) — before the scene resets to the
   form for a seamless loop. All timed against the same 12s duration —
   see the keyframe percentage comments below before changing any of
   them, since they're all synchronized to one shared timeline. ----- */
.mockup-frame {
  fill: var(--surface);
  stroke: var(--border);
}

.mockup-bar {
  fill: var(--info-bg);
}

.mockup-dot {
  fill: var(--border);
}

.mockup-address {
  fill: var(--border);
  opacity: 0.6;
}

.mockup-form-content {
  animation: mockupFormContent 12s ease-in-out infinite;
}

.mockup-field {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
}

.mockup-field-text {
  font-size: 10px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  fill: var(--text);
  opacity: 0;
  animation: mockupTypeEmail 12s linear infinite;
}

.mockup-button-group {
  transform-origin: 72px 110px;
  animation: mockupButtonPress 12s ease-in-out infinite;
}

.mockup-button {
  fill: var(--accent);
}

.mockup-button-text {
  font-size: 9px;
  font-weight: 700;
  fill: #fff;
}

.mockup-cursor {
  stroke: var(--accent);
  stroke-width: 2;
  animation: mockupCursorBlink 0.9s steps(1) infinite;
}

.mockup-cursor-group {
  animation: mockupCursorMove 12s ease-in-out infinite;
}

.mockup-mailbox {
  opacity: 0;
  animation: mockupMailbox 12s ease-in-out infinite;
}

.mockup-mailbox-post {
  fill: var(--muted);
  opacity: 0.5;
}

.mockup-mailbox-roof {
  fill: var(--accent-dark);
}

.mockup-mailbox-body {
  fill: var(--accent);
}

.mockup-mailbox-side {
  fill: var(--accent-dark);
}

.mockup-mailbox-opening {
  fill: var(--text);
  opacity: 0.55;
}

.mockup-mailbox-doorflap {
  fill: var(--accent);
  stroke: var(--accent-dark);
  stroke-width: 1;
  stroke-linejoin: round;
}

.mockup-mailbox-dash {
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.8;
}

.mockup-envelope {
  opacity: 0;
  animation: mockupEnvelopeTrip 12s ease-in-out infinite;
}

.mockup-envelope-body {
  fill: var(--accent);
}

.mockup-envelope-flap {
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.mockup-letter {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0;
  animation: mockupLetter 12s ease-out infinite;
}

/* ---- timeline (12s total, all keyframes below share this duration) ----
   0-24%    cursor + typing: Email
   24-32%   hold (email visible, cursor blinking)
   32-36%   cursor exits, button press
   36-44%   envelope appears at the button and flies up out of the form (sent)
   40-46%   the form content fades out — the "screen" is clearing
   53-60%   the mailbox fades in
   61-70%   the envelope reappears inside the mailbox and slides out to the side
   70-94%   hold (envelope resting beside the mailbox)
   78-86%   a letter slides up out of the envelope (opened)
   86-94%   extra hold once the letter is fully open, before resetting
   94-100%  everything resets — mailbox fades out, form fades back in
--------------------------------------------------------------------- */
@keyframes mockupFormContent {
  0%, 40% { opacity: 1; }
  46%, 94% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes mockupCursorMove {
  0% { transform: translate(44px, 66px); opacity: 1; }
  28% { transform: translate(44px, 66px); opacity: 1; }
  32% { opacity: 0; }
  95% { opacity: 0; transform: translate(44px, 66px); }
  100% { opacity: 1; transform: translate(44px, 66px); }
}

@keyframes mockupCursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes mockupTypeEmail {
  0%, 6% { opacity: 0; }
  20% { opacity: 1; }
  40% { opacity: 1; }
  44%, 100% { opacity: 0; }
}

@keyframes mockupButtonPress {
  0%, 32% { transform: scale(1); }
  34% { transform: scale(0.88); }
  36% { transform: scale(1); }
  100% { transform: scale(1); }
}

@keyframes mockupMailbox {
  0%, 53% { opacity: 0; }
  60% { opacity: 1; }
  94% { opacity: 1; }
  96%, 100% { opacity: 0; }
}

@keyframes mockupEnvelopeTrip {
  /* trip 1: sent — fades in at the button, flies up, fades out in place
     (no position change while opacity is animating — that overlap was
     what caused the diagonal "zoom" look), then jumps to inside the
     mailbox while fully invisible */
  0%, 40% { opacity: 0; transform: translate(0, 0); }
  44% { opacity: 1; transform: translate(0, -4px); }
  51% { opacity: 1; transform: translate(0, -85px); }
  52% { opacity: 0; transform: translate(0, -85px); }
  53%, 60% { opacity: 0; transform: translate(92px, 22px); }
  /* trip 2: arrives — fades in at the mailbox door (stationary), then
     slides out to the side while fully visible, holds through the
     letter opening plus an extra second before the loop resets */
  61% { opacity: 1; transform: translate(92px, 22px); }
  70% { opacity: 1; transform: translate(40px, 20px); }
  94% { opacity: 1; transform: translate(40px, 20px); }
  96%, 100% { opacity: 0; transform: translate(40px, 20px); }
}

@keyframes mockupLetter {
  0%, 78% { opacity: 0; transform: translateY(0); }
  86% { opacity: 1; transform: translateY(-13px); }
  94% { opacity: 1; transform: translateY(-13px); }
  96%, 100% { opacity: 0; transform: translateY(-13px); }
}

.project-body {
  /* the text area below each thumbnail: meta line, title, blurb, link */
  padding: 1.4rem 1.5rem 1.6rem;
  display: grid;
  gap: 0.5rem;
}

.project-meta {
  /* small uppercase line, e.g. "RESIDENTIAL · SONOMA COUNTY, CA · 2024" */
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-body h3 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.project-body p.muted {
  margin: 0;
  font-size: 0.96rem;
}

.project-link {
  /* Now wraps the entire card (thumb + body) so the whole panel is
     clickable, not just a text label — see the hover tint/button below
     for the visual affordance. Cancelling text-decoration here matters:
     without it, the site-wide a:hover{text-decoration:underline} rule
     would underline the title and description too, since they're now
     all inside this one link. */
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.project-link:hover,
.project-link:focus {
  text-decoration: none;
}

.project-card.is-live {
  position: relative;
}

.project-card.is-live::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(52, 84, 209, 0.06);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 1;
}

.project-card.is-live:hover::before,
.project-card.is-live:focus-within::before {
  opacity: 1;
}

.project-hover-cta {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(6px);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 2;
}

.project-hover-cta span {
  display: inline-block;
  white-space: nowrap;
  background: #d97706;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.35);
}

.project-card.is-live:hover .project-hover-cta,
.project-card.is-live:focus-within .project-hover-cta {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

/* Mirrors .project-card.is-live's hover-tint/hover-CTA behavior above,
   using --muted instead of --accent for the tint so hovering a
   reference-only card doesn't read as "live" even for a fraction of a
   second. */
.project-card.is-reference {
  position: relative;
}

.project-card.is-reference::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(95, 107, 122, 0.08);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 1;
}

.project-card.is-reference:hover::before,
.project-card.is-reference:focus-within::before {
  opacity: 1;
}

.project-card.is-reference:hover .project-hover-cta,
.project-card.is-reference:focus-within .project-hover-cta {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

/* ---------------------------------------------------------------------
   14b. BETA PROJECT CARD SCENES (homepage-card.html, one per project)
   Each beta card shares the placeholder's arch-node/arch-line
   3-node skeleton (Section 14), but adds one small motion flourish on
   top of it that's specific to what the project actually does, so the
   six beta cards read as distinct from each other and from the
   placeholder rather than as six copies of the same icon. Workflow
   Visualizer departs from the shared skeleton entirely -- a moving
   "current state" ring reads better for a state machine than three
   identical boxes.
   --------------------------------------------------------------------- */

/* Habit Tracker: a week strip of day cells -- the first several already
   checked off, the current day mid-pulse (still open), the rest empty --
   with a flame that flickers to signal an active streak. Replaces the
   old three-generic-boxes skeleton entirely; a calendar reads as
   "habit" in a way an icon-in-a-box never could. */
.habits-thumb-day {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 2;
}

.habits-thumb-day-done {
  fill: var(--accent);
  stroke: var(--accent);
}

.habits-thumb-day-active {
  fill: var(--info-bg);
  stroke: var(--accent);
  stroke-dasharray: 4 3;
  animation: habitsDayPulse 2.2s ease-in-out infinite;
}

@keyframes habitsDayPulse {
  0%, 100% { stroke-opacity: 0.45; }
  50% { stroke-opacity: 1; }
}

.habits-thumb-flame {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: habitsFlameFlicker 1.6s ease-in-out infinite;
}

@keyframes habitsFlameFlicker {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  30% { transform: scale(1.14) rotate(-4deg); opacity: 0.85; }
  55% { transform: scale(0.94) rotate(3deg); opacity: 1; }
  80% { transform: scale(1.1) rotate(-2deg); opacity: 0.9; }
}

/* Moderated Image Gallery: two different photos -- a mountain skyline
   and a potted flower -- scanned by Rekognition at the same time, one
   coming back approved (shield-check), the other rejected (shield-x).
   Different subjects in each frame, not the same zigzag glyph rotated
   twice, and the outcome badges fade in only once their scan finishes
   rather than sitting on screen the whole time. */
.gallery-thumb-photo rect {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 2;
}

.gallery-thumb-sun {
  fill: var(--accent);
  opacity: 0.35;
}

.gallery-thumb-mountain-back {
  fill: var(--border);
}

.gallery-thumb-mountain-front {
  fill: var(--accent);
  opacity: 0.85;
}

.gallery-thumb-art-stroke {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-thumb-leaf {
  fill: var(--accent);
  opacity: 0.5;
}

.gallery-thumb-petal {
  fill: var(--accent);
  opacity: 0.75;
}

.gallery-thumb-flower-center {
  fill: var(--accent);
}

.gallery-thumb-badge path:first-child {
  stroke: none;
}

.gallery-thumb-badge-approve path:first-child {
  fill: var(--success-text);
}

.gallery-thumb-badge-reject path:first-child {
  fill: var(--error-text);
}

.gallery-thumb-badge {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: galleryBadgeReveal 8s ease-in-out infinite;
}

@keyframes galleryBadgeReveal {
  0%, 64% { opacity: 0; transform: scale(0.6); }
  72% { opacity: 1; transform: scale(1.12); }
  78%, 92% { opacity: 1; transform: scale(1); }
  98%, 100% { opacity: 0; transform: scale(0.6); }
}

.gallery-scan-bar {
  fill: rgba(52, 84, 209, 0.28);
  transform-box: fill-box;
  opacity: 0;
  animation: gallerySweep 8s ease-in-out infinite;
}

@keyframes gallerySweep {
  0%, 24% { transform: translateY(0); opacity: 0; }
  30% { opacity: 0.9; }
  62% { transform: translateY(120px); opacity: 0.9; }
  70%, 100% { transform: translateY(120px); opacity: 0; }
}

/* Nova Lite Summarizer: a full page of text lines funnels down into a
   short summary page, a spark marking the model call at the pinch
   point -- literally "long text in, short text out" instead of three
   boxes with a checkmark between them. */
.summarizer-thumb-page {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 2;
}

.summarizer-thumb-page-summary {
  stroke: var(--accent);
}

.summarizer-thumb-line {
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.summarizer-thumb-summary-line {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.summarizer-thumb-funnel {
  stroke: var(--border);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summarizer-thumb-spark {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
  animation: summarizerSparkPulse 2.4s ease-in-out infinite;
}

@keyframes summarizerSparkPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.nova-doc-lines {
  transform-box: fill-box;
  transform-origin: 0% 50%;
  animation: novaDocPulse 8s ease-in-out infinite;
}

@keyframes novaDocPulse {
  0%, 15% { transform: scaleX(1); }
  35%, 55% { transform: scaleX(0.55); }
  75%, 100% { transform: scaleX(1); }
}

.nova-summary-lines {
  animation: novaSummaryGlow 8s ease-in-out infinite;
}

@keyframes novaSummaryGlow {
  0%, 40% { opacity: 0.5; }
  55%, 85% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* A dot traveling the funnel arrow itself -- the doc shrinking and the
   summary glowing were both too subtle on their own to read as motion. */
.nova-thumb-travel-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
  opacity: 0;
  animation: novaDotTravel 8s ease-in-out infinite;
}

@keyframes novaDotTravel {
  0%, 20% { transform: translateX(0); opacity: 0; }
  28% { opacity: 1; }
  48% { transform: translateX(60px); opacity: 1; }
  56%, 100% { transform: translateX(60px); opacity: 0; }
}

/* Order Processing: three waypoints on a conveyor belt (placed ->
   charged -> shipped) with the order itself traveling the full belt as
   a dot, instead of a dot hopping between two gaps in a row of boxes. */
.orders-thumb-belt {
  stroke: var(--border);
  stroke-width: 3;
  stroke-dasharray: 6 6;
}

.orders-thumb-stop rect {
  fill: var(--accent);
}

.order-ship-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
  opacity: 0;
  animation: orderShipTravel 8s ease-in-out infinite;
}

@keyframes orderShipTravel {
  0%, 8% { opacity: 0; transform: translateX(0); }
  14% { opacity: 1; }
  46% { opacity: 1; transform: translateX(220px); }
  52%, 100% { opacity: 0; transform: translateX(220px); }
}

/* Website Chatbot: two conversation bubbles -- a plain visitor bubble
   and an accent bot bubble with a typing indicator and a small spark --
   instead of an icon-in-a-box row.  */
.chatbot-thumb-bubble {
  fill: var(--info-bg);
  stroke: var(--border);
  stroke-width: 2;
}

.chatbot-thumb-bubble-bot {
  fill: var(--accent);
  stroke: var(--accent);
}

.chatbot-thumb-bubble-line {
  stroke: var(--muted);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.chatbot-thumb-spark {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
  animation: chatbotSparkPulse 2.4s ease-in-out infinite;
}

@keyframes chatbotSparkPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.chat-typing-dot {
  animation: chatTypingBounce 1.1s ease-in-out infinite;
}

.chat-typing-dot-1 { animation-delay: 0s; }
.chat-typing-dot-2 { animation-delay: 0.15s; }
.chat-typing-dot-3 { animation-delay: 0.3s; }

@keyframes chatTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* Workflow Visualizer: three diamond state nodes (the classic
   flowchart/state-machine symbol) linked by small chevron waypoints,
   with a ring that jumps from one to the next -- a state machine's
   current state advancing, rather than three parallel boxes lighting
   up together. */
.workflow-thumb-chevron {
  fill: var(--muted);
}

.workflow-thumb-state {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.workflow-thumb-glyph {
  stroke: var(--accent);
}

.workflow-thumb-active-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  opacity: 0;
  animation: workflowStateJump 8s ease-in-out infinite;
}

@keyframes workflowStateJump {
  0%, 4% { transform: translateX(0); opacity: 0; }
  8%, 28% { transform: translateX(0); opacity: 1; }
  32% { transform: translateX(95px); opacity: 0; }
  36%, 56% { transform: translateX(95px); opacity: 1; }
  60% { transform: translateX(190px); opacity: 0; }
  64%, 84% { transform: translateX(190px); opacity: 1; }
  88%, 100% { transform: translateX(190px); opacity: 0; }
}

/* Data Lake & Analytics: droplets fall into a lake, a bar chart rises
   out the other side -- a literal "data lake" instead of an icon row. */
.datalake-thumb-drop {
  fill: var(--accent);
  opacity: 0.85;
  animation: datalakeDropFall 4s ease-in infinite;
}

.datalake-thumb-drop-1 { animation-delay: 0s; }
.datalake-thumb-drop-2 { animation-delay: 1.3s; }
.datalake-thumb-drop-3 { animation-delay: 2.6s; }

@keyframes datalakeDropFall {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.85; }
  70% { opacity: 0.85; }
  85%, 100% { transform: translateY(70px); opacity: 0; }
}

.datalake-thumb-lake {
  fill: var(--info-bg);
}

.datalake-thumb-lake-line {
  stroke: var(--accent);
  stroke-width: 2;
}

.datalake-thumb-chart rect {
  fill: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .datalake-thumb-drop {
    animation: none;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .habits-thumb-day-active,
  .habits-thumb-flame,
  .gallery-scan-bar,
  .gallery-thumb-badge,
  .nova-doc-lines,
  .nova-summary-lines,
  .summarizer-thumb-spark,
  .nova-thumb-travel-dot,
  .order-ship-dot,
  .chat-typing-dot,
  .chatbot-thumb-spark,
  .workflow-thumb-active-ring {
    animation: none;
  }

  .nova-summary-lines,
  .gallery-thumb-badge {
    opacity: 1;
  }

  .gallery-scan-bar,
  .order-ship-dot,
  .workflow-thumb-active-ring {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------------
   15. ABOUT / PRACTICE SECTION (index.html only)
   The two-column panel near the bottom: copy on the left (.about-copy),
   the AWS certification badge grid on the right (.about-badges /
   .badge-grid / .badge-card). Each .badge-card is a real <a> link to
   that certification's public Credly page (opens in a new tab), using
   the actual Credly badge image (assets/badges/*.png) with the
   certification name as plain text underneath for accessibility/SEO.
   Add more .badge-card links + images to .badge-grid as you earn more
   certifications; it wraps automatically, left to right.
   --------------------------------------------------------------------- */
.about {
  padding: 1rem 0 3rem;
}

.about .eyebrow {
  font-size: 0.95rem;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.7fr);
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background: var(--surface-translucent);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.about h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
}

.badges-label {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  align-items: start; /* stops cards in the same row from stretching to
                          match the tallest one — that stretch was what
                          pushed shorter cards' text away from the top */
  gap: 0.85rem;
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* centers the icon+name as a block within the
                               fixed min-height below, so shorter names
                               don't leave the content stranded at the top */
  gap: 0.5rem;
  min-width: 0; /* without this, a grid item's implicit minimum width is
                   based on its content's widest unbreakable word — here,
                   the long certification names — which can force this
                   card's column wider than the container allows and
                   collapse the whole grid down to fewer columns than
                   intended (this is the same fix .flow-node needed) */
  min-height: 11rem; /* keeps every tile the same size regardless of how
                         long its certification name is */
  text-align: center;
  padding: 0.85rem 0.5rem;
  border-radius: 16px;
  background: var(--info-bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.badge-card:hover,
.badge-card:focus-visible {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.badge-card:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

.badge-card:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 3px;
}

/* Fixed-size, centered window for the badge art. The four Credly badges
   aren't all the same shape (hexagons vs. shield/ribbon shapes) or the
   same intrinsic proportions, so sizing the <img> itself with a fixed
   width+height could crop or unevenly inset some of them; centering a
   naturally-sized image inside a fixed box instead keeps every badge
   fully visible and consistently sized regardless of its shape. */
.badge-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.badge-icon {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  transition: transform 0.2s ease;
}

.badge-card:hover .badge-icon,
.badge-card:focus-visible .badge-icon {
  transform: scale(1.05);
}

.badge-name {
  margin: 0;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.3;
  overflow-wrap: break-word;
}

.badges-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------------
   16. "HOW IT WORKS" ARCHITECTURE DIAGRAM (project1.html only)
   The animated AWS flow diagram below the contact form: 7 .flow-node
   icons (Users, Route 53, CloudFront, S3, API Gateway, Lambda, SES) in
   a bordered .flow-diagram box, connected by 6 numbered .flow-connector
   arrows, plus a matching .flow-steps list with the written walkthrough.

   Icons intentionally have no circular frame — the "lit up" state is
   shown by desaturating inactive icons (grayscale + low opacity) and
   restoring full color on the active/done ones instead. .flow-track
   uses align-items: flex-start so every icon's top edge lines up even
   when one node's label wraps to two lines (e.g. "API Gateway") —
   .flow-node-icon and .flow-connector both have a fixed 60px height so
   the connector lines land exactly at icon-center height.

   How the animation works: a small inline <script> at the bottom of
   project1.html calls setActiveStep(n) on a timer, which adds
   "is-active"/"is-done" classes to the diagram nodes/connectors and the
   matching list item — the CSS below just reacts to those classes.
   Clicking a connector or list item jumps to that step and pauses
   autoplay; it resumes itself after a few seconds idle (see
   IDLE_RESUME_MS in that script). Edit STEP_MS there to change how long
   each step stays highlighted during autoplay.
   --------------------------------------------------------------------- */
.how-it-works {
  padding: 1rem 0 4rem;
}

.decisions {
  padding: 1rem 0 4rem;
}

.how-it-works .eyebrow,
.use-cases .eyebrow,
.pricing .eyebrow,
.decisions .eyebrow {
  font-size: 0.95rem;
}

.how-it-works h2,
.use-cases h2,
.pricing h2,
.decisions h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
}

.how-it-works .section-intro,
.use-cases .section-intro,
.pricing .section-intro,
.decisions .section-intro {
  margin-bottom: 2.5rem;
}

/* ---------------------------------------------------------------------
   ARCHITECTURE DIAGRAM (all project pages)
   A full AWS architecture diagram (built with draw.io, exported as a
   PNG) sits at the bottom of every project page as a click-to-expand
   thumbnail, plus a hero button (#architecture-diagram) linking
   straight to it. Shared markup/behavior across every project --
   the trigger/lightbox ids are the same everywhere, wired by an
   identical small script copied into each project's script.js,
   matching this codebase's existing "shared chrome, copied per page"
   convention rather than a separate JS file.
   --------------------------------------------------------------------- */
.architecture-diagram-section {
  padding: 1rem 0 4rem;
}

.arch-diagram-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  position: relative;
  box-shadow: var(--shadow);
}

.arch-diagram-thumb {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.2s ease;
}

.arch-diagram-trigger:hover .arch-diagram-thumb,
.arch-diagram-trigger:focus-visible .arch-diagram-thumb {
  filter: brightness(0.93);
}

.arch-diagram-trigger:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 3px;
}

.arch-diagram-expand-hint {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(20, 24, 38, 0.75);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  pointer-events: none;
}

.arch-diagram-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(10, 12, 20, 0.92);
  opacity: 0;
  pointer-events: none;
  /* visibility (after the fade) takes the closed lightbox's close button out
     of the tab order, which aria-hidden alone does not. */
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.arch-diagram-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0s;
}

.arch-diagram-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}

.arch-diagram-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.arch-diagram-lightbox-close:hover,
.arch-diagram-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.3);
}

body.diagram-lightbox-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .arch-diagram-expand-hint {
    right: 0.6rem;
    bottom: 0.6rem;
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
  }
}

.flow-diagram-sentinel {
  height: 1px;
}

.flow-diagram {
  overflow: visible;
  padding: 1.5rem;
  position: sticky;
  top: 6rem;
  z-index: 10;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  transform-origin: top center;
  transition: transform 0.25s ease;
  overflow-anchor: none;
}

/* Added via IntersectionObserver + a sentinel element right before the
   diagram in the HTML — .is-stuck means the diagram is currently pinned
   to the top of the viewport by its own sticky positioning, rather than
   sitting in its normal scroll position. */
.flow-diagram.is-stuck {
  transform: scale(0.78);
}

.flow-track {
  display: flex;
  align-items: flex-start; /* keeps every icon's top edge level, regardless
                               of whether a node's label wraps to two lines */
  width: 100%;
}

.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  width: 80px;
  text-align: center;
}

.flow-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px; /* fixed height on every icon box keeps the row aligned */
  color: var(--muted);
}

.flow-node-icon svg {
  width: 64px;
  height: 64px;
  transition: filter 0.35s ease, transform 0.35s ease;
}

.flow-node-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  /* Start desaturated; each icon "lights up" in its original AWS color
     once its step becomes active or done — this is the state cue now
     that there's no circular frame to recolor. The trailing
     drop-shadow(...0) term is a no-op visually (zero alpha) but keeps
     every state's filter list the same shape (grayscale, opacity,
     drop-shadow) as .is-active's below — when a transition crosses
     between filter lists of different lengths, browsers can't
     interpolate them and instead hold the old value until a late,
     abrupt flip, which is exactly what made the glow look "stuck" on
     the previous node after the dot had already moved on. */
  filter: grayscale(100%) opacity(0.45) drop-shadow(0 6px 14px rgba(52, 84, 209, 0));
  transition: filter 0.35s ease, transform 0.35s ease;
}

.flow-node-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.25;
  transition: color 0.35s ease;
}

/* A node "lights up" once the step feeding into it is active or done.
   is-done (already passed, or jumped to directly via a click) recolors
   instantly. is-active waits ~1.1s — matching flowDotTravel's duration —
   so the icon doesn't turn on until the traveling dot actually arrives. */
.flow-node.is-done .flow-node-icon img {
  filter: grayscale(0%) opacity(1) drop-shadow(0 6px 14px rgba(52, 84, 209, 0));
  transition: filter 0.35s ease, transform 0.35s ease;
}

.flow-node.is-active .flow-node-icon img {
  transform: scale(1.1);
  filter: grayscale(0%) opacity(1) drop-shadow(0 6px 14px rgba(52, 84, 209, 0.45));
  transition: filter 0.35s ease 1.05s, transform 0.35s ease 1.05s;
}

.flow-node.is-done .flow-node-icon svg {
  color: var(--accent);
  transition: color 0.35s ease, transform 0.35s ease;
}

.flow-node.is-active .flow-node-icon svg {
  color: var(--accent);
  transform: scale(1.1);
  transition: color 0.35s ease 1.05s, transform 0.35s ease 1.05s;
}

.flow-node.is-done .flow-node-label {
  color: var(--text);
  transition: color 0.35s ease;
}

.flow-node.is-active .flow-node-label {
  color: var(--text);
  transition: color 0.35s ease 1.05s;
}

/* project2.html's ws-diagram already waits for the dot's real
   animationend event before adding is-active, so the 1.05s delay above
   (designed for project1.html's simpler synchronous timing) would
   double up here and make highlighting look later than it should. */
.ws-diagram .flow-node.is-active .flow-node-icon img,
.ws-diagram .flow-node.is-active .flow-node-icon svg,
.ws-diagram .flow-node.is-active .flow-node-label {
  transition-delay: 0s;
}

.flow-connector {
  position: relative;
  height: 68px; /* matches .flow-node-icon so the line centers on it */
  flex: 1 1 24px;
  min-width: 20px;
  cursor: default;
  border: none;
  background: none;
  font: inherit;
  pointer-events: none; /* purely decorative now — the node handles clicks */
}

.flow-connector-num {
  /* Small circle badge, styled to match .flow-step-num in the written
     list below — sits just above the connector line. */
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--info-bg);
  color: var(--accent-dark);
  font-size: 0.64rem;
  font-weight: 800;
  transition: background 0.35s ease, color 0.35s ease;
}

.flow-connector-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
  transition: background 0.35s ease;
}

.flow-connector-line::after {
  /* arrowhead */
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  transform: translateY(-50%) rotate(-45deg);
  transition: border-color 0.35s ease;
}

.flow-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.flow-connector.is-active .flow-connector-num {
  background: var(--accent);
  color: #fff;
}

.flow-connector.is-active .flow-connector-line,
.flow-connector.is-done .flow-connector-line {
  background: var(--accent);
}

.flow-connector.is-active .flow-connector-line::after,
.flow-connector.is-done .flow-connector-line::after {
  border-color: var(--accent);
}

.flow-connector.is-active .flow-dot {
  animation: flowDotTravel 1.1s ease-in-out;
}

@keyframes flowDotTravel {
  0% {
    left: 0;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

/* Mobile counterpart: the connector line runs top-to-bottom instead of
   left-to-right (see the vertical layout override under the 760px
   media query), so the dot travels via "top" instead of "left". */
@keyframes flowDotTravelVertical {
  0% {
    top: 0;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.flow-node[data-step] {
  cursor: pointer;
}

.flow-node[data-step]:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 4px;
  border-radius: 12px;
}

/* ---------------------------------------------------------------------
   FAN-OUT DIAGRAM (project/fanningsns/project3.html only)
   SNS fans out to two independent paths at once (step 5), each
   finishing its own way (step 6), with one path continuing one step
   further (step 7). The lead-up chain (Visitor through SNS) sits
   vertically centered between the two branches, which fork off SNS
   via genuine diagonal lines rather than a right-angle drop-and-turn.

   Base rules below are the MOBILE layout — full-width rows for the
   linear lead-up/tail, two columns for the forked middle section, and
   one diagonal-pair "fork" indicator standing in for the whole split.
   The min-width block replaces this with a wide grid: one middle row
   for the lead-up, one row above and one below for the two branches.
   --------------------------------------------------------------------- */
.fanout-diagram .flow-track {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  justify-items: center;
  gap: 0;
  width: 100%;
}

.fanout-diagram .flow-node {
  position: relative;
}

.fanout-diagram .flow-connector {
  width: 68px;
  height: 36px;
  flex: none;
}

.fanout-diagram .flow-connector-line {
  left: 50%;
  right: auto;
  top: 4px;
  bottom: 4px;
  height: auto;
  width: 2px;
  transform: translateX(-50%);
}

.fanout-diagram .flow-connector-line::after {
  right: auto;
  left: 50%;
  bottom: -1px;
  top: auto;
  transform: translateX(-50%) rotate(45deg);
}

.fanout-diagram .flow-dot {
  left: 50%;
  top: 0;
}

.fanout-diagram .flow-connector.is-active .flow-dot {
  animation: flowDotTravelVertical 1.1s ease-in-out;
}

/* Numbered badges live on the nodes instead of the connectors — many
   nodes now share a step, so one connector-line badge stops mapping
   cleanly to "this step" the way it did in a single-branch diagram. */
.fanout-diagram .flow-connector-num {
  display: none;
}

.fanout-diagram .flow-node[data-step]::after {
  content: attr(data-step);
  position: absolute;
  top: -6px;
  right: -2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--info-bg);
  color: var(--accent-dark);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s ease, color 0.35s ease;
}

.fanout-diagram .flow-node.is-active[data-step]::after,
.fanout-diagram .flow-node.is-done[data-step]::after {
  background: var(--accent);
  color: #fff;
}

/* The mobile fork indicator — two diagonal lines fanning from a
   shared point out to each branch column below. Built as two CSS
   rotations anchored to left: 50% on the same full-width row SNS
   itself centers in, so the pivot is centered by construction rather
   than depending on an SVG viewBox stretching predictably. */
.fanout-diagram .fork-wrap {
  grid-column: 1 / -1;
  position: relative;
  width: 100%;
  height: 44px;
}

.fanout-diagram .fork-arrow {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2.5px;
  height: 46px;
  background: var(--border);
  transform-origin: top center;
  transition: background 0.35s ease;
  border-radius: 2px;
}

/* A plain downward-pointing triangle with NO rotation of its own —
   it only inherits whatever rotation .fork-arrow itself has, so it's
   guaranteed to point the same direction as its line on both sides.
   The previous version rotated the arrowhead separately from the
   line (a second, independently-calibrated angle), which was easy to
   get wrong for one side and not the other, exactly as reported. */
.fanout-diagram .fork-arrow::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--border);
  transform: translateX(-50%);
  transition: border-top-color 0.35s ease;
}

.fanout-diagram .fork-arrow.fork-left { transform: translateX(-50%) rotate(-32deg); }
.fanout-diagram .fork-arrow.fork-right { transform: translateX(-50%) rotate(32deg); }

/* The dot lives inside the rotated .fork-arrow, so animating its own
   top position (0% to 100% of the arrow's height) automatically
   traces whichever direction that arrow is rotated to — no separate
   path needed per side, unlike the desktop SVG version. */
.fanout-diagram .fork-arrow-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}

.fanout-diagram .fork-wrap.is-active .fork-arrow-dot {
  animation: forkArrowDotTravel 1.1s ease-in-out;
}

@keyframes forkArrowDotTravel {
  0% { top: 0%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.fanout-diagram .fork-wrap.is-active .fork-arrow,
.fanout-diagram .fork-wrap.is-done .fork-arrow {
  background: var(--accent);
}

.fanout-diagram .fork-wrap.is-active .fork-arrow::after,
.fanout-diagram .fork-wrap.is-done .fork-arrow::after {
  border-top-color: var(--accent);
}

.fanout-diagram .fork-diagonal {
  display: none;
}

/* Mobile node/connector placement — full-width rows for the linear
   lead-up and tail, two columns for the forked middle section.
   DynamoDB sits under the Lambda that actually writes to it (the
   SQS-branch column) rather than centered under both columns.

   Every row is assigned explicitly rather than left to grid
   auto-placement. Auto-placement (relying on DOM order + sparse
   packing) is spec-correct, but explicit rows make the layout
   deterministic regardless of DOM order, browser quirks, or a stray
   mismatched CSS/HTML deploy — worth the extra verbosity here. */
.fanout-diagram .flow-node[data-node="visitor"] { grid-column: 1 / -1; grid-row: 1; }
.fanout-diagram .flow-connector[data-step="1"] { grid-column: 1 / -1; grid-row: 2; }
.fanout-diagram .flow-node[data-node="webpage"] { grid-column: 1 / -1; grid-row: 3; }
.fanout-diagram .flow-connector[data-step="2"] { grid-column: 1 / -1; grid-row: 4; }
.fanout-diagram .flow-node[data-node="apigateway"] { grid-column: 1 / -1; grid-row: 5; }
.fanout-diagram .flow-connector[data-step="3"] { grid-column: 1 / -1; grid-row: 6; }
.fanout-diagram .flow-node[data-node="lambda-publisher"] { grid-column: 1 / -1; grid-row: 7; }
.fanout-diagram .flow-connector[data-step="4"] { grid-column: 1 / -1; grid-row: 8; }
.fanout-diagram .flow-node[data-node="sns"] { grid-column: 1 / -1; grid-row: 9; }
.fanout-diagram .fork-wrap { grid-row: 10; }

.fanout-diagram .flow-node[data-node="lambda-notifier"] { grid-column: 1; grid-row: 11; }
.fanout-diagram .flow-node[data-node="sqs"] { grid-column: 2; grid-row: 11; }
.fanout-diagram .flow-connector.step6-main { grid-column: 1; grid-row: 12; }
.fanout-diagram .flow-connector.step6-branch { grid-column: 2; grid-row: 12; }
.fanout-diagram .flow-node[data-node="ses"] { grid-column: 1; grid-row: 13; }
.fanout-diagram .flow-node[data-node="lambda-logger"] { grid-column: 2; grid-row: 13; }
.fanout-diagram .flow-connector[data-step="7"] { grid-column: 2; grid-row: 14; }
.fanout-diagram .flow-node[data-node="dynamodb"] { grid-column: 2; grid-row: 15; }

@media (min-width: 761px) {
  .fanout-diagram .flow-track {
    display: grid;
    grid-template-columns: 84px 48px 84px 48px 84px 48px 84px 48px 84px 48px 84px 48px 84px 48px 84px;
    grid-template-rows: auto 8px auto 8px auto;
    align-items: center;
    justify-items: center;
    width: 100%;
  }

  /* Row 3 (middle) is the lead-up chain, vertically centered between
     the two step-5 branch rows (1 and 5) instead of pinned to the top. */
  .fanout-diagram .flow-node[data-node="visitor"] { grid-column: 1; grid-row: 3; }
  .fanout-diagram .flow-node[data-node="webpage"] { grid-column: 3; grid-row: 3; }
  .fanout-diagram .flow-node[data-node="apigateway"] { grid-column: 5; grid-row: 3; }
  .fanout-diagram .flow-node[data-node="lambda-publisher"] { grid-column: 7; grid-row: 3; }
  .fanout-diagram .flow-node[data-node="sns"] { grid-column: 9; grid-row: 3; }

  .fanout-diagram .flow-node[data-node="lambda-notifier"] { grid-column: 11; grid-row: 1; }
  .fanout-diagram .flow-node[data-node="ses"] { grid-column: 13; grid-row: 1; }
  .fanout-diagram .flow-node[data-node="sqs"] { grid-column: 11; grid-row: 5; }
  .fanout-diagram .flow-node[data-node="lambda-logger"] { grid-column: 13; grid-row: 5; }
  .fanout-diagram .flow-node[data-node="dynamodb"] { grid-column: 15; grid-row: 5; justify-self: center; }

  .fanout-diagram .flow-connector[data-step="1"] { grid-column: 2; grid-row: 3; }
  .fanout-diagram .flow-connector[data-step="2"] { grid-column: 4; grid-row: 3; }
  .fanout-diagram .flow-connector[data-step="3"] { grid-column: 6; grid-row: 3; }
  .fanout-diagram .flow-connector[data-step="4"] { grid-column: 8; grid-row: 3; }
  .fanout-diagram .flow-connector.step6-main { grid-column: 12; grid-row: 1; }
  .fanout-diagram .flow-connector.step6-branch { grid-column: 12; grid-row: 5; }
  .fanout-diagram .flow-connector[data-step="7"] { grid-column: 14; grid-row: 5; }

  .fanout-diagram .flow-connector {
    width: 100%;
    height: 68px;
  }

  .fanout-diagram .flow-connector .flow-connector-line {
    left: 8px;
    right: 8px;
    top: 50%;
    bottom: auto;
    height: 2px;
    width: auto;
    transform: translateY(-50%);
  }

  .fanout-diagram .flow-connector .flow-connector-line::after {
    right: -1px;
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) rotate(-45deg);
  }

  .fanout-diagram .flow-connector .flow-dot {
    left: 0;
    top: 50%;
  }

  .fanout-diagram .flow-connector.is-active .flow-dot {
    animation: flowDotTravel 1.1s ease-in-out;
  }

  /* Desktop fork — two straight diagonal lines from SNS to each
     branch node, replacing the mobile fork-wrap entirely at this
     width. Each spans ONLY the gap column plus the branch node's own
     column (columns 10-11) — never column 9, which is SNS's own
     column, so this element can't end up sharing a grid cell with the
     SNS node itself and rendering its line back through the icon. */
  .fanout-diagram .fork-wrap {
    display: none;
  }

  .fanout-diagram .fork-diagonal {
    display: block;
    pointer-events: none;
  }

  .fanout-diagram .fork-diagonal svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .fanout-diagram .fork-diagonal line {
    stroke: var(--border);
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke 0.35s ease;
  }

  .fanout-diagram .fork-diagonal .fork-arrowhead {
    fill: var(--border);
    transition: fill 0.35s ease;
  }

  .fanout-diagram .fork-diagonal.is-active line,
  .fanout-diagram .fork-diagonal.is-done line {
    stroke: var(--accent);
  }

  .fanout-diagram .fork-diagonal.is-active .fork-arrowhead,
  .fanout-diagram .fork-diagonal.is-done .fork-arrowhead {
    fill: var(--accent);
  }

  /* Traveling dot along the diagonal, matching the straight
     connectors' dot animation. A diagonal can't reuse their left/top
     keyframes (those only move in one axis) — offset-path lets a dot
     travel along an arbitrary line, including this one, the same way
     the straight connectors' dot travels left-to-right. */
  .fanout-diagram .fork-diagonal .fork-dot {
    fill: var(--accent);
    opacity: 0;
  }

  .fanout-diagram .fork-diagonal.fork-up .fork-dot {
    offset-path: path("M 16 55 L 37 22");
  }

  .fanout-diagram .fork-diagonal.fork-down .fork-dot {
    offset-path: path("M 16 45 L 37 78");
  }

  .fanout-diagram .fork-diagonal.is-active .fork-dot {
    animation: forkDotTravel 1.1s ease-in-out;
  }

  @keyframes forkDotTravel {
    0% { offset-distance: 0%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
  }

  .fanout-diagram .fork-diagonal.fork-up { grid-column: 10 / 12; grid-row: 1 / 4; }
  .fanout-diagram .fork-diagonal.fork-down { grid-column: 10 / 12; grid-row: 3 / 6; }

  /* Shrinks further than the default .is-stuck scale (0.78) once
     pinned — this diagram is wider than project1's, so it benefits
     from a bit more reduction to comfortably clear the viewport. */
  .flow-diagram.fanout-diagram.is-stuck {
    transform: scale(0.65);
  }
}

.flow-steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.flow-step {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.flow-step-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--info-bg);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.9rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.flow-step-body h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.flow-step-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.flow-step-body ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
}

.flow-step-body li {
  color: var(--muted);
  font-size: 0.9rem;
}

.flow-step-body code {
  font-size: 0.85em;
}

.flow-step.is-active {
  border-color: var(--accent);
  background: var(--info-bg);
  box-shadow: var(--shadow);
}

.flow-step.is-active .flow-step-num {
  background: var(--accent);
  color: #fff;
}

.flow-step:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 3px;
}

/* Data Lake & Analytics: every step is already permanently .is-active
   (nothing here autoplays), so clicking a diagram node needs its own,
   louder cue on arrival -- a brief outline pulse layered on top of the
   steady .is-active styling, not a replacement for it. */
.flow-step.is-jumped-to {
  animation: flowStepJumpPulse 1.6s ease-out;
}

@keyframes flowStepJumpPulse {
  0% { box-shadow: 0 0 0 4px rgba(52, 84, 209, 0.35); }
  100% { box-shadow: var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
  .flow-step.is-jumped-to {
    animation: none;
  }
}

/* ---------------------------------------------------------------------
   17. USE CASES (project1.html only)
   Three simple cards below the "How it works" diagram, describing
   other situations this same S3 + API Gateway + Lambda + SES pattern
   fits. Add more by copying a .usecase-card into .usecase-grid — it
   wraps automatically.
   --------------------------------------------------------------------- */
.use-cases {
  padding: 1rem 0 4rem;
}

.usecase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.usecase-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.usecase-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--info-bg);
  color: var(--accent);
}

.usecase-icon svg {
  width: 24px;
  height: 24px;
}

.usecase-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

/* Compact variant — used for the moderated-image-gallery guidelines
   section, where these cards are a quick pre-upload reminder rather
   than a marketing-card callout. Add class="compact" alongside
   .usecase-grid. */
.usecase-grid.compact {
  gap: 0.75rem;
  margin-top: 1rem;
}

.usecase-grid.compact .usecase-card {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  box-shadow: none;
}

.usecase-grid.compact .usecase-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 0.5rem;
  border-radius: 9px;
}

.usecase-grid.compact .usecase-icon svg {
  width: 18px;
  height: 18px;
}

.usecase-grid.compact .usecase-card h3 {
  margin-bottom: 0.3rem;
  font-size: 0.92rem;
}

.usecase-grid.compact .usecase-card p {
  font-size: 0.85rem;
}

/* Collapses the restricted-content list (moderated-image-gallery only)
   behind a one-line disclosure instead of always showing all four
   cards on mobile -- most visitors just need to know a list exists,
   not read it up front. Desktop has room to just show it, so the
   toggle affordance is removed there entirely (see the min-width
   override below) rather than defaulting to collapsed either way. */
.guidelines-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
  list-style: none;
}

.guidelines-disclosure summary::-webkit-details-marker {
  display: none;
}

.guidelines-disclosure summary::after {
  /* chevron, matches the one used on .nav-dropdown summary */
  content: "";
  width: 0.5em;
  height: 0.5em;
  flex: none;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.guidelines-disclosure[open] summary::after {
  transform: rotate(-135deg) translate(1px, 1px);
}

.guidelines-disclosure summary:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 4px;
  border-radius: 6px;
}

/* Desktop: always show the restricted-content list and drop the
   disclosure control -- there's room for it, so nothing needs to stay
   hidden behind a click. The content shows regardless of the [open]
   attribute; the summary becomes inert (no chevron, no pointer,
   plain-text look) rather than a non-functional-looking button. */
@media (min-width: 761px) {
  /* Chrome wraps a <details>'s non-summary content in an internal
     ::details-content box that itself carries content-visibility:
     hidden and height:0 while closed -- overriding display on the
     .usecase-grid child alone doesn't reach that ancestor box, so it
     needs its own override too, or the grid stays collapsed to 0
     height regardless. */
  .guidelines-disclosure::details-content {
    content-visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
  }

  .guidelines-disclosure .usecase-grid {
    display: grid !important;
  }

  .guidelines-disclosure summary {
    cursor: default;
    pointer-events: none;
  }

  .guidelines-disclosure summary::after {
    display: none;
  }
}

.guidelines-disclosure .usecase-grid {
  margin-top: 1rem;
}

/* ---------------------------------------------------------------------
   18. PRICING (project1.html only)
   Three cost-tier cards plus a breakdown list of what drives cost.
   All three cards use the same plain .pricing-card styling.
   --------------------------------------------------------------------- */
.pricing {
  padding: 1rem 0 4rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.pricing-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.pricing-tier {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pricing-amount {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.pricing-period {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
}

.pricing-breakdown {
  padding: 1.5rem clamp(1.25rem, 4vw, 2rem);
  background: var(--info-bg);
  border-radius: 20px;
  align-self: start;
}

.pricing-breakdown h3 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.pricing-breakdown ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.pricing-breakdown li {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.pricing-breakdown strong {
  color: var(--text);
}

/* Interactive alternative to the old 3-card grid: one card whose
   figures update live as a range input is dragged across 5 volume
   steps (script.js), instead of 3 fixed cards sitting side by side.
   .pricing-layout puts this beside .pricing-breakdown on desktop
   (single column, stacked, on mobile -- see Section 21). */
.pricing-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
  align-items: start;
}

@media (min-width: 761px) {
  .pricing-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.pricing-slider {
  max-width: 480px;
}

.pricing-slider-card {
  text-align: center;
}

.pricing-slider-control {
  margin-top: 1.75rem;
  padding: 0 0.2rem;
}

/* Both the -webkit and -moz thumb rules below need to stay in separate
   rulesets, each with only its own pseudo-element -- a browser drops
   an entire selector list the instant it hits one pseudo-element it
   doesn't recognize, so combining them with a comma would make both
   browsers ignore the whole rule. */
.pricing-slider-input {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.pricing-slider-input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pricing-slider-input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pricing-slider-input:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .pricing-slider-input:hover::-webkit-slider-thumb {
    transform: scale(1.12);
  }

  .pricing-slider-input:hover::-moz-range-thumb {
    transform: scale(1.12);
  }
}

.pricing-slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

/* States what the tick numbers above actually count -- submissions,
   votes, images, whatever unit this project's volume slider scales
   by -- since that's specific to each project and isn't otherwise
   labeled anywhere near the slider itself. */
.pricing-slider-unit {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------------------------------------------------------------------
   19. BACK-TO-TOP BUTTON (both pages)
   The floating circular arrow button in the bottom-right corner.
   Hidden by default (opacity 0 + pointer-events: none); a small script
   at the bottom of each HTML file adds "is-visible" once the page has
   scrolled past 500px, and smooth-scrolls to the top on click.
   --------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  padding: 0; /* overrides the generic button rule's padding, which was
                 eating almost the entire box and squeezing the icon
                 down to nearly nothing via flexbox's default shrink */
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(52, 84, 209, 0.32);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
  z-index: 90;
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent-dark);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   20. MOBILE SIDEBAR NAV (mobile only, all pages)
   A left-edge sidebar that replaces both the old scroll-triggered
   popover menu AND the in-header nav on mobile (the header nav is
   hidden below at the same breakpoint — see Section 21). Two pieces,
   both always in the DOM:
     .mobile-sidebar-rail  — a small stack of 3 circular buttons
       (expand, home, dark mode) pinned top-left. This is the entire
       visible footprint while collapsed, present from first paint
       rather than fading in on scroll like the old button did.
     .mobile-sidebar-panel — the full option list. Hidden at width: 0
       while collapsed; .is-open (toggled by script.js) animates it
       out to a capped width and gives it its own overflow-y so the
       menu scrolls independently of the page underneath.
   A backdrop dims the page and closes the sidebar on tap, standard
   drawer behavior. Nothing here needs a real "device" to reason about
   sizing: the rail's icons stay put and only .mobile-sidebar-panel's
   width animates, so partial-width states never reflow the icons.
   --------------------------------------------------------------------- */
.mobile-sidebar {
  display: none;
}

@media (max-width: 760px) {
  .mobile-sidebar {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100dvh;
    z-index: 150;
    pointer-events: none;
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 32, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 140;
  }

  .mobile-sidebar.is-open .mobile-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Sits well clear of the header (rather than overlapping the logo,
     which lives in that top-left corner at scroll position 0) since
     the rail is visible from first paint instead of fading in after
     scrolling like the button it replaces did. The translucent pill
     background lets it read as one floating control rather than 3
     loose buttons, and is very faint at rest so it doesn't compete
     with whatever's scrolling underneath it -- script.js adds
     "is-scrolling" for as long as a scroll is actively happening (see
     the rule below) and removes it a beat after motion settles. */
  .mobile-sidebar-rail {
    position: absolute;
    top: 5.5rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 151;
    background: var(--surface-translucent);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.5rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0.25;
    transition: top 0.28s ease, opacity 0.3s ease;
  }

  .mobile-sidebar-rail.is-scrolling,
  .mobile-sidebar.is-open .mobile-sidebar-rail {
    opacity: 1;
  }

  /* Row instead of column once open — a horizontal strip only needs
     the panel's existing top padding to clear it, instead of the much
     taller allowance a 3-high stack would need. Once open, the
     panel's own opaque background covers the top-left corner instead
     of the transparent page, so the rail relocates there too — same
     spot a drawer's close control normally lives. */
  .mobile-sidebar.is-open .mobile-sidebar-rail {
    top: 1rem;
    left: 1rem;
    flex-direction: row;
  }

  /* Home and dark-mode are reachable inside the open panel itself, so
     the rail keeps only the collapse control once open -- one button
     instead of three avoids a redundant-looking cluster next to the
     panel's own Home/Dark mode rows. */
  .mobile-sidebar.is-open .mobile-sidebar-home,
  .mobile-sidebar.is-open .mobile-sidebar-rail-theme {
    display: none;
  }

  .mobile-sidebar-toggle,
  .mobile-sidebar-home,
  .mobile-sidebar-rail-theme {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(52, 84, 209, 0.32);
    pointer-events: auto;
    /* Without this, a tap here while the page is still mid-scroll is
       ambiguous to the browser (could be the start of a pan) and gets
       held for gesture disambiguation instead of registering as a tap
       right away -- this button doesn't pan, so telling the browser
       that up front lets a tap commit immediately even during active
       scroll momentum. */
    touch-action: manipulation;
    transition: background 0.2s ease;
  }

  @media (hover: hover) and (pointer: fine) {
    .mobile-sidebar-toggle:hover,
    .mobile-sidebar-home:hover,
    .mobile-sidebar-rail-theme:hover {
      background: var(--accent-dark);
    }
  }

  .mobile-sidebar-toggle:focus-visible,
  .mobile-sidebar-home:focus-visible,
  .mobile-sidebar-rail-theme:focus-visible {
    outline: 3px solid rgba(52, 84, 209, 0.35);
    outline-offset: 3px;
  }

  .mobile-sidebar-toggle svg,
  .mobile-sidebar-home svg,
  .mobile-sidebar-rail-theme svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .mobile-sidebar-toggle .icon-collapse {
    display: none;
  }

  .mobile-sidebar.is-open .mobile-sidebar-toggle .icon-expand {
    display: none;
  }

  .mobile-sidebar.is-open .mobile-sidebar-toggle .icon-collapse {
    display: block;
  }

  /* Panel: width-only transition (not transform) so the rail above it
     never has to move — it stays anchored at top-left in both states. */
  .mobile-sidebar-panel {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    max-width: 50vw;
    overflow: hidden;
    visibility: hidden;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: width 0.28s ease, visibility 0s linear 0.28s;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    /* Clears the translucent pill rail sitting on top of this corner
       while open -- a touch more than the pill's own ~60px footprint
       would need, for breathing room. */
    padding: 5.2rem 0 0.6rem;
    /* Without an explicit z-index, this sits in the z-index:auto
       paint layer, which stacking rules place BELOW any sibling that
       has an explicit z-index -- .mobile-sidebar-backdrop (140) below
       -- regardless of DOM order. That silently put the backdrop on
       top of the panel, tinting it gray and eating every click before
       it reached a link. 145 keeps it under the rail (151) but above
       the backdrop. */
    z-index: 145;
  }

  .mobile-sidebar.is-open .mobile-sidebar-panel {
    width: 50vw;
    visibility: visible;
    overflow-y: auto;
    pointer-events: auto;
    /* Deliberately NOT redeclaring `transition` here -- the base rule's
       value (with visibility's 0.28s delay, so it stays visible for
       the full width shrink when closing) must stay in effect on both
       sides of the toggle. Overriding it here too, even to the same
       width portion, made the width transition change its own
       transition property mid-flight and get stuck part-way. */
  }

  .mobile-sidebar-panel a,
  .mobile-sidebar-panel button.mobile-sidebar-link {
    color: var(--text);
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    margin: 0 0.6rem;
    border-radius: 10px;
    text-align: left;
    background: none;
    border: none;
    width: calc(100% - 1.2rem);
    font-size: inherit;
    cursor: pointer;
  }

  .mobile-sidebar-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    margin: 0 0.6rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    border-radius: 10px;
  }

  .mobile-sidebar-group-summary::-webkit-details-marker {
    display: none;
  }

  .mobile-sidebar-group-summary::after {
    content: "";
    flex: none;
    width: 0.5em;
    height: 0.5em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
  }

  .mobile-sidebar-group[open] > .mobile-sidebar-group-summary::after {
    transform: rotate(-135deg) translate(1px, 1px);
  }

  .mobile-sidebar-group-content a.mobile-sidebar-sublink {
    display: block;
    padding-left: 1.7rem;
    font-weight: 500;
    font-size: 0.92rem;
  }

  /* Same collapsible treatment as .nav-dropdown-subsection -- see that
     rule's comment for why the sublinks need `display: block` once
     nested inside a <details> instead of being direct grid children. */
  .mobile-sidebar-subgroup summary {
    cursor: pointer;
    list-style: none;
  }

  .mobile-sidebar-subgroup summary::-webkit-details-marker {
    display: none;
  }

  /* The current page's own name in the list -- styled to match the
     sibling project links around it (.mobile-sidebar-sublink) rather
     than standing out as a small-caps section label, since it's the
     same kind of thing they are (a project name), just rendered as an
     expand toggle instead of a plain link because you're already on
     that page. padding-left 1.7rem matches the sibling sublinks'
     left edge (no indent trick needed -- the chevron sits at the row's
     right edge via flex, not competing with the text). */
  .mobile-sidebar-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    padding-left: 1.7rem;
    margin: 0 0.6rem;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--text);
    border-radius: 10px;
  }

  .mobile-sidebar-subgroup summary.mobile-sidebar-group-label::after {
    content: "";
    flex: none;
    width: 0.45em;
    height: 0.45em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
  }

  .mobile-sidebar-subgroup[open] summary.mobile-sidebar-group-label::after {
    transform: rotate(-135deg) translate(1px, 1px);
  }

  .mobile-sidebar-subgroup a.mobile-sidebar-sublink {
    display: block;
    padding-left: 2.4rem;
  }

  @media (hover: hover) and (pointer: fine) {
    .mobile-sidebar-panel a:hover,
    .mobile-sidebar-panel button.mobile-sidebar-link:hover,
    .mobile-sidebar-group-summary:hover,
    .mobile-sidebar-subgroup summary.mobile-sidebar-group-label:hover {
      background: var(--info-bg);
      color: var(--accent);
      text-decoration: none;
    }
  }
}

/* ---------------------------------------------------------------------
   21. MOBILE RESPONSIVE OVERRIDES
   Everything below applies only at 760px and narrower (phones/small
   tablets). Mostly: stack the header/cards/about section vertically,
   shrink the logo and hearts badge, and give jump-to-section anchors
   extra top clearance since the stacked header is taller on mobile.
   --------------------------------------------------------------------- */
@media (max-width: 760px) {
  .card,
  .about-grid {
    display: block;
  }

  /* Single-row layout via grid-template-areas: logo left, hearts
     right, same horizontal axis. The nav no longer gets a row here —
     .mobile-sidebar (Section 20) is the sole mobile nav entry point,
     so .site-header nav is hidden below instead of being placed. */
  .site-header-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "brand topmark";
    align-items: center;
    padding: 0.5rem 1.25rem; /* a bit thinner than the desktop default */
    text-align: initial;
  }

  /* The header stacks logo/hearts/nav vertically here, which makes it
     too tall to comfortably pin in place while scrolling (it would
     eat a big chunk of a phone screen permanently). Let it scroll
     away like normal content instead — this is why the scroll-margin
     values below are much smaller than the desktop ones too, since
     there's no sticky header left to clear when a link jumps to an
     anchor. */
  .site-header {
    position: static;
  }

  #projects,
  #about,
  #contact,
  #demo,
  #how-it-works,
  #use-cases,
  #pricing,
  .project-card {
    scroll-margin-top: 1.5rem;
  }

  .brand-row {
    grid-area: brand;
    justify-self: start;
    display: inline-flex;
  }

  .top-mark {
    grid-area: topmark;
    justify-self: end;
    margin: 0;
  }

  /* Replaced by .mobile-sidebar (Section 20) on mobile — the dropdown,
     About link, and theme toggle all live in the sidebar instead. */
  .site-header nav {
    display: none;
  }

  .hero {
    padding-top: 0.75rem;
  }

  .top-mark {
    height: 28px; /* mobile hearts-badge size */
  }

  .logo-mark img {
    height: 60px; /* mobile logo size */
  }

  /* Logo/hearts stay one fixed size on mobile regardless of scroll
     position -- the shrink-on-scroll effect below only makes sense on
     desktop, where the header stays pinned in view; on mobile the
     header scrolls away entirely (position: static above), so the
     brief size change right before that happens just read as an
     unexpected jump rather than a purposeful shrink. */
  .site-header.is-scrolled .logo-mark img {
    height: 60px;
  }

  .site-header.is-scrolled .top-mark {
    height: 28px;
  }

  /* Smaller, tighter grid on mobile so the public gallery doesn't
     spend a full screen's height on a single photo. */
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  /* Two project cards per row on mobile instead of one -- the default
     220px column minimum only ever fits one column at this width. */
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  /* Below this breakpoint the poster-split hero above collapses into
     the "circle avatar over centered copy" treatment instead of just
     reflowing the two columns -- the colored diagonal panel look
     doesn't work at this width, so it's dropped in favor of plain
     centered text with a small round photo above it. */
  .home-hero-grid {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 0;
    /* Base rule's overflow: hidden exists only to clip the desktop
       diagonal clip-path panel and the grid's own rounded corners --
       both dropped below this breakpoint (clip-path: none on
       .home-hero-copy above, border-radius: 0 here), so nothing left
       needs clipping. Left hidden, it was cutting the CTA buttons'
       box-shadow off in a hard rectangle wherever it crossed the
       grid's edge instead of letting it fade out naturally. */
    overflow: visible;
  }

  .home-hero-copy {
    order: 2;
    background: none;
    color: inherit;
    clip-path: none;
    padding: 0 0 1rem;
    text-align: center;
  }

  .home-hero-copy .eyebrow {
    color: var(--accent);
  }

  .home-hero-copy h1 {
    color: inherit;
    /* The desktop column's nowrap sizing assumes a wide column that
       doesn't exist once the layout stacks to full-width, centered
       copy here -- allow it to wrap again so it doesn't overflow a
       narrow phone screen. */
    white-space: normal;
  }

  .home-hero-copy .hero-arrow {
    color: var(--accent);
  }

  .home-hero-copy p {
    color: var(--muted);
    margin-left: auto;
    margin-right: auto;
  }

  .home-hero-copy .hero-actions {
    justify-content: center;
  }

  .home-hero-copy .button-link {
    background: var(--accent);
    color: #fff;
  }

  .home-hero-copy .button-link.ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
  }

  .home-hero-photo-wrap {
    order: 1;
    justify-self: center;
    width: 200px;
    height: 200px;
    margin: 1rem 0 1.5rem;
    background: none;
  }

  .home-hero-photo-ring {
    display: block;
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--info-text));
    opacity: 0.25;
    filter: blur(2px);
  }

  .home-hero-photo {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 4px solid var(--surface);
  }

  .contact-form {
    padding-top: 0;
    margin-top: 1.5rem;
  }

  .about-badges {
    margin-top: 1.5rem;
  }

  /* The back-to-top button is fixed at bottom:1.5rem; right:1.5rem and
     becomes visible once scrolled past 500px — true by the time anyone
     reaches the footer. On desktop the footer's content sits well
     inside its max-width container, clear of the actual viewport edge
     where that button lives; on mobile the footer stretches close to
     the full width, so its right-aligned social icons (.footer-right)
     land almost exactly where the button sits, visually covered by it
     even though they're still very much present in the page. This
     just gives the footer enough room to clear it. */
  footer {
    padding-bottom: 4.5rem;
  }

  .flow-step {
    padding: 0.9rem 1rem;
  }

  /* The horizontal diagram becomes a 2-column grid of icons on small
     screens — no room to fit 7 icons in a row, and a single-column
     list left too much horizontal space unused. The connecting lines
     don't translate well to a wrapping grid, so they're hidden here;
     each node shows its own step number as a small corner badge
     instead (see the data-step attribute on the node elements in the
     HTML — the same is-active/is-done classes the JS already applies
     to nodes drive this badge's color, no extra script needed). A tall
     vertical stack also isn't worth pinning in place, so sticky
     positioning is turned off too.

     Everything in this block is scoped with :not(.ws-diagram) —
     project2.html's WebSocket diagram uses the same generic
     .flow-node/.flow-diagram/.flow-connector class names (with its own
     distinct .ws-diagram class added alongside), so without this guard
     these rules — being more specific than project2's own
     [data-node="..."] selectors — would win the cascade and hijack its
     icons into this diagram's grid positions instead. */
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) {
    position: static;
    top: auto;
    padding: 1.25rem 1rem 1rem;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram).is-stuck {
    transform: none;
    padding: 1.25rem 1rem 1rem;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-track {
    display: grid;
    grid-template-columns: 1fr 56px 1fr;
    grid-template-rows: auto 32px auto 32px auto 32px auto;
    align-items: center;
    justify-items: center;
    width: 100%;
    min-width: 0;
  }

  /* 2-column snake: reads left-to-right, then right-to-left, then
     left-to-right again, then the last (odd) node alone on the final
     row — same zigzag principle as project2.html's mobile diagram,
     extended to this flow's 7 nodes instead of 4.

     Every project page from project4.html onward reuses this same
     generic .flow-diagram/.flow-node/.flow-connector markup, and more
     than one project's nodes happen to share a [data-node] value with
     this one (e.g. "apigateway", "lambda"). A bare
     .flow-diagram:not(.ws-diagram):not(.fanout-diagram) guard doesn't
     actually stop those same-named nodes on OTHER pages from matching
     these rules too -- and because that guard carries three :not()
     clauses, it out-specifies a simpler per-page class selector and
     silently wins, overriding that other page's own positioning and
     landing two nodes in the same cell. So project1's nodes get their
     own scoping class here too (.contact-diagram, set directly in
     contact-form-api's HTML), exactly like every project below it. */
  .contact-diagram .flow-node[data-node="users"] { grid-column: 1; grid-row: 1; }
  .contact-diagram .flow-node[data-node="route53"] { grid-column: 3; grid-row: 1; }
  .contact-diagram .flow-node[data-node="cloudfront"] { grid-column: 3; grid-row: 3; }
  .contact-diagram .flow-node[data-node="s3"] { grid-column: 1; grid-row: 3; }
  .contact-diagram .flow-node[data-node="apigateway"] { grid-column: 1; grid-row: 5; }
  .contact-diagram .flow-node[data-node="lambda"] { grid-column: 3; grid-row: 5; }
  .contact-diagram .flow-node[data-node="ses"] { grid-column: 3; grid-row: 7; }

  /* Same reasoning as the comment above: each project gets its own
     scoping class (set on its .flow-diagram element in that project's
     own HTML, alongside .ws-diagram/.fanout-diagram's existing
     precedent) so a shared [data-node] value like "apigateway" or
     "lambda" can safely mean a different grid cell on a different
     page, with no specificity ambiguity between them. All six follow
     the exact same 2-column snake shape as project1's, just stopping
     one row-pair earlier for the five that have 6 nodes instead of 7. */
  .workflow-diagram .flow-node[data-node="visitor"] { grid-column: 1; grid-row: 1; }
  .workflow-diagram .flow-node[data-node="website"] { grid-column: 3; grid-row: 1; }
  .workflow-diagram .flow-node[data-node="apigateway"] { grid-column: 3; grid-row: 3; }
  .workflow-diagram .flow-node[data-node="lambda"] { grid-column: 1; grid-row: 3; }
  .workflow-diagram .flow-node[data-node="stepfunctions"] { grid-column: 1; grid-row: 5; }
  .workflow-diagram .flow-node[data-node="dynamodb"] { grid-column: 3; grid-row: 5; }

  .gallery-diagram .flow-node[data-node="visitor"] { grid-column: 1; grid-row: 1; }
  .gallery-diagram .flow-node[data-node="cognito"] { grid-column: 3; grid-row: 1; }
  .gallery-diagram .flow-node[data-node="apigateway"] { grid-column: 3; grid-row: 3; }
  .gallery-diagram .flow-node[data-node="lambda"] { grid-column: 1; grid-row: 3; }
  .gallery-diagram .flow-node[data-node="s3quarantine"] { grid-column: 1; grid-row: 5; }
  .gallery-diagram .flow-node[data-node="rekognition"] { grid-column: 3; grid-row: 5; }
  .gallery-diagram .flow-node[data-node="outcome"] { grid-column: 3; grid-row: 7; }

  .habits-diagram .flow-node[data-node="visitor"] { grid-column: 1; grid-row: 1; }
  .habits-diagram .flow-node[data-node="apigateway"] { grid-column: 3; grid-row: 1; }
  .habits-diagram .flow-node[data-node="lambda"] { grid-column: 3; grid-row: 3; }
  .habits-diagram .flow-node[data-node="dynamodb"] { grid-column: 1; grid-row: 3; }
  .habits-diagram .flow-node[data-node="scheduler"] { grid-column: 1; grid-row: 5; }
  .habits-diagram .flow-node[data-node="resetlambda"] { grid-column: 3; grid-row: 5; }

  .summarizer-diagram .flow-node[data-node="visitor"] { grid-column: 1; grid-row: 1; }
  .summarizer-diagram .flow-node[data-node="apigateway"] { grid-column: 3; grid-row: 1; }
  .summarizer-diagram .flow-node[data-node="lambda"] { grid-column: 3; grid-row: 3; }
  .summarizer-diagram .flow-node[data-node="dynamodb"] { grid-column: 1; grid-row: 3; }
  .summarizer-diagram .flow-node[data-node="bedrock"] { grid-column: 1; grid-row: 5; }
  .summarizer-diagram .flow-node[data-node="response"] { grid-column: 3; grid-row: 5; }

  .orders-diagram .flow-node[data-node="visitor"] { grid-column: 1; grid-row: 1; }
  .orders-diagram .flow-node[data-node="apigateway"] { grid-column: 3; grid-row: 1; }
  .orders-diagram .flow-node[data-node="lambda"] { grid-column: 3; grid-row: 3; }
  .orders-diagram .flow-node[data-node="stepfunctions"] { grid-column: 1; grid-row: 3; }
  .orders-diagram .flow-node[data-node="dynamodb"] { grid-column: 1; grid-row: 5; }
  .orders-diagram .flow-node[data-node="outcome"] { grid-column: 3; grid-row: 5; }

  .chatbot-diagram .flow-node[data-node="visitor"] { grid-column: 1; grid-row: 1; }
  .chatbot-diagram .flow-node[data-node="cognito"] { grid-column: 3; grid-row: 1; }
  .chatbot-diagram .flow-node[data-node="apigateway"] { grid-column: 3; grid-row: 3; }
  .chatbot-diagram .flow-node[data-node="lambda"] { grid-column: 1; grid-row: 3; }
  .chatbot-diagram .flow-node[data-node="bedrock"] { grid-column: 1; grid-row: 5; }
  .chatbot-diagram .flow-node[data-node="dynamodb"] { grid-column: 3; grid-row: 5; }

  .containers-diagram .flow-node[data-node="developer"] { grid-column: 1; grid-row: 1; }
  .containers-diagram .flow-node[data-node="cicd"] { grid-column: 3; grid-row: 1; }
  .containers-diagram .flow-node[data-node="ecs"] { grid-column: 3; grid-row: 3; }
  .containers-diagram .flow-node[data-node="elb"] { grid-column: 1; grid-row: 3; }
  .containers-diagram .flow-node[data-node="ecsdrain"] { grid-column: 1; grid-row: 5; }
  .containers-diagram .flow-node[data-node="cloudwatch"] { grid-column: 3; grid-row: 5; }

  .vpcnet-diagram .flow-node[data-node="vpc"] { grid-column: 1; grid-row: 1; }
  .vpcnet-diagram .flow-node[data-node="subnets"] { grid-column: 3; grid-row: 1; }
  .vpcnet-diagram .flow-node[data-node="igw"] { grid-column: 3; grid-row: 3; }
  .vpcnet-diagram .flow-node[data-node="natgw"] { grid-column: 1; grid-row: 3; }
  .vpcnet-diagram .flow-node[data-node="isolated"] { grid-column: 1; grid-row: 5; }
  .vpcnet-diagram .flow-node[data-node="sg"] { grid-column: 3; grid-row: 5; }

  /* 5 nodes only (one shorter than the 6-node shape above) -- ends on
     the left at row 5 instead of pairing up on the right. */
  .opsdash-diagram .flow-node[data-node="producers"] { grid-column: 1; grid-row: 1; }
  .opsdash-diagram .flow-node[data-node="kinesis"] { grid-column: 3; grid-row: 1; }
  .opsdash-diagram .flow-node[data-node="lambda"] { grid-column: 3; grid-row: 3; }
  .opsdash-diagram .flow-node[data-node="dynamodb"] { grid-column: 1; grid-row: 3; }
  .opsdash-diagram .flow-node[data-node="apigateway"] { grid-column: 1; grid-row: 5; }

  /* 6 nodes: unstepped weekly-schedule entry + 5 stepped nodes, same
     snake shape as .summarizer-diagram/.workflow-diagram. */
  .linkedin-diagram .flow-node[data-node="weekly"] { grid-column: 1; grid-row: 1; }
  .linkedin-diagram .flow-node[data-node="draft"] { grid-column: 3; grid-row: 1; }
  .linkedin-diagram .flow-node[data-node="email"] { grid-column: 3; grid-row: 3; }
  .linkedin-diagram .flow-node[data-node="review"] { grid-column: 1; grid-row: 3; }
  .linkedin-diagram .flow-node[data-node="onetime"] { grid-column: 1; grid-row: 5; }
  .linkedin-diagram .flow-node[data-node="publish"] { grid-column: 3; grid-row: 5; }

  /* 4 nodes, no unstepped entry -- fills exactly 2 rows. */
  .datalake-diagram .flow-node[data-node="raw"] { grid-column: 1; grid-row: 1; }
  .datalake-diagram .flow-node[data-node="glue"] { grid-column: 3; grid-row: 1; }
  .datalake-diagram .flow-node[data-node="athena"] { grid-column: 3; grid-row: 3; }
  .datalake-diagram .flow-node[data-node="quicksight"] { grid-column: 1; grid-row: 3; }

  /* Was missing a scoping class entirely -- fell through to unpositioned
     grid auto-placement on mobile, scrambling the zigzag (nodes and
     connectors landing in each other's rows). Same 6-node shape as
     .workflow-diagram/.orders-diagram. */
  .dr-diagram .flow-node[data-node="visitor"] { grid-column: 1; grid-row: 1; }
  .dr-diagram .flow-node[data-node="route53"] { grid-column: 3; grid-row: 1; }
  .dr-diagram .flow-node[data-node="apigateway"] { grid-column: 3; grid-row: 3; }
  .dr-diagram .flow-node[data-node="lambda"] { grid-column: 1; grid-row: 3; }
  .dr-diagram .flow-node[data-node="dynamodb"] { grid-column: 1; grid-row: 5; }
  .dr-diagram .flow-node[data-node="dynamodb-standby"] { grid-column: 3; grid-row: 5; }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector {
    display: block;
    pointer-events: none;
    width: 100%;
    justify-self: stretch;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector[data-step="1"] { grid-column: 2; grid-row: 1; }
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector[data-step="2"] { grid-column: 3; grid-row: 2; }
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector[data-step="3"] { grid-column: 2; grid-row: 3; }
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector[data-step="4"] { grid-column: 1; grid-row: 4; }
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector[data-step="5"] { grid-column: 2; grid-row: 5; }
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector[data-step="6"] { grid-column: 3; grid-row: 6; }

  /* The written step number moves to a corner badge on the node itself
     (below) — the connector's own number label is redundant here. */
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector-num {
    display: none;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector.is-vertical {
    height: 100%;
    width: 68px;
    align-self: stretch;
    justify-self: center;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector.is-vertical .flow-connector-line {
    left: 50%;
    right: auto;
    top: 8px;
    bottom: 8px;
    height: auto;
    width: 2px;
    transform: translateX(-50%);
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector.is-vertical .flow-connector-line::after {
    right: auto;
    left: 50%;
    bottom: -1px;
    top: auto;
    transform: translateX(-50%) rotate(45deg);
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector.is-vertical .flow-dot {
    left: 50%;
    top: 0;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector.is-active.is-vertical .flow-dot {
    animation: flowDotTravelVertical 1.1s ease-in-out;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector.is-reversed .flow-connector-line {
    transform: translateY(-50%) scaleX(-1);
  }

  /* var(--border) is too light to read clearly against this card's
     background at mobile sizes, especially before a step has become
     active/done - darken the resting (not-yet-visited) arrow color. */
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector-line {
    background: var(--muted);
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-connector-line::after {
    border-color: var(--muted);
    background: transparent;
    border-left-width: 0;
    border-top-width: 0;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node {
    position: relative;
    flex-direction: column;
    width: 68px;
    min-width: 0;
    justify-self: center;
    text-align: center;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node-label {
    overflow-wrap: break-word;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node-icon {
    width: 52px;
    height: 52px;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node-icon svg,
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node-icon img {
    width: 46px;
    height: 46px;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node.is-active .flow-node-icon img,
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node.is-active .flow-node-icon svg,
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node.is-active .flow-node-label {
    transition-delay: 0s;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node[data-step]::after {
    content: attr(data-step);
    position: absolute;
    top: -6px;
    right: 2px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--info-bg);
    color: var(--accent-dark);
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.35s ease, color 0.35s ease;
  }

  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node.is-active[data-step]::after,
  .flow-diagram:not(.ws-diagram):not(.fanout-diagram) .flow-node.is-done[data-step]::after {
    background: var(--accent);
    color: #fff;
  }

  .back-to-top {
    right: 1.75rem;
    bottom: 1.75rem;
    width: 42px;
    height: 42px;
  }

  .back-to-top svg {
    width: 19px;
    height: 19px;
  }

  /* Same rest/scroll opacity behavior as the sidebar rail (Section
     20): very faint at rest, solid for as long as a scroll is
     actively happening -- script.js adds "is-scrolling" on the same
     scroll listener as the rail. */
  .back-to-top.is-visible {
    opacity: 0.25;
  }

  .back-to-top.is-visible.is-scrolling {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------------
   22. REDUCED-MOTION ACCESSIBILITY
   If the visitor's OS has "reduce motion" turned on, this collapses
   every animation/transition on the page to near-zero duration
   (scroll reveal, hover lifts, pulse dot, shimmer, grid drift, dropdown
   fade, header shrink — all of it). Leave this last in the file so it
   always wins.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    transition: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}


/* ==========================================================================
   Live Poll (project/polling)
   ========================================================================== */

:root {
  --poll-color-1: #3454d1;
  --poll-color-2: #6c3fd1;
  --poll-color-3: #2f8fbf;
  --poll-color-4: #17633a;
  --poll-color-5: #263fa0;
}

/* Dark mode — same token names, different values, so every rule that
   already reads var(--bg)/var(--text)/etc. adapts automatically with
   no other changes needed. Applied via a data-theme attribute on <html>
   rather than only prefers-color-scheme, so the toggle in the nav can
   override the system setting and the choice can persist (see the
   small blocking script in <head> that sets this before first paint,
   and the toggle wiring in each page's script). */
[data-theme="dark"] {
  --bg: #0e1320;
  --surface: #161d2e;
  --text: #e8ecf6;
  --muted: #96a2ba;
  --border: #2b3550;
  --accent: #7391ff;
  --accent-dark: #97aeff;
  --success-bg: #10301f;
  --success-text: #6fe0a0;
  --error-bg: #351515;
  --error-text: #ff8f8f;
  --info-bg: #16213a;
  --info-text: #93b0ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --grid-line: rgba(115, 145, 255, 0.16);
  --surface-translucent: rgba(22, 29, 46, 0.9);

  --poll-color-1: #7391ff;
  --poll-color-2: #a98bff;
  --poll-color-3: #5fc2ef;
  --poll-color-4: #4fd996;
  --poll-color-5: #97aeff;
}

/* Toggle switch in the nav — icon-only circular button on desktop,
   labeled row inside the mobile menu. Both control the same state;
   whichever is visible at the current width just reflects it. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.theme-toggle-icon-btn {
  width: 38px;
  height: 38px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .theme-toggle-icon-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
  }
}

.mobile-sidebar-theme-toggle {
  width: calc(100% - 1.2rem);
  font-weight: 700;
  font-size: 0.95rem;
}

/* The poll section stacks (header text, then the voting panel below it)
   instead of using .card's default two-column layout. */
.poll-card {
  display: block;
}

.poll-card > .poll-panel {
  margin-top: 2rem;
}

.poll-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  background: var(--info-bg);
  color: var(--info-text);
}

.poll-status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.poll-status[data-state="live"] {
  background: var(--success-bg);
  color: var(--success-text);
}

.poll-status[data-state="reconnecting"] {
  background: var(--error-bg);
  color: var(--error-text);
}

.poll-activity {
  margin-top: 1.75rem;
}

.poll-panel {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.poll-total {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.poll-rows {
  display: grid;
  gap: 0.75rem;
}

.poll-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 1.25fr) auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.poll-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.poll-row-label {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poll-row-desc {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: break-word;
}

.poll-row:hover {
  border-color: var(--accent);
  background: var(--accent-dark);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.poll-row:hover .poll-row-desc {
  color: rgba(255, 255, 255, 0.85);
}

.poll-row.is-mine:hover {
  box-shadow: 0 0 0 3px rgba(52, 84, 209, 0.14);
}

.poll-row:active {
  transform: none;
}

.poll-row:hover .poll-row-count,
.poll-row:hover .poll-row-you {
  color: #fff;
}

.poll-row.is-mine {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 84, 209, 0.14);
}

.poll-row-track-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}

.poll-row-you {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.poll-row-track {
  position: relative;
  width: 100%;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.poll-row-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.poll-row-count {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.poll-feed {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
}

.poll-feed li {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border-radius: 10px;
}

@media (max-width: 640px) {
  .poll-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* ==========================================================================
   Design decisions section (project/polling)
   ========================================================================== */

.decision-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.decision-item {
  padding: 1.25rem clamp(1.25rem, 4vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
}

.decision-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.decision-item p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}


/* ==========================================================================
   WebSocket persistent-connection diagram (project/polling only)
   ========================================================================== */

.ws-diagram {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  padding: 2.75rem 2.5rem;
}

.ws-loop-svg {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

#ws-loop-path {
  stroke: var(--accent);
  stroke-width: 1.5;
  transition: stroke 0.4s ease;
}

#ws-loop-path.active {
  stroke-dasharray: 6 6;
  animation: wsMarchingDash 1.2s linear infinite;
}

#ws-loop-path.closed {
  stroke: var(--border);
  stroke-dasharray: none;
  animation: none;
}

@keyframes wsMarchingDash {
  to {
    stroke-dashoffset: -16;
  }
}

.ws-loop-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.3s ease;
  pointer-events: none;
}

.ws-loop-label.on {
  opacity: 1;
}

.ws-loop-label.closed {
  color: var(--error-text);
}

.ws-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.ws-loop-group {
  display: flex;
  align-items: flex-start;
  flex: 1 1 auto;
}

.ws-arrow {
  position: relative;
  height: 68px;
  flex: 1 1 60px;
  min-width: 50px;
}

.ws-line {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
}

.ws-line::before,
.ws-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--border);
  border-right: 2px solid var(--border);
}

.ws-line::before {
  left: -1px;
  transform: translateY(-50%) rotate(-135deg);
}

.ws-line::after {
  right: -1px;
  transform: translateY(-50%) rotate(45deg);
}

.ws-line-l,
.ws-line-r {
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.ws-line-l {
  left: 14px;
  width: calc(50% - 10px);
  right: auto;
}

.ws-line-l::after {
  display: none;
}

.ws-line-r {
  right: 14px;
  width: calc(50% - 10px);
  left: auto;
}

.ws-line-r::before {
  display: none;
}

/* Reusable on any .ws-line — used by the mobile stub arrows to show only
   one arrowhead (the one pointing into the node they connect to). */
.ws-line.hide-before::before {
  display: none;
}

.ws-line.hide-after::after {
  display: none;
}

.ws-line-l.cracked {
  transform: translate(-6px, -50%);
}

.ws-line-r.cracked {
  transform: translate(6px, -50%);
}

.ws-line-l.highlight-fwd,
.ws-line-l.highlight-rev,
.ws-line-r.highlight-fwd,
.ws-line-r.highlight-rev {
  background: var(--accent);
  height: 3px;
  transition: background 0.2s ease, height 0.2s ease, transform 0.5s ease, opacity 0.5s ease;
}

.ws-line-r.highlight-fwd::after {
  border-color: var(--accent);
}

.ws-line-l.highlight-rev::before {
  border-color: var(--accent);
}

.ws-crack {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 24px;
  transform: translate(-50%, -50%);
  opacity: 0;
  color: var(--error-text);
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.ws-crack.show {
  opacity: 1;
}

.ws-line.highlight-fwd,
.ws-line.highlight-rev {
  background: var(--accent);
  height: 3px;
  transition: background 0.2s ease, height 0.2s ease;
}

.ws-line.highlight-fwd::after {
  border-color: var(--accent);
}

.ws-line.highlight-rev::before {
  border-color: var(--accent);
}

.ws-dot {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translate(-50%, -50%);
}

.ws-dot.dot-fwd {
  animation: wsDotFwd 1.6s linear;
}

.ws-dot.dot-rev {
  animation: wsDotRev 1.6s linear;
}

@keyframes wsDotFwd {
  0% { left: 14px; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: calc(100% - 14px); opacity: 0; }
}

@keyframes wsDotRev {
  0% { left: calc(100% - 14px); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: 14px; opacity: 0; }
}

.ws-step {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: var(--info-bg);
  color: var(--accent-dark);
  font-size: 0.64rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ws-step-top {
  top: -10px;
}

.ws-step-bottom {
  top: auto;
  bottom: -10px;
}

.ws-step:hover,
.ws-step:active,
.ws-step:focus {
  transform: translateX(-50%) !important;
}

.ws-step:hover {
  border-color: var(--accent);
}

.ws-step:focus-visible {
  outline: 3px solid rgba(52, 84, 209, 0.35);
  outline-offset: 2px;
}

.ws-step.is-active {
  background: var(--accent);
  color: #fff;
}

.ws-close-note {
  margin-top: 1.5rem;
}

.ws-arrow-stub {
  display: none;
  position: relative;
  height: 68px;
}

/* The mobile stub dots run as two sequential legs (lambda, then API
   Gateway) instead of one continuous trip, so each leg needs to be
   quicker than the standard dot speed — otherwise the full sequence
   runs longer than the phase's hold time and overlaps with the next
   phase's dot, which is what caused multiple dots to appear at once. */
.ws-arrow-stub .ws-dot.dot-fwd,
.ws-arrow-stub .ws-dot.dot-rev {
  animation-duration: 0.7s;
}

@media (max-width: 760px) {
  .ws-diagram {
    max-width: none;
    padding: 1.25rem 1rem 1rem;
  }

  /* Sticky shrink-on-scroll is a desktop-only affordance — on mobile the
     diagram just sits in normal flow instead of pinning/scaling as you
     scroll past it, matching project1.html's mobile behavior. */
  .flow-diagram.ws-diagram {
    position: static;
    top: auto;
  }

  .flow-diagram.ws-diagram.is-stuck {
    transform: none;
  }

  /* Same desktop-only sticky/shrink exemption as ws-diagram above. */
  .flow-diagram.fanout-diagram {
    position: static;
    top: auto;
  }

  .flow-diagram.fanout-diagram.is-stuck {
    transform: none;
  }

  /* The loop visualization is desktop-only: .ws-loop-group uses
     display:contents here so its children can become direct grid items
     (for the zigzag layout below), but that means the group itself has
     no measurable box for positionLoop() to read — and even if it did,
     a rectangle can't cleanly wrap just API Gateway + Lambda + DynamoDB
     without also covering Browser, since they're not a clean row/column
     block in this layout. */
  .ws-loop-svg,
  .ws-loop-label {
    display: none;
  }

  /* No click-to-jump on mobile — it just autoplays on a continuous
     loop, so the numbered step buttons and the lightning-bolt crack
     glyph (tied to a "closed" state that isn't shown here either) are
     both hidden. */
  .ws-step,
  .ws-crack {
    display: none;
  }

  .ws-track {
    display: grid;
    grid-template-columns: 36px 1fr 60px 1fr 36px;
    grid-template-rows: auto 16px auto;
    align-items: center;
    justify-items: center;
    row-gap: 0.3rem;
  }

  .ws-loop-group {
    display: contents;
  }

  /* Zigzag: browser top-left, API Gateway top-right, lambda bottom-left,
     DynamoDB bottom-right — bottom row reads left-to-right in the same
     order votes actually flow (lambda, then DynamoDB). The API Gateway
     <-> lambda connection can't be one clean line once lambda sits in
     the opposite corner, so instead of a full-width divider it's shown
     as a dashed line exiting API Gateway's right side and a dashed
     arrow appearing on lambda's left side — implying the connection
     continues off to the side rather than drawing a literal path
     across empty space. */
  [data-node="browser"] {
    grid-column: 2;
    grid-row: 1;
  }

  [data-node="apigateway"] {
    grid-column: 4;
    grid-row: 1;
  }

  [data-node="lambda"] {
    grid-column: 2;
    grid-row: 3;
  }

  [data-node="dynamodb"] {
    grid-column: 4;
    grid-row: 3;
  }

  #ws-arrow-connect {
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    height: 32px;
  }

  #ws-arrow-tally {
    grid-column: 3;
    grid-row: 3;
    width: 100%;
    height: 32px;
  }

  .ws-step-top {
    top: -10px;
  }

  .ws-step-bottom {
    bottom: -10px;
    top: auto;
  }

  #ws-arrow-stub-apigw {
    grid-column: 5;
    grid-row: 1;
    width: 100%;
    height: 32px;
  }

  #ws-arrow-stub-lambda {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    height: 32px;
  }

  .ws-arrow-stub {
    display: block;
  }

  .ws-arrow-stub .ws-line {
    left: 4px;
    right: 4px;
    width: auto;
    border-top: 1px dashed var(--border);
    background: none;
    height: 0;
  }

  .ws-arrow-stub .ws-line.highlight-fwd,
  .ws-arrow-stub .ws-line.highlight-rev {
    border-top-color: var(--accent);
  }

  /* The original full-width vote connector is no longer shown on
     mobile (replaced by the two dashed stubs above), but it's kept in
     the layout — just collapsed and invisible — rather than
     display:none, because its dot's animationend event is what the JS
     actually waits on to know when "the vote reached its destination"
     and light up the next node. A display:none element never fires
     that event at all, which would silently break the highlight
     timing; opacity:0 lets the animation keep running unseen. */
  #ws-arrow-vote {
    grid-column: 3;
    grid-row: 2;
    width: 100%;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
}


/* ---------------------------------------------------------------------
   NOTIFY TRIGGER, LIVE LOG TABLE & FAN-OUT BRANCH
   (project/fanningsns/project3.html only)
   Styles for the SNS demo page: the "Trigger test notification" button
   row, the live delivery-log table it fills in, the small delivered/
   pending status badges inside that table, and the static "meanwhile"
   branch diagram shown under the main animated flow.
   --------------------------------------------------------------------- */
.notify-trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: center;
  gap: 0.85rem;
  padding-top: 1rem;
}

.trigger-button-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cooldown-counter {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 1ch;
  text-align: center;
}

/* Always occupies its box — visibility/opacity toggle via .is-visible
   from script.js, rather than the hidden attribute (display:none),
   so its space is reserved whether a message is showing or not. That
   reservation is what keeps the button from shifting position when a
   message appears, and what keeps "Live delivery log" below it from
   getting overlapped — both problems came from the same root cause:
   an element whose presence/absence changed the layout around it. */
.notify-trigger #trigger-status {
  min-height: 3.4rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.notify-trigger #trigger-status.is-visible {
  opacity: 1;
  visibility: visible;
}

.notify-log-wrap {
  grid-column: 1 / -1;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.notify-log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.notify-log-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Info bubble: a small "i" trigger next to a label that reveals a short
   explanation on click. Two copies exist for the Message ID column —
   one inside the real desktop <th>, one inline within each mobile
   card's row — since the mobile card layout visually hides the real
   <thead> entirely and generates its other labels from a CSS
   data-label attribute, which can't contain a real clickable button. */
.th-with-info {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.info-bubble-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  font-style: italic;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.info-bubble-trigger:hover,
.info-bubble-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.info-bubble {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 230px;
  max-width: calc(100vw - 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

/* The mobile-only per-row label, real HTML (not the ::before trick the
   other columns use) so it can hold the interactive trigger button.
   Hidden on desktop, where the real <th> already labels the column. */
.mobile-field-label-inline {
  display: none;
}

@media (max-width: 760px) {
  .notify-log .th-with-info {
    display: none;
  }

  .mobile-field-label-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    position: relative;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
  }

  /* On mobile the trigger's horizontal position varies row to row, but
     the bubble should still consistently land near the screen edge
     rather than centering under wherever the trigger happens to be
     (which is what caused it to spill off the left edge). Positioned
     against the viewport instead of the trigger — script.js sets
     `top` inline once it knows the trigger's actual position, since
     that part genuinely does depend on which row was clicked. */
  .info-bubble {
    position: fixed;
    left: auto;
    right: 1rem;
    transform: none;
    width: calc(100vw - 3rem);
    max-width: 280px;
  }
}

.notify-log {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.notify-log th,
.notify-log td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.notify-log th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.notify-log td code {
  font-size: 0.85rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge-ok {
  color: var(--success-text);
  background: var(--success-bg);
}

.status-badge-pending {
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
}

.status-badge-error {
  color: var(--error-text);
  background: var(--error-bg);
}

/* ----- Job timeline (Workflow Visualizer) -------------------------------
   A 4-stage horizontal stepper: Submitted -> Validating -> Processing ->
   Complete. Unlike the notify-log badges above (independent rows, each
   its own single state), this is one continuous path — earlier segments
   stay visibly "done" behind whichever stage is currently active, so the
   whole run reads as progress rather than a single changing label. */
.job-timeline-wrap {
  margin: 1.75rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
}

/* Sits in the same grid cell as the result it precedes (.job-timeline-
   wrap or .summarize-result), swapped out the moment that real content
   appears -- a dashed outline so the empty space on first load reads
   as "something will render here" instead of a blank gap. */
.result-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  margin: 1.75rem 0;
  padding: 1.5rem;
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* [hidden] and .result-placeholder are equal specificity, and this
   stylesheet's rule comes after the UA default -- without this override,
   script.js setting `.hidden = true` on a placeholder has no visible
   effect at all, since `display: flex` above wins. Confirmed this was
   silently broken on nova-summarizer's already-live result placeholder. */
.result-placeholder[hidden] {
  display: none;
}

.job-timeline-wrap h3 {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
}

.job-timeline {
  display: flex;
  align-items: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
}

.job-timeline-step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.job-timeline-line {
  position: absolute;
  top: 17px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
  transition: background 0.4s ease;
}

.job-timeline-dot {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.job-timeline-label {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.3s ease;
}

.job-timeline-step.is-done .job-timeline-line {
  background: var(--success-text);
}

.job-timeline-step.is-done .job-timeline-dot {
  background: var(--success-text);
  border-color: var(--success-text);
  color: #fff;
}

.job-timeline-step.is-done .job-timeline-label {
  color: var(--text);
}

.job-timeline-step.is-active .job-timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  animation: jobTimelinePulse 1.4s ease-in-out infinite;
}

.job-timeline-step.is-active .job-timeline-label {
  color: var(--accent);
}

.job-id-note {
  margin: 1rem 0 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

@keyframes jobTimelinePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 84, 209, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(52, 84, 209, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .job-timeline-step.is-active .job-timeline-dot {
    animation: none;
  }
}

@media (max-width: 560px) {
  .job-timeline-label {
    font-size: 0.72rem;
  }
}

/* The static "meanwhile" branch shown under the main animated diagram —
   deliberately not part of the click-through stepper, since it happens
   in parallel with it rather than after it. */
.fanout-branch {
  margin-top: 3rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.fanout-branch h3 {
  margin: 0.25rem 0 0.75rem;
  font-size: 1.3rem;
}

.fanout-branch-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.fanout-branch-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.fanout-branch-node .flow-node-icon img {
  width: 34px;
  height: 34px;
}

.fanout-branch-arrow {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .notify-log,
  .notify-log thead,
  .notify-log tbody,
  .notify-log tr,
  .notify-log th,
  .notify-log td {
    display: block;
  }

  .notify-log thead {
    /* Column headers become each row's field labels instead (see
       td::before below) — a header row doesn't make sense once every
       row is its own stacked card. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .notify-log tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
  }

  .notify-log td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: none;
  }

  .notify-log td:not(:last-child) {
    border-bottom: 1px dashed var(--border);
  }

  .notify-log td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
  }

  /* This cell has a real inline label instead (see
     .mobile-field-label-inline) — without this, the generic rule
     above still generates an empty pseudo-element here, which occupies
     its own flex slot and pushes the real label off-center. */
  .notify-log td.msg-id-cell::before {
    content: none;
  }

  .fanout-branch-row {
    justify-content: center;
  }
}

/* ---------------------------------------------------------------------
   23. AUTH (moderated-image-gallery + website-chatbot)
   Sign up / log in / forgot password tabs live inside a <dialog>,
   opened from a single "Log in" button (#auth-section) so the demo
   section shows one control instead of a permanently-visible form
   stack. The gallery's upload-form guidelines checkbox + rejection
   banner and the public gallery grid are further down this section.
   --------------------------------------------------------------------- */
.auth-modal {
  /* No position override here on purpose -- the UA stylesheet's
     default `position: fixed` on <dialog> is what centers it in the
     viewport when shown via showModal(). Overriding that (even to
     `relative`) breaks centering, since `fixed` is already a valid
     containing block for the absolutely-positioned close button
     below -- there's nothing else position needs to do here. */
  width: calc(100vw - 2rem);
  max-width: 420px;
  padding: 1.75rem;
  border: none;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.auth-modal::backdrop {
  background: rgba(10, 14, 26, 0.55);
  backdrop-filter: blur(2px);
}

.auth-modal-heading {
  margin: 0 0 1rem;
  padding-right: 2rem;
  font-size: 1.3rem;
}

.auth-modal-close {
  justify-self: auto;
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--info-bg);
  color: var(--text);
  box-shadow: none;
}

.auth-modal-close svg {
  width: 15px;
  height: 15px;
}

@media (hover: hover) and (pointer: fine) {
  .auth-modal-close:hover {
    background: var(--border);
    transform: none;
  }
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-tab {
  justify-self: auto;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 700;
  font-size: 0.92rem;
}

.auth-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.auth-panel[hidden] {
  display: none;
}

.auth-switch {
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-switch button {
  justify-self: auto;
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1.25rem;
  background: var(--info-bg);
}

/* Without this, the [hidden] attribute set by reflectSession() in
   script.js has no visible effect -- .session-row's own `display: flex`
   above ties the native [hidden] UA rule on specificity, and an author
   rule always wins that tie, so the row stayed visibly rendered
   regardless of sign-in state until this override was added. */
.session-row[hidden] {
  display: none;
}

.session-row .muted {
  margin: 0;
}

.upload-status-badge {
  font-weight: 700;
}

.upload-status-badge.status-badge-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.85rem;
}

.rejection-note {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: var(--error-bg);
  color: var(--error-text);
  font-weight: 600;
  margin-top: 0.75rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 1 / 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-item img:hover {
    transform: scale(1.04);
  }
}

.gallery-item a.gallery-download {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.72);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Guarded to real hover-capable pointers only -- left unguarded, a tap
   on a touch device latches this :hover state, and mobile browsers
   spend that first tap "revealing" the hover state instead of firing
   a click -- the image needed a second tap to actually open the
   lightbox. :focus-visible (keyboard) is unaffected either way and
   stays outside the guard. */
@media (hover: hover) and (pointer: fine) {
  .gallery-item:hover a.gallery-download {
    opacity: 1;
  }
}

.gallery-item a.gallery-download:focus-visible {
  opacity: 1;
}

.gallery-empty-note {
  margin-top: 1.5rem;
}

/* Expanded view of a gallery image, opened via showModal() on click --
   same <dialog>/::backdrop pattern as .auth-modal above, just sized to
   the image instead of a fixed card width. */
.gallery-lightbox {
  /* dvh, not vh -- vh is pinned to the viewport height with mobile
     Safari's browser chrome hidden, which is taller than what's
     actually visible whenever the address bar is showing. That let
     the image render taller than the real visible area with no way
     to tell, since this dialog also sets overflow: visible (so a
     too-tall image spills past its box instead of clipping or
     scrolling). dvh tracks the actual current viewport, chrome and
     all, so this caps to what's really on screen in any orientation. */
  max-width: 85vw;
  max-height: 85dvh;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: transparent;
  overflow: visible;
}

.gallery-lightbox::backdrop {
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(2px);
}

.gallery-lightbox img {
  display: block;
  max-width: 85vw;
  max-height: 85dvh;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.gallery-lightbox-close {
  justify-self: auto;
  position: absolute;
  top: -14px;
  right: -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.gallery-lightbox-close svg {
  width: 15px;
  height: 15px;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-lightbox-close:hover {
    background: var(--accent-dark);
    transform: none;
  }
}

/* ---------------------------------------------------------------------
   24. HABIT TRACKER (project6.html only)
   Device-id notice banner, habit cards, and the check-in calendar grid.
   --------------------------------------------------------------------- */
.device-notice {
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  background: var(--info-bg);
  color: var(--info-text);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.device-notice code {
  font-weight: 700;
}

.habit-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.habit-form label {
  flex: 1 1 240px;
}

.habit-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.habit-list-empty-note {
  margin-top: 0;
}

.habit-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  background: var(--surface);
  display: grid;
  gap: 0.9rem;
}

.habit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.habit-card-head h3 {
  margin: 0;
  word-break: break-word;
}

.habit-delete-button {
  justify-self: auto;
  font-size: 0.82rem;
  padding: 0.3rem 0.85rem;
  flex-shrink: 0;
}

.habit-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.habit-stats strong {
  color: var(--text);
  font-size: 1.1rem;
}

.habit-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.habit-calendar-cell {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: var(--border);
}

.habit-calendar-cell.is-checked {
  background: var(--accent);
}

.habit-checkin-button {
  justify-self: stretch;
  text-align: center;
}

.habit-checkin-button.is-done {
  background: var(--success-bg);
  color: var(--success-text);
}

/* ---------------------------------------------------------------------
   25. NOVA LITE SUMMARIZER (project7.html only)
   Length-toggle radio pills, character counter, and the result box.
   --------------------------------------------------------------------- */
.length-toggle {
  display: flex;
  gap: 0.5rem;
}

.length-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.length-toggle label {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
}

.length-toggle input:checked + label,
.length-toggle input:focus-visible + label {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.char-count {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
  margin-top: -0.6rem;
}

.char-count.is-over-limit {
  color: var(--error-text);
  font-weight: 700;
}

.summarize-result {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  background: var(--surface);
  margin-top: 1.5rem;
}

.summarize-result h3 {
  margin: 0 0 0.75rem;
}

.summarize-result-bullets {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.summarize-result-bullets li {
  margin-bottom: 0.35rem;
}

.summarize-result-takeaways-label {
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.summarize-result-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ---------------------------------------------------------------------
   26. ORDER PROCESSING (project8.html only)
   Product picker, failed-state timeline step, and the order log table.
   --------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* Forces the 4 product cards into a single row once there's room for
   them (paired with .card-full-row, which gives this the full card
   width to work with) -- auto-fill above stays as the mobile-safe
   fallback for narrower viewports where .card drops to display:block. */
@media (min-width: 761px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.reset-inventory-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.product-card {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.product-card input {
  width: auto;
  margin-top: 0.2rem;
}

.product-card-body h4 {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
}

.product-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.product-card-body .out-of-stock {
  color: var(--error-text);
  font-weight: 700;
}

.job-timeline-step.is-failed .job-timeline-line {
  background: var(--error-text);
}

.job-timeline-step.is-failed .job-timeline-dot {
  background: var(--error-text);
  border-color: var(--error-text);
  color: #fff;
}

.job-timeline-step.is-failed .job-timeline-label {
  color: var(--error-text);
}

/* ---------------------------------------------------------------------
   27. WEBSITE CHATBOT (project9.html only)
   Chat window, message bubbles, and the FAQ/AI/guardrail source tags.
   --------------------------------------------------------------------- */
.chat-window {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Same fix as .session-row[hidden] above -- .chat-window's own
   `display: flex` otherwise wins the specificity tie against the
   native [hidden] UA rule, so the chat window stayed visibly rendered
   before a visitor ever signed in. */
.chat-window[hidden] {
  display: none;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem;
  background: var(--surface);
}

/* The chat panel sits alone in the .card's second column now (see
   .card-primary-col in the shared demo-layout section), so it has room
   to be noticeably taller than the 420px default. */
@media (min-width: 761px) {
  .chat-messages {
    max-height: 620px;
  }
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.chat-message.is-user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message.is-assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble {
  border-radius: 16px;
  padding: 0.65rem 1rem;
  white-space: pre-wrap;
}

.chat-message.is-user .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-message.is-assistant .chat-bubble {
  background: var(--info-bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-source-tag {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.chat-source-faq {
  color: var(--info-text);
  background: var(--info-bg);
}

.chat-source-ai {
  color: var(--success-text);
  background: var(--success-bg);
}

.chat-source-guardrail {
  color: var(--error-text);
  background: var(--error-bg);
}

.chat-form {
  display: flex;
  gap: 0.75rem;
}

.chat-form input {
  flex: 1;
}

.chat-form button {
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   28. REFERENCE-ONLY PROJECT NOTICE
   Shared by the 5 beta-only "Reference build" projects (Multi-Region DR,
   Data Lake & Analytics, Container Orchestration, VPC Network Design,
   Real-Time Operations Dashboard) -- their AWS architecture is designed
   and documented but intentionally never deployed, to avoid running
   infrastructure (NAT gateways, EKS control planes, Kinesis shards,
   QuickSight seats, etc.) nobody needs live 24/7. Placed under each
   page's <h1>, above .hero-actions.
   --------------------------------------------------------------------- */
.reference-build-notice {
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  background: var(--info-bg);
  color: var(--info-text);
  font-weight: 600;
  margin: 0.75rem 0 1.25rem;
  max-width: 640px;
}

/* ---------------------------------------------------------------------
   29. MULTI-REGION DR (project/dr/index.html only)
   Posture selector, region map, and homepage-card thumbnail scene.
   --------------------------------------------------------------------- */
.dr-mode-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.dr-mode-button {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dr-mode-button:hover {
  border-color: var(--accent);
}

.dr-mode-button.is-active {
  border-color: var(--accent);
  background: var(--info-bg);
}

.dr-mode-name {
  font-weight: 700;
}

.dr-mode-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.dr-region-map {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
  flex-wrap: wrap;
}

.dr-region {
  position: relative;
  flex: 1;
  min-width: 200px;
  padding: 1.25rem 1.4rem;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.dr-region-label {
  margin: 0 0 0.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dr-region-role {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.dr-region.is-active {
  border-color: var(--success-text, #1a7f4e);
}

.dr-region.is-active .dr-region-role {
  color: var(--success-text, #1a7f4e);
}

.dr-region.is-down {
  border-color: var(--error-text, #b3261e);
  opacity: 0.6;
}

.dr-region.is-down .dr-region-role {
  color: var(--error-text, #b3261e);
}

.dr-region.is-promoted {
  border-color: var(--accent);
}

.dr-region-pulse {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success-text, #1a7f4e);
  animation: statusPulse 2s ease-in-out infinite;
}

.dr-region.is-down .dr-region-pulse {
  animation: none;
  background: var(--error-text, #b3261e);
}

.dr-region-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  flex-shrink: 0;
}

.dr-region-link-line {
  width: 100%;
  height: 2px;
  background: var(--border);
  position: relative;
}

.dr-region-link-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
}

@media (max-width: 640px) {
  .dr-region-map {
    flex-direction: column;
  }
  .dr-region-link {
    width: 2px;
    height: 32px;
  }
}

/* Homepage-card thumbnail scene: a large globe split into two regions
   telling the actual failover story end to end -- the left (primary)
   region fails over (check -> X), a dotted route appears and traffic
   travels it (accurately tracing the same quadratic curve the path is
   drawn with, sampled at 10 points rather than the old 3-point
   approximation that visibly drifted off the dashes), and the right
   (standby) region comes up (clock -> check) -- rather than two static
   pins that never change state. */
.dr-thumb-globe {
  fill: var(--info-bg);
}

.dr-thumb-globe-outline,
.dr-thumb-meridian {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
}

.dr-thumb-split {
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

.dr-thumb-arc {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 5 5;
  opacity: 0;
  animation: drArcAppear 6.8s ease-in-out infinite;
}

@keyframes drArcAppear {
  0%, 14% { opacity: 0; }
  20%, 88% { opacity: 0.5; }
  96%, 100% { opacity: 0; }
}

/* Traces M107.7,72.7 Q160,26.7 212.3,72.7 with 10 sampled points
   (dx = W*t, dy = -2h*t*(1-t) for this symmetric quadratic) rather than
   CSS motion-path, which the rest of this site's thumb animations avoid
   for broader browser support -- same technique as
   .opsdash-thumb-pulse-dot below. */
.dr-thumb-arc-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
  opacity: 0;
  animation: drArcTravel 6.8s ease-in-out infinite;
}

@keyframes drArcTravel {
  0%, 14% { transform: translate(0, 0); opacity: 0; }
  16% { opacity: 1; }
  22.8% { transform: translate(10.5px, -8.3px); }
  29.6% { transform: translate(20.9px, -14.7px); }
  36.4% { transform: translate(31.4px, -19.3px); }
  43.2% { transform: translate(41.8px, -22.1px); }
  50% { transform: translate(52.3px, -23px); }
  56.8% { transform: translate(62.8px, -22.1px); }
  63.6% { transform: translate(73.2px, -19.3px); }
  70.4% { transform: translate(83.7px, -14.7px); }
  77.2% { transform: translate(94.1px, -8.3px); }
  84% { transform: translate(104.6px, 0); opacity: 1; }
  92%, 100% { transform: translate(104.6px, 0); opacity: 0; }
}

.dr-thumb-pin circle {
  fill: var(--surface);
  stroke-width: 2;
}

.dr-thumb-pin-left circle {
  animation: drLeftPinColor 6.8s ease-in-out infinite;
}

@keyframes drLeftPinColor {
  0%, 14% { stroke: var(--success-text); }
  22%, 100% { stroke: var(--error-text); }
}

.dr-thumb-check-left {
  stroke: var(--success-text);
  opacity: 1;
  animation: drCheckLeftFade 6.8s ease-in-out infinite;
}

@keyframes drCheckLeftFade {
  0%, 14% { opacity: 1; }
  20%, 100% { opacity: 0; }
}

.dr-thumb-x-left {
  stroke: var(--error-text);
  opacity: 0;
  animation: drXLeftFade 6.8s ease-in-out infinite;
}

@keyframes drXLeftFade {
  0%, 14% { opacity: 0; }
  20%, 100% { opacity: 1; }
}

.dr-thumb-pin-right circle {
  animation: drRightPinColor 6.8s ease-in-out infinite;
}

@keyframes drRightPinColor {
  0%, 84% { stroke: var(--muted); }
  92%, 100% { stroke: var(--success-text); }
}

.dr-thumb-clock-right {
  stroke: var(--muted);
  opacity: 1;
  animation: drClockRightFade 6.8s ease-in-out infinite;
}

@keyframes drClockRightFade {
  0%, 84% { opacity: 1; }
  90%, 100% { opacity: 0; }
}

.dr-thumb-check-right {
  stroke: var(--success-text);
  opacity: 0;
  animation: drCheckRightFade 6.8s ease-in-out infinite;
}

@keyframes drCheckRightFade {
  0%, 84% { opacity: 0; }
  90%, 100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dr-thumb-arc,
  .dr-thumb-arc-dot,
  .dr-thumb-pin-left circle,
  .dr-thumb-pin-right circle,
  .dr-thumb-check-left,
  .dr-thumb-x-left,
  .dr-thumb-clock-right,
  .dr-thumb-check-right {
    animation: none;
  }

  .dr-thumb-arc {
    opacity: 0.5;
  }

  .dr-thumb-arc-dot {
    opacity: 1;
    transform: translate(104.6px, 0);
  }

  .dr-thumb-pin-left circle {
    stroke: var(--error-text);
  }

  .dr-thumb-check-left {
    opacity: 0;
  }

  .dr-thumb-x-left {
    opacity: 1;
  }

  .dr-thumb-pin-right circle {
    stroke: var(--success-text);
  }

  .dr-thumb-clock-right {
    opacity: 0;
  }

  .dr-thumb-check-right {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------------
   30. CONTAINER ORCHESTRATION (project/containers/index.html only)
   Rolling-deployment task grid and homepage-card thumbnail scene.
   The diagram sits in the #demo card's right-hand column (the same
   grid .card uses everywhere else for "intro copy left, interactive
   widget right") and stacks CI/CD trigger -> ALB -> tasks top to
   bottom, one column wide, so it reads as a vertical pipeline rather
   than the wide horizontal task row this used to be. The connectors
   between tiers carry a continuously-looping dot (.orchestration-flow-
   dot) so the pipeline visibly "moves" even at rest, not just while a
   deployment is in progress.
   --------------------------------------------------------------------- */
.orchestration-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.75rem 1.5rem;
  background: var(--info-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
}

.orchestration-node {
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  text-align: center;
}

.orchestration-connector {
  position: relative;
  width: 2px;
  height: 32px;
  background: var(--border);
}

.orchestration-connector::after {
  /* arrowhead */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  transform: translateX(-50%) rotate(45deg);
}

.orchestration-flow-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  animation: orchestrationFlowDot 2.4s ease-in-out infinite;
}

@keyframes orchestrationFlowDot {
  0%, 4% {
    top: 0;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  96%, 100% {
    top: 100%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orchestration-flow-dot {
    animation: none;
    opacity: 0;
  }
}

.orchestration-task-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  margin-top: 1.25rem;
}

.orchestration-task {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--success-bg, #e3f7e9);
  border: 2px solid var(--success-text, #1a7d3c);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.orchestration-task-version {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--success-text, #1a7d3c);
}

.orchestration-task.is-updating {
  background: var(--info-bg);
  border-color: var(--accent);
  animation: orchestrationPulse 0.9s ease-in-out infinite;
}

.orchestration-task.is-updating .orchestration-task-version {
  color: var(--accent);
}

.orchestration-task.is-updated {
  transform: scale(1.05);
}

@keyframes orchestrationPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .orchestration-task.is-updating {
    animation: none;
  }
}

.containers-thumb-box {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

/* ECS rolling deployment: a highlight dot sweeps left to right along the
   service's task row while each task flips from "old version" (outline)
   to "new version" (filled + checked) as the dot reaches it, one at a
   time. All five hold as "new" together, then the whole row rolls back
   to "old" at once and the sweep restarts -- matching the card copy's
   "rolling out new versions one task at a time," not five boxes each
   blinking on their own independent clock. */
.containers-thumb-flip-1 { animation: containersBoxFlip1 3.6s ease-in-out infinite; }
.containers-thumb-flip-2 { animation: containersBoxFlip2 3.6s ease-in-out infinite; }
.containers-thumb-flip-3 { animation: containersBoxFlip3 3.6s ease-in-out infinite; }
.containers-thumb-flip-4 { animation: containersBoxFlip4 3.6s ease-in-out infinite; }
.containers-thumb-flip-5 { animation: containersBoxFlip5 3.6s ease-in-out infinite; }

@keyframes containersBoxFlip1 { 0%, 4% { fill: var(--surface); stroke: var(--accent); } 8%, 92% { fill: var(--accent); stroke: var(--accent); } 98%, 100% { fill: var(--surface); stroke: var(--accent); } }
@keyframes containersBoxFlip2 { 0%, 18% { fill: var(--surface); stroke: var(--accent); } 22%, 92% { fill: var(--accent); stroke: var(--accent); } 98%, 100% { fill: var(--surface); stroke: var(--accent); } }
@keyframes containersBoxFlip3 { 0%, 32% { fill: var(--surface); stroke: var(--accent); } 36%, 92% { fill: var(--accent); stroke: var(--accent); } 98%, 100% { fill: var(--surface); stroke: var(--accent); } }
@keyframes containersBoxFlip4 { 0%, 46% { fill: var(--surface); stroke: var(--accent); } 50%, 92% { fill: var(--accent); stroke: var(--accent); } 98%, 100% { fill: var(--surface); stroke: var(--accent); } }
@keyframes containersBoxFlip5 { 0%, 60% { fill: var(--surface); stroke: var(--accent); } 64%, 92% { fill: var(--accent); stroke: var(--accent); } 98%, 100% { fill: var(--surface); stroke: var(--accent); } }

.containers-thumb-check-1 { opacity: 0; animation: containersCheckFade1 3.6s ease-in-out infinite; }
.containers-thumb-check-2 { opacity: 0; animation: containersCheckFade2 3.6s ease-in-out infinite; }
.containers-thumb-check-3 { opacity: 0; animation: containersCheckFade3 3.6s ease-in-out infinite; }
.containers-thumb-check-4 { opacity: 0; animation: containersCheckFade4 3.6s ease-in-out infinite; }
.containers-thumb-check-5 { opacity: 0; animation: containersCheckFade5 3.6s ease-in-out infinite; }

@keyframes containersCheckFade1 { 0%, 6% { opacity: 0; } 10%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes containersCheckFade2 { 0%, 20% { opacity: 0; } 24%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes containersCheckFade3 { 0%, 34% { opacity: 0; } 38%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes containersCheckFade4 { 0%, 48% { opacity: 0; } 52%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes containersCheckFade5 { 0%, 62% { opacity: 0; } 66%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }

.containers-thumb-line {
  stroke: var(--border);
  stroke-width: 2;
}

.containers-thumb-dot {
  fill: var(--accent);
  animation: containersDotSweep 3.6s ease-in-out infinite;
}

@keyframes containersDotSweep {
  0% { transform: translateX(0); opacity: 1; }
  64% { transform: translateX(236px); opacity: 1; }
  92% { transform: translateX(236px); opacity: 1; }
  98% { transform: translateX(236px); opacity: 0; }
  99% { transform: translateX(0); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .containers-thumb-flip-1, .containers-thumb-flip-2, .containers-thumb-flip-3, .containers-thumb-flip-4, .containers-thumb-flip-5,
  .containers-thumb-check-1, .containers-thumb-check-2, .containers-thumb-check-3, .containers-thumb-check-4, .containers-thumb-check-5,
  .containers-thumb-dot {
    animation: none;
  }
}

/* ---------------------------------------------------------------------
   31. VPC NETWORK DESIGN (project/vpc/index.html only)
   Click-to-inspect subnet/resource diagram, detail panel, and
   homepage-card thumbnail scene. Reuses --accent/--muted/--border/
   --surface/--info-bg/--info-text/--text tokens already defined in
   :root, so it follows the existing dark-mode behavior automatically.
   --------------------------------------------------------------------- */
.vpc-demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .vpc-demo-layout {
    grid-template-columns: 1fr;
  }
}

.vpc-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem;
}

.vpc-diagram-svg {
  width: 100%;
  height: auto;
  font-family: inherit;
}

.vpc-boundary {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.vpc-boundary-label {
  font-size: 12px;
  font-weight: 700;
  fill: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vpc-az-box {
  fill: var(--info-bg);
  fill-opacity: 0.35;
  stroke: var(--border);
  stroke-width: 1;
}

.vpc-az-label {
  font-size: 11px;
  font-weight: 700;
  fill: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vpc-connector {
  stroke: var(--border);
  stroke-width: 2;
}

.vpc-node {
  cursor: pointer;
  outline: none;
}

.vpc-node rect {
  transition: stroke 0.2s ease, stroke-width 0.2s ease, fill 0.2s ease;
}

.vpc-node text {
  font-size: 11px;
  fill: var(--text);
  pointer-events: none;
}

.vpc-node:focus-visible rect {
  stroke: var(--accent);
  stroke-width: 3;
}

.vpc-node-igw rect {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
}

.vpc-node-igw text {
  font-weight: 700;
}

.vpc-subnet-label {
  font-size: 11px;
  font-weight: 700;
  fill: var(--muted);
}

.vpc-subnet {
  stroke-width: 1.5;
}

.vpc-subnet-public {
  fill: rgba(52, 84, 209, 0.07);
  stroke: rgba(52, 84, 209, 0.35);
}

.vpc-subnet-private {
  fill: rgba(16, 163, 74, 0.07);
  stroke: rgba(16, 163, 74, 0.35);
}

.vpc-subnet-isolated {
  fill: rgba(217, 119, 6, 0.07);
  stroke: rgba(217, 119, 6, 0.35);
}

.vpc-subnet-node.is-selected > rect {
  stroke-width: 3;
}

.vpc-subnet-node.is-selected .vpc-subnet-public {
  stroke: var(--accent);
}

.vpc-subnet-node.is-selected .vpc-subnet-private {
  stroke: #10a34a;
}

.vpc-subnet-node.is-selected .vpc-subnet-isolated {
  stroke: #d97706;
}

.vpc-resource,
.vpc-nat {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
}

.vpc-resource-node.is-selected .vpc-resource,
.vpc-nat-node.is-selected .vpc-nat {
  stroke: var(--accent);
  stroke-width: 3;
  fill: var(--info-bg);
}

.vpc-detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  min-height: 220px;
}

.vpc-detail-placeholder {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.vpc-detail-content h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.vpc-detail-content .muted {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.vpc-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.vpc-detail-table th,
.vpc-detail-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.vpc-detail-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vpc-detail-note {
  margin-top: 1rem;
}

/* Two AZs, each a public/private/isolated tier stack -- fill opacity
   increases tier by tier (lighter = more open to traffic, darker = more
   locked down) and a dot flows top to bottom through each column,
   standing in for the actual security-group-gated request path this
   project lets you click through. */
.vpc-thumb-tier {
  stroke: var(--accent);
  stroke-width: 2;
  fill: var(--accent);
}

.vpc-thumb-tier-public { opacity: 0.18; }
.vpc-thumb-tier-private { opacity: 0.4; }
.vpc-thumb-tier-isolated { opacity: 0.65; }

.vpc-thumb-link {
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 3 3;
}

.vpc-thumb-flow-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
  opacity: 0;
  animation: vpcFlowTravel 4s ease-in-out infinite;
}

.vpc-thumb-flow-dot-b {
  animation-delay: 2s;
}

@keyframes vpcFlowTravel {
  0%, 6% { transform: translateY(0); opacity: 0; }
  14% { opacity: 1; }
  50% { transform: translateY(48px); opacity: 1; }
  86% { transform: translateY(96px); opacity: 1; }
  94%, 100% { transform: translateY(96px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .vpc-thumb-flow-dot {
    animation: none;
    opacity: 0;
  }
}

/* ---------------------------------------------------------------------
   32. REAL-TIME OPERATIONS DASHBOARD (project/opsdash/index.html only)
   Stats row, hand-rolled SVG bar/line charts, and homepage-card
   thumbnail scene.
   --------------------------------------------------------------------- */
.opsdash-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.opsdash-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: center;
}

.opsdash-stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.opsdash-stat-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.opsdash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.opsdash-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.4rem 1.5rem;
}

.opsdash-chart-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.opsdash-bar-chart,
.opsdash-line-chart {
  width: 100%;
  height: auto;
}

.opsdash-chart-label {
  font-size: 11px;
  fill: var(--muted);
  dominant-baseline: middle;
}

.opsdash-chart-count {
  font-size: 12px;
  font-weight: 700;
  fill: var(--text);
  dominant-baseline: middle;
}

.opsdash-bar-track {
  fill: var(--info-bg);
}

.opsdash-bar-fill {
  fill: var(--accent);
  transition: width 0.3s ease;
}

.opsdash-line-baseline {
  stroke: var(--border);
  stroke-width: 1;
}

.opsdash-line-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.opsdash-line-dot {
  fill: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .opsdash-bar-fill {
    transition: none;
  }
}

/* A live heartbeat/pulse line with a traveling blip, standing in for
   the Kinesis event stream -- reads as "real-time" in a way three
   static bars never could (bars don't move, a live monitor does). */
.opsdash-thumb-baseline {
  stroke: var(--border);
  stroke-width: 2;
}

.opsdash-thumb-pulse-line {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Approximates the pulse-line's path with a few translate stops
   rather than CSS motion-path, matching .dr-thumb-arc-dot's approach. */
.opsdash-thumb-pulse-dot {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
  opacity: 0;
  animation: opsdashPulseTravel 3.2s ease-in-out infinite;
}

@keyframes opsdashPulseTravel {
  0%, 4% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  20% { transform: translate(0, 0); }
  24.25% { transform: translate(25px, 0); }
  28.5% { transform: translate(40px, -20px); }
  32.75% { transform: translate(55px, 15px); }
  37% { transform: translate(70px, -5px); }
  41.25% { transform: translate(85px, -40px); }
  45.5% { transform: translate(100px, 20px); }
  49.75% { transform: translate(115px, -10px); }
  54% { transform: translate(130px, 5px); }
  58.25% { transform: translate(145px, -25px); }
  62.5% { transform: translate(160px, 10px); }
  66.75% { transform: translate(175px, -10px); }
  71% { transform: translate(190px, 25px); }
  75.25% { transform: translate(205px, -15px); }
  79.5% { transform: translate(220px, 0); }
  83.75% { transform: translate(235px, 0); }
  88% { transform: translate(260px, 0); opacity: 1; }
  96%, 100% { transform: translate(260px, 0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .opsdash-thumb-pulse-dot {
    animation: none;
  }
}

/* ---------------------------------------------------------------------
   33. LINKEDIN POST PIPELINE (project/linkedin/index.html only)
   Weekly review simulator and homepage-card thumbnail scene.
   --------------------------------------------------------------------- */
.li-board {
  margin-top: 1.5rem;
}

.li-summary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--info-text);
  background: var(--info-bg);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}

.li-posts {
  display: grid;
  gap: 1rem;
}

.li-post {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}

.li-post.is-approved,
.li-post.is-published {
  border-color: var(--success-text);
}

.li-post.is-declined {
  border-color: var(--error-text);
  opacity: 0.9;
}

.li-post-image {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--info-bg), var(--surface));
  border: 1px solid var(--border);
}

.li-post-image-letter {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
}

.li-post-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.li-post-day {
  font-weight: 800;
}

.li-post-subject {
  font-size: 0.82rem;
  color: var(--muted);
}

.li-post-badge {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--info-text);
}

.li-post.is-approved .li-post-badge,
.li-post.is-published .li-post-badge {
  background: var(--success-bg);
  color: var(--success-text);
}

.li-post.is-declined .li-post-badge {
  background: var(--error-bg);
  color: var(--error-text);
}

.li-post-text {
  margin: 0;
  line-height: 1.55;
}

.li-post-note {
  margin: 0.5rem 0 0;
}

.li-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.li-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.li-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.li-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.li-btn-approve {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.li-btn-approve:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.li-reason-input {
  flex: 1 1 200px;
  min-width: 0;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.li-publish-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.li-publish-row p {
  margin: 0;
}

/* Notice shown after "Fast-forward to publish times". Fixed to the
   viewport so it stays visible while the page scrolls back up to the demo. */
.li-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 60;
  width: min(440px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1.5px solid var(--success-text);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
  animation: liToastIn 0.25s ease-out;
}

.li-toast-title {
  display: block;
  color: var(--success-text);
  margin-bottom: 0.35rem;
}

.li-toast-text {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

@keyframes liToastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .li-toast {
    animation: none;
  }
}

@media (max-width: 520px) {
  .li-post {
    grid-template-columns: 1fr;
  }

  .li-post-image {
    width: 100%;
    height: 64px;
  }
}

/* Homepage-card thumbnail: five post cards across the top get approved
   one after another (check badges pop in), then a paper plane flies
   along the track below -- "approved, then published". The plane's
   translate lives on an inner <g> so the CSS animation transform doesn't
   replace the outer SVG transform attribute that positions it. */
.linkedin-thumb-card {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 2;
}

.linkedin-thumb-lines {
  stroke: var(--border);
  stroke-width: 3;
  stroke-linecap: round;
}

.linkedin-thumb-badge {
  fill: var(--accent);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: linkedinBadgePop 6s ease-in-out infinite;
}

.linkedin-thumb-tick {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  animation: linkedinTickShow 6s ease-in-out infinite;
}

.linkedin-thumb-badge-2,
.linkedin-thumb-tick.linkedin-thumb-badge-2 { animation-delay: 0.6s; }
.linkedin-thumb-badge-3,
.linkedin-thumb-tick.linkedin-thumb-badge-3 { animation-delay: 1.2s; }

@keyframes linkedinBadgePop {
  0% { opacity: 0; transform: scale(0.4); }
  6% { opacity: 1; transform: scale(1.15); }
  10% { opacity: 1; transform: scale(1); }
  82% { opacity: 1; transform: scale(1); }
  92%, 100% { opacity: 0; transform: scale(1); }
}

@keyframes linkedinTickShow {
  0%, 4% { opacity: 0; }
  8%, 82% { opacity: 1; }
  92%, 100% { opacity: 0; }
}

.linkedin-thumb-track {
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.linkedin-thumb-plane {
  fill: var(--accent);
  opacity: 0;
  animation: linkedinPlaneFly 6s ease-in-out infinite;
  animation-delay: 1.8s;
}

@keyframes linkedinPlaneFly {
  0% { transform: translateX(0); opacity: 0; }
  6% { opacity: 1; }
  60% { transform: translateX(236px); opacity: 1; }
  68%, 100% { transform: translateX(236px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .linkedin-thumb-badge,
  .linkedin-thumb-tick,
  .linkedin-thumb-plane {
    animation: none;
  }

  .linkedin-thumb-badge,
  .linkedin-thumb-tick {
    opacity: 1;
  }

  .linkedin-thumb-plane {
    opacity: 1;
    transform: translateX(110px);
  }
}

/* ---------------------------------------------------------------------
   34. PAYDAYCOMPASS (project/paydaycompass/index.html only)
   Diagram sections and the homepage-card thumbnail scene.
   --------------------------------------------------------------------- */
.pc-also {
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.6rem;
}

.pc-flows {
  padding: 1rem 0 4rem;
}

.pc-flow {
  margin-top: 3rem;
}

.pc-flow h3 {
  margin: 0 0 0.5rem;
}

.pc-flow p {
  max-width: 70ch;
  margin: 0 0 1.25rem;
}

.payday-thumb-ring {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 3;
}

.payday-thumb-ticks {
  stroke: var(--border);
  stroke-width: 3;
  stroke-linecap: round;
}

.payday-thumb-needle {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: paydayNeedleSwing 6s ease-in-out infinite;
}

.payday-thumb-needle-n {
  fill: var(--accent);
}

.payday-thumb-needle-s {
  fill: var(--border);
}

.payday-thumb-hub {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.payday-thumb-bar {
  fill: var(--accent);
  opacity: 0.85;
  transform-box: fill-box;
  transform-origin: 0 50%;
  animation: paydayBarFill 6s ease-in-out infinite;
}

.payday-thumb-bar-2 { animation-delay: 0.5s; }
.payday-thumb-bar-3 { animation-delay: 1s; }

.payday-thumb-bar-track {
  fill: var(--border);
}

@keyframes paydayNeedleSwing {
  0%, 100% { transform: rotate(-28deg); }
  50% { transform: rotate(28deg); }
}

@keyframes paydayBarFill {
  0% { transform: scaleX(0.15); }
  50%, 80% { transform: scaleX(1); }
  100% { transform: scaleX(0.15); }
}

@media (prefers-reduced-motion: reduce) {
  .payday-thumb-needle,
  .payday-thumb-bar {
    animation: none;
  }

  .payday-thumb-needle {
    transform: rotate(20deg);
  }
}
