:root {
  --ink: #132c3e;
  --ink-2: #3f5668;
  --muted: #718797;
  --paper: #fffaf5;
  --surface: #ffffff;
  --surface-blue: #fff3e6;
  --blue: rgb(255, 132, 15);
  --blue-2: #ffad57;
  --cyan: #ffd2a3;
  --orange: rgb(255, 132, 15);
  --gold: #dca84a;
  --line: rgba(255, 132, 15, 0.18);
  --shadow: 0 20px 58px rgba(120, 74, 28, 0.12);
  --radius: 8px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: #ffffff;
}

/* Keep anchored sections clear of the sticky header. The script in the page
   measures the header and scrolls precisely; this is the no-JS fallback. */
main[id],
section[id] {
  scroll-margin-top: 96px;
}
@media (max-width: 900px) {
  main[id],
  section[id] {
    scroll-margin-top: 190px;
  }
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../Background2.webp") right 120px / min(100vw, 1180px) auto no-repeat;
  opacity: 0.22;
  pointer-events: none;
}

body > * {
  position: relative;
  z-index: 1;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 82px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  text-decoration: none;
}

.brand-logo {
  width: clamp(210px, 25vw, 340px);
  height: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  color: var(--ink-2);
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--blue);
  border-color: rgba(255, 132, 15, 0.28);
  background: rgba(255, 132, 15, 0.08);
  outline: none;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}
.nav-links .lang-switch a {
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.nav-links .lang-switch a:hover,
.nav-links .lang-switch a:focus-visible {
  color: var(--blue);
  border-color: transparent;
  background: rgba(255, 132, 15, 0.08);
}
.nav-links .lang-switch a[aria-current="true"],
.nav-links .lang-switch a[aria-current="true"]:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #c85f00);
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) 24px 74px;
  display: block;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 22px;
  max-width: 520px;
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 760;
}

.lead {
  max-width: 680px;
  color: var(--ink-2);
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.68;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #c85f00);
  box-shadow: 0 14px 34px rgba(255, 132, 15, 0.24);
}

.button-secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.hero-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-height: 390px;
  border: 1px solid rgba(255, 132, 15, 0.16);
  border-radius: var(--radius);
  background: #eef7fb;
  box-shadow: var(--shadow);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.62), rgba(255,255,255,0.10) 46%, rgba(255,255,255,0.34)),
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.42));
  pointer-events: none;
}

.hero-card > img {
  width: 100%;
  height: 100%;
  min-height: 390px;
  object-fit: cover;
  filter: saturate(0.82) brightness(1.34) contrast(0.9);
}

.hero-overlay-card {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 1;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.76);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(16, 47, 65, 0.12);
}

.hero-overlay-card span {
  display: block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-overlay-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}
.stat-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}

.stat {
  min-height: 96px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.8);
}

.stat strong {
  display: block;
  color: var(--blue);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stat-link {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  transition: background 0.18s ease;
}
.stat-link:hover,
.stat-link:focus-visible {
  background: rgba(255, 132, 15, 0.10);
  outline: none;
}
.stat-logo {
  width: 38px;
  height: 38px;
  flex: none;
  object-fit: contain;
}
/* Optical correction: the 4D icon is a solid, full-bleed square and reads much
   larger than the ring-shaped AI mark at the same size. Inset the artwork while
   keeping the 38px footprint, so both frames keep their text on the same line. */
.stat-logo[src$="4d-logo.png"],
.stat-logo[src$="testing-logo.svg"] {
  padding: 5px;
}
.stat .stat-copy {
  display: block;
  min-width: 0;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
}
.stat-link strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.stat .stat-cue {
  display: block;
  margin-top: 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stat-link:hover strong {
  color: var(--blue);
}

.section {
  padding: clamp(64px, 8vw, 104px) 24px;
}

.section.alt {
  background: rgba(255, 255, 255, 0.64);
  border-block: 1px solid rgba(255, 132, 15, 0.1);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
}

.section-head {
  max-width: 760px;
  margin-bottom: 34px;
}

.section h2 {
  margin-bottom: 16px;
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.section-intro,
.section p {
  color: var(--ink-2);
}

.section-intro { font-size: 18px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  min-height: 280px;
  background: rgba(255,255,255,0.84);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 42px rgba(22, 82, 110, 0.08);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--blue-2), var(--cyan));
}

.card-number {
  width: 38px;
  height: 38px;
  margin-bottom: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
}

.card h3 {
  margin-bottom: 12px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.card p {
  color: var(--ink-2);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}

.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.feature-list li {
  display: flex;
  gap: 12px;
  padding: 18px;
  color: var(--ink-2);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(22, 82, 110, 0.06);
}

.check {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 900;
  border-radius: 50%;
}

.projects {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.project {
  min-height: 245px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 16px 42px rgba(22, 82, 110, 0.08);
}

.project img {
  width: 100%;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 24px;
}

.project span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.42;
  font-weight: 500;
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 22px;
  padding: clamp(28px, 5vw, 50px);
  border: 1px solid rgba(255, 132, 15, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,243,230,0.94));
  box-shadow: var(--shadow);
}

.contact-panel h2 { color: var(--ink); }
.contact-panel p { color: var(--ink-2); }

.contact-form {
  margin-top: 26px;
  display: grid;
  gap: 10px;
}

.contact-form label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
  resize: vertical;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(255, 132, 15, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 132, 15, 0.12);
}

.contact-form .button {
  width: fit-content;
  margin-top: 8px;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.contact-form .button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* Spam honeypot. Moved out of sight rather than display:none, because some
   bots skip hidden fields. It is aria-hidden and untabbable, so nobody
   browsing or using a screen reader ever lands on it. */
.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-status.is-ok { color: #1c7c4a; font-weight: 700; }
.form-status.is-error { color: #b4341f; font-weight: 700; }

.contact-list {
  display: grid;
  gap: 12px;
}

.contact-item {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.contact-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.contact-item a,
.contact-item strong {
  display: inline-block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 17px;
  text-decoration: none;
}

.footer {
  padding: 28px 24px 38px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 132, 15, 0.1);
  font-size: 13px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .hero,
  .split,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .cards,
  .projects {
    grid-template-columns: 1fr 1fr;
  }

  .nav {
    min-height: auto;
    padding: 16px 20px;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .cards,
  .projects,
  .stats {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 42px;
  }

  .brand-logo {
    width: min(82vw, 320px);
  }
}

/* ---------------------------------------------------------------- articles */

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.article-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 42px rgba(22, 82, 110, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.article-card:hover,
.article-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 132, 15, 0.4);
  outline: none;
}
.article-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.article-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}
.article-card .read-on {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* article body: a narrow measure keeps long technical prose readable */
.article {
  max-width: 720px;
}
.article p,
.article li {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.72;
}
.article h3 {
  margin: 36px 0 12px;
  color: var(--ink);
  font-size: 21px;
  letter-spacing: -0.015em;
}
.article ul,
.article ol {
  margin: 0 0 20px;
  padding-left: 22px;
}
.article li { margin-bottom: 9px; }
.article strong { color: var(--ink); }

.callout {
  margin: 26px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: rgba(255, 132, 15, 0.07);
}
.callout p { margin: 0; font-size: 16px; }

.article-foot {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

/* Links inside article prose: the global `a { color: inherit }` would otherwise
   leave them looking like plain underlined text. */
.article p a,
.article li a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.article p a:hover,
.article li a:hover,
.article p a:focus-visible,
.article li a:focus-visible {
  text-decoration: none;
  background: rgba(255, 132, 15, 0.10);
  outline: none;
}

/* ------------------------------------------------- phone: auto-hiding menu */
/* On phones the wrapped nav plus the logo eats a large share of the viewport.
   Scrolling down collapses the links and keeps only the logo; scrolling up
   brings them back. Tablets and desktops are deliberately left alone. */

@media (max-width: 620px) {
  /* Stop the browser compensating the scroll position when the header resizes;
     that compensation reads as a scroll and would fight the script. */
  .site-header {
    overflow-anchor: none;
  }
  .nav-links {
    overflow: hidden;
    transition: max-height 0.26s ease, opacity 0.18s ease;
  }
  .site-header.nav-collapsed .nav {
    gap: 0;
  }
  .site-header.nav-collapsed .nav-links {
    max-height: 0;
    opacity: 0;
    visibility: hidden;   /* also takes the links out of the tab order */
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-links { transition: none; }
}

/* privacy note under the contact form */
.form-privacy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.form-privacy a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

/* footer link */
.footer-inner a { text-decoration: underline; text-underline-offset: 2px; }
.footer-inner a:hover { color: var(--blue); }
