:root {
  --surface: #f4f6f8;
  --surface-alt: #ebeff3;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #4b5f74;
  --line: #d5dde5;
  --brand: #0f3c78;
  --brand-soft: #d8e6f8;
  --accent: #1f7a6e;
  --success: #0f7a52;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(17, 40, 68, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(circle at 12% -10%, #d7e7ff 0%, rgba(215, 231, 255, 0) 36%),
    radial-gradient(circle at 90% 0%, #d7f2ea 0%, rgba(215, 242, 234, 0) 28%),
    var(--surface);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-family: "Spectral", Georgia, serif;
  line-height: 1.2;
  color: #0d233b;
  margin: 0 0 0.6rem;
}

h1 {
  font-size: clamp(2.1rem, 3.8vw, 3.45rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container-wide {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.section {
  padding: clamp(3.6rem, 6vw, 6rem) 0;
}

.section-tight {
  padding-top: clamp(2.8rem, 5vw, 4.2rem);
}

.section-tight-top {
  padding-top: clamp(2rem, 3.6vw, 3rem);
}

.section-tight-bottom {
  padding-bottom: clamp(2rem, 3.6vw, 3rem);
}

.problems-section.section-tight {
  padding-top: clamp(1.8rem, 3.2vw, 2.7rem);
}

.section-alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.88));
  border-top: 1px solid rgba(213, 221, 229, 0.7);
  border-bottom: 1px solid rgba(213, 221, 229, 0.7);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #2d5277;
  font-size: 0.78rem;
  margin-bottom: 0.9rem;
}

.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.24rem);
  max-width: 66ch;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(244, 246, 248, 0.82);
  border-bottom: 1px solid rgba(213, 221, 229, 0.8);
}

.nav-shell {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.04rem;
  font-weight: 800;
  color: #072744;
}

.brand .dot {
  color: #335c84;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  color: #20364e;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
}

.site-nav a.button {
  color: #ffffff;
}

.site-nav a.button:hover {
  color: #ffffff;
}

.site-nav a.nav-secondary {
  background: transparent;
  border-color: #9fb8d6;
  color: #1a4270;
}

.site-nav a.nav-secondary:hover {
  color: #143a66;
  background: #edf4ff;
}

.site-nav a.nav-secondary.active,
.site-nav a.nav-secondary:active {
  background: #3a67ad;
  border-color: #3a67ad;
  color: #ffffff;
}

.site-nav a.nav-secondary.active:hover {
  background: #355ea0;
  border-color: #355ea0;
  color: #ffffff;
}

.site-nav a.button.active {
  background: #0b2f5d;
  color: #ffffff;
}

.site-nav a.active {
  color: #072e5c;
  background: #dce8f8;
}

.menu-button {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: #1d3a59;
  cursor: pointer;
}

.hero {
  padding-top: clamp(4.2rem, 8vw, 7.3rem);
  padding-bottom: clamp(2.2rem, 4vw, 3.4rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 1.6rem;
}

.hero-header {
  margin-bottom: 1.35rem;
  text-align: left;
}

.hero-header h1 {
  max-width: none;
  margin-inline: 0;
  white-space: nowrap;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.1;
}

.hero-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.hero-aside {
  background: linear-gradient(180deg, #fff, #f5f9fc);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  align-self: start;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.45rem 0 1.15rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms ease, background-color 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: #0d3569;
  text-decoration: none;
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.menu-button:focus-visible,
.site-nav a:focus-visible {
  outline: 3px solid #8ec2ff;
  outline-offset: 2px;
}

.button-ghost {
  background: transparent;
  border-color: #9fb8d6;
  color: #1a4270;
}

.button-ghost:hover {
  background: #edf4ff;
}

.button-sm {
  padding: 0.56rem 0.95rem;
  font-size: 0.93rem;
}

.trust-points {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.trust-points li {
  position: relative;
  padding-left: 1.35rem;
  color: #1f456b;
  font-weight: 500;
  line-height: 1.45;
}

.trust-points li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.42rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f7a6e, #0f3c78);
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h1,
.section-header h2 {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.page-intro-heading {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.problems-heading {
  white-space: nowrap;
}

.problem-grid,
.service-grid,
.case-grid,
.approach-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.3vw, 1.5rem);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(17, 40, 68, 0.1);
  border-color: #c5d2df;
}

.panel p:last-child {
  margin-bottom: 0;
}

.service-outcome {
  color: #204f7d;
  font-weight: 700;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.55rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
}

.pin-risk {
  background: #fff1f1;
  border-color: #f2c6c6;
  color: #8b2f2f;
}

.pin-data {
  background: #eef5ff;
  border-color: #c8daff;
  color: #244a84;
}

.pin-control {
  background: #f3f0ff;
  border-color: #d6cdf9;
  color: #4e3f87;
}

.pin-ops {
  background: #eef9f6;
  border-color: #c3e8da;
  color: #1f6458;
}

.pin-outcome {
  background: #edf7ff;
  border-color: #c8e0f5;
  color: #24557f;
}

.model-grid {
  margin-bottom: 1rem;
}

.model-meta {
  margin-bottom: 0.95rem;
  color: #2e4d6e;
}

.case-study header p {
  margin-bottom: 1rem;
}

.flagship-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.55rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #9db8d8;
  background: #eaf2fe;
  color: #163f6b;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
}

.case-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.case-facts dt {
  font-weight: 800;
  color: #153555;
}

.case-facts dd {
  margin: 0;
}

.details-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: #103d71;
}

.details-panel summary:hover {
  color: #0b2f58;
}

.details-panel[open] summary {
  margin-bottom: 0.7rem;
}

.rich-content h2,
.rich-content h3 {
  margin-top: 0.9rem;
}

.rich-content h2 {
  font-size: clamp(1.2rem, 1.6vw, 1.55rem);
  line-height: 1.25;
}

.rich-content h3 {
  font-size: clamp(1.05rem, 1.25vw, 1.25rem);
  line-height: 1.3;
}

.rich-content ul {
  margin: 0 0 0.9rem;
  padding-left: 1.1rem;
  list-style: disc;
  list-style-position: outside;
}

.rich-content li {
  margin-bottom: 0.25rem;
}

.case-gallery {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.screenshot-panel {
  margin-top: 0.8rem;
}

.case-gallery-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fcff;
  overflow: hidden;
}

.case-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}

.case-gallery-item figcaption {
  padding: 0.55rem 0.7rem 0.65rem;
  font-size: 0.86rem;
  color: #325172;
}

.approach-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem;
}

.step span {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #163e67;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.tech-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
}

.tech-list li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  color: #264464;
  font-weight: 600;
}

.value-tech-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.principle-list {
  margin: 0;
  padding-left: 1.2rem;
  list-style: disc;
  list-style-position: outside;
  color: #28486a;
}

.principle-list li {
  margin-bottom: 0.38rem;
}

.cta-band {
  padding-top: clamp(2.2rem, 4vw, 3.4rem);
  padding-bottom: clamp(4rem, 6vw, 5rem);
}

.cta-shell {
  text-align: center;
  background: linear-gradient(135deg, #3d5f89 0%, #476d90 47%, #538183 100%);
  color: #fff;
  padding: clamp(1.7rem, 3.6vw, 2.55rem) clamp(1.1rem, 2.6vw, 1.8rem) clamp(2.25rem, 4.2vw, 3rem);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.cta-shell h2,
.cta-shell p {
  color: #fff;
}

.cta-shell h2 {
  font-size: clamp(1.35rem, 1.9vw, 1.8rem);
  line-height: 1.25;
  white-space: nowrap;
}

.cta-shell p {
  margin-bottom: 1.15rem;
}

.cta-shell .button {
  background: #fff;
  color: #0e3d71;
}

.about-grid,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.1rem;
}

.check-list {
  margin: 0;
  padding-left: 1.2rem;
}

.check-list li {
  margin-bottom: 0.3rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.submission-trust-points {
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}

.submission-trust-points li {
  position: relative;
  padding-left: 1.15rem;
  color: #2a4a6b;
  font-size: 0.92rem;
}

.submission-trust-points li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.46rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f7a6e, #0f3c78);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  gap: 0.4rem;
  color: #183551;
}

input,
textarea {
  font: inherit;
  border: 1px solid #b6c5d5;
  border-radius: 12px;
  background: #fff;
  color: #142b45;
  padding: 0.68rem 0.75rem;
}

textarea {
  resize: vertical;
}

span.field-validation-error {
  display: block;
  min-height: 1.2rem;
  color: #8f1b1b;
  font-size: 0.86rem;
}

.success-message {
  background: #e8f8f0;
  color: #0d5c3f;
  border: 1px solid #abd9c2;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.error-message {
  background: #fdeeee;
  color: #8f1b1b;
  border: 1px solid #e7b4b4;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 1.7rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), #edf2f7);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.footer-grid h2 {
  font-size: 1rem;
  margin-bottom: 0.45rem;
}

.footer-grid p,
.footer-grid a {
  font-size: 0.95rem;
}

.footer-grid span {
  display: block;
  font-size: 0.95rem;
  color: #4b5f74;
}

.footer-bottom {
  border-top: 1px solid rgba(213, 221, 229, 0.9);
  margin-top: 1rem;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: #4d6278;
  font-size: 0.9rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .hero-grid,
  .hero-lower,
  .about-grid,
  .contact-grid,
  .approach-strip,
  .footer-grid,
  .value-tech-grid {
    grid-template-columns: 1fr;
  }

  .problem-grid,
  .service-grid,
  .case-grid,
  .approach-flow,
  .field-grid,
  .case-gallery {
    grid-template-columns: 1fr;
  }

  .menu-button {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 78px;
    background: rgba(244, 246, 248, 0.98);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.2rem 1rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav.open {
    display: flex;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .hero-header h1 {
    white-space: normal;
    text-wrap: balance;
  }

  .problems-heading {
    white-space: normal;
  }

  .cta-shell h2 {
    white-space: normal;
  }
}

@media (max-width: 1120px) {
  .hero-header h1,
  .problems-heading,
  .cta-shell h2 {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---- The portfolio wheel (Pages/Portfolio.cshtml + js/portfolio-wheel.js) ----
   Without the script (no .is-live) the cards are a plain list; with it they stand around a wheel on its edge. */
.wheel { margin-top: 1.5rem; }
.wheel-card { margin: 0 0 1.25rem; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.wheel-card img { display: block; width: 100%; height: auto; user-select: none; }
.wheel-card figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1.25rem 1rem; display: flex; align-items: baseline; gap: 0.75rem;
  background: linear-gradient(180deg, rgba(15, 60, 120, 0) 0%, rgba(15, 60, 120, 0.88) 55%); color: #fff; }
.wheel-num { font: 700 0.8rem/1 "Manrope", sans-serif; letter-spacing: 0.12em; opacity: 0.8; }
.wheel-title { font: 600 clamp(1.05rem, 2.2vw, 1.45rem)/1.2 "Spectral", Georgia, serif; }
.wheel-controls, .wheel-dots { display: none; }

.wheel.is-live .wheel-stage { position: relative; height: var(--stage-h); perspective: 1700px; perspective-origin: 50% 50%; outline: none; touch-action: pan-x pinch-zoom; cursor: grab; }
.wheel.is-live .wheel-stage:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); border-radius: var(--radius); }
.wheel.is-live .wheel-ring { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.95s cubic-bezier(0.22, 0.8, 0.2, 1); }
.wheel.is-live .wheel-card { position: absolute; left: 50%; top: 50%; margin: calc(var(--card-h) / -2) 0 0 calc(var(--card-w) / -2);
  width: var(--card-w); height: var(--card-h); backface-visibility: hidden; opacity: 0.28; filter: saturate(0.4) blur(0.4px);
  transition: opacity 0.6s ease, filter 0.6s ease, box-shadow 0.6s ease; cursor: pointer; }
.wheel.is-live .wheel-card img { height: 100%; object-fit: cover; object-position: top center; }
.wheel.is-live .wheel-card.is-front { opacity: 1; filter: none; cursor: default; box-shadow: 0 30px 70px rgba(17, 40, 68, 0.22); }
.wheel.is-live .wheel-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.5rem; }
.wheel-count { margin: 0; min-width: 16ch; text-align: center; color: var(--muted); font-weight: 600; }
.wheel.is-live .wheel-dots { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.75rem; }
.wheel-dots button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 0.3rem 0.6rem; font: 700 0.75rem/1 "Manrope", sans-serif; color: var(--muted); cursor: pointer; }
.wheel-dots button[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.case-details { margin-top: 2rem; }
.case-detail { margin-bottom: 1.5rem; }
.case-detail h2 { margin: 0.35rem 0 0.5rem; }
.case-purpose { margin-bottom: 1.25rem; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1.25rem 2rem; }
.case-grid h3 { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.4rem; }
.case-grid p { margin: 0; }
.case-facts { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.case-facts li { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 0.4rem 0.85rem; font-weight: 700; font-size: 0.9rem; }
.case-meta { margin: 1rem 0 0; color: var(--muted); }
.case-caption { margin: 0.4rem 0 0; font-size: 0.85rem; font-style: italic; color: var(--muted); }

@media (max-width: 640px) {
  .wheel.is-live .wheel-stage { perspective: 1100px; }
  .wheel-count { min-width: 0; font-size: 0.85rem; }
  .wheel-count-title { display: none; }
}
.wheel-controls .button { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .wheel.is-live .wheel-ring, .wheel.is-live .wheel-card { transition: none; }
}
.case-detail[hidden] { display: none !important; }   /* a safeguard: any display rule on .panel must not override [hidden] */
.wheel-card { scroll-margin-top: 140px; }   /* a link to a card (#slug) lands on the wheel below the sticky header */
