/* ============================================================
   AM\CodeCraft — site styles
   Built on Bootstrap 5.3. Tokens below drive both themes, so
   every colour pair is contrast-checked once, in one place.
   ============================================================ */

@font-face {
  font-family: "Acherus";
  src: url("../fonts/acherus_grotesque_-_regular.woff") format("woff"),
       url("../fonts/acherus_grotesque_-_regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */

html[data-bs-theme="light"],
:root {
  --paper: #fbfbf9;
  --surface: #ffffff;
  --surface-2: #f1f2ef;
  --ink: #0f1720;
  --text: #3c4753;
  --muted: #4d5865;
  --line: #e0e3de;
  --brand: #1a6a8c;
  --brand-strong: #14506c;
  --accent: #2f9fc9;
  --on-brand: #ffffff;
  --chip-bg: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 32, .06), 0 12px 32px rgba(15, 23, 32, .06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 32, .06);
  --invert-bg: #0f1720;
  --invert-fg: #f3f7f9;
  --invert-muted: #c3cdd6;
  --invert-line: rgba(255, 255, 255, .12);
}

html[data-bs-theme="dark"] {
  --paper: #0c1116;
  --surface: #141b22;
  --surface-2: #1b242c;
  --ink: #f2f6f8;
  --text: #c9d3da;
  --muted: #aab6bf;
  --line: #2a353f;
  --brand: #7cc6e8;
  --brand-strong: #a3d8f1;
  --accent: #46b3e6;
  --on-brand: #06121a;
  --chip-bg: #141b22;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --invert-bg: #18212a;
  --invert-fg: #f3f7f9;
  --invert-muted: #bcc7d0;
  --invert-line: rgba(255, 255, 255, .10);
}

/* ---------- base ---------- */

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--paper);
  color: var(--text);
  font-family: "Acherus", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  color: var(--ink);
  letter-spacing: -.02em;
  font-weight: 700;
  line-height: 1.1;
}

h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.85rem); }
h3 { font-size: clamp(1.15rem, 1.5vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--brand);
  text-underline-offset: 3px;
}

a:hover { color: var(--brand-strong); }

.lead-muted {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 62ch;
}

.section {
  padding: clamp(64px, 8vw, 110px) 0;
  scroll-margin-top: 84px;
}

.section--alt {
  background-color: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .74rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: .9rem;
}

.section-head {
  margin-bottom: 2.4rem;
}

.section-head p { margin-bottom: 0; }

/* ---------- header ---------- */

.site-header {
  background-color: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink) !important;
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: 1.05rem;
}

.navbar-brand svg {
  width: 22px;
  height: 22px;
  color: var(--brand);
}

.navbar .nav-link {
  color: var(--text);
  font-size: .94rem;
  font-weight: 500;
  padding: .5rem .85rem !important;
  border-radius: 999px;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  color: var(--ink);
  background-color: var(--surface-2);
}

.navbar .nav-link.active {
  color: var(--ink);
  background-color: var(--surface-2);
}

.navbar-toggler {
  border-color: var(--line);
}

.navbar-toggler:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}

.theme-toggle {
  border: 1px solid var(--line);
  background-color: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.theme-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent);
  outline-offset: 2px;
}

.theme-toggle .icon-sun { display: none; }
html[data-bs-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-bs-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- buttons ---------- */

.btn {
  border-radius: 999px;
  font-weight: 600;
  padding: .78rem 1.55rem;
  font-size: .98rem;
  border-width: 1px;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-color: var(--on-brand);
  --bs-btn-hover-bg: var(--brand-strong);
  --bs-btn-hover-border-color: var(--brand-strong);
  --bs-btn-hover-color: var(--on-brand);
  --bs-btn-active-bg: var(--brand-strong);
  --bs-btn-active-border-color: var(--brand-strong);
  --bs-btn-focus-shadow-rgb: 47, 159, 201;
}

.btn-outline-ink {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
  background-color: transparent;
}

.btn-outline-ink:hover,
.btn-outline-ink:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
  background-color: var(--surface-2);
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(96px, 12vw, 150px) 0 clamp(64px, 7vw, 96px);
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  margin: .4rem 0 1.1rem;
  max-width: 15ch;
}

.hero .rotator {
  display: block;
  min-height: 1.7em;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: .6rem;
}

.hero .rotator::before { content: "{ "; opacity: .6; }
.hero .rotator::after  { content: " }"; opacity: .6; }

/* typewriter caret */
#rotator-text::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -.15em;
  background-color: currentColor;
  animation: caret-blink 1s step-end infinite;
}

@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #rotator-text::after { animation: none; }
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.2rem;
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.hero-stats strong {
  display: block;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: -.02em;
}

.hero-stats span {
  font-size: .84rem;
  color: var(--muted);
}

.hero-visual {
  position: relative;
  padding: 0 0 26px 0;
}

.hero-window {
  border-radius: 18px;
  overflow: hidden;
  background-color: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-chrome {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .75rem .9rem;
  background-color: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.hero-chrome .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--ink) 22%, transparent);
}

.hero-address {
  flex: 1;
  height: 20px;
  margin-left: .6rem;
  border-radius: 999px;
  background-color: var(--surface);
  border: 1px solid var(--line);
}

.hero-body {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1.2rem;
  padding: 1.4rem;
}

.skel-nav {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.skel-main {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.skel {
  display: block;
  height: 9px;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--ink) 15%, transparent);
}

.skel-lg {
  display: block;
  height: 14px;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--ink) 24%, transparent);
  margin-bottom: .3rem;
}

.w-35 { width: 35%; } .w-40 { width: 40%; } .w-50 { width: 50%; }
.w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; }

.skel-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  margin-top: .9rem;
}

.skel-card {
  height: 62px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent);
}

.skel-card.accent {
  border-style: solid;
  border-color: transparent;
  background-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.hero-code {
  position: absolute;
  right: -14px;
  bottom: 0;
  background-color: #0b0f14;
  color: #d7e3ea;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: .85rem 1rem .9rem;
  box-shadow: var(--shadow);
  max-width: 290px;
}

.code-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .64rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #9fb0bc;
  margin-bottom: .5rem;
}

.hero-code pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.55;
  color: #dde8ee;
}

@media (max-width: 991.98px) {
  .hero-visual { padding-bottom: 0; }
  .hero-code {
    position: static;
    margin-top: 1rem;
    max-width: none;
  }
}

.shot-dot {
  width: 7px;
  height: 8px;
  border-radius: 50%;
  background-color: #3fbf8f;
  box-shadow: 0 0 0 3px rgba(63, 191, 143, .22);
  flex: 0 0 auto;
}

/* ---------- about ---------- */

.portrait {
  width: 100%;
  max-width: 340px;
  height: auto !important;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: block;
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.6rem;
}

@media (max-width: 991.98px) {
  .about-cards { grid-template-columns: 1fr; }
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.4rem;
  align-items: start;
}

@media (max-width: 767.98px) {
  .about-cards { grid-template-columns: 1fr; }
}

.flip {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;          /* the card always has a size, even if a face is empty */
  min-height: 190px;
  border: 0;
  padding: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  perspective: 1100px;
  border-radius: 16px;
}

.flip:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

.flip-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .5s ease;
}

.flip[aria-pressed="true"] .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .5rem;
  padding: 1.35rem 1.3rem;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-front {
  background-color: var(--invert-bg);
  color: var(--invert-fg);
}

.flip-back {
  background-color: var(--surface);
  border: 1px solid var(--line);
  transform: rotateY(180deg);
}

.flip-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, .08);
  color: #7cc6e8;
  font-size: .95rem;
}

.flip-face h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--invert-fg);
}

.flip-back h3 { color: var(--ink); }

.flip-face p {
  margin: 0;
  font-size: .88rem;
  color: var(--text);
}

.flip-hint {
  margin-top: auto;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}

/* ---------- disclosure ---------- */

.disclosure {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: 0;
  padding: 0;
  margin: .2rem 0 1rem;
  color: var(--brand);
  font-weight: 600;
  font-size: .95rem;
  border-bottom: 1px dashed currentColor;
}

.disclosure:hover { color: var(--brand-strong); }

.disclosure .caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .2s ease;
}

.disclosure[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* ---------- tools ---------- */

.tool-group { margin-bottom: 1.8rem; }

.tool-group h3 {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: .8rem;
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tool-chips li {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background-color: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .32rem .8rem .32rem .4rem;
  font-size: .86rem;
  color: var(--ink);
}

.tool-chips img,
.tool-chips .badge-mono {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
  display: inline-block;
}

.tool-chips .badge-mono {
  background-color: var(--surface-2);
  color: var(--brand);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- services accordion ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;      /* expanding one card must not stretch its neighbours */
}

@media (max-width: 991.98px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
  .services-grid { grid-template-columns: 1fr; }
}

.service.is-open {
  grid-column: 1 / -1;      /* an open card takes the full row, so no dead space is left beside it */
}

.service {
  align-self: start;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.service > button {
  width: 100%;
  background: none;
  border: 0;
  padding: 1rem 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  text-align: left;
  font-weight: 700;
  font-size: .98rem;
  color: var(--ink);
}

.service > button:hover { background-color: var(--surface-2); }

.service > button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: -3px;
}

.service > button .sign {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background-color: var(--surface-2);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  line-height: 1;
}

.service-body {
  display: none;
  padding: 0 1.05rem 1.1rem;
  border-top: 1px solid var(--line);
  margin-top: .2rem;
}

.service.is-open .service-body { display: block; }

.service-body ul {
  list-style: none;
  padding: 0;
  margin: .8rem 0 0;
  columns: 2;
  column-gap: 2rem;
}

@media (max-width: 767.98px) {
  .service-body ul { columns: 1; }
}

.service-body li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: .45rem;
  font-size: .9rem;
  color: var(--text);
}

.service-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
}

/* ---------- browser strip ---------- */

.browser-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.browser-strip p {
  margin: 0;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.browser-strip ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.browser-strip li {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--muted);
}

.browser-strip img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ---------- projects carousel ---------- */

.project-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 0 .5rem;
}

.project-slide img.desk {
  width: min(68%, 720px);
  height: auto;
  border-radius: 10px;
}

.project-slide.solo img.desk {
  width: min(82%, 880px);
}

.project-slide img.mob {
  width: min(20%, 190px);
  height: auto;
  border-radius: 10px;
}

@media (max-width: 767.98px) {
  .project-slide img.desk { display: none; }
  .project-slide.solo img.desk { display: block; width: 100%; }
  .project-slide.solo img.desk {
  width: min(82%, 880px);
}

.project-slide img.mob { width: min(60%, 220px); }
}

.carousel-indicators [data-bs-target] {
  background-color: var(--muted);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  opacity: .45;
}

.carousel-indicators .active { opacity: 1; }

.carousel-control-prev,
.carousel-control-next {
  width: 44px;
  height: 44px;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 1;
  color: var(--ink);
}

.carousel-control-prev { left: -6px; }
.carousel-control-next { right: -6px; }

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: invert(1) grayscale(1);
  width: 1rem;
  height: 1rem;
}

html[data-bs-theme="dark"] .carousel-control-prev-icon,
html[data-bs-theme="dark"] .carousel-control-next-icon {
  filter: invert(0) grayscale(1);
}

/* ---------- automation flow ---------- */

.flow {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2.4rem;
  position: relative;
}

.flow::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 8px;
  bottom: 28px;
  width: 2px;
  background-color: var(--line);
}

.flow li {
  position: relative;
  padding: 0 0 1.5rem 58px;
}

.flow li:last-child { padding-bottom: 0; }

.flow .num {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background-color: var(--paper);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow h4 {
  margin: .35rem 0 .25rem;
  font-size: 1rem;
}

.flow p {
  margin: 0;
  font-size: .92rem;
  color: var(--text);
}

.flow-states {
  list-style: none;
  padding: 0;
  margin: 0;
}

.flow-states li {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  margin-bottom: .9rem;
  font-size: .9rem;
  color: var(--text);
}

.chip {
  flex: 0 0 auto;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.chip-amber { background-color: #fbebd4; color: #7a4708; }
.chip-slate { background-color: #e6e9ec; color: #39434b; }
.chip-sky   { background-color: #dcecf6; color: #145570; }
.chip-red   { background-color: #fadfdb; color: #8a2b19; }

html[data-bs-theme="dark"] .chip-amber { background-color: #3d2a12; color: #f0c48a; }
html[data-bs-theme="dark"] .chip-slate { background-color: #26313a; color: #cfd8de; }
html[data-bs-theme="dark"] .chip-sky   { background-color: #123243; color: #a9d8ef; }
html[data-bs-theme="dark"] .chip-red   { background-color: #3a1814; color: #f0ad9e; }

/* ---------- clients ---------- */

.clients {
  background-color: var(--invert-bg);
  padding: clamp(44px, 5vw, 64px) 0;
}

.clients p.label {
  color: var(--invert-muted);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 1.6rem;
}

.clients ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.6rem 2.6rem;
}

.clients li {
  display: flex;
  align-items: center;
  justify-content: center;
}

.clients img {
  max-height: 42px;
  max-width: 150px;
  width: auto;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: .85;
}

.clients li.wide img { max-width: 190px; max-height: 34px; }
.clients li.tall img { max-height: 54px; max-width: 190px; }

/* ---------- contact ---------- */

.contact-card {
  background-color: var(--invert-bg);
  border-radius: 20px;
  padding: clamp(28px, 4vw, 46px);
  color: var(--paper);
}

.contact-card h3 {
  color: var(--invert-fg);
  margin-bottom: .8rem;
}

.contact-card p {
  color: var(--invert-muted);
  max-width: 46ch;
}

.contact-card .btn-primary {
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: #ffffff;
  --bs-btn-color: #0f1720;
  --bs-btn-hover-bg: #e8f4fa;
  --bs-btn-hover-border-color: #e8f4fa;
  --bs-btn-hover-color: #0f1720;
}



html[data-bs-theme="dark"] .contact-card .btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-color: #06121a;
  --bs-btn-hover-bg: #6fc9ea;
  --bs-btn-hover-border-color: #6fc9ea;
  --bs-btn-hover-color: #06121a;
}

/* ---------- footer ---------- */

.site-footer {
  background-color: var(--invert-bg);
  color: var(--invert-muted);
  padding: clamp(44px, 5vw, 64px) 0;
}

.site-footer h3 {
  color: var(--invert-fg);
}

.site-footer p {
  color: var(--invert-muted);
  max-width: 60ch;
}

.site-footer h5 {
  color: var(--invert-muted);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 2rem 0 1rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
}

.site-footer a {
  color: var(--invert-fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .92rem;
}

.site-footer a:hover { color: #ffffff; text-decoration: underline; }



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

/* only hide when JS is running — otherwise content must stay visible */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}

/* safety net: never leave content invisible for more than a moment */
.js .reveal.is-visible,
.reveal-fallback .reveal {
  opacity: 1;
  transform: none;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .flip-inner { transition: none; }
}

/* one-frame transition freeze used by the theme toggle */
.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* ---------- automation case study ---------- */

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .case-grid { grid-template-columns: 1fr; }
}

.case {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.case h3 {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: .8rem;
}

.case p { margin: 0; font-size: .93rem; }

.case ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: .93rem;
}

.case li { margin-bottom: .5rem; }
.case li:last-child { margin-bottom: 0; }

/* ---------- forward deployed engineer block ---------- */

.fde-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background-color: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.6rem;
}

.fde-copy h3 { margin-bottom: .5rem; }
.fde-copy p:last-child { margin-bottom: 0; font-size: .95rem; max-width: 72ch; }
.fde-block .btn { white-space: nowrap; }

@media (max-width: 767.98px) {
  .fde-block { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
}

/* ---------- agent architecture diagram ---------- */

.agent-diagram {
  margin: 0 0 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: var(--surface);
  padding: clamp(18px, 2.6vw, 30px);
  box-shadow: var(--shadow-sm);
}

.diagram-head h3 {
  font-size: 1.05rem;
  margin: 0 0 .35rem;
}

.diagram-head p {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 1.4rem;
}

.diagram-grid {
  display: grid;
  grid-template-columns: 168px 32px 1fr;
  gap: 1rem;
  align-items: stretch;
}

.diag-agents { justify-content: center; }

/* align the lower row with the host panel, not the page edge */
.diagram-grid.lower {
  grid-template-columns: 1fr 1fr;
  margin-top: 1rem;
  margin-left: 232px;
  align-items: stretch;
}

.diag-box.wide { height: 100%; }

.diag-col { display: flex; flex-direction: column; gap: .45rem; }

.diag-agents { align-items: stretch; }

.diag-label {
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: .2rem;
}

.diag-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  background-color: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-radius: 10px;
  padding: .6rem .7rem;
  font-size: .82rem;
  color: var(--ink);
}

.diag-box b { font-weight: 700; font-size: .84rem; }
.diag-box em { font-style: normal; font-size: .74rem; color: var(--muted); line-height: 1.35; }
.diag-box.small {
  padding: .45rem .6rem;
  font-size: .78rem;
  flex-direction: row;
  align-items: center;
  gap: .45rem;
}
.diag-box.muted { opacity: .65; }
.diag-box.tiny { padding: .5rem .6rem; }

.diag-box.purple {
  border-color: color-mix(in srgb, #7b61ff 30%, var(--line));
  background-color: color-mix(in srgb, #7b61ff 7%, var(--surface));
}

.diag-box.green {
  border-color: color-mix(in srgb, #1f9d6b 30%, var(--line));
  background-color: color-mix(in srgb, #1f9d6b 7%, var(--surface));
}

.diag-note {
  font-size: .7rem;
  color: var(--muted);
  margin-top: .2rem;
}

.diag-arrow {
  text-align: center;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  font-size: 1.1rem;
  line-height: 1;
}

.diag-host {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem;
  background-color: var(--surface-2);
}

.host-inner { display: flex; flex-direction: column; gap: .9rem; }

.diag-flow {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
  gap: .3rem;
  align-items: stretch;
}

.diag-flow .diag-box { justify-content: center; }

.diag-icon {
  display: flex;
  align-items: center;
  color: var(--brand);
  margin-bottom: .1rem;
}

.diag-controls {
  border: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 12px;
  padding: .7rem .8rem;
}

.control-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.diagram-takeaway {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  margin-top: 1.2rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  background-color: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  font-size: .86rem;
}

.diagram-takeaway b { color: var(--ink); }
.diagram-takeaway .diag-icon { color: var(--brand); margin: 0; }
.diagram-takeaway span { color: var(--text); }

@media (max-width: 991.98px) {
  .diagram-grid,
  .diagram-grid.lower {
    grid-template-columns: 1fr;
    margin-left: 0;
  }
  .diag-arrow { transform: rotate(90deg); }
  .diag-agents { flex-direction: row; flex-wrap: wrap; }
  .diag-agents .diag-label, .diag-agents .diag-note { flex-basis: 100%; }
  .diag-flow { grid-template-columns: 1fr; }
  .diag-flow .diag-arrow { transform: rotate(90deg); }
  .control-row { grid-template-columns: 1fr; }
  .diagram-takeaway { flex-direction: column; gap: .35rem; }
}

/* ============================================================
   Automation case study
   ============================================================ */

.block-title {
  font-size: 1.1rem;
  margin: 2.4rem 0 .3rem;
}

.block-sub {
  font-size: .9rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
}

/* vibe coding / engineering */
.built-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.built-card {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}

.built-card b { display: block; font-size: 1rem; color: var(--ink); margin-bottom: .2rem; }
.built-card p { margin: 0; font-size: .9rem; }

.built-icon, .callout-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--brand);
}

/* warning callout */
.callout-warn {
  display: flex;
  gap: .8rem;
  align-items: center;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  background-color: #fdece9;
  border: 1px solid #f6c9c1;
  color: #7a2a19;
  font-size: .9rem;
  margin-bottom: 1rem;
}

.callout-warn .callout-icon {
  background-color: #f9d7d0;
  color: #a3341f;
  width: 30px;
  height: 30px;
}

[data-bs-theme="dark"] .callout-warn {
  background-color: #3a1814;
  border-color: #5a2a22;
  color: #f2b3a6;
}

[data-bs-theme="dark"] .callout-warn .callout-icon {
  background-color: #4a1f19;
  color: #f0a795;
}

/* ai strip */
.ai-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.1rem;
  border: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 12px;
  font-size: .86rem;
}

.ai-strip-label {
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.ai-strip ul {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ai-strip li {
  background-color: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  padding: .16rem .6rem;
  font-size: .78rem;
  color: var(--ink);
  font-weight: 600;
}

.ai-strip-note { color: var(--muted); font-size: .78rem; }

/* pipeline */
.pipe {
  list-style: none;
  padding: 0;
  margin: 0 0 .4rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .6rem;
}

.pipe-step {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.pipe-step::after {
  content: "→";
  position: absolute;
  right: -.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: color-mix(in srgb, var(--ink) 40%, transparent);
  font-size: .9rem;
}

.pipe-step:last-child::after { content: none; }

.pipe-num {
  position: absolute;
  top: -.55rem;
  left: .8rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--brand);
  color: var(--on-brand);
  font-size: .62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pipe-icon { color: var(--brand); margin-top: .2rem; }
.pipe-step b { font-size: .84rem; color: var(--ink); line-height: 1.25; }
.pipe-step em { font-style: normal; font-size: .76rem; color: var(--muted); line-height: 1.4; }

/* edge cases */
.edge-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .6rem;
}

.edge-card {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem .9rem;
}

.edge-icon { color: var(--brand); display: inline-flex; margin-bottom: .5rem; }
.edge-card h4 { font-size: .84rem; margin: 0 0 .3rem; line-height: 1.25; }
.edge-card p { margin: 0; font-size: .76rem; color: var(--muted); line-height: 1.45; }

/* observability */
.obs-block {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1rem;
  margin-top: 2.4rem;
}

.obs-copy p { font-size: .9rem; max-width: 60ch; }

.obs-chain {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
}

.obs-chain li {
  position: relative;
  padding-top: 1rem;
  font-size: .74rem;
  line-height: 1.4;
}

.obs-chain li::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: color-mix(in srgb, var(--brand) 30%, transparent);
}

.obs-dot {
  position: absolute;
  top: -2px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--brand);
}

.obs-chain b { display: block; font-size: .78rem; color: var(--ink); margin-bottom: .15rem; }
.obs-chain em { font-style: normal; color: var(--muted); }

.obs-aside {
  background-color: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  align-self: start;
}

.obs-aside b { display: block; margin: .6rem 0 .3rem; font-size: .9rem; color: var(--ink); }
.obs-aside p { margin: 0; font-size: .82rem; color: var(--text); }

.diagram-wrap { margin-bottom: 1.2rem; }

@media (max-width: 1199.98px) {
  .pipe { grid-template-columns: repeat(3, 1fr); }
  .pipe-step::after { content: none; }
  .edge-grid { grid-template-columns: repeat(3, 1fr); }
  .obs-chain { grid-template-columns: repeat(3, 1fr); row-gap: 1rem; }
}

@media (max-width: 991.98px) {
  .built-grid, .obs-block { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .pipe, .edge-grid { grid-template-columns: 1fr; }
  .obs-chain { grid-template-columns: 1fr; row-gap: 1.1rem; }
}

/* ============================================================
   Hero data-flow panel (animated)
   ============================================================ */

.dataflow {
  position: relative;
  background-color: #0b1015;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.df-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .8rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.df-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #3fbf8f;
  box-shadow: 0 0 0 3px rgba(63, 191, 143, .2);
  animation: df-pulse 2.4s ease-in-out infinite;
}

.df-title { color: #cfdae2; font-weight: 700; }

.df-status {
  margin-left: auto;
  color: #7fd0a9;
  font-weight: 600;
  letter-spacing: .1em;
}

/* nodes */
.df-nodes {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
  position: relative;
  z-index: 2;
}

.df-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .3rem;
  padding: .55rem .35rem;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  animation: df-lit 5.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 1.1s);
}

.df-ico { color: #6fc9ea; display: flex; }
.df-node b { font-size: .74rem; color: #eef4f8; line-height: 1.25; }
.df-node em { font-style: normal; font-size: .64rem; color: rgba(255, 255, 255, .55); line-height: 1.3; }

/* rail + travelling packets */
.df-rail {
  position: relative;
  height: 2px;
  background-color: rgba(255, 255, 255, .1);
  margin: 0 .6rem 1.2rem;
  border-radius: 2px;
}

.df-packet {
  position: absolute;
  top: -3px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #46b3e6;
  box-shadow: 0 0 10px 2px rgba(70, 179, 230, .65);
  animation: df-travel 3.3s linear infinite;
  animation-delay: var(--d);
}

/* output line */
.df-out {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
  background-color: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: .55rem .7rem;
}

.df-out-label {
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.df-out code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .7rem;
  color: #cfe8f5;
}

@keyframes df-travel {
  0%   { left: 0; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}

@keyframes df-lit {
  0%, 100% { border-color: rgba(255, 255, 255, .12); background-color: rgba(255, 255, 255, .04); }
  12%      { border-color: rgba(70, 179, 230, .75); background-color: rgba(70, 179, 230, .16); }
  30%      { border-color: rgba(255, 255, 255, .12); background-color: rgba(255, 255, 255, .04); }
}

@keyframes df-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

@media (max-width: 575.98px) {
  .df-nodes { grid-template-columns: repeat(2, 1fr); }
  .df-node:last-child { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  .df-packet { display: none; }
  .df-node, .df-dot { animation: none; }
}

/* hero: illustration with data moving between devices */
.hero-scene {
  position: relative;
}

.hero-streams {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hs-dash {
  animation: hs-travel 3.4s linear infinite;
}

.hs-slow {
  animation-duration: 4.8s;
  animation-delay: .9s;
}

@keyframes hs-travel {
  from { stroke-dashoffset: 240; }
  to   { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-dash { animation: none; stroke-dasharray: 60 180; }
}

/* note beside the stage list */
.flow-note {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.flow-note h4 { margin: 0 0 .5rem; font-size: 1rem; }
.flow-note p { margin: 0; font-size: .9rem; color: var(--text); }
