/* Additions to Knodir's styles.css for the production site. styles.css stays his file. */

/* Brand kit (Brand Kit/Colors and font.pdf) over Knodir's palette: red #E52528, grey #696969,
   Montserrat. Diagrams use --accent / --accent-rgb, so they follow. */
:root {
  --bg-rgb: 236, 236, 234;          /* --bg as numbers, for the fades over the hero photo */
  --nav-bg: rgba(246, 246, 244, 0.88);
  --hero-sub: #3a3a37;
  --tile: linear-gradient(180deg, #f6f6f4, #e2e2df);   /* team portraits, avatars */
  --mark: #dcdcd9;                  /* the big footer line */
  --accent: #e52528;
  --accent-rgb: 229, 37, 40;
  --muted: #696969;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Montserrat", system-ui, sans-serif;
}
/* Montserrat runs ~25-30% wider than Inter Tight and reads larger at the same size, so the
   site uses its own scale rather than Knodir's numbers (tuned at 390-1440 px wide). The :root
   prefix keeps these ahead of Knodir's own media-query sizes. */
:root body { font-size: 16px; }
:root .mono { font-size: 12px; letter-spacing: 0.06em; }
:root .nav-links { font-size: 14px; }
:root .hero h1 { font-size: clamp(38px, 5vw, 78px); font-weight: 700; letter-spacing: -0.03em; max-width: 22ch; }
:root .hero-copy p { font-size: 19px; }
:root h2 { font-size: clamp(30px, 4vw, 58px); font-weight: 700; letter-spacing: -0.03em; }
:root h3 { font-size: clamp(21px, 2vw, 28px); font-weight: 600; letter-spacing: -0.02em; }
:root .lead { font-size: clamp(20px, 1.9vw, 27px); letter-spacing: -0.01em; }
:root .stat b { font-size: clamp(38px, 4.8vw, 70px); letter-spacing: -0.04em; }
:root .person .portrait { font-size: clamp(24px, 2.4vw, 36px); }
:root .person .name { font-size: 14px; letter-spacing: -0.01em; }
:root .foot-mark { font-size: clamp(28px, 4.2vw, 62px); font-weight: 700; letter-spacing: -0.04em; }
:root .blog-index h1, :root .post-article h1, :root .prose h1 { font-size: clamp(36px, 4.6vw, 66px); font-weight: 700; letter-spacing: -0.03em; }
:root .post h2 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; letter-spacing: -0.02em; }
:root .blog-intro { font-size: 18px; }
/* Diagram captions are SVG <text> with a JetBrains Mono attribute; CSS outranks it */
:root .fig svg text { font-family: var(--sans); font-weight: 500; }
@media (max-width: 768px) {
  :root body { font-size: 15px; }
  :root .nav-links a:not(.btn) { font-size: 20px; }
}

/* Hero photo: crop from near the top so the scanner head stays below the floating bar on
   every desktop shape (at 50% 72% it went under the bar's blur on 16:9 screens). Portrait
   screens crop sideways instead, so this only matters on wide ones. */
:root .hero-media img { object-position: 50% 24%; }

/* The last product card already ends with the section's bottom padding; About doesn't need its
   own full top padding on top of that (it left a screen-tall gap on desktop). */
:root #about { padding-top: clamp(24px, 3vw, 48px); }

/* The hero fills the first screen, so on wide screens the next section's heading doesn't show
   under the scroll cue before the visitor scrolls. */
:root .hero { min-height: 100vh; min-height: 100svh; }

/* Product cards end on their highlighted line (no button under it any more) */
:root .feature .text > :last-child { margin-bottom: 0; }

/* Above the floating bar there is a 12px gap; page text scrolling through it looked cut off.
   Fill it with the page colour, fading into the bar. */
.nav.scrolled::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 28px;
  background: linear-gradient(to bottom, var(--bg) 40%, rgba(236, 236, 234, 0));
  pointer-events: none;
}
.nav.open::before { display: none; }
/* Phone menu open: the section strip would read like a duplicate menu item */
.nav.open .nav-sub { display: none; }

/* Buttons and form fields don't inherit the page font by default (they showed Arial) */
button, input, select, textarea { font-family: inherit; }

/* Logo: red-and-white over the hero photo, grey-and-red once the bar turns light */
.logo { display: inline-flex; align-items: center; }
.logo img { height: 38px; width: auto; }
.nav.scrolled .logo img { height: 32px; }
@media (max-width: 768px) { .logo img, .nav.scrolled .logo img { height: 32px; } }
.logo .logo-dark { display: none; }
.nav.scrolled .logo .logo-light, .nav.open .logo .logo-light { display: none; }
.nav.scrolled .logo .logo-dark, .nav.open .logo .logo-dark { display: block; }

/* Phones: the stats stack, so the hero is taller than the screen and the fixed scroll cue sat on
   the last stat. Phones scroll naturally; drop the cue and let the booking prompt take its spot. */
@media (max-width: 768px) {
  .scroll-cue { display: none; }
  /* main.js sets this while the hero is in view, so the prompt doesn't cover the stats */
  .demo-prompt.before-scroll { opacity: 0; transform: translateY(16px); pointer-events: none; }
}

/* The booking prompt is now a link, not a dialog trigger */
.demo-open { color: inherit; text-decoration: none; }
/* Past the first screen: only the avatar, label on hover/focus. Hidden while the footer shows. */
.demo-prompt { transition: opacity 0.25s, transform 0.25s; }
.demo-prompt.compact:not(:hover):not(:focus-within) .demo-label,
.demo-prompt.compact:not(:hover):not(:focus-within) .demo-dismiss,
.demo-prompt.lifted:not(:hover):not(:focus-within) .demo-label,
.demo-prompt.lifted:not(:hover):not(:focus-within) .demo-dismiss { display: none; }
.demo-prompt.compact:not(:hover):not(:focus-within) .demo-open,
.demo-prompt.lifted:not(:hover):not(:focus-within) .demo-open { padding: 6px; }
/* Touch screens have no hover: the compact prompt keeps its cross so it can still be tucked away */
@media (hover: none) {
  .demo-prompt.compact:not(.docked):not(:hover):not(:focus-within) .demo-dismiss,
  .demo-prompt.lifted:not(.docked):not(:hover):not(:focus-within) .demo-dismiss,
  .demo-prompt:not(.docked) .demo-dismiss { display: grid; padding: 0 12px; }
}
.demo-prompt.scrolling-down { opacity: 0; transform: translateY(16px); pointer-events: none; }
/* main.js sets --lift so the prompt rides just above the footer once the footer is on screen */
.demo-prompt { --base-bottom: 20px; bottom: calc(var(--base-bottom) + var(--lift, 0px)); }
@media (max-width: 768px) { .demo-prompt { --base-bottom: 16px; } }
/* Tucked into the right edge (the cross): only the avatar peeks out, like a phone's floating
   button. A tap slides it back out; the spring easing gives it the same feel. */
.demo-prompt { transition: opacity 0.25s, transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.15), right 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.demo-prompt.docked { right: 0; border-radius: 999px 0 0 999px; border-right: 0; transform: translateX(14px); }
.demo-prompt.docked .demo-label, .demo-prompt.docked .demo-dismiss { display: none; }
.demo-prompt.docked .demo-open { padding: 6px 20px 6px 6px; }
.demo-prompt.docked:hover, .demo-prompt.docked:focus-within { transform: translateX(4px); }
/* Docked it is small enough to stay put while reading; only the footer still moves it aside */
.demo-prompt.docked.scrolling-down, .demo-prompt.docked.before-scroll { opacity: 1; transform: translateX(14px); pointer-events: auto; }
/* Phones: one thing at the bottom at a time; the cookie choice comes first */
@media (max-width: 768px) {
  .consent-open .demo-prompt { opacity: 0; pointer-events: none; }
}

/* Footer: "Cookie settings" looks like the links next to it */
.foot-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.foot-link:hover { color: var(--fg); }

/* Blog: topics announced but not written yet */
.post.upcoming .mono { color: var(--accent); }
.post.upcoming h2 { color: var(--muted); }

/* Post page and simple text pages (privacy) */
.post-article h1, .prose h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 500;
  margin: 12px 0 0;
  max-width: 22ch;
}
.post-body, .prose .wrap > :not(h1) { max-width: 68ch; }
.post-body { margin-top: 40px; font-size: 18px; }
.post-body h2, .prose h2 { font-size: 26px; letter-spacing: -0.02em; font-weight: 500; margin: 2em 0 0.5em; }
.post-body img { border-radius: 12px; margin: 1.5em 0; }
.post-body a, .prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote { margin: 1.6em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 3px solid var(--accent); font-size: 1.2em; font-weight: 500; line-height: 1.45; }
.post-body blockquote p { margin: 0; }
.post-back { margin-top: 64px; }

/* Cookie consent banner, bottom left (the booking prompt is bottom right) */
.consent {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: 360px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  line-height: 1.45;
}
.consent p { margin: 0 0 10px; color: var(--muted); }
.consent .btn { padding: 8px 16px; font-size: 14px; }
/* Room under the page while the banner shows, so the footer can scroll clear of it */
.consent-open footer { padding-bottom: var(--consent-h, 0px); }
.consent a { color: var(--fg); text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 768px) {
  .consent { left: 12px; right: 12px; bottom: 12px; max-width: none; display: flex; gap: 12px; align-items: center; padding: 12px 14px; font-size: 13px; }
  .consent p { margin: 0; flex: 1; }
  .consent-actions { flex-direction: column; gap: 6px; }
  .consent .btn { padding: 7px 14px; }
}
/* The phone layout sets display:flex, which would otherwise override the hidden attribute */
.consent[hidden] { display: none; }


/* Booking window (Knodir's .demo-* styles in styles.css): the details step, confirmation and
   time-zone picker added when it was wired to booking-api (assets/js/book.js). */
.demo-tz-pick { display: grid; gap: 6px; margin: 14px 0 0 36px; font-size: 15px; }
.demo-tz-pick select, .demo-form input, .demo-form textarea {
  font: inherit; font-size: 16px; padding: 12px 14px; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg);
}
/* Neutral focus: red is kept for real errors */
.demo-form input:focus, .demo-form textarea:focus, .demo-tz-pick select:focus { outline: 2px solid var(--fg); outline-offset: 1px; border-color: transparent; }
.demo-dialog button:focus-visible { outline-color: var(--fg); }
.demo-form, .demo-done { grid-template-columns: 1fr; }
.demo-chosen { font-size: 20px; letter-spacing: -0.02em; margin: 0; }
.demo-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.demo-fields label { display: grid; gap: 6px; font-size: 15px; }
.demo-fields .wide { grid-column: 1 / -1; }
.demo-fields .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.demo-error { color: var(--accent); font-weight: 500; margin: 0; }
.demo-actions { display: flex; gap: 12px; }
.demo-actions .btn[disabled] { opacity: 0.6; cursor: progress; }
.demo-small { font-size: 14px; margin: 0; }
.demo-small a, .demo-slots .none a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.demo-main[hidden], .demo-tz-pick[hidden] { display: none; }
.demo-host { padding-right: 40px; } /* clear of the close button */
@media (max-width: 900px) {
  .demo-fields { grid-template-columns: 1fr; }
  .demo-tz-pick { margin-left: 0; }
}
/* Phones: keep the calendar near the top; the agenda is a nice-to-have there */
@media (max-width: 600px) {
  .demo-side hr, .demo-side h3, .demo-agenda { display: none; }
  .demo-host .avatar.lg { width: 56px; height: 56px; font-size: 20px; }
  .demo-facts { margin-top: 18px; gap: 10px; }
}



/* ---------- Evening (Day / Evening switch; the head script sets data-theme) ----------
   Same greys as demo.ayavex.com's evening, brand red kept. Knodir's styles.css stays light-only: the
   rules below swap its few fixed colours for tokens. */
:root[data-theme="dark"] {
  --bg: #262626; --bg-2: #333333; --fg: #f5f5f5; --muted: #b0b0b0; --line: rgba(255, 255, 255, 0.14);
  --bg-rgb: 38, 38, 38;
  --nav-bg: rgba(51, 51, 51, 0.88);
  --hero-sub: #d6d6d6;
  --tile: linear-gradient(180deg, #3d3d3d, #2e2e2e);
  --mark: #383838;
  color-scheme: dark;
}
:root .nav.scrolled .nav-shell { background: var(--nav-bg); }
:root .hero-media::after {
  background: linear-gradient(to bottom,
    rgba(var(--bg-rgb), 0) 0%, rgba(var(--bg-rgb), 0) 28%,
    rgba(var(--bg-rgb), 0.55) 42%, rgba(var(--bg-rgb), 0.6) 100%);
}
:root #solutions {
  background: linear-gradient(to bottom,
    rgba(var(--bg-rgb), 0) 0,
    rgba(var(--bg-rgb), 0.45) calc(var(--fade) * 0.4),
    rgba(var(--bg-rgb), 0.85) calc(var(--fade) * 0.75),
    var(--bg) var(--fade));
}
:root .nav.scrolled::before { background: linear-gradient(to bottom, var(--bg) 40%, rgba(var(--bg-rgb), 0)); }
:root .hero-copy p, :root .hero .stat .mono { color: var(--hero-sub); }
:root .person .portrait, :root .avatar { background: var(--tile); }
:root .foot-mark { color: var(--mark); }
/* Evening bar: the white logo once the bar is dark (by day the grey/red one) */
:root[data-theme="dark"] .nav.scrolled .logo .logo-light, :root[data-theme="dark"] .nav.open .logo .logo-light { display: block; }
:root[data-theme="dark"] .nav.scrolled .logo .logo-dark, :root[data-theme="dark"] .nav.open .logo .logo-dark { display: none; }
/* Bolt Mapper diagram: its fixed dark strokes and labels turn light */
:root[data-theme="dark"] #bolt-mapper svg [stroke^="rgba(0,0,0"] { stroke: rgba(255, 255, 255, 0.45); }
:root[data-theme="dark"] #bolt-mapper svg [stroke="#6b6b67"] { stroke: #9a9a96; }
:root[data-theme="dark"] #bolt-mapper svg text { fill: #9a9a96; }
:root[data-theme="dark"] .scroll-cue svg { animation-name: bob; color: var(--fg); }

/* Day / Evening switch (same look as demo.ayavex.com) */
.lighting { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; flex: none; margin-left: 20px; }
.lighting button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: inherit; opacity: 0.75;
  font: 600 12px/1 var(--sans); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.lighting button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.lighting button[value="dark"] svg { fill: currentColor; stroke: none; }
.lighting button[aria-pressed="true"] { background: var(--accent); color: #fff; opacity: 1; }
.lighting button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav:not(.scrolled):not(.open) .lighting { border-color: rgba(255, 255, 255, 0.4); }
@media (min-width: 769px) { .nav-shell > .wrap .nav-links { margin-left: auto; } }   /* links stay right, beside the switch */
html:not(.js) .lighting { display: none; }   /* the switch needs JavaScript */
@media (max-width: 768px) {
  .lighting { margin-left: auto; margin-right: 8px; order: 1; }
  .menu-toggle { order: 2; }
  .lighting button span { display: none; }
  .lighting button { padding: 6px 8px; }
}

/* "Log in" (demo.ayavex.com): a small outlined pill in the bar, a plain item in the phone menu */
@media (min-width: 769px) {
  .nav-links .nav-login { border: 1px solid currentColor; border-radius: 999px; padding: 5px 14px; opacity: 1; }
  .nav-links .nav-login:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
}

/* Booking window: "Book a call" / "Keep in touch" switch (keep-in-touch.js), same look as its 12h/24h toggle */
.demo-mode { grid-column: 1 / -1; justify-self: start; display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.demo-mode button { font: inherit; font-size: 14px; border: 0; background: none; cursor: pointer; padding: 7px 16px; border-radius: 999px; color: var(--muted); }
.demo-mode button[aria-pressed="true"] { background: var(--fg); color: var(--bg-2); }
.demo-mode button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.demo-products { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.demo-products legend { font-size: 15px; margin-bottom: 8px; }
.demo-products .check { display: flex; align-items: center; gap: 8px; }
.demo-products input { width: auto; accent-color: var(--accent); }
.demo-products .soon { font-size: 12px; color: var(--muted); }
.demo-dialog .demo-fields { align-items: end; }
/* Keep in touch is not a call: the call facts, time zone and agenda step aside */
.demo-dialog.touch-mode .demo-facts, .demo-dialog.touch-mode .demo-tz, .demo-dialog.touch-mode .demo-tz-pick,
.demo-dialog.touch-mode .demo-side hr, .demo-dialog.touch-mode .demo-side h3, .demo-dialog.touch-mode .demo-agenda { display: none; }

/* /embed/book/: the booking window alone, framed over demo.ayavex.com. The framing page dims and blurs what's behind. */
html:has(body.embed), body.embed { background: transparent; }
body.embed .demo-dialog::backdrop { background: transparent; backdrop-filter: none; }

/* Wide screens: the window is two columns with its own height limit, so a column taller than the screen
   (Keep in touch with every product listed) scrolls inside the window instead of losing its Send button. */
@media (min-width: 901px) {
  .demo-side, .demo-main { max-height: calc(100dvh - 34px); overflow-y: auto; overscroll-behavior: contain; }
}
