/* ==========================================================================
   Perception Instruments -- product site
   Dark, single-product design system. Pure CSS, no dependencies.
   ========================================================================== */

:root {
  --bg: #07080b;
  --bg-raise: #0c0e13;
  --panel: #10131a;
  --panel-edge: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef1f6;
  --text-dim: #a7b0bf;
  --text-muted: #7c8698;
  --accent: #6ea8ff;
  --accent-bright: #93bbff;
  --max-w: 1440px;
  --pad: 40px;
  --radius: 18px;
  --header-h: 80px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(110, 168, 255, 0.35); color: #fff; }

img, video { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.header {
  position: relative;
  z-index: 10;
  background: rgba(7, 8, 11, 0.92);
  border-bottom: 1px solid rgba(30, 35, 44, 0.9);
  transition: background 0.3s, box-shadow 0.3s;
}

.header.scrolled {
  background: rgba(7, 8, 11, 0.96);
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}

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

.nav a.cta-btn {
  background: var(--accent);
  color: var(--white, #fff);
  padding: 10px 20px;
  font-weight: 600;
  transition: background 0.3s;
}

.nav a.cta-btn:hover { background: var(--accent-bright); color: var(--white, #fff); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 15px 32px;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.btn-primary {
  background: var(--text);
  color: #06070a;
}

.btn-primary:hover { background: var(--accent-bright); transform: translateY(-2px); }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-bright);
  margin-bottom: 22px;
}

.section-title {
  font-size: clamp(34px, 4.8vw, 60px);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.section-sub {
  font-size: clamp(19px, 1.8vw, 23px);
  color: var(--text-dim);
  max-width: 620px;
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Hero entrance -- the single time-based intro animation on the page.
   Everything below the fold is scroll-scrubbed (see @supports block) or static.
   -------------------------------------------------------------------------- */

@keyframes hero-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

.hero-text > * { animation: hero-in 0.9s var(--ease) backwards; }
.hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.hero-text > *:nth-child(2) { animation-delay: 0.14s; }
.hero-text > *:nth-child(3) { animation-delay: 0.23s; }
.hero-text > *:nth-child(4) { animation-delay: 0.32s; }
.hero-text > *:nth-child(5) { animation-delay: 0.41s; }
.hero-media { animation: hero-in 1s 0.3s var(--ease) backwards; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 56px) 0 72px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -18%;
  width: 68vw;
  height: 68vw;
  max-width: 980px;
  max-height: 980px;
  background: radial-gradient(circle, rgba(56, 100, 180, 0.22) 0%, rgba(56, 100, 180, 0) 62%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -35%;
  left: -20%;
  width: 55vw;
  height: 55vw;
  max-width: 760px;
  max-height: 760px;
  background: radial-gradient(circle, rgba(110, 168, 255, 0.09) 0%, rgba(110, 168, 255, 0) 60%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 64px;
  align-items: center;
  width: 100%;
}

.hero h1 {
  /* cap keeps "Measure what" on one line in the ~590px hero column at 1440px */
  font-size: clamp(48px, 6.6vw, 92px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero h1 .accent {
  background: linear-gradient(100deg, var(--accent-bright), #d9e6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .subtitle {
  font-size: clamp(19px, 1.7vw, 22px);
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 540px;
  margin-top: 28px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.hero-points span {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.hero-points span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* Hero media: the instrument is a tall portrait-format tower -- show it whole.
   Frame width is derived from viewport height so the full machine always fits;
   the video keeps its native 9:16 ratio (no crop). */

.hero-media { position: relative; }

.hero-media::before {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -4%;
  right: 6%;
  width: 46%;
  background: linear-gradient(180deg, rgba(110, 168, 255, 0.13) 0%, rgba(110, 168, 255, 0.04) 55%, rgba(110, 168, 255, 0) 100%);
  filter: blur(36px);
  pointer-events: none;
}

.hero-media .device-frame {
  width: min(100%, calc((100vh - 210px) * 0.5625));
  width: min(100%, calc((100svh - 210px) * 0.5625));
  margin-left: auto;
}

.hero-media .device-frame video {
  /* native source ratio: the full tower shows uncropped; the 40% target
     only matters if a browser rounds the box a pixel or two off-ratio */
  aspect-ratio: 9 / 16;
  object-position: 50% 40%;
}

.device-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--panel-edge);
  background: #000;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.device-frame video,
.device-frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Portrait sources: taller container, crop windowed on the action region
   (22-62% of source height: probe at top, tray below). The 4:5 container
   shows ~70% of the frame, so Y=30% centers the window on that region. */
.device-frame.portrait video,
.device-frame.portrait img {
  aspect-ratio: 4 / 5;
  object-position: 50% 30%;
}

.cap-media > .device-frame.portrait {
  max-width: 460px;
  margin: 0 auto;
}

.frame-label {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #dfe7f5;
  background: rgba(7, 8, 11, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 7px 13px;
  border-radius: 999px;
}

.frame-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5be49b;
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero-media .spec-chip {
  position: absolute;
  top: -18px;
  right: -12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.spec-chip .k {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.spec-chip .v {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent-bright);
}

/* --------------------------------------------------------------------------
   Full-bleed cinema band
   -------------------------------------------------------------------------- */

.cinema {
  position: relative;
  overflow: hidden;
}

.cinema video {
  width: 100%;
  max-height: 64vh;
  object-fit: cover;
  /* Action region of the prototype clips spans 22-62% of source height
     (gantry + probe at top, tray below; dead space above and below).
     On wide viewports the band shows ~23% of the frame, so Y=28% puts
     the window top at ~22%: probe and gantry in the upper half of the
     band, tray in the lower half, clear of the bottom caption.
     (Mobile override below: taller window, Y=40% fits the whole region.) */
  object-position: 50% 28%;
  filter: saturate(0.92);
}

.cinema::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(7, 8, 11, 0) 22%, rgba(7, 8, 11, 0) 62%, var(--bg) 100%);
  pointer-events: none;
}

.cinema-caption {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 42px;
  text-align: center;
  padding: 0 var(--pad);
}

.cinema-caption strong {
  display: block;
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cinema-caption span {
  font-size: 16.5px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Sections / capability rows
   -------------------------------------------------------------------------- */

.section {
  padding: 92px 0;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section-head { max-width: 720px; }

.cap-rows {
  display: flex;
  flex-direction: column;
  gap: 110px;
  margin-top: 96px;
}

.cap-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}

.cap-row.flip .cap-media { order: -1; }

.cap-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.18em;
  margin-bottom: 16px;
  display: block;
}

.cap-text h3 {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.cap-text p {
  margin-top: 18px;
  font-size: 19px;
  color: var(--text-dim);
  max-width: 500px;
}

.cap-meta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cap-meta span {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 999px;
  padding: 6px 14px;
}

.cap-media .device-frame {
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.cap-media .device-frame:hover {
  transform: translateY(-6px);
  box-shadow: 0 54px 110px rgba(0, 0, 0, 0.65);
}

.media-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.media-duo .device-frame video,
.media-duo .device-frame img { aspect-ratio: 3 / 4; }

/* --------------------------------------------------------------------------
   Proof band
   -------------------------------------------------------------------------- */

.proof-band {
  background: var(--bg-raise);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 92px 0;
}

.proof-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}

.proof-count {
  font-size: clamp(84px, 10vw, 144px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #ffffff, var(--accent-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.proof-label {
  display: block;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.proof-copy .section-title { font-size: clamp(32px, 3.8vw, 48px); }

.proof-copy p {
  color: var(--text-dim);
  font-size: 19px;
  max-width: 520px;
  margin-top: 18px;
}

.proof-copy p + p { margin-top: 14px; }

.proof-links {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.text-link {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-bright);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}

.text-link:hover { gap: 11px; color: #fff; }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-section { padding: 96px 0; }

.contact-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 80px;
  align-items: start;
}

.contact-copy h2 {
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.contact-copy > p {
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 19px;
  max-width: 500px;
}

.card-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-bright);
  margin-bottom: 18px;
}

.contact-methods { margin-top: 28px; }

.contact-methods a {
  font-size: 19px;
  font-weight: 600;
  color: var(--accent-bright);
}

.contact-methods a:hover { color: #fff; }

.btn-primary-light {
  display: inline-flex;
  margin-top: 26px;
  background: var(--text);
  color: #06070a;
  font-size: 16.5px;
  font-weight: 600;
  padding: 15px 32px;
  border-radius: 999px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn-primary-light:hover { background: var(--accent-bright); transform: translateY(-2px); }

/* Form */

.contact-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 38px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  font-family: inherit;
  font-size: 16.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
  width: 100%;
}

.contact-form textarea { resize: vertical; min-height: 74px; }

.contact-form select { appearance: none; -webkit-appearance: none; }

.contact-form select option { background: var(--panel); color: var(--text); }

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-muted); }

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(110, 168, 255, 0.06);
}

.contact-form input:disabled,
.contact-form textarea:disabled,
.contact-form select:disabled,
.contact-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.contact-form button {
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 700;
  color: #06070a;
  background: var(--text);
  border: none;
  border-radius: 999px;
  padding: 15px 30px;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.contact-form button:not(:disabled):hover { background: var(--accent-bright); transform: translateY(-2px); }

.form-note {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.form-note a { color: var(--accent-bright); }

/* --------------------------------------------------------------------------
   About page
   -------------------------------------------------------------------------- */

.page-hero {
  padding: 92px 0 80px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  height: 70vw;
  max-width: 1100px;
  max-height: 860px;
  background: radial-gradient(ellipse, rgba(56, 100, 180, 0.16) 0%, rgba(56, 100, 180, 0) 60%);
  pointer-events: none;
}

.page-hero .section-inner { position: relative; z-index: 1; }

.page-hero h1 {
  font-size: clamp(44px, 6.4vw, 84px);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.033em;
  max-width: 820px;
}

.page-hero .subtitle {
  font-size: clamp(19px, 1.7vw, 22px);
  color: var(--text-dim);
  max-width: 620px;
  margin-top: 26px;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 40px;
}

.team-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
}

.team-card:hover { transform: translateY(-6px); border-color: rgba(147, 187, 255, 0.35); }

.team-photo {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(0.9);
}

.team-body { padding: 30px 32px 34px; }

.team-body h3 {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.team-body .role {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-bright);
  margin: 6px 0 16px;
}

.team-body p { font-size: 18px; color: var(--text-dim); }

.team-body p + p { margin-top: 12px; }

.fact-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 28px;
}

.fact-strip > div {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 22px 24px;
}

.fact-strip span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.fact-strip strong {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

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

footer {
  border-top: 1px solid var(--border);
  background: var(--bg-raise);
}

.footer-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 70px var(--pad) 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 60px;
}

.footer-brand p {
  margin-top: 16px;
  font-size: 16px;
  color: var(--text-muted);
  max-width: 380px;
}

.footer-links h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.footer-links ul { list-style: none; }

.footer-links li + li { margin-top: 11px; }

.footer-links a {
  font-size: 16px;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}

.footer-links a:hover { color: var(--text); }

.footer-bar {
  border-top: 1px solid var(--border);
}

.footer-bar p {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 22px var(--pad);
  font-size: 14px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  :root { --pad: 28px; }

  .hero-inner { gap: 44px; }

  .cap-row { gap: 44px; }
}

@media (max-width: 768px) {
  .header-inner {
    height: auto;
    min-height: 64px;
    padding: 14px 24px 12px;
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .logo { font-size: 19px; }
  .nav {
    order: 2;
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  .nav a {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    letter-spacing: 0.05em;
  }
  .nav a.cta-btn {
    padding: 8px 12px;
  }

  .hero { min-height: 0; padding-top: calc(var(--header-h) + 72px); }

  .hero-inner { grid-template-columns: 1fr; gap: 52px; }

  .hero .subtitle { font-size: 19px; }

  /* Full machine, whole and centered, on small screens */
  .hero-media .device-frame {
    width: min(100%, calc(64vh * 0.5625));
    width: min(100%, calc(64svh * 0.5625));
    margin: 0 auto;
  }

  .hero-media .spec-chip { top: auto; bottom: -18px; right: 14px; }

  /* Small screens: the band window covers ~64% of the source frame,
     so Y=40% fits the whole 22-62% action region. */
  .cinema video { object-position: 50% 40%; }

  .cap-row,
  .cap-row.flip { grid-template-columns: 1fr; gap: 30px; }

  /* uniform stacking on mobile: copy first, media below */
  .cap-row.flip .cap-media { order: 0; }

  .cap-rows { gap: 84px; margin-top: 70px; }

  .section { padding: 56px 0; }

  .proof-band { padding: 56px 0; }

  .proof-grid { grid-template-columns: 1fr; gap: 44px; }

  .contact-inner { grid-template-columns: 1fr; gap: 52px; }

  .contact-section { padding: 56px 0; }

  .team-grid { grid-template-columns: 1fr; }

  .fact-strip { grid-template-columns: 1fr; }

  .footer-main { grid-template-columns: 1fr; gap: 40px; padding: 56px var(--pad) 44px; }
}

@media (max-width: 560px) {
  :root { --pad: 20px; }

  .header-inner { padding: 12px 20px 10px; }
  .logo { font-size: 18px; }
  .nav { gap: 8px; }
  .nav a { font-size: 10px; letter-spacing: 0.04em; }
  .nav a.cta-btn { padding: 7px 10px; }

  .hero-ctas { flex-direction: column; align-items: stretch; }

  .btn-primary, .btn-ghost { width: 100%; }

  .media-duo { grid-template-columns: 1fr; }

  .contact-form { padding: 26px 22px; }

  .cinema-caption { bottom: 24px; }
}

/* --------------------------------------------------------------------------
   Scroll-scrubbed motion -- native CSS scroll-driven animations only.
   Wrapped in @supports so non-supporting browsers get a clean, fully
   visible static page. No JS, no hidden content by construction.
   -------------------------------------------------------------------------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {

    /* Media unveils as it scrolls into view: clip-path reveal + settle,
       scrubbed by scroll position (reversible). Animates the media inside
       the frame so the frame border and shadow stay intact. */
    @keyframes media-unveil {
      from { clip-path: inset(36% 12% 36% 12%); transform: scale(1.12); }
      to { clip-path: inset(0 0 0 0); transform: none; }
    }

    .cap-media .device-frame > video,
    .cap-media .device-frame > img {
      animation: media-unveil linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 75%;
    }

    /* Full-bleed band: subtle vertical parallax drift, scrubbed by scroll */
    @keyframes cinema-drift {
      from { transform: scale(1.1) translateY(-3%); }
      to { transform: scale(1.1) translateY(3%); }
    }

    .cinema video {
      animation: cinema-drift linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }

    /* Numbers and cards rise as they enter, scrubbed */
    @keyframes rise-in {
      from { opacity: 0; transform: translateY(44px); }
      to { opacity: 1; transform: none; }
    }

    .proof-count,
    .proof-label {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }

    .team-card > .team-photo {
      animation: media-unveil linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 70%;
    }

    /* Pinned capability walkthrough (desktop): the device visual sticks
       while its copy block scrolls past -- one scene per capability. */
    @media (min-width: 861px) {
      .cap-rows { gap: 0; margin-top: 40px; }

      .cap-row { min-height: 115vh; align-items: start; }

      .cap-text {
        padding: 24vh 0 30vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
      }

      .cap-media {
        position: sticky;
        top: calc(var(--header-h) + 9vh);
        align-self: start;
        padding-bottom: 6vh;
      }
    }
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

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

  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
}

/* FLAT DESIGN: no rounded corners anywhere; depth comes from a slight lift */
header *, main *, footer *, main *::before, main *::after { border-radius: 0 !important; }
.cap-card, .service-card, .standard-grid > div, .team-card, .contact-form, .feature-panel {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cap-card:hover, .service-card:hover, .standard-grid > div:hover, .team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
