/* =========================================================================
   CAL-COMP USA (SAN DIEGO) — CLEAN TIER-1 DESIGN SYSTEM
   Modern, editorial, human-crafted corporate & industrial aesthetics
========================================================================= */

:root {
--pcb-pattern-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%232c58b0' stroke-opacity='.055' stroke-width='1'%3E%3Cpath d='M0 42h54l14 14h48l16-16h50l18 18h40M26 0v52l18 18v52l-16 16v64l18 18v20M92 0v30l18 18v50l18 18v44l-20 20v60M152 0v58l18 18v42l-18 18v48l22 22v34M240 94h-42l-16 16h-48l-18 18H62l-18-18H0M240 176h-54l-16-16h-42l-18 18H56l-16-16H0'/%3E%3C/g%3E%3Cg fill='%232c58b0' fill-opacity='.075'%3E%3Ccircle cx='26' cy='52' r='3'/%3E%3Ccircle cx='68' cy='56' r='3'/%3E%3Ccircle cx='110' cy='48' r='3'/%3E%3Ccircle cx='170' cy='76' r='3'/%3E%3Ccircle cx='198' cy='94' r='3'/%3E%3Ccircle cx='44' cy='110' r='3'/%3E%3Ccircle cx='92' cy='98' r='3'/%3E%3Ccircle cx='128' cy='116' r='3'/%3E%3Ccircle cx='182' cy='110' r='3'/%3E%3Ccircle cx='40' cy='162' r='3'/%3E%3Ccircle cx='108' cy='180' r='3'/%3E%3Ccircle cx='152' cy='184' r='3'/%3E%3Ccircle cx='186' cy='176' r='3'/%3E%3Ccircle cx='46' cy='220' r='3'/%3E%3Ccircle cx='174' cy='206' r='3'/%3E%3C/g%3E%3C/svg%3E");
--pcb-pattern-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%238ad8ff' stroke-opacity='.075' stroke-width='1'%3E%3Cpath d='M0 42h54l14 14h48l16-16h50l18 18h40M26 0v52l18 18v52l-16 16v64l18 18v20M92 0v30l18 18v50l18 18v44l-20 20v60M152 0v58l18 18v42l-18 18v48l22 22v34M240 94h-42l-16 16h-48l-18 18H62l-18-18H0M240 176h-54l-16-16h-42l-18 18H56l-16-16H0'/%3E%3C/g%3E%3Cg fill='%238ad8ff' fill-opacity='.11'%3E%3Ccircle cx='26' cy='52' r='3'/%3E%3Ccircle cx='68' cy='56' r='3'/%3E%3Ccircle cx='110' cy='48' r='3'/%3E%3Ccircle cx='170' cy='76' r='3'/%3E%3Ccircle cx='198' cy='94' r='3'/%3E%3Ccircle cx='44' cy='110' r='3'/%3E%3Ccircle cx='92' cy='98' r='3'/%3E%3Ccircle cx='128' cy='116' r='3'/%3E%3Ccircle cx='182' cy='110' r='3'/%3E%3Ccircle cx='40' cy='162' r='3'/%3E%3Ccircle cx='108' cy='180' r='3'/%3E%3Ccircle cx='152' cy='184' r='3'/%3E%3Ccircle cx='186' cy='176' r='3'/%3E%3Ccircle cx='46' cy='220' r='3'/%3E%3Ccircle cx='174' cy='206' r='3'/%3E%3C/g%3E%3C/svg%3E");
  --color-primary: #2c58b0;      /* Live KINPO blue (2026-08-18) */
  --color-primary-dark: #1b3d74;
  --color-primary-accent: #2c58b0;
  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Inter's disambiguation set: open 4, straight-tailed l, dotted zero.
     These are Inter character variants — they did nothing on Roboto and
     nothing on Barlow, so they were previously inert on the headings. */
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  color: #1e293b;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5,h6 {
  font-family: "Barlow", system-ui, sans-serif;
  letter-spacing: -0.015em;
}

/* Metrics, cert codes and measurements are compared column-to-column, so the
   digits must not shift width between values. */
.font-data-mono,.table-precision td,.table-precision th {
  font-variant-numeric: tabular-nums;
}

/* Material Symbols Clean Configuration */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 350, "GRAD" 0, "opsz" 22;
  user-select: none;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Clean Editorial Shadows & Cards */
.card-clean,main article,main .motion-card {
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 16px -10px rgba(15, 23, 42, 0.08);
  transition: border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Paint the light card surface only where the element has not declared its own.
   `main .motion-card` is specificity (0,1,1) and would otherwise beat a single
   Tailwind `bg-*` utility (0,1,0), repainting deliberately dark cards white and
   leaving their white text invisible. */
.card-clean:not([class*="bg-"]),main article:not([class*="bg-"]),main .motion-card:not([class*="bg-"]) {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}
.card-clean:not([class*="bg-"]):hover,main article:not([class*="bg-"]):hover,main .motion-card:not([class*="bg-"]):hover {
  border-color: #cbd5e1;
}
.card-clean:hover,main article:hover,main .motion-card:hover {
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  transform: translate3d(0, -5px, 0);
}

.card-subtle {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

/* Clean Badges & Tags */
/* Restrained, Minimalist Header & Accents */
.badge-clean {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-clean-dark {
  background-color: rgba(255, 255, 255, 0.06);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.2);
}

/* Clean Button Styles */
.btn-primary {
  background-color: #2c58b0;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 10px 20px;
  border-radius: 4px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover {
  background-color: #1b3d74;
  box-shadow: 0 4px 12px rgba(44, 88, 176, 0.2);
}

.btn-secondary {
  background-color: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 10px 20px;
  border-radius: 4px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Precision Table Aesthetics */
.table-precision {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table-precision th {
  background-color: #f1f5f9;
  color: #1e293b;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 3px solid #2c58b0;   /* contract §5 — 3px header rule */
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.table-precision td {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}
.table-precision tr:last-child td {
  border-bottom: none;
}
.table-precision tbody tr:nth-child(even) td {
  background-color: #f8fafc;
}
.table-precision tr:hover td {
  background-color: #eef2f9;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Accessible focus outlines */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 2px solid #2c58b0;
  outline-offset: 2px;
}

/* Compact text links still need a usable minimum pointer target. */
header a,main a,footer a {
  align-items: center;
  display: inline-flex;
  min-height: 24px;
}

header button,main button {
  min-height: 24px;
}

html { 
  scroll-behavior: smooth; 
}

/* The sticky header is 73px tall; without this an anchored section lands
   underneath it. Applies to every in-page jump target. */
[id] {
  scroll-margin-top: 88px;
}

/* Readability bump (older audiences): raise micro-labels 10–11px to 12px.
   Uses !important to beat Tailwind browser-runtime-generated utilities. */
.text-\[11px\] { font-size: 0.75rem !important; }
.text-\[10px\] { font-size: 0.75rem !important; }

/* Contrast bump (older audiences): raise muted body text on LIGHT surfaces.
   slate-400→slate-500 (#64748b), slate-500→slate-600 (#475569) — design.md §3.4
   targets AAA on body copy. Dark panels (footer/hero/cert strip/contact/dark
   cards) keep their original light-gray text via the restore rules below
   (higher specificity + later in file wins). 2026-08-18. */
main section .text-slate-400 { color: #64748b !important; }
main section .text-slate-500 { color: #475569 !important; }

/* Restore muted (not white) text inside dark surfaces. slate-500 #64748b lands at
   3.7:1 on these near-black panels — below AA — so the dark-surface value is
   lifted to #8595ab (~6:1) while staying dimmer than the slate-400 tier. */
main .bg-slate-950 .text-slate-400,main .bg-slate-900 .text-slate-400,main .bg-surface-dark .text-slate-400,main .bg-slate-800 .text-slate-400,[class*="bg-slate-950/"] .text-slate-400,[class*="bg-slate-900/"] .text-slate-400,[class*="bg-slate-800/"] .text-slate-400 { color: #94a3b8 !important; }

main .bg-slate-950 .text-slate-500,main .bg-slate-900 .text-slate-500,main .bg-surface-dark .text-slate-500,main .bg-slate-800 .text-slate-500,[class*="bg-slate-950/"] .text-slate-500,[class*="bg-slate-900/"] .text-slate-500,[class*="bg-slate-800/"] .text-slate-500 { color: #8595ab !important; }

/* Nav dropdown chevron. Rotation is bound to the real open state (set by
   assets/navigation.js), not to :hover — the panels are click-only, so a
   hover rotation advertised an open state that never happened. */
.nav-chevron {
  transition: transform 0.2s ease;
}

/* Restrained motion system ------------------------------------------------- */
header {
  transition: background-color 0.25s ease, box-shadow 0.25s ease,
              border-color 0.25s ease;
}

header > div:first-child,header > div:first-child img {
  transition: padding 0.25s ease, height 0.25s ease, transform 0.2s ease;
}

header.header-scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  border-bottom-color: #cbd5e1;
  box-shadow: 0 8px 24px -18px rgba(15, 23, 42, 0.65);
}

header.header-scrolled > div:first-child {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

header.header-scrolled > div:first-child img {
  height: 2.1rem;
}

/* The motion-ready gate keeps content visible when JavaScript is unavailable. */
html.motion-ready .reveal-item {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

html.motion-ready .reveal-item.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

html.motion-ready .hero-entrance {
  animation: hero-entrance 0.85s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hero-entrance {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

main .motion-card {
  transition: border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

main .motion-card:hover,html.motion-ready main .motion-card.is-visible:hover {
  transform: translate3d(0, -5px, 0);
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

main .motion-card .material-symbols-outlined {
  transition: transform 0.22s ease;
}

main .motion-card:hover .material-symbols-outlined {
  transform: translateY(-2px);
}

main .motion-image {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.3s ease;
}

main figure:hover .motion-image,main a:hover > .motion-image,main .motion-card:hover .motion-image {
  filter: saturate(1.03) contrast(1.02);
  transform: scale(1.02);
}

.motion-button {
  transition: background-color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.motion-button:hover {
  transform: translateY(-1px);
}

.motion-button:active {
  transform: translateY(0);
}

/* Contact anchor clears the 73px sticky header (Phase 5.2). */
#contact {
  scroll-margin-top: 88px;
}

/* Tables must never drive horizontal scroll on 375px viewports (Archetype B
   requirement — tables are the primary content type). Contract keeps 12px cell
   padding; this only tightens it below the small breakpoint. */
@media (max-width: 640px) {
  .table-precision { font-size: 12px; }
  .table-precision th,.table-precision td {
    padding: 10px 8px;
    word-break: normal;
  }
}

/* =========================================================================
   DESIGN POLISH — 2026-08-23 (post-rebuild style pass, research-informed:
   photography, typographic scale, section rhythm, accent rules; contract-
   conformant: 4px radius, no blur/gradient/lift, light surfaces)
   ========================================================================= */

/* Controlled-document section labels: blue rule + mono index ("01 — ROLE").
   This is the precision-blueprint device, not the removed pill eyebrows. */
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #2c58b0;
}
.section-kicker::before {
  content: "";
  width: 32px;
  height: 3px;
  background-color: #2c58b0;
  flex-shrink: 0;
}

/* Display typography: tighter tracking on the largest scale only. */
.display-display {
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* Card materiality: subtle lift & soft shadow */
.card-clean {
  transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Button hierarchy: primary carries a quiet elevation; hover deepens color. */
.btn-primary {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12),
              0 6px 16px -10px rgba(44, 88, 176, 0.4);
}
.btn-primary:hover {
  background-color: #1b3d74;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.14),
              0 10px 22px -10px rgba(44, 88, 176, 0.5);
}

/* Photography band: full-width facility imagery with a solid KINPO-blue
   scrim + mono caption — the parent brand's photo-section language, with
   the blue accent owned by KINPO interactive blue (contract: photo scrims
   are imagery, not panels). */
.photo-band {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background-color: #1b3d74;
}
.photo-band img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-band .photo-band__scrim {
  position: absolute;
  inset: 0;
  background-color: rgba(27, 61, 116, 0.35);
}
.photo-band .photo-band__caption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background-color: rgba(15, 23, 42, 0.55);
  padding: 4px 10px;
  border-radius: 4px;
  max-width: calc(100% - 32px);
}

/* Section-heading accent rule on light surfaces: the KINPO 3px rule applied
   sitewide so every page carries the same controlled-document rhythm. The
   dark contact band keeps its own white-led hierarchy. */
main section:not(.bg-surface-dark):not([class*="bg-slate-9"]):not([class*="bg-slate-8"]) h2 {
  position: relative;
  padding-bottom: 12px;
}
main section:not(.bg-surface-dark):not([class*="bg-slate-9"]):not([class*="bg-slate-8"]) h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background-color: #2c58b0;
}

/* A left-anchored rule under a centred heading reads as a stray mark, because
   the h2 spans the full column while its text sits in the middle. Centre it. */
main section .text-center h2::after,main section h2.text-center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* Two-tone identity rows on tinted bands. */
.band-brand-tint {
  background-color: #eef2f9;
  border-top: 1px solid #dde5f2;
  border-bottom: 1px solid #dde5f2;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Subtle PCB traces add technical texture without reducing readability.
   Light variant on light surfaces; the dark variant is needed on dark panels
   or the pattern is invisible against them. Opt out with .no-pcb-texture. */
main section:not([class*="bg-gradient"]):not(.no-pcb-texture) {
  background-image: var(--pcb-pattern-light);
  background-position: center top;
  background-size: 240px 240px;
}

main section[class*="bg-slate-9"]:not(.no-pcb-texture),main section[class*="bg-slate-8"]:not(.no-pcb-texture),main section[class*="surface-dark"]:not(.no-pcb-texture) {
  background-image: var(--pcb-pattern-dark);
}

@media (prefers-reduced-motion: reduce) {
  header > div:first-child,header > div:first-child img {
    transition: none;
  }
}

/* Reduced motion: reveal content immediately. `theme.js` still sets
   `motion-ready`, which hides `.reveal-item` until the IntersectionObserver
   fires — so without this, a reduced-motion visitor waits on an animation they
   asked not to have. Content visibility must never depend on motion. */
@media (prefers-reduced-motion: reduce) {
  html.motion-ready .reveal-item,html.motion-ready .reveal-item.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html.motion-ready .hero-entrance {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* September 25 audit: short viewports, readable tables, and motion preference. */
footer a { overflow-wrap: anywhere; min-width: 0; }
footer .grid > div { min-width: 0; }
#mobile-menu {
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.table-precision th,.table-precision td { font-size: 1rem; }
main [data-equipment-row] dt,main [data-equipment-row] dd { font-size: 1rem; }
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .motion-card,.motion-card.is-visible:hover,.card-clean:hover,.card-subtle:hover,.btn-primary:hover,.btn-secondary:hover,.nav-chevron,.group:hover img,.motion-image,.motion-button,.motion-card .material-symbols-outlined,html.motion-ready .reveal-item,html.motion-ready .hero-entrance {
    transform: none !important;
  }
}

/* Print: content that reveals on scroll stays at opacity 0 until observed, so
   without this every block below the first screen prints blank (measured
   2026-10-06: 17 of 22 blocks on quality.html). Force everything visible and
   static, and keep the sticky header from repeating or overlapping content. */
@media print {
  html.motion-ready .reveal-item,html.motion-ready .reveal-item.is-visible,html.motion-ready .hero-entrance,.motion-card,.motion-image,.motion-button {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  header { position: static !important; box-shadow: none !important; }
  #mobile-menu { display: none !important; }
  main section { break-inside: auto; }
  .card-clean,.card-subtle,[class*="shadow-card"],table,figure,img { break-inside: avoid; }
  * { box-shadow: none !important; }
}
