/* ==========================================================================
   Plan9 Studios — Design System (Redesign Pass)
   Dark industrial / editorial software-studio direction.
   ========================================================================== */

:root {
  --p9-bg: #0a0a0a;
  --p9-bg-raised: #111111;
  --p9-bg-sunken: #050505;
  --p9-bg-panel: #0d0d0d;
  --p9-border: #232323;
  --p9-border-lo: #181818;
  --p9-border-hi: #303030;
  
  --p9-white-hi: #ffffff;
  

  --p9-text: #f0f0ef;
  --p9-muted: #96968f;
  /* UX/Security pass: lightened from #5c5c58 (~2.95:1 on --p9-bg, fails
     WCAG AA at the small label sizes this token is used on) to ~5.1:1 --
     still visibly dimmer than --p9-muted for hierarchy, but readable. */
  --p9-dim: #82827c;

  --p9-red: #e8334a;
  --p9-red-hi: #ff4d63;
  --p9-red-lo: rgba(232, 51, 74, 0.10);
  --p9-red-glow: rgba(232, 51, 74, 0.22);

  --p9-amber: #d9a441;
  --p9-amber-lo: rgba(217, 164, 65, 0.12);
  --p9-green: #3bbf6c;
  --p9-green-lo: rgba(59, 191, 108, 0.12);

  --p9-radius-sm: 4px;
  --p9-radius: 8px;
  --p9-radius-lg: 14px;

  --p9-space-1: 0.5rem;
  --p9-space-2: 1rem;
  --p9-space-3: 1.5rem;
  --p9-space-4: 2rem;
  --p9-space-5: 3.5rem;
  --p9-space-6: 5.5rem;

  --p9-container: 1320px;
  --p9-container-narrow: 760px;

  --p9-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Helvetica, Arial, sans-serif;
  --p9-font-mono: 'SFMono-Regular', ui-monospace, 'Cascadia Code', Consolas, 'Liberation Mono', monospace;

  /* UX/Security pass — readability pass type scale. Additive: existing
     --p9-* values above are unchanged (besides --p9-dim, see comment).
     Responsive clamp()s follow the same pattern already used for
     headings (.p9-h1/.p9-h2) rather than fixed px, and give a coherent
     floor at each tier instead of a blanket size increase everywhere. */
  --p9-fs-body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);       /* ~16-17px: normal body text */
  --p9-fs-body-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);   /* ~17-19px: important body/product copy */
  --p9-fs-secondary: clamp(0.9375rem, 0.91rem + 0.15vw, 1rem);  /* ~15-16px: secondary descriptive copy */
  --p9-fs-nav: clamp(0.875rem, 0.85rem + 0.1vw, 1rem);          /* ~14-16px: navigation */
  --p9-fs-button: clamp(0.875rem, 0.85rem + 0.1vw, 1rem);       /* ~14-16px: buttons */
  --p9-fs-label: 0.8125rem;                                     /* 13px floor: tiny technical labels */
  --p9-line-body: 1.65;
  /* AA-safe replacement for the various hardcoded #aaa/#7a7a7a/#6a6a6a
     paragraph-copy colours found across the legacy per-page templates. */
  --p9-text-body: #d7d7d4;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--p9-bg);
  color: var(--p9-text);
  font-family: var(--p9-font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

::selection { background: var(--p9-red); color: #fff; }
:focus-visible { outline: 2px solid var(--p9-red-hi); outline-offset: 2px; border-radius: 2px; }

/* ---------- Layout primitives ---------- */
.p9-container { max-width: var(--p9-container); margin: 0 auto; padding: 0 2rem; }
.p9-container-narrow { max-width: var(--p9-container-narrow); margin: 0 auto; padding: 0 2rem; }
.p9-section { padding: var(--p9-space-6) 0; }
.p9-section-tight { padding: var(--p9-space-4) 0; }
.p9-section-header { max-width: 680px; margin: 0 0 var(--p9-space-4); }
.p9-section-header.center { margin-left: auto; margin-right: auto; text-align: center; }
.p9-divider { border: none; border-top: 1px solid var(--p9-border); margin: 0; }

/* ---------- Typography ---------- */
.p9-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--p9-font-mono);
  font-size: var(--p9-fs-label); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--p9-red-hi); margin-bottom: 0.9rem;
}
.p9-eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--p9-red); display: inline-block; }

.p9-h1 { font-size: clamp(2.5rem, 5.2vw, 4.5rem); font-weight: 800; line-height: 1.03; letter-spacing: -0.025em; color: var(--p9-text); margin: 0; }
.p9-h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.015em; color: var(--p9-text); margin: 0; }
.p9-h3 { font-size: 1.2rem; font-weight: 700; color: var(--p9-text); letter-spacing: -0.005em; margin: 0; }
.p9-lead { font-size: 1.2rem; color: var(--p9-muted); line-height: 1.6; }
.p9-body { color: var(--p9-muted); line-height: 1.7; }
.p9-label { font-family: var(--p9-font-mono); font-size: var(--p9-fs-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--p9-dim); }

/* ---------- Buttons ---------- */
.p9-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.95rem 1.75rem; border-radius: var(--p9-radius-sm); font-weight: 700; font-size: 0.95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.p9-btn:active { transform: translateY(1px); }
.p9-btn-block { display: flex; width: 100%; }
.p9-btn-sm { padding: 0.6rem 1.1rem; font-size: 0.85rem; }
.p9-btn-primary { background: var(--p9-red); color: #fff; }
.p9-btn-primary:hover { background: var(--p9-red-hi); }
.p9-btn-outline { border-color: var(--p9-border-hi); color: var(--p9-text); background: transparent; }
.p9-btn-outline:hover { border-color: var(--p9-red); color: var(--p9-red-hi); }
.p9-btn-ghost { color: var(--p9-muted); }
.p9-btn-ghost:hover { color: var(--p9-text); }

/* ---------- Grid ---------- */
.p9-grid { display: grid; gap: 1.5rem; }
.p9-grid-2 { grid-template-columns: repeat(2, 1fr); }
.p9-grid-3 { grid-template-columns: repeat(3, 1fr); }
.p9-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .p9-grid-3, .p9-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .p9-grid-2, .p9-grid-3, .p9-grid-4 { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.p9-card { background: var(--p9-bg-panel); border: 1px solid var(--p9-border); border-radius: var(--p9-radius); padding: 1.75rem; transition: border-color .18s ease, transform .18s ease, background-color .18s ease; }
.p9-card-hover:hover { border-color: rgba(232,51,74,0.4); transform: translateY(-3px); background: #101010; }
.p9-card h3, .p9-card .p9-h3 { margin-bottom: 0.5rem; }
.p9-family { font-family: var(--p9-font-mono); font-size: var(--p9-fs-label); letter-spacing: 0.09em; text-transform: uppercase; color: var(--p9-red-hi); margin-bottom: 0.75rem; }
.p9-product-card { display: flex; flex-direction: column; min-height: 100%; }
/* [hidden] must win over the unconditional `display: flex` above --
   without this, an author rule always beats the browser's own
   [hidden]{display:none} rule regardless of source order, so a filtered-
   out card (pill-filter.js, or the initial server-rendered state for a
   direct ?family= link) stays visibly displayed even though it's
   correctly marked hidden in the DOM. Same class of bug fixed previously
   for the Yasmin widget panel -- see static/css/yasmin.css. */
.p9-product-card[hidden] { display: none; }
.p9-product-card p { color: var(--p9-muted); font-size: 0.95rem; line-height: 1.6; flex-grow: 1; }
.p9-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--p9-border-lo); }
.p9-price-tag { font-weight: 700; font-size: 0.85rem; color: var(--p9-text); }
.p9-price-tag.quote { color: var(--p9-muted); font-weight: 500; }

/* ---------- Standard pricing presentation (product cards, featured band, hero) ---------- */
.p9-card-price { display: flex; flex-direction: column; gap: 0.15rem; }
.p9-card-price-main { font-weight: 700; font-size: 0.95rem; color: var(--p9-text); }
.p9-card-price-main.quote, .p9-card-price-main.coming-soon { color: var(--p9-muted); font-weight: 500; }
.p9-card-price-period { font-weight: 500; }
.p9-price-suffix { color: var(--p9-white-hi); font-size: .8em; font-weight: 600; letter-spacing: .01em; white-space: nowrap; display: inherit; }
.p9-card-price-note { display: inline-flex; align-items: center;gap: .35rem; margin: .45rem 0 0; color: var(--p9-red-hi); font-size: 1rem; font-weight: 600; }
.p9-card-link { color: var(--p9-red-hi); font-weight: 600; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.p9-card-link:hover { text-decoration: underline; }

/* Prepared-package domain link (Complete Branded Website package cards +
   order review) -- a small badge-style treatment so the domain a customer
   is actually getting reads as a distinct, clickable fact rather than
   plain body copy, without introducing a new colour or a "loud" link
   style inconsistent with the rest of the UI. */
.p9-domain-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--p9-red-lo);
  border: 1px solid rgba(232, 51, 74, 0.28);
  color: var(--p9-red-hi);
  font-weight: 600;
  font-size: .92em;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.p9-domain-link:hover {
  background: rgba(232, 51, 74, 0.16);
  border-color: var(--p9-red-hi);
  text-decoration: underline;
}
.p9-domain-link::after {
  content: "↗";
  font-size: .85em;
  opacity: .75;
}

.p9-product-hero-price { display: flex; flex-direction: column; gap: 0.25rem; margin: 1.25rem 0; }
.p9-product-hero-price-main { font-weight: 800; font-size: 1.75rem; }
.p9-product-hero-price-note { font-size: 0.85rem; color: var(--p9-dim); font-weight: 500; }

.p9-pricing-inclusions { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 0.6rem; }
.p9-pricing-inclusions li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.92rem; }
.p9-pricing-inclusions li::before { content: "✓"; color: var(--p9-red-hi); font-weight: 700; flex-shrink: 0; }

/* ---------- Package price block (order box + Complete Branded cards) ----------
   The headline price for a single purchasable ProductPackage option, plus
   its supporting notes (Setup included / Managed hosting included) and,
   for annual managed-service packages, the onboarding/setup disclosure
   and Year-2+ renewal-price line sourced from the package's existing
   Price Suffix / `renewal_package` fields. Kept as its own component
   (rather than reusing .p9-card-price, which drives the compact product
   card and hero prices) since this one has its own size and spacing. */
.p9-package-price {
  color: var(--p9-red-hi);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}
.p9-package-price--lg { font-size: 1.6rem; }
.p9-package-note { font-size: 0.78rem; color: var(--p9-dim); font-weight: 500; margin-bottom: 0.9rem; }

.p9-package-pricing { margin: .85rem 0 1.15rem; }
.p9-package-pricing--managed {
  margin: 1rem 0 1.35rem;
}
.p9-package-price-label {
  display: block;
  margin-bottom: .3rem;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--p9-text);
}
.p9-package-pricing--managed .p9-package-price {
  margin: 0 0 .32rem;
  color: var(--p9-red-hi);
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -.015em;
}
.p9-package-pricing--managed .p9-package-price .p9-price-suffix {
  color: var(--p9-white-hi);
  letter-spacing: .02em;
  display: inherit;
}
.p9-annual-pricing-copy { margin: 0; }
.p9-onboarding-note {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: .45rem 0 0;
  color: var(--p9-red-hi);
  font-size: 1rem;
  font-weight: 600;
}
.p9-onboarding-note > span {
  color: inherit;
  font-size: .86em;
  line-height: 1;
}
.p9-year-two {
  margin: 0;
  color: var(--p9-text);
  font-size: .88rem;
  line-height: 1.4;
}
.p9-year-two strong {
  color: var(--p9-text);
  font-size: inherit;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.p9-year-two strong span { color: var(--p9-text); font-size: inherit; font-weight: inherit; }
.p9-first-year-description {
  margin: .55rem 0 0 !important;
  padding: 0;
  color: var(--p9-muted);
  font-size: 0.95rem !important;
  line-height: 1.6;
}

.p9-family-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.2rem; border-radius: 999px; border: 1px solid var(--p9-border-hi); color: var(--p9-muted); text-decoration: none; font-size: .85rem; font-weight: 600; transition: border-color .15s ease, color .15s ease; }
.p9-family-pill:hover, .p9-family-pill.active { border-color: var(--p9-red); color: var(--p9-text); }

/* ---------- Product logo stage (includes/product_logo_stage.html) ---------- */
/* Neutral off-white/pale-grey surface every real product logo sits on --
   see the partial's own docstring for why this is applied uniformly. */
.p9-logo-stage { position: relative; display: flex; align-items: center; justify-content: center; background: #f3f1ec; border-radius: var(--p9-radius); overflow: hidden; }
.p9-logo-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.p9-logo-stage-card { width: 100%; height: 84px; padding: 1rem 1.25rem; margin-bottom: 0.9rem; }
.p9-logo-stage-hero { width: 100%; max-width: 280px; height: 108px; padding: 1.25rem 1.75rem; margin: 0 0 1.75rem; }
.p9-logo-stage-hero.p9-logo-stage-centered { margin-left: auto; margin-right: auto; }

/* ---------- Demo showcase (pages/demos.html, pages/demo_detail.html) ---------- */
.p9-demo-card { display: flex; flex-direction: column; height: 100%; background: var(--p9-bg-panel); border: 1px solid var(--p9-border); border-radius: var(--p9-radius-lg); overflow: hidden; transition: border-color .18s ease, transform .18s ease; }
.p9-demo-card:hover { border-color: rgba(232,51,74,0.4); transform: translateY(-3px); }
.p9-demo-preview { position: relative; aspect-ratio: 16 / 10; background: var(--p9-bg-sunken); border-bottom: 1px solid var(--p9-border); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.p9-demo-preview img { width: 100%; height: 100%; display: block; }
.p9-demo-preview .p9-logo-stage { width: 78%; }

/* StudioAI range logo -- same uploaded logo image + p9-logo-stage frame as
   every other product, plus the product's own name underneath it (only
   for StudioAI family products). See
   templates/includes/product_logo_stage.html. */
.p9-logo-stage.studioai-logo-stage { flex-direction: column; padding-top: 1rem; padding-bottom: 1rem; }
.p9-logo-stage.studioai-logo-stage img { width: auto; height: 60%; max-width: 80%; }
.studioai-product-name { margin: 0; font-family: var(--p9-font-mono); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02em; text-align: center; }
.p9-logo-stage-hero.studioai-logo-stage .studioai-product-name { font-size: 0.95rem; }
.p9-demo-preview-empty { font-family: var(--p9-font-mono); font-size: var(--p9-fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--p9-dim); padding: 1.5rem; text-align: center; }
.p9-demo-group-badge { position: absolute; top: 0.9rem; left: 0.9rem; font-family: var(--p9-font-mono); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--p9-text); background: rgba(10,10,10,0.72); border: 1px solid var(--p9-border-hi); padding: 0.3rem 0.6rem; border-radius: 999px; backdrop-filter: blur(6px); }
.p9-demo-group-badge-beta { color: var(--p9-amber); border-color: var(--p9-amber); }
.p9-demo-card-body { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.p9-demo-card-body p { color: var(--p9-muted); font-size: 0.92rem; line-height: 1.6; margin-top: 0.4rem; flex-grow: 1; }
.p9-demo-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--p9-border-lo); }
.p9-demo-details-link { color: var(--p9-muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.p9-demo-details-link:hover { color: var(--p9-text); }

.p9-demo-detail-preview { aspect-ratio: 16 / 9; background: var(--p9-bg-sunken); border: 1px solid var(--p9-border); border-radius: var(--p9-radius-lg); overflow: hidden; margin: 2rem 0; display: flex; align-items: center; justify-content: center; }
.p9-demo-detail-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p9-demo-detail-preview .p9-logo-stage { width: 60%; max-width: 380px; }

/* ---------- Small inline SVG icon set (core/templatetags/icons.py) ---------- */
/* Sized in em, not a fixed rem, so it always matches whatever font-size its
   wrapping element already sets (the same way the emoji/dingbat characters
   it replaces used to scale) -- no per-context override needed. */
.p9-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }
.p9-icon-check { color: #4ade80; }
.p9-icon-cross { color: var(--p9-muted); }

/* ---------- Navigation ---------- */
.p9-nav { position: sticky; top: 0; z-index: 200; background: rgba(10,10,10,0.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--p9-border); }
.p9-nav-inner { max-width: var(--p9-container); margin: 0 auto; padding: 0 2rem; height: 76px; display: flex; align-items: center; gap: 2.5rem; }

.p9-logo { display: flex; align-items: baseline; gap: 0.4rem; text-decoration: none; flex: 0 0 auto; }
.p9-logo-mark { font-weight: 900; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--p9-text); border: 1px solid var(--p9-border-hi); padding: 0.28rem 0.55rem; border-radius: 3px; line-height: 1; }
.p9-logo-mark span { color: var(--p9-red); }
.p9-logo-word { font-weight: 600; font-size: var(--p9-fs-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--p9-muted); }

.p9-nav-toggle { display: none; background: none; border: 1px solid var(--p9-border-hi); color: var(--p9-text); border-radius: var(--p9-radius-sm); font-size: 1.1rem; width: 42px; height: 42px; margin-left: auto; cursor: pointer; }

.p9-nav-links { list-style: none; display: flex; align-items: center; gap: 2rem; margin: 0; padding: 0; flex: 1; }
.p9-nav-links > li { position: relative; }
.p9-nav-links a { color: var(--p9-muted); text-decoration: none; font-size: 0.94rem; font-weight: 500; padding: 0.5rem 0; }
.p9-nav-links a:hover, .p9-nav-links a.active { color: var(--p9-text); }

.p9-has-mega { padding-bottom: 26px; margin-bottom: -26px; }
.p9-mega-toggle { display: inline-flex; align-items: center; gap: 0.1rem; }
.p9-mega-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--p9-muted); cursor: pointer;
  padding: 0.5rem 0.15rem; font-size: 0.7rem; line-height: 1;
}
.p9-mega-trigger:hover,
.p9-has-mega.p9-open .p9-mega-trigger { color: var(--p9-text); }
/* State-driven only (no :hover/:focus-within) -- .p9-open, toggled by the
   chevron button and the pointer-capable hover-assist in header.html's
   inline script, is the sole mechanism that reveals this panel. */
.p9-mega {
  position: absolute; top: 100%; left: 161%; margin-top: 26px; transform: translateX(-50%) translateY(-6px);
  width: min(680px, 90vw); background: #0d0d0d; border: 1px solid var(--p9-border-hi); border-radius: var(--p9-radius);
  padding: 1.75rem; opacity: 0; visibility: hidden; pointer-events: none; z-index: 250;
  box-shadow: 0 24px 48px rgba(0,0,0,0.55);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.p9-nav-links li.p9-has-mega.p9-open .p9-mega { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.p9-mega-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem 2rem; }
.p9-mega-col-title { font-family: var(--p9-font-mono); font-size: var(--p9-fs-label); text-transform: uppercase; letter-spacing: 0.1em; color: var(--p9-red-hi); margin-bottom: 0.7rem; }
.p9-mega a.p9-mega-link { display: block; padding: 0.45rem 0; color: #cfcfcb; text-decoration: none; font-size: 0.92rem; }
.p9-mega a.p9-mega-link:hover, .p9-mega a.p9-mega-link:focus-visible { color: #fff; }
.p9-nav-badge-soon { display: inline-block; margin-left: 0.5rem; padding: 0.12rem 0.45rem; border: 1px solid var(--p9-amber); border-radius: 3px; color: var(--p9-amber); font-family: var(--p9-font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: middle; }
.p9-mega-foot { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--p9-border-lo); }

.p9-nav-actions { display: flex; align-items: center; gap: 0.75rem; flex: 0 0 auto; }
.p9-account-menu { position: relative; }
.p9-account-trigger { display: flex; align-items: center; gap: 0.4rem; background: none; border: 1px solid var(--p9-border-hi); color: var(--p9-text); padding: 0.55rem 1rem; border-radius: 999px; font-size: 0.85rem; font-family: inherit; cursor: pointer; }
.p9-account-trigger:hover { border-color: var(--p9-red); }
.p9-account-dropdown { position: absolute; top: calc(100% + 10px); right: 0; min-width: 200px; background: #0d0d0d; border: 1px solid var(--p9-border-hi); border-radius: var(--p9-radius); padding: 0.5rem; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .15s ease; box-shadow: 0 24px 48px rgba(0,0,0,0.55); z-index: 250; }
.p9-account-menu.p9-open .p9-account-dropdown, .p9-account-menu:focus-within .p9-account-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.p9-account-dropdown a, .p9-account-dropdown button { display: block; width: 100%; text-align: left; padding: 0.6rem 0.8rem; border-radius: 6px; color: #ccc; text-decoration: none; font-size: 0.9rem; background: none; border: none; font-family: inherit; cursor: pointer; }
.p9-account-dropdown a:hover, .p9-account-dropdown button:hover { background: rgba(255,255,255,0.06); color: #fff; }
.p9-account-dropdown hr { border: none; border-top: 1px solid var(--p9-border-lo); margin: 0.4rem 0; }

@media (max-width: 900px) {
  .p9-nav-toggle { display: block; }
  /* Intentionally position: absolute, not fixed. .p9-nav has
     backdrop-filter, and per spec any ancestor with filter/backdrop-filter
     (like transform) becomes the containing block for position: fixed
     descendants -- so a "fixed" panel here would size/position itself
     against the 76px-tall .p9-nav bar instead of the viewport, squashing
     it to almost nothing. .p9-nav is already position: sticky, which is a
     positioned element, so position: absolute here resolves consistently
     against it regardless of backdrop-filter. Height is set explicitly
     (rather than an inset bottom:0, which would also only reach the
     bottom of the 76px nav bar) so the panel still fills the viewport
     below the header. */
  .p9-nav-links { display: none; position: absolute; top: 76px; left: 0; right: 0; height: calc(100vh - 76px); height: calc(100dvh - 76px); background: #0a0a0a; flex-direction: column; align-items: flex-start; gap: 0; padding: 1.5rem 2rem; overflow-y: auto; border-top: 1px solid var(--p9-border); }
  .p9-nav-links.p9-open { display: flex; }
  .p9-nav-links > li { width: 100%; }
  .p9-nav-links a { display: block; padding: 0.9rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--p9-border-lo); }
  .p9-has-mega { padding-bottom: 0; margin-bottom: 0; }
  .p9-mega-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; }
  .p9-mega-trigger { font-size: 0.85rem; padding: 0.9rem 0.4rem; }
  .p9-mega { position: static; left: auto; top: auto; transform: none; width: 100%; margin-top: 0; opacity: 1; visibility: visible; pointer-events: none; display: none; box-shadow: none; border: none; background: none; backdrop-filter: none; padding: 0.25rem 0 0.75rem 1rem; }
  .p9-nav-links li.p9-has-mega.p9-open .p9-mega { display: block; pointer-events: auto; transform: none; }
  .p9-mega-grid { grid-template-columns: 1fr; }
  .p9-mobile-auth { display: flex; gap: 0.75rem; padding-top: 0.5rem; }
  .p9-mobile-auth a { border: 1px solid var(--p9-border-hi); border-radius: var(--p9-radius-sm); padding: 0.6rem 1rem !important; }
  .p9-nav-actions { display: none; }
}
@media (min-width: 901px) { .p9-mobile-auth { display: none; } }

/* ---------- Hero ---------- */
.p9-hero { position: relative; padding: var(--p9-space-6) 0 var(--p9-space-5); overflow: hidden; border-bottom: 1px solid var(--p9-border); }
.p9-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(232,51,74,0.08), transparent 55%), repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 120px);
}
.p9-hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2.25rem; }
.p9-hero .p9-lead { max-width: 620px; margin-top: 1.25rem; }
.p9-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--p9-space-5); align-items: center; }
.p9-hero-grid > * { min-width: 0; }
@media (max-width: 980px) { .p9-hero-grid { grid-template-columns: minmax(0, 1fr); } }
.p9-hero-meta { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 2.25rem; font-family: var(--p9-font-mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--p9-dim); text-transform: uppercase; }
.p9-hero-meta span { color: var(--p9-white-hi); }

/* ---------- Workflow diagrams ---------- */
.p9-workflow-step { display: flex; gap: 1rem; align-items: flex-start; }
.p9-workflow-num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--p9-red-lo); color: var(--p9-red-hi); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; font-family: var(--p9-font-mono); }

.p9-flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; justify-content: center; margin: 2.75rem 0 0; }
.p9-flow-step { flex: 1 1 150px; max-width: 190px; text-align: center; padding: 1.25rem 1rem; }
.p9-flow-icon { width: 54px; height: 54px; border-radius: var(--p9-radius); background: var(--p9-bg-panel); border: 1px solid var(--p9-border-hi); color: var(--p9-red-hi); display: flex; align-items: center; justify-content: center; margin: 0 auto .8rem; font-size: 1.15rem; font-weight: 800; font-family: var(--p9-font-mono); }
.p9-flow-arrow { align-self: center; color: var(--p9-dim); font-size: 1.3rem; padding: 0 .25rem; }
.p9-callout { border: 1px solid var(--p9-border-hi); background: var(--p9-bg-panel); border-radius: var(--p9-radius); padding: 1.5rem; border-left: 3px solid var(--p9-red); }

/* ---------- Product feature band ---------- */
.p9-feature-band { padding: var(--p9-space-6) 0; border-bottom: 1px solid var(--p9-border); }
.p9-feature-band:nth-child(even) { background: var(--p9-bg-raised); }
.p9-feature-band-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--p9-space-5); align-items: center; }
.p9-feature-band-grid.reverse > *:first-child { order: 2; }
@media (max-width: 980px) { .p9-feature-band-grid, .p9-feature-band-grid.reverse > *:first-child { grid-template-columns: 1fr; order: 0; } }
.p9-feature-visual { background: var(--p9-bg-panel); border: 1px solid var(--p9-border); border-radius: var(--p9-radius-lg); padding: var(--p9-space-4); min-height: 320px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.p9-feature-num { font-family: var(--p9-font-mono); font-size: 0.85rem; color: var(--p9-red-hi); letter-spacing: 0.08em; margin-bottom: 1rem; }
.p9-feature-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.9rem; }
.p9-feature-list li { display: flex; gap: 0.75rem; align-items: baseline; color: var(--p9-muted); }
.p9-feature-list li::before { content: '—'; color: var(--p9-red); flex: 0 0 auto; }

/* ---------- Comparison ---------- */
.p9-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--p9-border); border: 1px solid var(--p9-border); border-radius: var(--p9-radius-lg); overflow: hidden; }
.p9-compare-col { background: var(--p9-bg-panel); padding: 2.25rem; }
.p9-compare-col .p9-label { display: block; margin-bottom: 0.75rem; }
@media (max-width: 760px) { .p9-compare-grid { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */
.p9-cta-band { background: var(--p9-bg-panel); border: 1px solid var(--p9-border); border-radius: var(--p9-radius-lg); padding: var(--p9-space-5) var(--p9-space-4); text-align: center; position: relative; overflow: hidden; }
.p9-cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 260px at 50% 0%, var(--p9-red-glow), transparent 70%); opacity: 0.5; pointer-events: none; }
.p9-cta-band > * { position: relative; }
.p9-cta-band .p9-hero-cta { justify-content: center; }

/* ---------- Blog cards ---------- */
.p9-blog-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; margin-bottom: 1.1rem; border: 1px solid var(--p9-border); }

/* ---------- Numbered process rows ---------- */
.p9-process { counter-reset: p9step; }
.p9-process-row { display: grid; grid-template-columns: 64px 1fr; gap: 1.5rem; padding: 1.75rem 0; border-top: 1px solid var(--p9-border-lo); }
.p9-process-row:first-child { border-top: none; }
.p9-process-index { font-family: var(--p9-font-mono); font-size: 0.85rem; color: var(--p9-dim); }

/* ---------- Public form (pages/register_interest.html) ---------- */
.p9-form { max-width: 560px; }
.p9-form-group { margin-bottom: 1.25rem; }
.p9-form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--p9-text); margin-bottom: 0.4rem; }
.p9-form-group input[type="text"],
.p9-form-group input[type="email"],
.p9-form-group input[type="date"],
.p9-form-group select,
.p9-form-group textarea {
  width: 100%; padding: 0.75rem 0.9rem; background: var(--p9-bg-panel); border: 1px solid var(--p9-border);
  border-radius: var(--p9-radius); color: var(--p9-text); font: inherit; font-size: 0.95rem;
  transition: border-color 0.15s ease;
}
.p9-form-group input:focus, .p9-form-group select:focus, .p9-form-group textarea:focus { outline: none; border-color: var(--p9-red-hi); box-shadow: 0 0 0 3px var(--p9-red-lo); }
.p9-form-group select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238d8d8d' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.95rem center; padding-right: 2.75rem; cursor: pointer;
}
.p9-form-group select option { background: var(--p9-bg-panel); color: var(--p9-text); }
.p9-form-group input:disabled { color: var(--p9-muted); opacity: 1; cursor: not-allowed; }
.p9-form-group textarea { resize: vertical; min-height: 110px; }
.p9-form-error { color: var(--p9-red-hi); font-size: 0.8rem; margin-top: 0.35rem; }
.p9-form-optional { color: var(--p9-dim); font-weight: 400; }
.p9-form-alert { padding: 0.85rem 1rem; border-radius: var(--p9-radius); font-size: 0.9rem; margin-bottom: 1.5rem; }
.p9-form-alert-success { background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); color: #4ade80; }
.p9-form-alert-error { background: var(--p9-red-lo); border: 1px solid rgba(232, 51, 74, 0.3); color: var(--p9-red-hi); }
.p9-form-alert-warning { background: rgba(250, 204, 21, 0.08); border: 1px solid rgba(250, 204, 21, 0.3); color: #facc15; }

/* ---------- Footer ---------- */
.p9-footer { background: var(--p9-bg-sunken); border-top: 1px solid var(--p9-border); padding: var(--p9-space-6) 0 var(--p9-space-3); }
.p9-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--p9-space-4); }
@media (max-width: 980px) { .p9-footer-grid { grid-template-columns: 1fr 1fr; } .p9-footer-brand { grid-column: 1 / -1; margin-bottom: 1rem; } }
@media (max-width: 560px) { .p9-footer-grid { grid-template-columns: 1fr; } }
.p9-footer-brand p { color: var(--p9-muted); font-size: 0.92rem; line-height: 1.6; margin-top: 1.1rem; max-width: 320px; }
.p9-footer-col h4 { font-family: var(--p9-font-mono); font-size: var(--p9-fs-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--p9-dim); margin: 0 0 1.1rem; font-weight: 500; }
.p9-footer-col { display: flex; flex-direction: column; gap: 0.7rem; }
.p9-footer-col a { color: var(--p9-muted); text-decoration: none; font-size: 0.92rem; }
.p9-footer-col a:hover { color: #fff; }
.p9-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: var(--p9-space-5); padding-top: var(--p9-space-3); border-top: 1px solid var(--p9-border-lo); color: var(--p9-dim); font-size: 0.82rem; }
.p9-footer-bottom a { color: var(--p9-dim); text-decoration: none; }
.p9-footer-bottom a:hover { color: #fff; }

/* ---------- Footer links ---------- */

.footer-links { display:flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; row-gap: 0.5rem; }
.footer-links a { white-space: nowrap; }

/* ---------- Breadcrumbs ---------- */
.p9-breadcrumbs { max-width: var(--p9-container); margin: 1.5rem auto 0; padding: 0 2rem; font-size: 0.82rem; color: var(--p9-dim); }
.p9-breadcrumbs a { color: var(--p9-dim); text-decoration: none; }
.p9-breadcrumbs a:hover { color: var(--p9-muted); }

/* ---------- FAQ / packages ---------- */
.p9-faq details { border-bottom: 1px solid var(--p9-border-lo); padding: 1.1rem 0; }
.p9-faq summary { cursor: pointer; font-weight: 600; color: var(--p9-text); list-style: none; }
.p9-faq summary::-webkit-details-marker { display: none; }
.p9-faq summary::after { content: '+'; float: right; color: var(--p9-red-hi); font-weight: 400; }
.p9-faq details[open] summary::after { content: '−'; }
.p9-faq p { color: var(--p9-muted); margin-top: .85rem; line-height: 1.7; }

.p9-packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 1.5rem; }
.p9-package { background: var(--p9-bg-panel); border: 1px solid var(--p9-border); border-radius: var(--p9-radius); padding: 1.85rem; }
.p9-package .price { font-size: 1.6rem; font-weight: 800; color: var(--p9-text); margin: .6rem 0 1.1rem; }
.p9-package .price .p9-price-suffix { font-size: .56em; }
.p9-control-label,
.p9-design-picker-label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--p9-dim);
  margin-bottom: .4rem;
}
.p9-control-label--spaced { margin-top: .9rem; }

/* Premium controls retain Plan9's dark, industrial palette while making the
   input surface, active state and keyboard focus feel deliberate and tactile. */
.p9-control-shell {
  position: relative;
  width: 100%;
  min-height: 3.25rem;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--p9-border-hi);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 44%),
    var(--p9-bg-panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 1px 0 rgba(0,0,0,.35);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease;
}
.p9-control-shell::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.025) 48%, transparent 100%);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}
.p9-control-shell:hover {
  border-color: #484844;
  background-color: var(--p9-bg-raised);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 5px 18px rgba(0,0,0,.16);
}
.p9-control-shell:hover::before { opacity: 1; }
.p9-control-shell:focus-within {
  border-color: var(--p9-red-hi);
  box-shadow: 0 0 0 3px var(--p9-red-lo), inset 0 1px 0 rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.18);
  background-color: var(--p9-bg-raised);
}
.p9-control {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 3.125rem;
  padding: .75rem 3.35rem .75rem 1rem;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: inherit;
  background: var(--p9-bg);
  color: var(--p9-text);
  caret-color: var(--p9-red-hi);
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .005em;
  line-height: 1.3;
}
.p9-control::placeholder { color: var(--p9-dim); font-weight: 400; opacity: 1; }
.p9-control:focus { outline: none; }
.p9-control-shell--select { cursor: pointer; }
.p9-control-shell--select .p9-control { cursor: pointer; }
.p9-control-shell--select .p9-control:disabled { cursor: not-allowed; color: var(--p9-muted); }
.p9-select-indicator {
  position: absolute;
  top: 50%;
  right: 1.05rem;
  width: 1.1rem;
  height: 1.1rem;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-left: 1px solid var(--p9-border);
  color: var(--p9-red-hi);
  pointer-events: none;
}
.p9-select-indicator::after {
  content: '';
  width: .42rem;
  height: .42rem;
  margin-left: .55rem;
  margin-top: -.22rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.p9-control-shell:focus-within .p9-select-indicator::after { transform: rotate(225deg) translate(-.1rem, -.1rem); }
.p9-domain-input-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 1rem;
  width: 1.125rem;
  height: 1.125rem;
  display: grid;
  color: var(--p9-red-hi);
  opacity: .88;
  transform: translateY(-50%);
  pointer-events: none;
}
.p9-domain-input-icon::after {
  content: '';
  position: absolute;
  top: .05rem;
  right: -.85rem;
  width: 1px;
  height: 1rem;
  background: var(--p9-border);
}
.p9-domain-input-icon svg { width: 100%; height: 100%; }
.p9-control-shell--input .p9-control { padding-left: 3.55rem; }
.p9-control-shell:has(.p9-input[aria-invalid="true"]) {
  border-color: var(--p9-red-hi);
  box-shadow: 0 0 0 3px rgba(232, 51, 74, .12), inset 0 1px 0 rgba(255,255,255,.04);
}
.p9-control-shell:has(.p9-input[aria-invalid="true"]) .p9-domain-input-icon { color: var(--p9-red-hi); }
.p9-domain-format-error {
  color: var(--p9-red-hi);
  font-size: .78rem;
  line-height: 1.45;
  margin-top: .4rem;
}

.p9-features, .p9-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.p9-feature { background: var(--p9-bg-panel); border: 1px solid var(--p9-border); border-radius: var(--p9-radius); padding: 1.6rem; }
.p9-shots img { border-radius: var(--p9-radius); border: 1px solid var(--p9-border); }

.p9-coming-soon { display: inline-block; color: var(--p9-amber); font-weight: 700; font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 1rem; }

.p9-generic { background: var(--p9-bg); color: var(--p9-text); }

/* ---------- Ready-Made Design picker (visual card chooser) ---------- */
.p9-design-picker-subcopy { font-size: .85rem; color: var(--p9-muted); margin: 0 0 .75rem; }
.p9-design-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.p9-design-card {
  position: relative; text-align: left; cursor: pointer; background: var(--p9-bg-raised); border: 1px solid var(--p9-border);
  border-radius: var(--p9-radius); padding: .9rem;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.p9-design-card:hover { border-color: var(--p9-border-hi); transform: translateY(-2px); }
.p9-design-card:focus-visible { outline: 2px solid var(--p9-red-hi); outline-offset: 2px; }
.p9-design-card.selected { border-color: var(--p9-red-hi); background: rgba(255,77,99,.06); }
.p9-design-card-media { width: 100%; aspect-ratio: 16/10; border-radius: 6px; margin-bottom: .6rem; overflow: hidden; background: var(--p9-bg-panel); display: flex; align-items: center; justify-content: center; }
.p9-design-card-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.p9-design-card-placeholder { font-size: 1.6rem; font-weight: 800; color: var(--p9-border-hi); }
/* Selected indicator is a visible checkmark badge, not colour alone. */
.p9-design-card-check {
  position: absolute; top: .6rem; right: .6rem; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--p9-red-hi); color: #fff; font-size: .75rem; line-height: 1.4rem; text-align: center;
  opacity: 0; transform: scale(.7); transition: opacity .15s ease, transform .15s ease;
}
.p9-design-card.selected .p9-design-card-check { opacity: 1; transform: scale(1); }
.p9-design-card-name { font-weight: 700; font-size: .92rem; color: var(--p9-text); padding-right: 1.6rem; }
.p9-design-card-desc { font-size: .8rem; color: var(--p9-muted); margin-top: .3rem; line-height: 1.5; }
.p9-design-card-live { display: inline-block; margin-top: .55rem; font-size: .78rem; font-weight: 600; color: var(--p9-red-hi); text-decoration: none; }
.p9-design-card-live:hover, .p9-design-card-live:focus-visible { text-decoration: underline; }
.p9-design-card-note { font-size: .74rem; color: var(--p9-dim); margin-top: 1rem; }
.p9-design-select-fallback { margin-top: .75rem; border: 1px solid var(--p9-border); border-radius: 10px; padding: .7rem .8rem .8rem; background: rgba(255,255,255,.012); }
.p9-design-select-fallback summary { cursor: pointer; font-size: .78rem; color: var(--p9-dim); }
.p9-design-select-fallback summary:focus-visible { outline: 2px solid var(--p9-red-hi); outline-offset: 2px; }
.p9-design-select-control { margin-top: .7rem; }
@media (max-width: 560px) {
  .p9-control-shell { min-height: 3.375rem; }
  .p9-control { min-height: 3.25rem; font-size: 1rem; }
}

/* ---------- Creative Work editorial gallery (pages/creative_work.html) ----------
   Alternating full-bleed editorial rows, styled after a reference mock
   the client supplied directly (see conversation). Each entry pairs a
   tilting artwork tile with a text column; odd/even entries mirror
   sides for rhythm. The 3D tilt-on-hover is plain CSS custom properties
   (--rx/--ry) driven by a small vanilla-JS mousemove handler (see
   static/js/creative-work-tilt.js) -- no library, and it no-ops entirely
   on touch devices and prefers-reduced-motion, where the CSS already
   renders a static tile. */
.p9-cw-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--p9-space-4);
  align-items: end;
  padding-bottom: var(--p9-space-4);
  border-bottom: 1px solid var(--p9-border);
  margin-bottom: var(--p9-space-4);
}
.p9-cw-hero-kicker {
  font-family: var(--p9-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--p9-red-hi);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.p9-cw-hero-kicker::before { content: ''; width: 2rem; height: 1px; background: var(--p9-red-hi); }
.p9-cw-hero h1 {
  font-size: clamp(2.6rem, 7vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-wrap: balance;
  color: var(--p9-text);
}
.p9-cw-hero h1 em { font-style: italic; font-weight: 300; color: var(--p9-red-hi); }
.p9-cw-hero-aside {
  font-family: var(--p9-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p9-muted);
  text-align: right;
  line-height: 1.9;
  white-space: nowrap;
}
.p9-cw-hero-aside strong {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--p9-text);
  letter-spacing: -0.03em;
  font-family: var(--p9-font);
  line-height: 1;
}

.p9-cw-intro {
  padding: var(--p9-space-3) 0 var(--p9-space-4);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--p9-space-4);
  border-bottom: 1px solid var(--p9-border);
}
.p9-cw-intro-label {
  font-family: var(--p9-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--p9-muted);
  padding-top: 0.35rem;
}
.p9-cw-intro-text { font-size: clamp(1.1rem, 1.8vw, 1.5rem); line-height: 1.5; color: #d0d0ce; max-width: 62ch; }
.p9-cw-intro-text strong { color: var(--p9-text); font-weight: 600; }

/* ————— MARQUEE ————— */
.p9-cw-marquee {
  overflow: hidden;
  white-space: nowrap;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--p9-border);
  font-family: var(--p9-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--p9-border-hi);
  user-select: none;
}
.p9-cw-marquee-track { display: inline-block; animation: p9-cw-marquee 40s linear infinite; }
.p9-cw-marquee-track span { margin: 0 1.5rem; }
.p9-cw-marquee-track .hl { color: var(--p9-red-hi); }
@keyframes p9-cw-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ————— GALLERY ROWS ————— */
.p9-cw-gallery { display: flex; flex-direction: column; }

.p9-cw-entry {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2.2rem, 6vw, 4.5rem) 0;
  border-bottom: 1px solid var(--p9-border);
  align-items: center;
}
.p9-cw-entry:nth-child(even) .p9-cw-entry-media { order: 2; }
.p9-cw-entry:nth-child(even) .p9-cw-entry-info { order: 1; text-align: right; }
.p9-cw-entry:nth-child(even) .p9-cw-entry-desc { margin-left: auto; }

.p9-cw-entry-media { perspective: 1000px; position: relative; z-index: 1; }

.p9-cw-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--p9-radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--p9-bg-raised) 0%, var(--p9-bg-sunken) 100%);
  border: 1px solid var(--p9-border);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.5s ease;
  will-change: transform;
}
.p9-cw-entry:nth-child(3n+1) .p9-cw-tile { aspect-ratio: 16 / 10; }
.p9-cw-entry:first-child .p9-cw-tile { aspect-ratio: 21 / 9; }
.p9-cw-entry:hover .p9-cw-tile {
  border-color: var(--p9-red-hi);
  box-shadow: 0 30px 60px -20px var(--p9-red-glow), 0 0 0 1px var(--p9-red-lo), inset 0 0 60px -20px var(--p9-red-lo);
}

.p9-cw-tile-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transform: translate3d(calc(var(--ry, 0deg) * -0.6), calc(var(--rx, 0deg) * 0.6), 0) scale(1.02);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.p9-cw-tile-inner img { width: 100%; height: 100%; display: block; object-fit: cover; }
.p9-cw-mark {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--p9-border-hi);
  transition: color 0.4s ease;
  user-select: none;
}
.p9-cw-entry:hover .p9-cw-mark { color: var(--p9-red-hi); }

.p9-cw-entry-num {
  position: absolute;
  bottom: -0.15em; left: -0.05em;
  font-size: clamp(3.2rem, 9vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.8;
  color: var(--p9-text);
  mix-blend-mode: difference;
  z-index: 3;
  pointer-events: none;
  transform: translateZ(40px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s;
}
.p9-cw-entry:nth-child(even) .p9-cw-entry-num { left: auto; right: -0.05em; }
.p9-cw-entry:hover .p9-cw-entry-num { transform: translateZ(60px) translateY(-0.08em); color: var(--p9-red-hi); }

.p9-cw-entry-info { display: flex; flex-direction: column; gap: 1rem; z-index: 1; }
.p9-cw-entry-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--p9-font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.p9-cw-entry:nth-child(even) .p9-cw-entry-meta { align-items: flex-end; }
.p9-cw-meta-line { color: var(--p9-muted); }
.p9-cw-meta-line--attr { color: var(--p9-red-hi); }
.p9-cw-entry-featured {
  color: var(--p9-amber);
  align-self: flex-start;
}
.p9-cw-entry:nth-child(even) .p9-cw-entry-featured { align-self: flex-end; }

.p9-cw-entry-title {
  font-size: clamp(1.7rem, 3.6vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0;
  color: var(--p9-text);
  transition: color 0.3s;
  text-wrap: balance;
}
.p9-cw-entry:hover .p9-cw-entry-title { color: var(--p9-red-hi); }
.p9-cw-entry:first-child .p9-cw-entry-title { font-size: clamp(2.2rem, 5.2vw, 4.6rem); }

.p9-cw-entry-desc { color: var(--p9-muted); font-size: clamp(0.9rem, 1.1vw, 1.02rem); line-height: 1.65; max-width: 48ch; transition: color 0.3s; }
.p9-cw-entry:hover .p9-cw-entry-desc { color: #b5b5b0; }

/* ————— RESPONSIVE ————— */
@media (max-width: 900px) {
  .p9-cw-hero { grid-template-columns: 1fr; align-items: start; }
  .p9-cw-hero-aside { text-align: left; }
  .p9-cw-intro { grid-template-columns: 1fr; gap: 1.25rem; }
  .p9-cw-entry { grid-template-columns: 1fr; gap: 1.5rem; }
  .p9-cw-entry:nth-child(even) .p9-cw-entry-media { order: 0; }
  .p9-cw-entry:nth-child(even) .p9-cw-entry-info { order: 1; text-align: left; }
  .p9-cw-entry:nth-child(even) .p9-cw-entry-meta { align-items: flex-start; }
  .p9-cw-entry:nth-child(even) .p9-cw-entry-featured { align-self: flex-start; }
  .p9-cw-entry:nth-child(even) .p9-cw-entry-desc { margin-left: 0; }
  .p9-cw-entry-num { font-size: clamp(2.4rem, 11vw, 5.5rem); }
  .p9-cw-entry:first-child .p9-cw-tile { aspect-ratio: 16 / 10; }
}
@media (max-width: 600px) {
  .p9-cw-entry { padding: 1.75rem 0; }
  .p9-cw-tile { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .p9-cw-marquee-track { animation: none; }
  .p9-cw-tile, .p9-cw-tile-inner { transform: none !important; }
}

/* ---------- /designs/ showroom cards ---------- */
.p9-showcase-card-media { width: 100%; aspect-ratio: 16/10; border-radius: 8px; margin-bottom: 1rem; overflow: hidden; background: var(--p9-bg-raised); display: flex; align-items: center; justify-content: center; position: relative; }
.p9-showcase-card-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.p9-showcase-card-placeholder { font-size: 2rem; font-weight: 800; color: var(--p9-border-hi); }
.p9-showcase-card-tag { position: absolute; left: .65rem; bottom: .65rem; background: var(--p9-bg-panel); border: 1px solid var(--p9-border); border-radius: 999px; padding: .2rem .65rem; font-size: .72rem; color: var(--p9-muted); }
.p9-showcase-card-actions { margin-top: 1rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* ---------- Custom scrollbar (site-wide) ----------
   Matches the dark/red Plan9 theme instead of the browser's default
   scrollbar. Firefox uses the two-value `scrollbar-color` shorthand;
   WebKit-based browsers (Chrome, Edge, Safari) use the ::-webkit-*
   pseudo-elements -- both are included since neither browser family
   respects the other's syntax. Any element that scrolls on its own
   (e.g. the Yasmin widget's message panel, see yasmin.css) inherits
   this by default; override locally only where a different look is
   genuinely needed. */
html {
  scrollbar-color: var(--p9-border-hi) var(--p9-bg-sunken);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--p9-bg-sunken);
}

::-webkit-scrollbar-thumb {
  background-color: var(--p9-border-hi);
  border-radius: var(--p9-radius);
  border: 2px solid var(--p9-bg-sunken);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--p9-red);
}

::-webkit-scrollbar-corner {
  background: var(--p9-bg-sunken);
}

/* ── Related-articles blog cards (product pages / blog internal linking).
   Reuses the existing .p9-card + .p9-demo-preview visual language --
   image at a fixed aspect ratio, sunken-background fallback state. ────── */
.p9-blog-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.p9-blog-card img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  border-bottom: 1px solid var(--p9-border);
}
.p9-blog-card-image-empty {
  aspect-ratio: 16 / 9; background: var(--p9-bg-sunken); border-bottom: 1px solid var(--p9-border);
  display: flex; align-items: center; justify-content: center; padding: 1rem; text-align: center;
  font-family: var(--p9-font-mono); font-size: var(--p9-fs-label); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--p9-dim);
}
.p9-blog-card h3, .p9-blog-card p { padding-left: 1.5rem; padding-right: 1.5rem; }
.p9-blog-card h3 { margin-top: 1.25rem; }
.p9-blog-card p { padding-bottom: 1.5rem; }

/* ---- Security badges on Complete Branded packages (manually recorded) ---- */
.p9-sec { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--p9-border-hi); border-radius: 10px; background: var(--p9-bg-sunken); }
.p9-sec-head { display: flex; align-items: center; gap: .5rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--p9-muted); margin-bottom: .75rem; word-break: break-word; }
.p9-sec-shield { color: var(--p9-green); flex: none; }
.p9-sec-grid { display: grid; gap: .6rem; }
.p9-sec-item { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "grade text" "grade test"; column-gap: .9rem; row-gap: .1rem; align-items: center; padding: .7rem .85rem; border: 1px solid var(--p9-border); border-radius: 8px; background: var(--p9-bg-raised); text-decoration: none; color: var(--p9-text); transition: border-color .15s, background .15s; }
.p9-sec-item:hover, .p9-sec-item:focus-visible { border-color: var(--p9-green); background: var(--p9-green-lo); }
.p9-sec-grade { grid-area: grade; font-weight: 800; font-size: 1.6rem; line-height: 1; color: var(--p9-green); min-width: 3.1rem; text-align: center; padding: .4rem .3rem; border-radius: 8px; background: var(--p9-green-lo); }
.p9-sec-text { grid-area: text; display: flex; flex-direction: column; line-height: 1.25; }
.p9-sec-text strong { font-size: .92rem; }
.p9-sec-text small { font-size: .76rem; color: var(--p9-muted); }
.p9-sec-test { grid-area: test; font-size: .76rem; color: var(--p9-green); font-weight: 600; }
.p9-sec-foot { margin: .75rem 0 0; font-size: .76rem; line-height: 1.5; color: var(--p9-dim); }
.p9-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

