/* ============================================================================
   AmbientPixels Design System — Components
   Load order: ap-tokens.css → ap-base.css → ap-components.css
   Organized in the same order as the design system doc (§2.1 → §2.15).
   Source of truth: .claude/skills/ambientpixelsdesign/skill.md §2
   ============================================================================ */


/* ============================================================================
   §2.2  Header — Logomark + Nav
   ============================================================================ */

.ap-nav {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-10);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ap-logo {
  font-family: var(--font-display);
  font-weight: var(--fw-heavy);
  font-size: 20px;
  letter-spacing: var(--tracking-tight);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--color-text-primary);
  text-decoration: none;
}

/* Logomark — 3×3 "ambient pixel" grid.
   8 static surround dots + a breathing center pixel. Name made mark.
   Outer ring fades off toward the corners (.18) with brighter cardinals (.5),
   so the eye lands on the pulsing center. Re-uses ap-breathe (§2.9). */
.ap-logo .m {
  width: 20px;
  height: 20px;
  display: inline-block;
  position: relative;
  background:
    radial-gradient(circle at 2px 2px,   rgba(244,244,244,.18) 1.25px, transparent 1.75px),
    radial-gradient(circle at 10px 2px,  rgba(244,244,244,.5)  1.25px, transparent 1.75px),
    radial-gradient(circle at 18px 2px,  rgba(244,244,244,.18) 1.25px, transparent 1.75px),
    radial-gradient(circle at 2px 10px,  rgba(244,244,244,.5)  1.25px, transparent 1.75px),
    radial-gradient(circle at 18px 10px, rgba(244,244,244,.5)  1.25px, transparent 1.75px),
    radial-gradient(circle at 2px 18px,  rgba(244,244,244,.18) 1.25px, transparent 1.75px),
    radial-gradient(circle at 10px 18px, rgba(244,244,244,.5)  1.25px, transparent 1.75px),
    radial-gradient(circle at 18px 18px, rgba(244,244,244,.18) 1.25px, transparent 1.75px);
}
.ap-logo .m::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-primary);
  animation: ap-breathe var(--dur-pulse) var(--ease-inout) infinite;
}
.ap-logo .m::after,
.ap-logo .m i { display: none; }

.ap-nav-links {
  display: flex;
  gap: var(--sp-8);
  font-size: var(--fs-meta);
  font-weight: var(--fw-medium);
  opacity: .8;
}
.ap-nav-links a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: opacity var(--dur-fast);
}
.ap-nav-links a:hover { opacity: .5; }

.ap-nav-cta {
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  border: 1px solid var(--color-text-primary);
  font-size: var(--fs-meta);
  font-weight: var(--fw-medium);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: all var(--dur-fast);
}
.ap-nav-cta:hover {
  background: var(--color-text-primary);
  color: var(--color-bg);
}


/* ============================================================================
   §2.2.1  Mobile Nav — hamburger toggle + full-screen sheet
   Activates at ≤1000px (where the 6-link row + CTA start clipping).
   Markup is auto-injected by /js/ap-nav-mobile.js — no per-page HTML changes.
   Bars mirror the logomark stepped pattern (100% / 70% / 45%) to stay in
   the same visual language; they flatten to 100% when the sheet is open.
   ============================================================================ */

.ap-nav-toggle { display: none; }
.ap-nav-sheet  { display: none; }

@media (max-width: 1000px) {
  .ap-nav { padding: var(--sp-5) var(--mobile-pad); }

  .ap-nav-links,
  .ap-nav-cta { display: none; }

  .ap-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    width: 26px;
    height: 18px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .ap-nav-toggle__bar {
    display: block;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 1px;
    transition: width var(--dur-fast) var(--ease);
  }
  .ap-nav-toggle__bar:nth-child(1) { width: 100%; }
  .ap-nav-toggle__bar:nth-child(2) { width: 70%;  }
  .ap-nav-toggle__bar:nth-child(3) { width: 45%;  }
  .ap-nav-toggle[aria-expanded="true"] .ap-nav-toggle__bar { width: 100%; }

  .ap-nav-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--color-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease);
  }
  .ap-nav-sheet.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .ap-nav-sheet__inner {
    max-width: var(--max-page);
    height: 100%;
    margin: 0 auto;
    padding: var(--sp-5) var(--mobile-pad) var(--sp-8);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  .ap-nav-sheet__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 28px;
  }
  .ap-nav-sheet__close {
    background: none;
    border: 0;
    padding: var(--sp-2) 0 var(--sp-2) var(--sp-4);
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-weight: var(--fw-medium);
    font-size: var(--fs-meta);
    letter-spacing: var(--tracking-tight);
    cursor: pointer;
    opacity: .8;
    transition: opacity var(--dur-fast);
  }
  .ap-nav-sheet__close:hover { opacity: .5; }

  .ap-nav-sheet__links {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    margin-top: var(--sp-12);
    flex: 1;
  }
  .ap-nav-sheet__links a {
    font-family: var(--font-display);
    font-weight: var(--fw-heavy);
    font-size: clamp(40px, 10vw, 64px);
    line-height: 1;
    letter-spacing: var(--tracking-tight);
    color: var(--color-text-primary);
    text-decoration: none;
    opacity: .92;
    transition: opacity var(--dur-fast);
  }
  .ap-nav-sheet__links a em {
    font-style: italic;
    font-weight: var(--fw-regular);
    color: var(--color-text-body);
  }
  .ap-nav-sheet__links a:hover,
  .ap-nav-sheet__links a:focus-visible { opacity: .55; outline: none; }

  .ap-nav-sheet__cta {
    align-self: flex-start;
    margin-top: var(--sp-8);
  }
}

@media (max-width: 600px) {
  .ap-nav-sheet__links { gap: var(--sp-3); }
}

html.ap-nav-lock,
html.ap-nav-lock body { overflow: hidden; }


/* ============================================================================
   §2.3  Meta Strip (telemetry line with blinking cursor)
   ============================================================================ */

.ap-meta-strip {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  opacity: var(--mono-opacity-boost, 0.55);
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
}
.ap-meta-strip span::before { content: '— '; }

.ap-cursor {
  display: inline-block;
  width: 8px;
  height: 12px;
  background: var(--color-status-live-solid);
  margin-left: 6px;
  vertical-align: -1px;
  animation: ap-blink 1.1s steps(2) infinite;
}


/* ============================================================================
   §2.4  Section Label (§ NN — NAME)
   ============================================================================ */

.ap-sec-idx {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono);
  opacity: var(--mono-opacity-boost, 0.55);
  text-transform: uppercase;
}


/* ============================================================================
   §2.5  Display Headline (with italic punchline)
   ============================================================================ */

.ap-display {
  font-family: var(--font-display);
  font-weight: var(--fw-heavy);
  font-size: var(--fs-display-lg);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
  margin: 0;
  text-wrap: balance;
}
.ap-display em {
  font-style: italic;
  font-weight: var(--fw-regular);   /* italic is ALWAYS light; solid punchline */
  color: var(--color-text-body);
}

/* Variant: hero sub-title (applied to h1) — inherits ap-display rules */
.ap-display--hero { /* same base rules apply */ }

/* Variant: CTA h2 — see also .ap-cta h2 below */
.ap-display--cta {
  font-size: var(--fs-display-xl);
  line-height: var(--lh-display-tight);
  letter-spacing: var(--tracking-cta);
}

/* Variant: pillar h3 — flat 32px per Monolith home reference (DS doc says
   clamp 32-48px; home wins). Line-height + tracking also tighter than
   .ap-display defaults to match reference. */
.ap-display--pillar {
  font-size: 32px;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  margin: 0 0 18px;
}

/* Variant: product row h3 */
.ap-display--row {
  font-size: var(--fs-display-md);
}


/* ============================================================================
   §2.6  Right-Rail Meta Paragraph (monospace meta body)
   ============================================================================ */

.ap-sec-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono-sm);
  line-height: 1.7;
  text-transform: uppercase;
  opacity: var(--mono-opacity-boost, 0.55);
  max-width: 40ch;
  justify-self: end;
  text-align: right;
}


/* ============================================================================
   §2.7  Section Head (label + headline + meta)
   ============================================================================ */

.ap-sec {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sec-pad-y) var(--sec-pad-x);
}

.ap-sec-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--col-gap);
  align-items: end;
  margin-bottom: var(--sp-20);
}

/* Section-head h2 — smaller than .ap-display base. DS --fs-display-lg
   (clamp 56-120px) is tuned for the CTA family; Monolith home reference
   uses clamp(48px, 6.5vw, 104px) for section h2 specifically. Scoped
   to .ap-sec-head so the base .ap-display stays DS-compliant. */
.ap-sec-head h2 {
  font-size: clamp(48px, 6.5vw, 104px);
  max-width: 14ch;
  margin-top: 12px;
}

@media (max-width: 1000px) {
  .ap-sec-head { grid-template-columns: 1fr; }
}


/* ============================================================================
   §2.8  Discipline Grid (3 columns, ghosted numerals)
   ============================================================================ */

.ap-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--color-border);
}
.ap-pillars--4 { grid-template-columns: repeat(4, 1fr); }
.ap-pillars--5 { grid-template-columns: repeat(5, 1fr); }

.ap-pillar {
  padding: var(--sp-12) 36px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  transition: background var(--dur-med);
}
.ap-pillar:last-child { border-right: none; }

/* Tighter side padding when columns are narrower so content doesn't squeeze. */
.ap-pillars--4 .ap-pillar { padding: var(--sp-12) var(--sp-6); }
.ap-pillars--5 .ap-pillar { padding: var(--sp-10) var(--sp-5); }

.ap-pillar:hover          { background: var(--color-surface-soft); }
.ap-pillar:hover h3,
.ap-pillar:hover h3 em    { color: var(--color-hover-text); }

/* Pillar numeral — opacity .42 and 112px/.85 leading per Monolith home
   reference (DS §3.3 doc says .12-.20; home wins). Tick bar 56px × 3px
   (doc says 40px × 2px). */
.ap-pillar .num {
  font-family: var(--font-heavy);
  font-size: var(--fs-numeral-lg);
  line-height: .85;
  letter-spacing: var(--tracking-display);
  opacity: .42;
  margin: 0 0 var(--sp-8);
  position: relative;
  padding-top: var(--sp-5);
}
.ap-pillar .num::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 3px;
  background: var(--pr, var(--color-text-primary));
}
.ap-pillar:nth-child(1) { --pr: var(--pc-ambientos); }
.ap-pillar:nth-child(2) { --pr: var(--pc-nova); }
.ap-pillar:nth-child(3) { --pr: var(--pc-ambientscore); }
.ap-pillar:nth-child(4) { --pr: var(--pc-storyforge); }
.ap-pillar:nth-child(5) { --pr: var(--pc-blindspot); }

.ap-pillar p {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  opacity: .72;
  margin: 0 0 var(--sp-8);
  max-width: 40ch;
  text-wrap: pretty;
}

.ap-pillar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono-sm);
  text-transform: uppercase;
  opacity: var(--mono-opacity-boost, 0.8);
}
.ap-pillar ul li {
  padding: var(--sp-3) 0;
  border-top: 1px dashed var(--color-border-dashed);
}
.ap-pillar ul li:first-child { border-top: none; }
.ap-pillar ul li::before { content: '→ '; opacity: .45; }

@media (max-width: 1000px) {
  .ap-pillars,
  .ap-pillars--4,
  .ap-pillars--5 { grid-template-columns: 1fr; }
  .ap-pillar,
  .ap-pillars--4 .ap-pillar,
  .ap-pillars--5 .ap-pillar { border-right: none; padding: 40px 0; }
}


/* ============================================================================
   §2.9  Product / Work Row (the workhorse)
   ============================================================================ */

.ap-prods {
  border-top: 1px solid var(--color-border);
}

.ap-pd {
  display: grid;
  grid-template-columns: 140px 1.5fr 1fr 120px 60px;
  gap: var(--sp-10);
  align-items: center;
  padding: 56px 36px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  transition: background-color var(--dur-fast), color var(--dur-fast);
  text-decoration: none;
  cursor: pointer;
}
.ap-pd:hover,
.ap-pd:focus-visible {
  background: var(--color-hover-surface);
  outline: none;
}

.ap-pd .n {
  font-family: var(--font-heavy);
  font-size: var(--fs-numeral-md);
  line-height: .8;
  opacity: .22;
  letter-spacing: var(--tracking-display);
  color: var(--color-text-primary);
  transition: opacity var(--dur-med), color var(--dur-med);
}
.ap-pd:hover .n,
.ap-pd:focus-visible .n {
  opacity: .85;
  color: var(--color-hover-text);
}

.ap-pd h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-heavy);
  font-size: var(--fs-display-md);
  line-height: .9;
  /* -0.035em — between --tracking-display (-.04) and --tracking-tight (-.025);
     Monolith home reference uses this value verbatim, no matching token. */
  letter-spacing: -0.035em;
  margin: 0;
  transition: color var(--dur-med);
}
.ap-pd:hover h3,
.ap-pd:focus-visible h3 { color: var(--color-hover-text); }
.ap-pd h3 em {
  font-style: italic;
  font-weight: var(--fw-regular);
  opacity: .82;
}

.ap-pd .meta {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-sm);
  text-transform: uppercase;
  opacity: var(--mono-opacity-boost, 0.65);
}

.ap-pd p {
  margin: 6px 0 0;
  font-size: var(--fs-body-xs);
  line-height: var(--lh-body-tight);
  opacity: .7;
  max-width: var(--max-prose);
  text-wrap: pretty;
}

.ap-pd .year {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  opacity: .82;
  text-align: right;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: flex-end;
}
.ap-pd .year::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: var(--r-dot);
  background: var(--op, var(--color-status-live));
  opacity: .9;
  animation: ap-breathe var(--dur-breathe) var(--ease-inout) infinite;
  margin-right: 2px;
}
.ap-pd.op-live { --op: var(--color-status-live); }
.ap-pd.op-beta { --op: var(--color-status-beta); }
.ap-pd.op-archive { --op: var(--color-text-muted); }
.ap-pd.op-archive .year::before { animation: none; opacity: .7; }

.ap-pd .go {
  font-family: var(--font-display);
  font-weight: var(--fw-heavy);
  font-size: 28px;
  text-align: right;
  opacity: .4;
  transition: transform var(--dur-fast), opacity var(--dur-fast), color var(--dur-fast);
}
.ap-pd:hover .go,
.ap-pd:focus-visible .go {
  transform: translateX(8px);
  opacity: 1;
  color: var(--color-hover-text);
}
.ap-pd:hover .year::before,
.ap-pd:focus-visible .year::before {
  animation: ap-breathe-once var(--dur-slow) var(--ease) 1;
}

/* Shipped Work uses a smaller title (3 items sit heavier than 7) */
.ap-shipped .ap-pd h3 {
  font-size: var(--fs-display-sm);
  letter-spacing: var(--tracking-tight);
}

@media (max-width: 1000px) {
  .ap-pd {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas:
      "n h y"
      "n p p"
      ". go go";
    gap: 8px 16px;
    padding: 40px 0;
  }
  .ap-pd .n    { grid-area: n; font-size: 48px; align-self: start; }
  .ap-pd h3    { font-size: clamp(28px, 6vw, 44px); overflow-wrap: break-word; }
  .ap-pd p     { grid-area: p; max-width: none; overflow-wrap: break-word; }
  .ap-pd .year { grid-area: y; align-self: start; }
  .ap-pd .go   { grid-area: go; text-align: left; }
}

/* Static variant — use when a row is a feature/spec description, not
   navigation. Keeps the hover surface + text brightening so the row
   still feels alive on pointer-over, but drops the pointer cursor and
   the → arrow so visitors don't mistake it for a clickable link. */
.ap-pd--static { cursor: default; }
.ap-pd--static .go { display: none; }

/* Image variant — portfolio rows that carry visual context.
   Replaces the ghost numeral column with a grayscale thumbnail that
   warms up on hover. Same rule-separated rhythm, visual anchor added. */
.ap-pd--img {
  grid-template-columns: 220px 1.5fr 1fr 120px 60px;
}
.ap-pd--img .n { display: none; }
.ap-pd--img .thumb {
  width: 220px;
  height: 140px;
  overflow: hidden;
  background: var(--color-bg-elev);
  align-self: center;
}
.ap-pd--img .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(.92) brightness(.85);
  transition: filter var(--dur-med), transform var(--dur-med);
}
.ap-pd--img:hover .thumb img,
.ap-pd--img:focus-visible .thumb img {
  filter: grayscale(0) contrast(1) brightness(1);
  transform: scale(1.03);
}
@media (max-width: 1000px) {
  .ap-pd--img {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    grid-template-areas:
      "t h y"
      "t p p"
      ". go go";
  }
  .ap-pd--img .thumb { grid-area: t; width: 88px; height: 88px; align-self: start; }
}

/* ≤500px — the 3-col row can't hold a long italic suffix ("Production.",
   "Infrastructure.") next to a wide mono status ("• PUBLISHING") inside a
   375px viewport. Drop status to its own row so the title gets full flex. */
@media (max-width: 500px) {
  .ap-pd {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas:
      "n h"
      "n y"
      "n p"
      ". go";
  }
  .ap-pd--img {
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-areas:
      "t h"
      "t y"
      "t p"
      ". go";
  }
  .ap-pd .year { justify-self: start; text-align: left; }
}

/* Icon thumbnail variant — for portfolio rows where there's no
   photographic asset to use. Renders as a centered FontAwesome icon
   on a colored gradient. Same grayscale-at-rest, color-on-hover
   rhythm as the photographic .thumb. Pages using this MUST load
   FontAwesome separately (it's not a core DS dependency). */
.ap-pd--img .thumb.thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: grayscale(1) contrast(.92) brightness(.85);
  transition: filter var(--dur-med), transform var(--dur-med);
}
.ap-pd--img .thumb.thumb--icon i {
  font-size: 64px;
  color: #fff;
  filter: drop-shadow(0 0 12px rgba(255,255,255,.25));
  transition: color var(--dur-med), filter var(--dur-med);
}
.ap-pd--img:hover .thumb.thumb--icon,
.ap-pd--img:focus-visible .thumb.thumb--icon {
  filter: none;
  transform: scale(1.03);
}
/* Icon picks up the slot's accent color on hover, with a matching halo. */
.ap-pd--img:hover .thumb.thumb--icon i,
.ap-pd--img:focus-visible .thumb.thumb--icon i {
  color: var(--icon-hover, #fff);
  filter: drop-shadow(0 0 18px var(--icon-glow, rgba(255,255,255,.45)));
}
/* Gradient background slots + paired icon-hover accents.
   Selector scoped under .ap-pd--img .thumb to beat the base
   `.ap-pd--img .thumb { background: ... }` rule on specificity
   (no !important needed). --icon-hover and --icon-glow cascade up
   via the .thumb--bg-* class to the i element via inheritance. */
.ap-pd--img .thumb.thumb--bg-ai    { background: linear-gradient(135deg, #5b00a8, #3818a8); --icon-hover: #d6a8ff; --icon-glow: rgba(157, 92, 255, .55); }
.ap-pd--img .thumb.thumb--bg-video { background: linear-gradient(135deg, #5dc21e, #107c10); --icon-hover: #b6f37a; --icon-glow: rgba(93, 194, 30, .55); }
.ap-pd--img .thumb.thumb--bg-gc    { background: linear-gradient(135deg, #1a2980, #26d0ce); --icon-hover: #7eebec; --icon-glow: rgba(38, 208, 206, .55); }
.ap-pd--img .thumb.thumb--bg-xbox  { background: linear-gradient(135deg, #107c10, #0a5c0a); --icon-hover: #6fff6f; --icon-glow: rgba(16, 200, 16, .55); }
.ap-pd--img .thumb.thumb--bg-log   { background: linear-gradient(135deg, #2e2e2e, #141414); --icon-hover: #4ade80; --icon-glow: rgba(74, 222, 128, .45); }


/* ============================================================================
   §2.9b  Case-study / Product Media Strip (full-bleed, editorial)
   ============================================================================ */

/* Full-bleed landscape image strip for pages that need one rich visual
   anchor (product-landing pages, case-study hubs, architecture pages
   showing actual UI). Monochrome editorial treatment — grayscale at rest,
   photographic vignette gradient on bottom, optional mono label beneath.
   The image fills edge-to-edge within the 1440px container. */
.ap-case-media {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 0 var(--sp-12);
}
.ap-case-media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.ap-case-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(.85) contrast(.95) brightness(.72);
}
.ap-case-media-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12,12,12,0) 50%, rgba(12,12,12,.78) 100%);
  pointer-events: none;
}
/* Brand variant — for logo/wordmark imagery. Drops the photographic
   wash so the mark reads confident and bright. Still B&W at rest. */
.ap-case-media-frame--brand img {
  filter: grayscale(1) contrast(.95) brightness(.95);
  background: #0c0c0c;
}
.ap-case-media-frame--brand::after { content: none; }

/* UI-screenshot variant — for screens of real UIs (dashboards, editors,
   etc). Keeps the gradient vignette but lifts brightness a hair so the
   type inside the screenshot stays readable in grayscale. */
.ap-case-media-frame--ui img {
  filter: grayscale(.7) contrast(1.05) brightness(.88);
}

/* Scrolling screenshot variant — for tall portrait screenshots of
   dashboards. The frame stays fixed 16:7 but the image (rendered via
   background-image) pans from top to bottom over 36s, alternating
   back up, independent of page scroll. Gives a cinematic 'here is
   everything this screen holds' effect without a static crop.

   Usage:
     <div class="ap-case-media-frame ap-case-media-frame--scroll"
          style="--scroll-src: url('/images/AmbientOS/os-foo.jpeg')"></div>
   No <img> child needed — the background-image on the frame does the work. */
.ap-case-media-frame--scroll {
  background-image: var(--scroll-src);
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: 50% 0%;
  filter: grayscale(.7) contrast(1.05) brightness(.88);
  animation: ap-scroll-image 36s var(--ease-inout) infinite alternate;
}
.ap-case-media-frame--scroll > img { display: none; }
@keyframes ap-scroll-image {
  0%   { background-position: 50%   0%; }
  8%   { background-position: 50%   0%; }
  92%  { background-position: 50% 100%; }
  100% { background-position: 50% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-case-media-frame--scroll {
    animation: none;
    background-position: 50% 0%;
  }
}

.ap-case-media-label {
  margin-top: var(--sp-4);
  padding: 0 var(--sec-pad-x);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  opacity: .55;
}


/* ============================================================================
   §2.9a  Image gallery — .media-grid + .image-row
   ----------------------------------------------------------------------------
   One canonical pattern for project image galleries. .media-grid is the
   legacy class (project pages); .image-row is the case-study variant. Both
   render identically: 3+ column responsive grid, hairline-bordered tiles,
   4:3 cropped images with brightness+scale hover, always-visible mono
   caption strip below the image (NOT a hover-revealed overlay).
   ============================================================================ */

.media-grid,
.image-row {
  display: grid;
  /* auto-fit collapses empty column tracks so a 3-item row fills width;
     auto-fill would leave a 4th empty slot. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-6) 0;
  padding: 0;
}

.media-item,
.image-item {
  position: relative;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
  margin: 0;
  padding: 0;
}

.media-item a,
.image-item a {
  display: block;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.media-item img,
.image-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-med), filter var(--dur-med);
  border-radius: 0;
}

.media-item a:hover img,
.media-item:hover img,
.image-item a:hover img,
.image-item:hover img {
  filter: brightness(1.08);
  transform: scale(1.04);
}

.media-item .media-caption,
.image-item .image-caption,
.media-item .image-caption,
.image-item .media-caption {
  position: static;
  opacity: 1;
  transform: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  padding: var(--sp-3);
  margin: 0;
  text-align: left;
  text-shadow: none;
  font-weight: normal;
}


/* ============================================================================
   §2.9b  Screens gallery (scroll cinema) — one pinned stage on the left,
   three caption sentinels on the right. Stage stays sticky while caption
   cards scroll past, swapping the active screenshot via crossfade. Replaces
   multiple .ap-case-media strips on product-landing pages.
   ============================================================================ */

.ap-screens-rail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sec-pad-x);
  align-items: start;
}

.ap-screens-stage {
  position: sticky;
  top: 80px;
  height: calc(100vh - 160px);
  max-height: 720px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.ap-screens-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
  filter: grayscale(.55) contrast(1.05) brightness(.88);
}
.ap-screens-slide.is-active { opacity: 1; }

.ap-screens-counter {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-sm);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  pointer-events: none;
}

.ap-screens-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 33.333%;
  background: var(--color-text-primary);
  transition: width var(--dur-med) var(--ease);
}

.ap-screens-sentinels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-20);
}

.ap-screens-sentinel {
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.ap-screens-caption {
  max-width: 420px;
  padding: var(--sp-6);
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
}
.ap-screens-caption .ap-sec-idx { margin-bottom: var(--sp-3); }

.ap-screens-title {
  font-family: var(--font-display);
  font-weight: var(--fw-heavy);
  font-size: clamp(28px, 3vw, 44px);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
  color: var(--color-text-primary);
}
.ap-screens-title em {
  font-style: italic;
  font-weight: var(--fw-regular);
  color: var(--color-text-body);
}

.ap-screens-desc {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono-sm);
  line-height: var(--lh-body-loose);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin: 0;
}

@media (max-width: 900px) {
  .ap-screens-rail { grid-template-columns: 1fr; }
  .ap-screens-stage {
    top: 72px;
    height: 60vh;
    max-height: 520px;
  }
  .ap-screens-sentinel { min-height: 70vh; }
  .ap-screens-caption { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ap-screens-slide    { transition: opacity .01ms; }
  .ap-screens-progress { transition: width .01ms; }
  .ap-screens-counter,
  .ap-screens-caption {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}


/* ============================================================================
   §2.9c  Case-study masthead + column-pair narrative
   ----------------------------------------------------------------------------
   Editorial hero pattern for case-study pages. Replaces the old "stack three
   display headlines" anti-pattern with one composed unit:

     <section class="ap-case-mast">
       <div class="ap-sec-idx">§ WORK — SHIPPED · CLIENT</div>
       <div class="ap-case-mast-grid">
         <div class="ap-case-mast-prose"> h1 + lede </div>
         <div class="ap-case-mast-frame"> signature image </div>
       </div>
       <dl class="ap-case-mast-specs"> 6 spec cells </dl>
     </section>

   .ap-case-cols is a 2-column narrative pattern used under a single section
   header to lay two related stories side-by-side instead of stacking two
   §-level H2 banners. Each column carries a small mono col-idx + h3 instead
   of a full ap-display banner.
   ============================================================================ */

.ap-case-mast {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-15) var(--sec-pad-x) var(--sp-12);
}
.ap-case-mast > .ap-sec-idx { margin-bottom: var(--sp-5); }

.ap-case-mast-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--col-gap);
  align-items: end;
  margin-bottom: var(--sp-10);
}

.ap-case-mast-prose { display: flex; flex-direction: column; gap: var(--sp-6); }
.ap-case-mast-prose h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-heavy);
  font-size: clamp(56px, 9vw, 120px);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
  margin: 0;
}
.ap-case-mast-prose h1 em {
  font-style: italic;
  font-weight: var(--fw-regular);
  color: var(--color-text-body);
}
.ap-case-mast-prose .lede {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text-secondary);
  max-width: 44ch;
  margin: 0;
}

.ap-case-mast-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-surface);
}
.ap-case-mast-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ap-case-mast-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}
.ap-case-mast-specs > div {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border-right: 1px solid var(--color-border-soft);
}
.ap-case-mast-specs > div:nth-child(3n) { border-right: none; }
.ap-case-mast-specs > div:nth-child(n+4) { border-top: 1px solid var(--color-border-soft); }
.ap-case-mast-specs dt {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin: 0;
}
.ap-case-mast-specs dd {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-body);
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

@media (max-width: 1000px) {
  .ap-case-mast-grid { grid-template-columns: 1fr; align-items: start; }
  .ap-case-mast-specs { grid-template-columns: 1fr; }
  .ap-case-mast-specs > div {
    border-right: none;
    border-top: 1px solid var(--color-border-soft);
  }
  .ap-case-mast-specs > div:first-child { border-top: none; }
}

/* Column-pair narrative — two stories side-by-side under one section
   header instead of stacking two §-level display banners. */
.ap-case-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--col-gap) calc(var(--col-gap) * 1.5);
}
.ap-case-cols > div { display: flex; flex-direction: column; gap: var(--sp-4); }
.ap-case-cols h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-heavy);
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
  margin: 0;
  color: var(--color-text-primary);
}
.ap-case-cols h3 em {
  font-style: italic;
  font-weight: var(--fw-regular);
  color: var(--color-text-body);
}
.ap-case-cols .col-idx {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.ap-case-cols p {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  color: var(--color-text-secondary);
  max-width: var(--max-prose);
  margin: 0;
}
@media (max-width: 1000px) {
  .ap-case-cols { grid-template-columns: 1fr; gap: var(--sp-12); }
}


/* ============================================================================
   §2.10  Status Indicator (dot + label)
   ============================================================================ */

.ap-status {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.ap-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: var(--r-dot);
  background: var(--color-status-live);
  animation: ap-breathe var(--dur-breathe) var(--ease-inout) infinite;
}
.ap-status--beta::before    { background: var(--color-status-beta); }
.ap-status--archive::before { background: var(--color-text-muted); animation: none; }


/* ============================================================================
   §2.11  Primary Button (white pill) + Ghost Button
   ============================================================================ */

.ap-btn {
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-meta);
  transition: all var(--dur-fast);
  display: inline-flex;
  gap: var(--sp-2);
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.ap-btn--primary {
  background: var(--color-text-primary);
  color: var(--color-bg);
}
.ap-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255,255,255,.2);
}

.ap-btn--ghost {
  background: none;
  padding: var(--sp-4) var(--sp-2);
  position: relative;
  color: var(--color-text-primary);
}
.ap-btn--ghost::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.ap-btn--ghost:hover::after { opacity: .6; }


/* ============================================================================
   §2.12  Secondary Link (underline-on-hover text)
   ============================================================================ */

.ap-link-mono {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-xs);
  opacity: .45;
  transition: opacity var(--dur-fast);
  text-decoration: none;
  color: inherit;
}
.ap-link-mono:hover {
  opacity: .85;
  text-decoration: underline;
}


/* ============================================================================
   §2.13  Marquee Strip
   ============================================================================ */

.ap-marquee {
  overflow: hidden;
  padding: 28px 0;
  border-top: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
  white-space: nowrap;
  font-family: var(--font-heavy);
  font-size: var(--fs-marquee);
  font-style: italic;
  opacity: .7;
}
.ap-marquee-track {
  display: inline-flex;
  gap: 48px;
  align-items: center;
  animation: ap-roll var(--dur-roll) linear infinite;
  padding-left: 48px;
}
.ap-marquee:hover .ap-marquee-track { animation-play-state: paused; }
.ap-marquee span { opacity: .9; }
.ap-marquee .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--r-dot);
  background: var(--color-text-primary);
  margin: 0 8px;
  transform: translateY(-4px);
  opacity: .7;
}


/* ============================================================================
   §2.14  Footer
   ============================================================================ */

.ap-foot-wrap { /* optional wrapper — style hooks live on children */ }

.ap-foot {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-15) var(--sp-10) 30px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--sp-15);
  font-size: var(--fs-meta);
  line-height: 1.45;
}

.ap-foot h5 {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xxs);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  opacity: .55;
  margin: 0 0 14px;
  font-weight: var(--fw-medium);
  line-height: 1.45;
}

.ap-foot ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  opacity: .82;
}
.ap-foot ul li {
  margin: 0;
  padding: 0;
  line-height: 1.45;
}
.ap-foot ul a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: opacity var(--dur-fast);
  line-height: 1.45;
}
.ap-foot ul a:hover { opacity: .55; }

.ap-foot-about {
  font-size: var(--fs-body-xs);
  line-height: var(--lh-body-loose);
  opacity: .72;
  max-width: var(--max-about);
  margin: var(--sp-3) 0 0;
}
.ap-foot-about em {
  font-style: italic;
  font-weight: var(--fw-regular);
  color: var(--color-text-body);
}

.ap-legal {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-10);
  border-top: 1px solid var(--color-border-soft);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-xs);
  text-transform: uppercase;
  opacity: .55;
}
.ap-legal-right {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.ap-legal-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--r-dot);
  background: var(--color-status-live-solid);
  animation: ap-breathe var(--dur-pulse) var(--ease-inout) infinite;
}

.ap-colophon {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 var(--sp-10) var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  opacity: .4;
  letter-spacing: var(--tracking-mono-xxs);
  text-align: center;
}

@media (max-width: 1000px) {
  .ap-foot  { grid-template-columns: 1fr 1fr; }
  .ap-legal { flex-direction: column; gap: 12px; text-align: left; }
}
@media (max-width: 600px) {
  .ap-foot  { grid-template-columns: 1fr; padding: 40px 20px; }
}


/* ============================================================================
   §2.15  CTA Block (closing)
   ============================================================================ */

.ap-cta {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-40) var(--sec-pad-x);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}
.ap-cta h2 {
  font-family: var(--font-heavy);
  font-size: var(--fs-display-xl);
  line-height: var(--lh-display-tight);
  letter-spacing: var(--tracking-cta);
  margin: 0 0 var(--sp-12);
  text-wrap: balance;
}
.ap-cta h2 em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--fw-regular);
  color: var(--color-text-body);
}
.ap-cta p {
  font-size: var(--fs-body-lg);
  opacity: .75;
  max-width: var(--max-prose);
  margin: 0 auto var(--sp-10);
  text-wrap: pretty;
}
.ap-cta-actions {
  display: inline-flex;
  gap: var(--sp-4);
  align-items: center;
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
  justify-content: center;
}


/* ============================================================================
   §2.15.1  Narrow-viewport gutter + type corrections
   Design spec §3.9 mandates 20px horizontal gutter at mobile, but the
   core section blocks (.ap-sec, .ap-cta, .ap-legal, .ap-colophon) were
   hard-coded to --sec-pad-x (40px) at every size — which pushed content
   past narrow viewports and created a horizontal scrollbar. Also the
   CTA headline's min clamp (--fs-display-xl, 72px) renders "something"
   wider than a 320px content area; scaled down here so the longest word
   in the line fits. overflow-x: clip is a belt-and-suspenders defense
   against any remaining overflow source from subpages.
   ============================================================================ */

@media (max-width: 600px) {
  .ap-sec,
  .ap-cta {
    padding-left: var(--mobile-pad);
    padding-right: var(--mobile-pad);
  }
  .ap-legal {
    padding-left: var(--mobile-pad);
    padding-right: var(--mobile-pad);
  }
  .ap-colophon {
    padding-left: var(--mobile-pad);
    padding-right: var(--mobile-pad);
  }
  .ap-cta h2 {
    font-size: clamp(48px, 13vw, 96px);
  }
}

html,
body {
  overflow-x: clip;
}


/* ============================================================
   §2.16  Modal + Form (DS extension — not originally specced in §2)

   The modal wraps a form; the form inputs follow the bottom-border-
   only treatment from §5 Deviation Policy ("the one 'input'
   component the system implicitly allows"). Scoped under .ap-modal
   so legacy modals without that class keep their old styling.

   Behavioral class names (.modal, .modal-overlay, .modal-close,
   .hidden, .active, .form-group, .form-status) are preserved for
   JavaScript compatibility — JS hooks must still find them.
   ============================================================ */

.ap-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  opacity: 0;
  transition: opacity var(--dur-med);
}
.ap-modal.hidden { display: none; }
.ap-modal.active { opacity: 1; }

.ap-modal .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, .82);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.ap-modal .modal-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 8vh auto 6vh;
  padding: var(--sp-15) var(--sp-12);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.ap-modal .modal-close {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-6);
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
  transition: color var(--dur-fast);
}
.ap-modal .modal-close:hover { color: var(--color-text-primary); }

.ap-modal h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-heavy);
  font-size: clamp(32px, 3vw, 48px);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--sp-3);
}
.ap-modal h2 em {
  font-style: italic;
  font-weight: var(--fw-regular);
  color: var(--color-text-body);
}

.ap-modal-sub {
  font-size: var(--fs-body-xs);
  line-height: var(--lh-body-loose);
  color: var(--color-text-secondary);
  margin: 0 0 var(--sp-10);
  max-width: 50ch;
}

/* Form (bottom-border-only per DS §5) */
.ap-modal .form-group {
  margin-bottom: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.ap-modal .form-group label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono-md);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.ap-modal input[type="text"],
.ap-modal input[type="email"],
.ap-modal select,
.ap-modal textarea {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding: var(--sp-3) 0;
  outline: none;
  transition: border-color var(--dur-fast);
  width: 100%;
}
.ap-modal input:focus,
.ap-modal select:focus,
.ap-modal textarea:focus {
  border-bottom-color: var(--color-text-primary);
}
.ap-modal textarea {
  resize: vertical;
  min-height: 120px;
  line-height: var(--lh-body);
}
.ap-modal select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  /* Minimal mono-styled chevron using two linear-gradients */
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(244,244,244,.55) 50%),
    linear-gradient(135deg, rgba(244,244,244,.55) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 8px) center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.ap-modal select option {
  background: var(--color-bg);
  color: var(--color-text-primary);
}

/* Consent row — mono tag, inline checkbox */
.ap-form-consent {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-xs);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin: var(--sp-8) 0 var(--sp-8);
  cursor: pointer;
}
.ap-form-consent input[type="checkbox"] {
  accent-color: var(--color-text-primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}
.ap-form-consent a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ap-form-consent a:hover { color: var(--color-text-primary); }

.ap-form-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
}
.ap-form-helper {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-xs);
  letter-spacing: var(--tracking-mono-xs);
  color: var(--color-text-tertiary);
  margin: 0;
}

.ap-modal .form-status {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono-sm);
  text-transform: uppercase;
  margin-top: var(--sp-6);
  padding: var(--sp-3) 0;
  color: var(--color-text-secondary);
  min-height: 1.5em;
}
.ap-modal .form-status:empty { display: none; }

/* Modal responsive */
@media (max-width: 600px) {
  .ap-modal .modal-content {
    margin: 4vh var(--mobile-pad);
    padding: var(--sp-10) var(--sp-6);
  }
  .ap-modal h2 { font-size: 28px; }
}

/* Lock body scroll when modal is open */
body.modal-open { overflow: hidden; }
