/* CAS v2 minimal utility CSS (no Tailwind build required). */
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; height: auto; }

/* Display helpers */
.block { display: block; } .inline-block { display: inline-block; }
.inline { display: inline; } .hidden { display: none; }
.flex { display: flex; } .inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flex */
.flex-col { flex-direction: column; } .flex-row { flex-direction: row; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-center { justify-content: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; } .gap-5 { gap: 1.25rem; } .gap-6 { gap: 1.5rem; }
.gap-7 { gap: 1.75rem; } .gap-8 { gap: 2rem; } .gap-10 { gap: 2.5rem; } .gap-16 { gap: 4rem; }
.flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; }

/* Grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }

/* Sizing */
.w-full { width: 100%; } .h-full { height: 100%; }
.min-h-screen { min-height: 100vh; } .min-h-\[60vh\] { min-height: 60vh; }
.min-h-\[44px\] { min-height: 44px; } .min-w-\[44px\] { min-width: 44px; }
.h-6 { height: 1.5rem; } .w-6 { width: 1.5rem; }
.h-8 { height: 2rem; } .w-8 { width: 2rem; }
.h-10 { height: 2.5rem; } .w-10 { width: 2.5rem; }
.h-12 { height: 3rem; } .w-12 { width: 3rem; }
.h-16 { height: 4rem; } .h-20 { height: 5rem; }
.max-w-md { max-width: 28rem; } .max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; } .max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; } .max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; } .mx-auto { margin-left: auto; margin-right: auto; }
.aspect-\[16\/9\] { aspect-ratio: 16/9; } .object-cover { object-fit: cover; }
.overflow-hidden { overflow: hidden; } .overflow-x-auto { overflow-x: auto; }

/* Padding/margin */
.p-0 { padding: 0; } .p-2 { padding: 0.5rem; } .p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; } .p-12 { padding: 3rem; } .p-20 { padding: 5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.pt-2 { padding-top: 0.5rem; } .pt-6 { padding-top: 1.5rem; }
.pt-10 { padding-top: 2.5rem; }
.pb-4 { padding-bottom: 1rem; } .pb-12 { padding-bottom: 3rem; } .pb-20 { padding-bottom: 5rem; }
.pr-4 { padding-right: 1rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; } .mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; } .mb-12 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; } .mt-16 { margin-top: 4rem; } .mt-24 { margin-top: 6rem; }
.mt-auto { margin-top: auto; }
.ml-2 { margin-left: 0.5rem; } .mr-3 { margin-right: 0.75rem; }
.space-y-2 > * + * { margin-top: 0.5rem; } .space-y-4 > * + * { margin-top: 1rem; } .space-y-6 > * + * { margin-top: 1.5rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.5; }
.text-base { font-size: 1rem; line-height: 1.6; }
.text-lg { font-size: 1.125rem; line-height: 1.6; }
.text-xl { font-size: 1.25rem; line-height: 1.5; }
.text-2xl { font-size: 1.5rem; line-height: 1.3; }
.text-3xl { font-size: 1.875rem; line-height: 1.2; }
.text-4xl { font-size: 2.25rem; line-height: 1.15; }
.text-5xl { font-size: 3rem; line-height: 1.1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.font-bold { font-weight: 700; } .font-semibold { font-weight: 600; } .font-medium { font-weight: 500; }
.tracking-tight { letter-spacing: -0.01em; } .tracking-widest { letter-spacing: 0.1em; }
.uppercase { text-transform: uppercase; } .leading-tight { line-height: 1.15; } .leading-relaxed { line-height: 1.65; }
.text-center { text-align: center; } .text-left { text-align: left; } .text-right { text-align: right; }
.whitespace-nowrap { white-space: nowrap; }

/* Borders */
.border { border: 1px solid; } .border-0 { border: 0; }
.border-t { border-top: 1px solid; } .border-b { border-bottom: 1px solid; }
.rounded { border-radius: 0.375rem; } .rounded-md { border-radius: 0.5rem; }
.rounded-lg { border-radius: 0.625rem; } .rounded-xl { border-radius: 0.875rem; } .rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Color utilities used inline in widgets are primarily CSS vars; these hex
   utilities cover only flash + error/success states. */
.bg-white { background-color: #ffffff; }
.bg-transparent { background-color: transparent; }
.bg-green-50 { background-color: #f0fdf4; }
.text-green-800 { color: #166534; }
.border-green-200 { border-color: #bbf7d0; }
.bg-red-50 { background-color: #fef2f2; }
.text-red-800 { color: #991b1b; }
.border-red-200 { border-color: #fecaca; }
.text-white { color: #ffffff; }

/* Buttons: reset browser defaults so inline-styled buttons look like the
   widget intended (transparent nav buttons, maroon CTAs, etc). */
button { font: inherit; color: inherit; }
button.bg-transparent { background: transparent; border: 0; }

/* ═════════════════════════════════════════════════════════════════════
   CAS design-system utilities (ported from web/src/styles/input.css +
   round-14 taste-skill upgrades: spring ease, tinted shadows, haptic
   press, staggered reveal, bezel architecture, ambient depth).
   See docs/internals/TASTE_SKILL_PORT_REPORT.md for the full rationale.
   ═════════════════════════════════════════════════════════════════════ */

/* Foundation motion + shadow tokens. Ban `ease`, `ease-in-out`, `linear`
   across the entire output — standardize on the spring curve so every
   hover/active/reveal feels tactile. Tinted shadows via color-mix carry
   the palette's hue so nothing bottoms out at rgba(0,0,0,X) "AI-default"
   flat black. */
:root {
  --cas-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --cas-ease-fluid: cubic-bezier(0.32, 0.72, 0, 1);
  --cas-dur-fast: 200ms;
  --cas-dur-med: 500ms;
  --cas-dur-slow: 800ms;
  --cas-shadow-whisper: 0 2px 8px color-mix(in oklab, var(--color-foreground) 5%, transparent);
  --cas-shadow-diffuse: 0 20px 40px -15px color-mix(in oklab, var(--color-primary) 14%, transparent);
  --cas-shadow-inner-highlight: inset 0 1px 0 color-mix(in oklab, white 14%, transparent);
}

/* Smooth anchor-scroll + text-wrap hygiene across every generated page.
   `text-wrap: balance` prevents orphan words on headlines; `pretty`
   improves paragraph ragged-right. Zero-cost wins. */
html { scroll-behavior: smooth; }
h1, h2, h3, .cas-hero-h1 { text-wrap: balance; }
p, .cas-body { text-wrap: pretty; }

/* Global focus-visible ring. Required for WCAG keyboard nav and
   replaces the browser-default dotted rectangle with the palette's
   primary color. Round radius inherits from the focused element. */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: inherit;
}

/* Tabular numerics. Apply to price columns, stat blocks, pricing-table
   tiers — any place aligned numbers matter. Prevents the ragged-digit
   look that proportional fonts produce. */
.cas-nums,
.price,
.money,
[data-nums="tabular"] { font-variant-numeric: tabular-nums; }

/* Plain-text uppercase eyebrow — NO pill background, NO border. Used
   above every H2 on public pages + as field labels in admin detail. */
.cas-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-foreground-muted);
  margin-bottom: 0.5rem;
}

/* Editorial divided-row: the workhorse pattern for "feature list"
   sections on the CAS site. Replaces 3-col icon-orb grids. Apply to
   a container of direct children <div>s. Last-child gets no divider. */
.cas-divided-rows > * {
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
}
.cas-divided-rows > *:first-child { border-top: 0; }

/* Hero H1 editorial scale — tighter line-height + negative letter-
   spacing so the heading feels like type, not text. */
.cas-hero-h1 {
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}

/* Primary button with hover-lift + soft primary shadow + haptic active
   press + focus ring. Round-14 upgrade: standardized on the spring ease,
   explicit :active transform so every click feels like a physical press,
   tinted shadow on hover via color-mix. */
.cas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--cas-dur-med) var(--cas-ease),
              box-shadow var(--cas-dur-med) var(--cas-ease),
              background-color var(--cas-dur-fast) var(--cas-ease);
  min-height: 44px;
  border: 1px solid transparent;
  box-shadow: var(--cas-shadow-whisper);
}
.cas-btn:active { transform: translateY(1px) scale(0.98); }
.cas-btn-primary {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}
.cas-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--cas-shadow-diffuse);
}
.cas-btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: none;
}
.cas-btn-secondary:hover {
  background-color: var(--color-secondary);
  transform: translateY(-1px);
  box-shadow: var(--cas-shadow-diffuse);
}

/* Nested trailing icon wrapper — the "button-in-button" pattern from the
   taste-skill extraction. Wrap an SVG inside .cas-btn-icon so the arrow
   lives in its own circular cell with a subtle translucent bg; on hover,
   the icon translates diagonally while the button itself lifts. */
.cas-btn-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: color-mix(in oklab, currentColor 12%, transparent);
  transition: transform var(--cas-dur-med) var(--cas-ease);
}
.cas-btn:hover .cas-btn-icon { transform: translate(2px, -1px); }

/* Card with hover-lift — the CAS .gallery-card / .card-feature pattern.
   Round-14 upgrade: whisper-shadow at rest, diffused primary-tinted on
   hover, spring ease on both transitions. Cards now lift against the
   palette, not against flat black. */
.cas-card-lift {
  box-shadow: var(--cas-shadow-whisper);
  transition: transform var(--cas-dur-med) var(--cas-ease),
              box-shadow var(--cas-dur-med) var(--cas-ease),
              border-color var(--cas-dur-med) var(--cas-ease);
}
.cas-card-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--cas-shadow-diffuse);
  border-color: color-mix(in oklab, var(--color-primary) 25%, var(--color-border));
}

/* Scroll-reveal animation. IntersectionObserver (shipped as reveal.js)
   toggles .revealed. Round-14: optional staggered cascade via --index —
   set style="--index: <i>" on each loop-emitted item to get an 80ms
   waterfall instead of simultaneous mount. */
.cas-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms var(--cas-ease), transform 600ms var(--cas-ease);
  transition-delay: calc(var(--index, 0) * 80ms);
}
.cas-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .cas-reveal { opacity: 1 !important; transform: none !important; }
}

/* Hairline section divider — the CAS pattern. 1px, border-color at
   low opacity. NEVER a gradient, NEVER a shadow. */
.cas-divider {
  height: 1px;
  background-color: var(--color-border);
  border: 0;
}

/* Italic serif accent — for one word inside a heading (the CAS
   emotional-emphasis pattern). Use via {word} syntax in the widget. */
.cas-accent {
  font-style: italic;
  color: var(--color-primary);
  font-weight: inherit;
}

/* Double-bezel (Doppelrand) — the taste-skill "machined hardware" card.
   Outer tray has tiny padding + hairline border + large radius; inner
   plate has a mathematically smaller radius via calc() + inner highlight.
   Use for hero images, featured cards, testimonial photos (NOT every
   card — selective for emphasis). */
.cas-bezel {
  padding: 0.375rem;
  border-radius: 2rem;
  background: color-mix(in oklab, var(--color-foreground) 4%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-foreground) 6%, transparent);
}
.cas-bezel-inner {
  border-radius: calc(2rem - 0.375rem);
  background: var(--color-background);
  box-shadow: var(--cas-shadow-inner-highlight);
  overflow: hidden;
}
.cas-bezel-sm { padding: 0.25rem; border-radius: 1.25rem; }
.cas-bezel-sm .cas-bezel-inner { border-radius: calc(1.25rem - 0.25rem); }

/* Editorial image treatment — desaturate + warm palette-tint so stock
   and customer-uploaded photos blend into the archetype instead of
   fighting it. Apply to <img> or image wrapper. */
.cas-img-editorial {
  filter: saturate(0.88) contrast(1.05) brightness(0.98);
}

/* Ambient depth layer — subtle radial gradient on empty-ish sections so
   they don't read as flat. Fixed, pointer-events-none, sits behind
   content. Opt-in via class on the section. */
.cas-section-ambient { position: relative; isolation: isolate; }
.cas-section-ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top right, color-mix(in oklab, var(--color-primary) 5%, transparent), transparent 60%),
    radial-gradient(ellipse at bottom left, color-mix(in oklab, var(--color-primary) 3%, transparent), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Section + container vertical rhythm. Use .cas-section on every
   widget root and .cas-container inside for consistent breathing
   room across the whole site. clamp() scales without media-query
   noise. */
.cas-section { padding-block: clamp(4rem, 10vw, 10rem); }
.cas-section-sm { padding-block: clamp(2.5rem, 6vw, 5rem); }
.cas-container {
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 768px)  { .cas-container { padding-inline: 2rem; } }
@media (min-width: 1280px) { .cas-container { padding-inline: 4rem; } }


/* Glass-style sticky nav: translucent primary with backdrop-blur on
   browsers that support it; solid fallback elsewhere. Impeccable 2d.4. */
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .cas-nav {
    background-color: color-mix(in srgb, var(--color-primary) 88%, transparent) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}

/* Sortable table headers — the permanent ⇅ arrow brightens on hover
   so users can see each column is clickable even before sorting. */
.cas-sortable-th .cas-sort-link:hover { opacity: 1 !important; color: var(--color-primary) !important; }
.cas-sortable-th .cas-sort-link:hover .cas-sort-arrow { opacity: 1 !important; }
.cas-sortable-th { cursor: pointer; user-select: none; }

/* Form validation — client-side HTML5 feedback.
   :user-invalid fires only AFTER the user has interacted (not on page
   load), so empty required fields don't start red. Fallback to :invalid
   on older Safari. */
.cas-form input:user-invalid,
.cas-form select:user-invalid,
.cas-form textarea:user-invalid {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.1);
}
.cas-form input:focus,
.cas-form select:focus,
.cas-form textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary) !important;
}
.cas-form input:user-invalid:focus,
.cas-form select:user-invalid:focus,
.cas-form textarea:user-invalid:focus {
  outline-color: var(--color-error);
  border-color: var(--color-error) !important;
}

/* Position / layering */
.relative { position: relative; } .absolute { position: absolute; }
.static { position: static; } .sticky { position: sticky; top: 0; }
.top-0 { top: 0; } .top-2 { top: 0.5rem; } .left-0 { left: 0; } .left-2 { left: 0.5rem; }
.z-50 { z-index: 50; } .shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }

/* Interactivity */
.cursor-pointer { cursor: pointer; }
.transition-all { transition: all 0.2s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-opacity { transition: opacity 0.2s ease; }
.hover\:opacity-70:hover { opacity: 0.7; } .hover\:opacity-80:hover { opacity: 0.8; } .hover\:opacity-90:hover { opacity: 0.9; }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.focus\:not-sr-only:focus { clip: auto; height: auto; width: auto; overflow: visible; margin: 0; white-space: normal; position: static; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.order-1 { order: 1; } .order-2 { order: 2; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.opacity-75 { opacity: 0.75; }

/* Responsive — collapse min-width: 768px breakpoint utilities */
@media (min-width: 768px) {
  .md\:hidden { display: none; }
  .md\:flex { display: flex; }
  .md\:grid { display: grid; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:col-span-3 { grid-column: span 3 / span 3; }
  .md\:flex-row { flex-direction: row; }
  .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
  .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
  .md\:pt-10 { padding-top: 2.5rem; }
  .md\:pb-20 { padding-bottom: 5rem; }
  .md\:mt-24 { margin-top: 6rem; }
  .md\:gap-3 { gap: 0.75rem; }
  .md\:gap-4 { gap: 1rem; }
  .md\:gap-5 { gap: 1.25rem; }
  .md\:gap-6 { gap: 1.5rem; }
  .md\:gap-8 { gap: 2rem; }
  .md\:gap-16 { gap: 4rem; }
  .md\:order-1 { order: 1; } .md\:order-2 { order: 2; }
  .md\:text-2xl { font-size: 1.5rem; }
  .md\:text-3xl { font-size: 1.875rem; }
  .md\:text-4xl { font-size: 2.25rem; }
  .md\:text-5xl { font-size: 3rem; }
  .md\:text-lg { font-size: 1.125rem; }
}
@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:top-2 { top: 0.5rem; } .sm\:left-2 { left: 0.5rem; }
  .sm\:text-xl { font-size: 1.25rem; }
  .sm\:text-lg { font-size: 1.125rem; }
}
@media (min-width: 1024px) {
  .lg\:text-5xl { font-size: 3rem; }
  .lg\:text-6xl { font-size: 3.75rem; }
  .lg\:hidden { display: none; }
  .lg\:flex { display: flex; }
  .lg\:grid { display: grid; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .lg\:gap-5 { gap: 1.25rem; }
  .lg\:gap-6 { gap: 1.5rem; }
}
@media (min-width: 1280px) {
  .xl\:gap-6 { gap: 1.5rem; }
  .xl\:gap-8 { gap: 2rem; }
}
