/* optero.no – see docs/marketing-site.md for the design direction. */
:root {
  --ink: #1f2b27;
  --text: #3d4a45;
  --muted: #6b7a74;
  --sage: #6f8f81;
  --sage-deep: #3f6b5b;
  --sage-soft: #a6cdb8;
  --sand: #d8c59b;
  --paper: #f7f9f8;
  --mist: #e7ede9;
  --line: #dce5e1;
  --white: #ffffff;
  --radius: 16px;
  --radius-lg: 28px;
  --gutter: max(clamp(20px, 5vw, 64px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --max: 1180px;
  --ease-out: cubic-bezier(.22, .8, .24, 1);
  --header-h: 64px;
  color-scheme: light;
  font: 100%/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-padding-top: calc(var(--header-h) + 16px); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

main {
  flex: 1;
  /* Cards waiting to slide in sit outside the viewport; never let them scroll the page sideways. */
  overflow-x: hidden;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 4px;
  border-radius: 8px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
}
.skip:focus { top: 12px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  /* background: rgba(247, 249, 248, .72); */
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}

.site-header.is-scrolled { border-bottom-color: rgba(31, 43, 39, .08); }

.site-header .wrap {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 620;
  letter-spacing: -.03em;
}

.brand img { width: 32px; height: 32px; border-radius: 8px; }

.nav { display: flex; align-items: center; gap: 6px; }

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.nav .nav-login {
  margin-left: 4px;
  padding: 0 16px;
  background: var(--mist);
  color: var(--ink);
}
.nav .nav-login:hover { background: #dbe4df; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 560;
  white-space: nowrap;
  transition: background-color .2s ease, transform .1s ease-out;
}

.btn:active { transform: scale(.97); }

.btn-primary { background: var(--sage-deep); color: var(--white); }
.btn-primary:hover { background: #335a4c; }

.btn-quiet { color: var(--sage-deep); padding-inline: 8px; }
.btn-quiet:hover { color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

/* ---------- Type ---------- */

h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }

.display {
  font-size: clamp(48px, 8.4vw, 112px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.045em;
}

.headline {
  font-size: clamp(34px, 5.2vw, 64px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.035em;
}

.lede {
  max-width: 34em;
  margin: 24px 0 0;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  letter-spacing: -.01em;
  text-wrap: pretty;
}

.center { text-align: center; }

.link { color: var(--sage-deep); text-decoration: underline; text-underline-offset: 3px; }
.center .lede,
.lede.center { margin-inline: auto; }

.section { padding-block: clamp(56px, 8vw, 112px); }

/* ---------- Home: hero ---------- */

/* The woven logo sits dimmed behind the words, so the hero is one calm picture rather than two columns. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: min(72svh, 720px);
  padding-block: clamp(56px, 9vw, 120px) clamp(24px, 4vw, 48px);
  text-align: center;
}

.hero-bg {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(160vw, 1100px);
  aspect-ratio: 1;
  margin-top: calc(min(160vw, 1100px) / -2);
  transform: translate3d(-50%, 0, 0);
  transform-origin: 50% 50%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent 72%);
  mask-image: radial-gradient(closest-side, #000 40%, transparent 72%);
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 79% 48%;
  opacity: .2;
  transform: scale(1.3);
}

.hero-copy { position: relative; }
.hero-copy .lede { margin-inline: auto; max-width: 30em; }
.hero .actions { justify-content: center; margin-top: 36px; }

/* The one orchestrated moment on load: the logo surfaces behind the words as they arrive. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .9s var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; }
  .hero-copy > :nth-child(3) { animation-delay: .16s; }
  .hero-bg img { animation: surface 2s var(--ease-out) both; }
}

@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } }
@keyframes surface { from { opacity: 0; transform: scale(1.2); } }

/* ---------- Home: the thread from first inquiry to invoice ---------- */

.journey {
  position: relative;
  padding-top: clamp(80px, 10vw, 128px);
}

/* Without JS: a short drop from the hero and a straight line through the steps. */
.journey-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: clamp(56px, 7vw, 96px);
  margin-left: -1px;
  background: linear-gradient(transparent, var(--sage));
}

.has-thread .journey-line,
.has-thread .flow::before { display: none; }

.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sage-deep), var(--sage) 55%, var(--sand));
}

.flow li { position: relative; padding-top: 36px; }

.flow-knot {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--sage);
  transition: border-color .5s ease, background-color .5s ease;
}

.has-thread .flow-knot { border-color: var(--line); }
.has-thread .flow li.is-reached .flow-knot { border-color: var(--sage-deep); background: var(--white); }
.has-thread .flow li.is-reached:last-child .flow-knot { border-color: var(--sand); }

.flow p { margin: 8px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; text-wrap: pretty; }

/* ---------- Home: the areas along a wandering thread, and the agents ---------- */

.journey-head { padding-top: clamp(56px, 8vw, 96px); }
.journey-head + .journey { padding-top: clamp(56px, 7vw, 88px); }
.flow h3 { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }

.flow.areas { grid-template-columns: 1fr; gap: 40px; max-width: 920px; margin-inline: auto; }
.flow.areas::before { top: 8px; bottom: 8px; left: 7px; right: auto; width: 2px; height: auto; background: linear-gradient(var(--sage-deep), var(--sage) 55%, var(--sand)); }
.flow.areas li { padding: 0 0 0 48px; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 8px 32px; align-items: baseline; }
.flow.areas h3 { line-height: 16px; }
.flow.areas p { margin: 0; font-size: 17px; }

.agents-lede { max-width: 34em; }

.tasks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
  margin: clamp(40px, 6vw, 64px) auto 0;
  padding: 0;
  list-style: none;
}
.tasks li {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
}
.tasks h3 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.tasks p { margin: 8px 0 0; font-size: 16px; line-height: 1.55; }

/* ---------- FAQ ---------- */

.faq { max-width: 760px; margin: 0 auto; padding-bottom: clamp(56px, 8vw, 96px); }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }

.faq summary {
  position: relative;
  display: block;
  padding: 22px 44px 22px 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.015em;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--sage-deep);
  border-bottom: 2px solid var(--sage-deep);
  transform: rotate(45deg);
  transition: transform .2s var(--ease-out);
}

.faq details[open] summary::after { transform: translate3d(0, 4px, 0) rotate(-135deg); }

.faq summary:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 4px; border-radius: 8px; }

.faq details > p { margin: 0 0 22px; max-width: 38em; font-size: 17px; line-height: 1.6; text-wrap: pretty; }

/* ---------- Pilot ---------- */

.pilot {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: clamp(32px, 6vw, 80px);
  border-radius: var(--radius-lg);
  background: var(--mist);
}

.pilot .lede { font-size: 18px; }

.pilot ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.pilot li {
  position: relative;
  padding-left: 30px;
  color: var(--text);
  font-size: 17px;
}

.pilot li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .5em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--sage);
}

.pilot li strong { display: block; color: var(--ink); font-weight: 600; }

.pilot .actions { margin-top: 32px; }

/* ---------- Features: thread ---------- */

.features-hero { padding-block: clamp(56px, 10vw, 128px) clamp(24px, 4vw, 48px); }

.thread {
  --progress: 1;
  --gap: clamp(56px, 9vw, 128px);
  --module-pad: clamp(28px, 5vw, 56px);
  --card-pad: clamp(28px, 3.4vw, 44px);
  position: relative;
  padding-block: 24px clamp(48px, 8vw, 96px);
}

/* Without JS: a straight line down the middle. With JS it is replaced by the woven SVG thread. */
.thread-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: var(--line);
}

.thread-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(var(--sage-deep), var(--sage) 55%, var(--sand));
  transform-origin: top;
  transform: scaleY(var(--progress));
}

.thread-svg { display: none; }

.has-thread .thread-line { display: none; }

.has-thread .thread-svg {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.thread-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.thread-track { stroke: var(--line); stroke-width: 2; }
.thread-band { stroke: url(#thread-gradient); stroke-width: 12; opacity: .16; }
.thread-ribbon { stroke: url(#thread-gradient); stroke-width: 3; }

.module {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--gap);
  padding-block: var(--module-pad);
}

.module-card {
  grid-column: 1;
  grid-row: 1;
  padding: var(--card-pad);
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(31, 43, 39, .04), 0 16px 40px -30px rgba(31, 43, 39, .28);
}


.module:nth-of-type(even) .module-card { grid-column: 2; }

/* Stagger the alternating cards so the thread reads as one continuous weave. */
.module + .module { margin-top: calc(-1 * clamp(64px, 11vw, 150px)); }

/* Where the thread passes through a card: on its inner edge, level with the heading. */
.module-knot {
  position: absolute;
  z-index: 1;
  top: calc(var(--module-pad) + var(--card-pad) + 10px);
  left: calc(50% - var(--gap) / 2);
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line);
  transition: border-color .5s ease, background-color .5s ease;
}

.module:nth-of-type(even) .module-knot { left: calc(50% + var(--gap) / 2); }

.module.is-reached .module-knot { border-color: var(--sage-deep); background: var(--white); }
.module.is-last.is-reached .module-knot { border-color: var(--sand); }

.module h2 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; line-height: 1.12; letter-spacing: -.03em; }

.module-card > p { margin: 12px 0 0; font-size: 18px; line-height: 1.5; color: var(--text); text-wrap: pretty; }

.module ul {
  margin: 22px 0 0;
  padding: 20px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.module li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.module li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .72em;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--sage);
}

/* Entrance: only when JS is running and motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .js .module-card {
    opacity: 0;
    transform: translate3d(-56px, 0, 0);
    transition: opacity .8s var(--ease-out), transform 1s var(--ease-out);
  }
  .js .module:nth-of-type(even) .module-card { transform: translate3d(56px, 0, 0); }
  .js .module.is-visible .module-card { opacity: 1; transform: none; }

  /* Front page: each step appears as the thread reaches it. */
  .has-thread .flow li > :not(.flow-knot) { opacity: 0; transform: translate3d(0, 10px, 0); transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); }
  .has-thread .flow li.is-reached > :not(.flow-knot) { opacity: 1; transform: none; }
}

.closing { padding-bottom: clamp(72px, 10vw, 128px); }

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

.site-footer {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 88px;
  padding-block: 16px;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 40px; height: 40px; }
.footer-links { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-links a:hover { color: var(--ink); }

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

@media (max-width: 860px) {
  .hero { min-height: 0; padding-block: 72px 16px; }

  .journey { padding-top: 72px; }
  .flow { grid-template-columns: 1fr; gap: 28px; }
  .flow::before {
    top: 8px;
    bottom: 8px;
    left: 7px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(var(--sage-deep), var(--sage) 55%, var(--sand));
  }
  .flow li { padding: 0 0 0 40px; }
  .flow h3 { line-height: 16px; }
  .tasks { grid-template-columns: 1fr; }
  .flow.areas { gap: 28px; }
  .flow.areas li { padding-left: 40px; grid-template-columns: 1fr; }
  .flow.areas p { margin-top: 4px; font-size: 16px; }

  .pilot { grid-template-columns: 1fr; }

  .thread { --module-pad: 20px; }
  .thread-line { left: 6.5px; margin-left: 0; }
  .module { grid-template-columns: minmax(0, 1fr); padding-left: 36px; }
  .module + .module { margin-top: 0; }
  .module-card,
  .module:nth-of-type(even) .module-card { grid-column: 1; grid-row: 1; }
  .module-knot,
  .module:nth-of-type(even) .module-knot { top: calc(var(--module-pad) + var(--card-pad) + 10px); left: 0; margin-left: 0; }
}

@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  .js .module-card { transform: translate3d(-24px, 0, 0); }
  .js .module:nth-of-type(even) .module-card { transform: translate3d(24px, 0, 0); }
  .js .module.is-visible .module-card { transform: none; }
}

@media (max-width: 400px) {
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 480px) {
  .nav { gap: 2px; }
  .nav a { padding: 0 9px; font-size: 14px; }
  .nav .nav-login { padding: 0 14px; }
  .brand { font-size: 19px; }
  .brand img { width: 28px; height: 28px; }
  .actions .btn-primary { width: 100%; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
