/* Arravex — corporate site. Swiss-modern, light, restrained.
   Bootstrap 5 CSS supplies grid and reboot; everything visual is defined here. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-300.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2"); }

:root {
  color-scheme: light;

  /* semantic colour tokens */
  --c-bg: #ffffff;
  --c-tint: #edf2f8;        /* pale blue */
  --c-sand: #f4efe6;        /* warm sand */
  --c-ink: #16191f;
  --c-muted: #565d6b;
  --c-line: #dfe3ea;
  --c-navy: #1f3a5f;        /* primary */
  --c-navy-deep: #152844;
  --c-blue: #3f6fb5;        /* secondary accent */
  --c-teal: #2f7a78;        /* tertiary accent */
  --c-link: #2c5a9a;        /* blue with AA contrast on white and tint */

  /* type */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* spacing scale (8px rhythm) */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-6: 3rem;
  --s-8: 4rem;
  --s-12: 6rem;

  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Bootstrap variable overrides */
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--c-ink);
  --bs-body-bg: var(--c-bg);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.65;
  --bs-link-color: var(--c-link);
  --bs-link-hover-color: var(--c-navy);
  --bs-gutter-x: 2rem;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body { font-weight: 400; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
p { margin-bottom: var(--s-2); }
h1, h2, h3 { font-weight: 500; color: var(--c-ink); }
figure { margin: 0; }
::selection { background: var(--c-navy); color: #fff; }

a { text-underline-offset: 0.25em; }
:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 3px; border-radius: 2px; }

/* Container padding equals half of the widest row gutter (g-5 = 3rem), so rows never overflow */
.container { max-width: 1160px; padding-left: 1.5rem; padding-right: 1.5rem; }

.skip-link {
  position: absolute; left: var(--s-2); top: -4rem; z-index: 1000;
  background: var(--c-navy); color: #fff; padding: 0.6rem 1rem; text-decoration: none;
}
.skip-link:focus { top: var(--s-1); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--c-line); }
.header-row { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }

.brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em;
  color: var(--c-navy); text-decoration: none;
}
.brand:hover { color: var(--c-navy); }
.brand-mark { display: block; width: 30px; height: 30px; }
.brand-small { font-size: 1.05rem; }
.brand-small .brand-mark { width: 24px; height: 24px; }

.site-nav { display: flex; gap: var(--s-4); }
.site-nav a {
  position: relative; color: var(--c-muted); text-decoration: none;
  font-size: 0.97rem; padding: 0.5rem 0;
  transition: color 0.2s var(--ease);
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.15rem; height: 2px;
  background: var(--c-blue); transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.site-nav a:hover, .site-nav a.is-active { color: var(--c-navy); }
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--c-line);
  color: var(--c-ink); font: inherit; font-size: 0.95rem;
  padding: 0.55rem 1rem; min-height: 44px; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--c-navy); }

@media (max-width: 767.98px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; gap: 0; background: #fff;
    border-bottom: 1px solid var(--c-line); padding: var(--s-1) 1.5rem;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.9rem 0; border-top: 1px solid var(--c-line); font-size: 1.05rem; }
  .site-nav a:first-child { border-top: 0; }
  .site-nav a::after { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--s-6) 0 var(--s-8);
  background-color: var(--c-tint);
  background-image: radial-gradient(circle, #c3d0e3 1px, transparent 1.3px);
  background-size: 28px 28px;
}
.hero-title {
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.07; letter-spacing: -0.025em; font-weight: 500;
  margin-bottom: var(--s-3); max-width: 14ch;
}
.hl { color: var(--c-blue); }
.hero-lead { font-size: 1.25rem; line-height: 1.55; color: var(--c-muted); max-width: 33rem; margin-bottom: var(--s-4); }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }

.hero-visual { position: relative; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-visual canvas, .scene {
  display: block; width: 100%; aspect-ratio: 1 / 1; height: auto;
  cursor: grab; touch-action: pan-y; border-radius: 4px;
}
.hero-visual canvas.is-dragging, .scene.is-dragging { cursor: grabbing; }
.hero-art { display: block; width: 100%; height: auto; }

.link-primary-arrow {
  display: inline-flex; align-items: center; gap: 0.75rem; min-height: 44px;
  color: #fff; background: var(--c-navy); font-weight: 500; text-decoration: none;
  padding: 0.55rem 1.4rem; border-radius: 2px;
  transition: background-color 0.2s var(--ease);
}
.link-primary-arrow svg { transition: transform 0.25s var(--ease); }
.link-primary-arrow:hover { color: #fff; background: var(--c-blue); }
.link-primary-arrow:hover svg { transform: translateX(4px); }
.link-quiet { color: var(--c-navy); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 1px solid transparent; }
.link-quiet:hover { color: var(--c-blue); border-bottom-color: var(--c-blue); }

/* ---------- Sections ---------- */
.section { padding: var(--s-12) 0; }
.section-sand { background: var(--c-sand); }
.section-tint { background: var(--c-tint); }
.section-intro { margin-bottom: var(--s-8); }

.eyebrow {
  display: flex; gap: 0.9rem; align-items: center;
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c-muted); margin-bottom: var(--s-3);
}
.eyebrow span { color: var(--c-teal); order: -1; font-weight: 600; }
.eyebrow::after { content: ""; width: 3rem; height: 2px; background: var(--c-blue); opacity: 0.55; order: 3; }

.section-title {
  font-size: clamp(1.8rem, 3.2vw, 2.75rem);
  line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: var(--s-3); max-width: 20ch; color: var(--c-navy);
}
.section-lead { font-size: 1.15rem; color: var(--c-muted); max-width: 36rem; }

/* ---------- Photo band ---------- */
.photo-band { height: clamp(240px, 30vw, 440px); overflow: hidden; background: var(--c-tint); }
.photo-band img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 36%; }

/* ---------- Services ---------- */
@media (min-width: 992px) {
  .services-side { position: sticky; top: calc(var(--header-h) + 24px); }
}
.stack-fig { width: 100%; max-width: 400px; height: auto; margin-top: var(--s-4); overflow: visible; }
.slab { cursor: default; }
.lift { transition: transform 0.4s var(--ease); }
.sl-top { fill: #fff; stroke: #9db0cc; stroke-width: 1.2; transition: fill 0.3s var(--ease), stroke 0.3s var(--ease); }
.sl-side { fill: #d9e3f1; stroke: #9db0cc; stroke-width: 1.2; transition: fill 0.3s var(--ease), stroke 0.3s var(--ease); }
.sl-grid { fill: none; stroke: #dbe3ee; stroke-width: 1; }
.sl-lead { stroke: #9db0cc; stroke-width: 1.2; transition: stroke 0.3s var(--ease); }
.sl-label { font-family: var(--font); font-size: 14px; fill: var(--c-muted); transition: fill 0.3s var(--ease); }
.sl-n { font-weight: 600; fill: var(--c-teal); }

.slab.is-active .lift { transform: translateY(-14px); }
.slab.is-active .sl-top { fill: #dce9fb; stroke: var(--c-blue); }
.slab.is-active .sl-side { fill: #a9c3ea; stroke: var(--c-blue); }
.slab.is-active .sl-lead { stroke: var(--c-blue); }
.slab.is-active .sl-label { fill: var(--c-navy); font-weight: 500; }

.svc-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--c-line); }
.svc {
  display: grid; grid-template-columns: 3.5rem 1fr; gap: var(--s-1) var(--s-2);
  padding: var(--s-4) 0; border-top: 1px solid var(--c-line);
}
.svc-num { font-size: 0.9rem; font-weight: 600; color: var(--c-teal); padding-top: 0.45rem; font-variant-numeric: tabular-nums; }
.svc-title { font-size: 1.4rem; letter-spacing: -0.01em; margin: 0; line-height: 1.3; transition: color 0.25s var(--ease); }
.svc-body { grid-column: 2; }
.svc-body p { max-width: 38rem; }
.svc-body p:last-child { margin-bottom: 0; }
.svc-deliver { font-size: 0.95rem; color: var(--c-muted); }
.svc-deliver span {
  display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--c-navy); margin-bottom: 0.2rem;
}
.svc.is-active .svc-title { color: var(--c-link); }

/* ---------- Approach ---------- */
.flow-art { width: 100%; height: auto; margin-bottom: var(--s-3); }
.step-num { font-size: 0.9rem; font-weight: 600; color: var(--c-teal); margin-bottom: var(--s-1); font-variant-numeric: tabular-nums; }
.step-title { font-size: 1.4rem; letter-spacing: -0.01em; margin-bottom: var(--s-1); color: var(--c-navy); }
.steps p:last-child { color: var(--c-muted); margin-bottom: 0; max-width: 20rem; }

/* ---------- Expertise ---------- */
.side-photo { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 28% center; }
.list-heading {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c-navy); margin-bottom: var(--s-2); padding-bottom: var(--s-2); border-bottom: 2px solid var(--c-blue);
}
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 0.95rem 0; border-bottom: 1px solid var(--c-line); font-size: 1.08rem; }

/* ---------- Contact ---------- */
.contact {
  color: #fff;
  background-color: var(--c-navy-deep);
  background-image: linear-gradient(rgba(21, 40, 68, 0.88), rgba(21, 40, 68, 0.88)), url("../img/city.jpg");
  background-size: cover; background-position: center 70%;
}
.contact .section-title { color: #fff; max-width: 14ch; }
.contact .eyebrow { color: rgba(255, 255, 255, 0.72); }
.contact .eyebrow span { color: #7cc4bf; }
.contact .eyebrow::after { background: #7ea4dd; }
.contact .section-lead { color: rgba(255, 255, 255, 0.82); }
.mail-link {
  display: inline-block; margin-top: var(--s-2);
  font-size: clamp(1.4rem, 3.6vw, 2.4rem); font-weight: 500; letter-spacing: -0.015em;
  color: #fff; text-decoration: none; border-bottom: 2px solid #7ea4dd;
  padding-bottom: 0.2rem; word-break: break-word;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.mail-link:hover { color: #cfe0f8; border-color: #cfe0f8; }
.contact :focus-visible { outline-color: #cfe0f8; }

/* ---------- Footer ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--c-line); padding: var(--s-4) 0; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.copyright { color: var(--c-muted); font-size: 0.92rem; }

/* ---------- Error pages ---------- */
.error-page { background: var(--c-tint); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.error-page .header-row { height: 80px; }
.error-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s-4) 0 var(--s-8); text-align: center; }
.error-code { display: flex; align-items: center; justify-content: center; gap: clamp(0rem, 1vw, 1rem); }
.error-digit {
  font-size: clamp(7rem, 24vw, 17rem); line-height: 1; font-weight: 500; letter-spacing: -0.04em;
  color: var(--c-blue); user-select: none; font-variant-numeric: lining-nums;
}
.error-scene { width: clamp(170px, 31vw, 400px); margin: 0 clamp(-2.5rem, -3vw, -0.5rem); flex: none; }
.error-title { font-size: clamp(1.6rem, 3.4vw, 2.4rem); color: var(--c-navy); margin: var(--s-2) 0 var(--s-1); letter-spacing: -0.02em; }
.error-text { color: var(--c-muted); max-width: 30rem; margin: 0 auto var(--s-4); font-size: 1.1rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: center; align-items: center; }
.error-note { margin-top: var(--s-6); font-size: 0.92rem; color: var(--c-muted); }
.error-note a { color: var(--c-link); }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 575.98px) {
  :root { --header-h: 64px; }
  .hero { padding: var(--s-4) 0 var(--s-6); }
  .section { padding: var(--s-8) 0; }
  .section-intro { margin-bottom: var(--s-6); }
  .svc { grid-template-columns: 2.5rem 1fr; }
}
