/* RAE Industries, raeai.ai, v6
   Type: Schibsted Grotesk (display and interface), Newsreader (reading text). SIL OFL, self-hosted.
   Palette: exam sheet, carbon, cobalt, slate, cobalt wash. The hero drawing keeps its v5 rules unchanged. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-v7.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-roman-v26.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --sheet: #f5f6f3;
  --carbon: #0f1012;
  --cobalt: #2338e8;
  --cobalt-deep: #1a29b8;
  --slate: #626265;
  --wash: #e6e9fb;
  --rule: #cfd2d6;
  --graphite: #34363a;

  --sans: "Schibsted Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --gutter: clamp(20px, 4.5vw, 64px);
  --gap: clamp(16px, 2.2vw, 32px);
  --maxw: 1440px;
  --header-h: 72px;
  --section-y: clamp(80px, 10vw, 160px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Base ------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html.menu-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--sheet);
  color: var(--carbon);
  font: 400 19px/1.62 var(--serif);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }
strong { font-weight: 500; }

::selection { background: var(--cobalt); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--carbon);
  color: #fff;
  font: 500 16px/1 var(--sans);
  text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* Type scale (1.25 steps from 19px reading text) ------------------------- */

.display,
.h2,
.h3,
.lead-in {
  font-family: var(--sans);
  color: var(--carbon);
  text-wrap: balance;
}
.display {
  font-weight: 700;
  font-size: clamp(44px, 7.4vw, 112px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  max-width: 13ch;
}
.h2 {
  font-weight: 700;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.h3 {
  font-weight: 600;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.008em;
}
.lead-in {
  font-weight: 500;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.prose { max-width: 36em; }
.prose p + p { margin-top: 0.9em; }
.muted { color: var(--slate); }

/* Links and buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 26px;
  background: var(--cobalt);
  color: #fff;
  font: 600 17px/1 var(--sans);
  text-decoration: none;
  transition: background-color 0.2s var(--ease);
}
.btn:hover { background: var(--cobalt-deep); }

.text-link {
  font-family: var(--sans);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}
.text-link:hover { color: var(--cobalt); text-decoration-color: currentColor; }

/* Header ----------------------------------------------------------------- */

.header-sentinel { position: absolute; top: 0; height: 1px; width: 1px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--sheet);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}
.brand__mark {
  font: 500 26px/1 var(--serif);
  letter-spacing: -0.02em;
}
.brand__dot { color: var(--cobalt); }
.brand__sub {
  font: 500 15px/1 var(--sans);
  color: var(--slate);
}
.nav__list { display: flex; gap: 28px; }
.nav__link {
  font: 500 16px/1 var(--sans);
  text-decoration: none;
  padding-block: 8px;
  border-bottom: 1px solid transparent;
}
.nav__link:hover { color: var(--cobalt); }
.nav__link[aria-current="page"] { border-bottom-color: var(--carbon); }
.site-header__cta { min-height: 44px; padding: 0 20px; font-size: 16px; }

.menu-btn {
  display: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--carbon);
  border-radius: 22px;
  background: transparent;
  color: var(--carbon);
  font: 500 16px/1 var(--sans);
  cursor: pointer;
}
.menu {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--sheet);
  overflow-y: auto;
}
.menu.is-open { display: block; }
.menu__list { padding-top: 24px; }
.menu__list a {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  font: 600 28px/1.1 var(--sans);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.menu__foot { margin-top: 28px; font: 500 18px/1.4 var(--sans); }

/* Hero ------------------------------------------------------------------- */

.hero { padding-top: clamp(40px, 6vw, 96px); }
.hero__sig {
  margin-top: clamp(40px, 5vw, 72px);
}
.hero__cap {
  margin-top: 16px;
  font: 400 16px/1.4 var(--sans);
  color: var(--slate);
}
.hero__lower {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 32px;
  margin-top: clamp(48px, 6vw, 88px);
  padding-bottom: var(--section-y);
  border-bottom: 1px solid var(--rule);
}
.hero__who { grid-column: 1 / span 5; }
.hero__copy { grid-column: 4 / span 6; text-align: center; }
.hero__copy .prose { margin-inline: auto; }
.hero__copy .actions { justify-content: center; }
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 32px;
}

/* Landing hero (dental, medical): type only */
.hero--landing .display { max-width: 11ch; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 400 16px/1.4 var(--sans); color: var(--slate); }
.crumbs li + li::before { content: "/"; margin-right: 10px; }
.crumbs a { text-underline-offset: 4px; }
.crumbs a:hover { color: var(--cobalt); }
.crumbs + .display { margin-top: 28px; }

/* Fig. 01: the signal drawing. Rules copied unchanged from v5. ----------- */

.flow { width: 100%; height: auto; overflow: visible; }
.flow path, .flow rect { fill: none; }
.f-tangle { stroke: var(--carbon); stroke-width: 1; opacity: 0.5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.f-order { stroke: var(--carbon); stroke-width: 1.15; stroke-dasharray: 1; stroke-dashoffset: 0; }
.f-pulse { stroke: var(--cobalt); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.06 2; stroke-dashoffset: -0.3; }
.flow .gate-wall { fill: url(#hatch); stroke: var(--carbon); stroke-width: 1; }
.hatch-line { stroke: var(--carbon); stroke-width: 0.8; opacity: 0.55; }
.gate-tick { stroke: var(--cobalt); stroke-width: 1.5; }
.flow__dims path { stroke: var(--slate); stroke-width: 1; opacity: 0.6; }

@media (prefers-reduced-motion: no-preference) {
  .f-tangle { animation: draw 2.4s var(--ease-in-out) 0.4s both; }
  .f-tangle:nth-of-type(2) { animation-delay: 0.48s; }
  .f-tangle:nth-of-type(3) { animation-delay: 0.56s; }
  .f-tangle:nth-of-type(4) { animation-delay: 0.64s; }
  .f-tangle:nth-of-type(5) { animation-delay: 0.72s; }
  .f-tangle:nth-of-type(6) { animation-delay: 0.8s; }
  .f-tangle:nth-of-type(7) { animation-delay: 0.88s; }
  .f-tangle:nth-of-type(8) { animation-delay: 0.96s; }
  .f-tangle:nth-of-type(9) { animation-delay: 1.04s; }
  .flow__gate { animation: fade 0.8s var(--ease) 1.2s both; }
  .f-order { animation: draw 1.3s var(--ease) 1.9s both; }
  .flow__dims { animation: fade 1s var(--ease) 2.6s both; }

  .f-pulse { animation: pulse 5.4s linear 3s infinite; }
  .f-pulse:nth-of-type(2) { animation-duration: 6.6s; animation-delay: 3.9s; }
  .f-pulse:nth-of-type(3) { animation-duration: 4.8s; animation-delay: 3.4s; }
  .f-pulse:nth-of-type(4) { animation-duration: 7.2s; animation-delay: 4.6s; }
  .f-pulse:nth-of-type(5) { animation-duration: 5.9s; animation-delay: 3.2s; }
}
@media (prefers-reduced-motion: reduce) {
  .f-pulse { stroke-dashoffset: -0.6; }
}
@media (max-width: 719px) {
  .f-tangle { stroke-width: 1.6; }
  .f-order { stroke-width: 1.7; }
  .f-pulse { stroke-width: 4.5; }
  .flow .gate-wall { stroke-width: 1.6; }
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pulse { from { stroke-dashoffset: 0.07; } to { stroke-dashoffset: -1.02; } }

/* Sections --------------------------------------------------------------- */

.band { padding-block: var(--section-y); }
.band + .band { border-top: 1px solid var(--rule); }
.band--wash { background: var(--wash); }
.band--wash + .band { border-top: 0; }

.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 40px;
}
.split__head { grid-column: 1 / span 5; }
.split__main { grid-column: 7 / span 6; }
.split__head .prose { margin-top: 24px; }

/* Task list: what we automate (not a sequence, so no numbers) */
.tasks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gap);
  margin-top: clamp(48px, 5vw, 72px);
  border-top: 1px solid var(--carbon);
}
.tasks > div {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--rule);
}
.tasks dt { font: 600 20px/1.25 var(--sans); letter-spacing: -0.008em; }
.tasks dd { margin-top: 8px; color: var(--graphite); max-width: 32em; }

.routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 16px;
  margin-top: clamp(48px, 5vw, 72px);
}
.route {
  display: block;
  padding: 28px 0 0;
  border-top: 3px solid var(--carbon);
  text-decoration: none;
}
.route__title {
  display: block;
  font: 700 clamp(26px, 2.6vw, 36px)/1.1 var(--sans);
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}
.route:hover .route__title { color: var(--cobalt); text-decoration-color: currentColor; }
.route__line { display: block; margin-top: 12px; color: var(--graphite); max-width: 30em; }
.note { margin-top: 40px; color: var(--graphite); max-width: 40em; }

/* Services: plain rows */
.rows { border-top: 1px solid var(--carbon); }
.rows > li {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: var(--gap);
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--rule);
}
.rows p { color: var(--graphite); }

/* Steps: a real sequence, so these are numbered */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 40px;
  margin-top: clamp(48px, 5vw, 72px);
  counter-reset: step;
}
.step { counter-increment: step; padding-top: 20px; border-top: 1px solid var(--carbon); }
.step::before {
  content: counter(step);
  display: block;
  font: 700 clamp(40px, 4vw, 60px)/1 var(--sans);
  letter-spacing: -0.04em;
  color: var(--cobalt);
}
.step .h3 { margin-top: 20px; }
.step p { margin-top: 10px; color: var(--graphite); }

/* Checks list */
.checks { border-top: 1px solid var(--carbon); }
.checks--after { margin-top: 32px; }
.checks li {
  position: relative;
  padding: 16px 0 16px 34px;
  border-bottom: 1px solid var(--rule);
}
.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 25px;
  width: 14px;
  height: 7px;
  border-left: 2px solid var(--cobalt);
  border-bottom: 2px solid var(--cobalt);
  transform: rotate(-45deg);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 40px;
  margin-top: 28px;
  font: 500 17px/1.4 var(--sans);
}
.facts dt { display: inline; color: var(--slate); font-weight: 400; }
.facts dd { display: inline; margin-left: 6px; }

/* Questions: native disclosure, opened by the reader */
.qa { border-top: 1px solid var(--carbon); }
.qa details { border-bottom: 1px solid var(--rule); }
.qa summary {
  position: relative;
  display: block;
  padding: 22px 48px 22px 0;
  font: 600 20px/1.3 var(--sans);
  letter-spacing: -0.008em;
  cursor: pointer;
  list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before,
.qa summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 16px;
  height: 2px;
  background: var(--carbon);
  transition: transform 0.25s var(--ease);
}
.qa summary::after { transform: rotate(90deg); }
.qa details[open] summary::after { transform: rotate(0deg); }
.qa summary:hover { color: var(--cobalt); }
.qa .answer { padding: 0 48px 28px 0; color: var(--graphite); max-width: 40em; }

/* Contact ---------------------------------------------------------------- */

.contact {
  padding-block: var(--section-y);
  background: var(--cobalt);
  color: #fff;
}
.contact .h2 { color: #fff; max-width: 20ch; }
.contact__sub { margin-top: 24px; max-width: 34em; color: #e3e6ff; }
.mail {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 28px;
  margin-top: clamp(40px, 5vw, 72px);
}
.mail__link {
  font: 700 clamp(34px, 6vw, 88px)/1 var(--sans);
  letter-spacing: -0.035em;
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 10px;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.2s var(--ease);
}
.mail__link:hover { text-decoration-color: #fff; }
.mail__tools { display: flex; align-items: center; gap: 14px; }
.copy-btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #fff;
  border-radius: 22px;
  background: transparent;
  color: #fff;
  font: 500 16px/1 var(--sans);
  cursor: pointer;
}
.copy-btn:hover { background: #fff; color: var(--cobalt); }
.copy-btn[hidden] { display: none; }
.copy-status { font: 400 16px/1 var(--sans); }
.contact :focus-visible { outline-color: #fff; }
.related { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 48px; }
.related .text-link { text-decoration-color: rgba(255, 255, 255, 0.4); }
.related .text-link:hover { color: #fff; text-decoration-color: #fff; }

/* Footer ----------------------------------------------------------------- */

.site-footer { padding-block: 40px 48px; }
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px 32px;
  font: 400 16px/1.4 var(--sans);
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.site-footer__links a { text-underline-offset: 4px; }
.site-footer__links a:hover { color: var(--cobalt); }
.site-footer__copy { color: var(--slate); }

/* Legal and 404 ---------------------------------------------------------- */

.doc { padding-block: clamp(48px, 7vw, 112px) var(--section-y); }
.doc__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.doc__aside { grid-column: 1 / span 3; }
.doc__main { grid-column: 4 / span 8; }
.doc__nav { display: grid; gap: 10px; font: 500 17px/1.3 var(--sans); position: sticky; top: calc(var(--header-h) + 24px); }
.doc__nav a { text-decoration: none; color: var(--slate); }
.doc__nav a:hover { color: var(--cobalt); }
.doc__nav a[aria-current="page"] { color: var(--carbon); text-decoration: underline; text-underline-offset: 5px; }
.doc__updated { margin-top: 16px; font: 400 16px/1.4 var(--sans); color: var(--slate); }
.doc__body { margin-top: 48px; max-width: 38em; }
.doc__body h2 {
  margin-top: 44px;
  font: 600 22px/1.25 var(--sans);
  letter-spacing: -0.01em;
}
.doc__body h2 + p { margin-top: 10px; }
.doc__body p + p { margin-top: 14px; }
.doc__body a { text-underline-offset: 4px; }
.doc__back { margin-top: 56px; font-family: var(--sans); }
.doc--404 .doc__main { grid-column: 1 / span 10; }
.doc--404 .doc__back { margin-top: 40px; }

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1099px) {
  .split__head, .split__main { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  :root { --header-h: 64px; }
  .nav, .site-header__cta { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
  .hero__who, .hero__copy { grid-column: 1 / -1; }
  .rows > li { grid-template-columns: 1fr; row-gap: 10px; }
  .doc__aside { display: none; }
  .doc__main { grid-column: 1 / -1; }
}
@media (max-width: 719px) {
  body { font-size: 18px; }
  .tasks, .routes, .steps { grid-template-columns: 1fr; }
  .hero__sig { margin-inline: calc(-1 * var(--gutter)); }
  .hero__cap { margin-inline: var(--gutter); }
  .btn { width: 100%; justify-content: center; }
}
@media (min-width: 900px) {
  .menu, .menu.is-open { display: none; }
}
