/* theme button, privacy notice and dialog */
.themebtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; cursor: pointer;
  color: var(--text); background: transparent;
  border: 1px solid var(--line2); border-radius: 999px;
  transition: border-color .2s, background .2s;
}
.themebtn:hover { border-color: var(--line3); background: var(--surf); }
.themebtn svg { width: 18px; height: 18px; }
.themebtn .ic-sun { display: none; }
html[data-theme="dark"] .themebtn .ic-sun { display: block; }
html[data-theme="dark"] .themebtn .ic-moon { display: none; }
html[data-theme="light"] .themebtn .ic-moon { display: block; }

.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--dim);
  border-bottom: 1px solid var(--line3);
}
.linkbtn:hover { color: var(--text); }

.cookie-notice {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 60;
  max-width: 720px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 14px 18px; background: var(--surf); color: var(--text);
  border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; flex: 1 1 280px; font-size: 14px; line-height: 1.7; color: var(--dim); }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn-s, .cookie-actions .btn-o { padding: 9px 16px; font-size: 12px; cursor: pointer; }

.privacy-dialog {
  width: min(680px, calc(100% - 32px)); max-height: 85vh; padding: 0;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line2); border-radius: 14px;
}
.privacy-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.privacy-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg);
}
.privacy-head h2 { margin: 0; font-size: 20px; }
.privacy-close {
  cursor: pointer; padding: 8px 14px; font: inherit; font-size: 13px;
  color: var(--text); background: transparent; border: 1px solid var(--line2); border-radius: 8px;
}
.privacy-body { padding: 8px 22px 22px; overflow: auto; max-height: calc(85vh - 70px); }
.privacy-body h3 { margin: 22px 0 6px; font-size: 16px; }
.privacy-body p { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--dim); }
@media (max-width: 720px) { .cookie-notice { inset-inline: 10px; bottom: 10px; } }

/* light-mode fixes for outline buttons */
html[data-theme="light"] .btn-o,
html[data-theme="light"] button.btn-o,
html[data-theme="light"] a.btn-o {
  color: var(--text) !important;
  background: transparent !important;
  border-color: var(--line3) !important;
}
html[data-theme="light"] .btn-o:hover,
html[data-theme="light"] button.btn-o:hover,
html[data-theme="light"] a.btn-o:hover {
  background: var(--surf) !important;
  border-color: var(--text) !important;
}

/* ===== click-to-expand rows: products, delivered work, capabilities, process ===== */
.pp-products { display: flex; flex-direction: column; gap: 12px; }
details.pp-product { border-radius: var(--pp-radius); }
details.pp-product > summary.pp-product-head {
  grid-template-columns: auto 1fr auto auto;
  border-bottom: 0;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  transition: background .2s;
}
details.pp-product > summary::-webkit-details-marker,
.cap-card > summary::-webkit-details-marker,
.proc-step > summary::-webkit-details-marker { display: none; }
details.pp-product > summary:hover { background: color-mix(in srgb, var(--surf) 70%, transparent); }
details.pp-product > summary:focus-visible,
.cap-card > summary:focus-visible,
.proc-step > summary:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
details.pp-product[open] > summary.pp-product-head { border-bottom: 1px solid var(--line); }
details.pp-product .pp-product-name p { font-size: 14px; }
.pp-chev { color: var(--dim); transition: transform .25s var(--ease, ease); flex: none; }
details[open] > summary > .pp-chev { transform: rotate(180deg); }

.cap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-top: 28px; }
.cap-card, .proc-step {
  border: 1px solid var(--line2); border-radius: var(--pp-radius, 12px);
  background: var(--pp-surf, var(--surf)); overflow: hidden;
}
.cap-card > summary, .proc-step > summary {
  display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none;
  padding: 16px 20px; transition: background .2s;
}
.cap-card > summary:hover, .proc-step > summary:hover { background: color-mix(in srgb, var(--surf) 70%, transparent); }
.cap-card > summary strong, .proc-step > summary strong { flex: 1; font-weight: 600; font-size: 16px; }
.cap-num { font-family: var(--font-mono); font-size: 12px; color: var(--faint); min-width: 2.2ch; }
.cap-card > p, .proc-step > p { margin: 0; padding: 0 20px 18px 20px; font-size: 14.5px; line-height: 1.85; color: var(--dim); }
.cap-card[open] > summary, .proc-step[open] > summary { padding-bottom: 10px; }
.proc-list { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.proc-time { font-size: 12px; color: var(--dim); padding: 4px 10px; border: 1px solid var(--line2); border-radius: 999px; white-space: nowrap; }
.proc-out { padding: 0 20px 18px; }
.proc-out p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.8; color: var(--dim); }
@media (max-width: 720px) {
  .cap-grid { grid-template-columns: 1fr; }
  details.pp-product > summary.pp-product-head { grid-template-columns: auto 1fr auto; gap: 12px; padding: 16px; }
  details.pp-product > summary .pp-status { grid-column: 2; justify-self: start; }
  details.pp-product > summary .pp-chev { grid-row: 1; grid-column: 3; }
  .proc-time { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pp-chev { transition: none; } }

/* ===== light-mode fixes for the products page ===== */
html[data-theme="light"] .pp {
  --pp-surf: #ECECE6;
  --pp-surf2: #E4E4DD;
}
html[data-theme="light"] .pp-tab:hover { color: var(--text); background: rgba(10, 10, 10, .05); }
html[data-theme="light"] .pp-tab.active {
  background: var(--text) !important;
  border: 1px solid var(--text) !important;
  color: var(--bg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html[data-theme="light"] .pp-tab.active .pp-tab-title { color: var(--bg) !important; }
html[data-theme="light"] .pp-tab.active .pp-tab-sub { color: var(--bg) !important; opacity: .75 !important; }
html[data-theme="light"] .pp-together-flow li:nth-child(2) {
  background: var(--text) !important;
  color: var(--bg) !important;
  border-color: var(--text) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .pp-together-flow li:nth-child(2) .pp-num { color: var(--bg) !important; }

/* ===== capabilities: light, simple motion ===== */
@keyframes capRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes capOpen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes railDraw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dotPop { from { transform: scale(0); } to { transform: scale(1); } }

.page.active .cap-card { animation: capRise .45s var(--ease, ease) both; }
.page.active .cap-card:nth-child(2) { animation-delay: .05s; }
.page.active .cap-card:nth-child(3) { animation-delay: .10s; }
.page.active .cap-card:nth-child(4) { animation-delay: .15s; }
.page.active .cap-card:nth-child(5) { animation-delay: .20s; }
.page.active .cap-card:nth-child(6) { animation-delay: .25s; }
.page.active .cap-card:nth-child(7) { animation-delay: .30s; }
.page.active .cap-card:nth-child(8) { animation-delay: .35s; }

.cap-card[open] > p, .proc-step[open] > p, .proc-step[open] > .proc-out { animation: capOpen .28s var(--ease, ease) both; }
.cap-card, .proc-step { transition: border-color .25s, background .25s; }
.cap-card[open], .proc-step[open] { border-color: var(--line3); }

.proc-list { position: relative; padding-inline-start: 28px; }
.proc-list::before {
  content: ''; position: absolute; inset-block: 22px; inset-inline-start: 7px; width: 2px;
  background: var(--line3); transform-origin: top; border-radius: 2px;
}
.page.active .proc-list::before { animation: railDraw .9s var(--ease, ease) both; }
.proc-list > li { position: relative; }
.proc-list > li::before {
  content: ''; position: absolute; inset-inline-start: -26px; top: 22px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--text);
}
.page.active .proc-list > li::before { animation: dotPop .3s var(--ease, ease) both; }
.page.active .proc-list > li:nth-child(1)::before { animation-delay: .15s; }
.page.active .proc-list > li:nth-child(2)::before { animation-delay: .30s; }
.page.active .proc-list > li:nth-child(3)::before { animation-delay: .45s; }
.page.active .proc-list > li:nth-child(4)::before { animation-delay: .60s; }
.page.active .proc-list > li:nth-child(5)::before { animation-delay: .75s; }
.page.active .proc-list > li { animation: capRise .45s var(--ease, ease) both; }
.page.active .proc-list > li:nth-child(2) { animation-delay: .1s; }
.page.active .proc-list > li:nth-child(3) { animation-delay: .2s; }
.page.active .proc-list > li:nth-child(4) { animation-delay: .3s; }
.page.active .proc-list > li:nth-child(5) { animation-delay: .4s; }

@media (prefers-reduced-motion: reduce) {
  .page.active .cap-card, .page.active .proc-list > li, .page.active .proc-list::before, .page.active .proc-list > li::before,
  .cap-card[open] > p, .proc-step[open] > p, .proc-step[open] > .proc-out { animation: none; }
}

/* ===== contrast fixes found in the audit ===== */
html[data-theme="light"] {
  --faint: #5A5A63;
  --zinc-500: #5A5A63;
}
header .navlinks a.n:not([aria-current="page"]),
.lang button:not([aria-pressed="true"]) { color: var(--dim); }

/* R&D cards and other hard-coded dark surfaces in light mode */
html[data-theme="light"] .rd-card { background: var(--surf); }
@media (max-width: 360px) {
  details.pp-product > summary.pp-product-head { grid-template-columns: 1fr auto; }
  details.pp-product > summary .pp-num { display: none; }
  .pp-product-name h3 { overflow-wrap: anywhere; }
}

/* header fits at 981-1140px now that it has a theme button */
@media (min-width: 981px) and (max-width: 1140px) {
  .navbar { gap: 14px; padding-inline: 24px; }
  .navlinks { gap: 12px; }
  .navutil { gap: 8px; }
  .navutil .cta { padding-inline: 12px; }
}

/* ===== home redesign: scenario demo (inverted band), focus cards, bigger team ===== */
.demo { margin-top: 28px; border-radius: 16px; overflow: hidden; background: var(--text); color: var(--bg); }
.demo-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 14px 0; }
.demo-tab {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 16px; font: inherit; font-size: 14px; font-weight: 600;
  color: color-mix(in srgb, var(--bg) 70%, transparent); background: transparent;
  border: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); border-radius: 999px;
  transition: background .2s, color .2s;
}
.demo-tab:hover { color: var(--bg); border-color: var(--bg); }
.demo-tab.on { background: var(--bg); color: var(--text); border-color: var(--bg); }
.demo-tab:focus-visible { outline: 2px solid var(--bg); outline-offset: 2px; }
.demo-n { font-family: var(--font-mono); font-size: 11px; opacity: .7; }
.demo-panel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: stretch; padding: 22px 24px 28px; animation: capOpen .3s var(--ease, ease) both; }
.demo-col { padding: 18px 20px; border: 1px solid color-mix(in srgb, var(--bg) 22%, transparent); border-radius: 12px; }
.demo-out { background: color-mix(in srgb, var(--bg) 10%, transparent); }
.demo-lbl { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; opacity: .65; }
.demo-col p { margin: 0; font-size: 15px; line-height: 1.9; }
.demo-arrow { align-self: center; font-size: 22px; opacity: .6; }
.demo-note { margin: 12px 0 0; font-size: 13px; color: var(--faint); }

.focus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.focus-card {
  display: block; padding: 22px 24px; text-decoration: none; color: var(--text);
  border: 1px solid var(--line2); border-radius: 14px; background: var(--surf);
  transition: border-color .2s, transform .2s;
}
.focus-card:hover { border-color: var(--text); transform: translateY(-2px); }
.focus-card h3 { margin: 6px 0 2px; font-size: 22px; }
.focus-card strong { display: block; font-size: 14px; font-weight: 600; color: var(--dim); margin-bottom: 10px; }
.focus-card p { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--dim); }

/* team: big portraits */
.team { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)) !important; }
.member .ava { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 14px; }
.member .ava img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }

@media (max-width: 820px) {
  .demo-panel { grid-template-columns: 1fr; }
  .demo-arrow { transform: rotate(90deg); justify-self: center; }
  .focus-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .demo-panel { animation: none; } .focus-card { transition: none; } }

.demo .demo-col p, .demo .demo-lbl, .demo .demo-n { color: var(--bg) !important; }
.demo .demo-tab { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.demo .demo-tab.on { color: var(--text); }
#demoSec .demo .demo-col p, #demoSec .demo .demo-lbl, #demoSec .demo .demo-n { color: var(--bg) !important; opacity: 1; }
#demoSec .demo .demo-lbl { opacity: .7; }

/* careers status card in light mode (refresh.css hard-codes a dark fill) */
html[data-theme="light"] .careers-status-sidebar { background: var(--surf) !important; }
