/* Back office ERP – product website
   Palette: office materials. Highlighter yellow only marks what OCR found. */
:root {
  --ink: #1d2b4f;
  --ink-soft: #3c4a6e;
  --paper: #f6f7f9;
  --sheet: #ffffff;
  --text: #2b3240;
  --muted: #5d6677;
  --rule: #d3d8e0;
  --highlight: #f2d64b;
  --approve: #2e7356;
  --approve-bg: #e3f1ea;
  --next-bg: #fbf1c4;
  --next-text: #6b5600;
  --planned-bg: #e8ebf1;

  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
}

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 8px;
  background: var(--sheet);
  padding: 8px 12px;
  z-index: 10;
}

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

h2 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 650;
}

/* ---- header ---------------------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  flex-wrap: wrap;
}

.site-header nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
}

.site-header nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-header .login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px 0 20px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 6px 14px -10px rgb(29 43 79 / 45%);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.site-header .login .arrow {
  transition: transform 0.15s ease;
}

/* shown by the web server once the app's address is configured (VINKLY_APP_URL) */
.site-header .login[hidden] {
  display: none;
}

.site-header .login:hover {
  background: var(--next-bg);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px -10px rgb(29 43 79 / 50%);
}

.site-header .login:hover .arrow {
  transform: translateX(3px);
}

.site-header .login:active {
  transform: translateY(0);
}

.site-header .login:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .site-header .login,
  .site-header .login .arrow {
    transition: none;
  }
}

/* ---- sections ---------------------------------------------------------------------------- */
main > section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) var(--gutter);
}

main > section + section {
  border-top: 1px solid var(--rule);
}

.section-intro {
  max-width: 62ch;
  color: var(--muted);
  margin: 16px 0 0;
}

/* ---- hero -------------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(42px, 6.4vw, 84px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 12ch;
}

.lede {
  font-size: clamp(18px, 1.6vw, 20px);
  max-width: 46ch;
  margin: 28px 0 0;
}

.hero-facts {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 8px;
}

.hero-facts li {
  padding-left: 22px;
  position: relative;
  color: var(--ink-soft);
  font-weight: 500;
}

.hero-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--approve);
}

/* the scan: paper on the left, record on the right, overlapping */
.scan {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.scan figcaption {
  grid-column: 1 / -1;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.paper {
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgb(29 43 79 / 35%);
  padding: 22px 20px;
  font: 400 11.5px/1.5 var(--mono);
  color: #3a3f4a;
  transform: rotate(-1.2deg);
  position: relative;
  z-index: 1;
}

.paper-head {
  display: grid;
  justify-items: start;
}

.paper-head strong {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}

.paper-title {
  margin: 16px 0 6px;
  font: 700 18px/1 var(--sans);
  color: var(--ink);
}

.paper-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 12px;
  margin: 0 0 12px;
}

.paper-meta dd {
  margin: 0;
}

.paper-lines {
  width: 100%;
  border-collapse: collapse;
}

.paper-lines td {
  padding: 3px 0;
  border-bottom: 1px dotted var(--rule);
}

.paper-lines td + td {
  text-align: right;
}

.paper-lines .total td {
  font-weight: 500;
  border-bottom: 0;
  color: var(--ink);
}

.paper-ogm {
  margin: 12px 0 0;
}

/* OCR highlights: drawn like a highlighter stroke */
.mark {
  background: linear-gradient(var(--highlight), var(--highlight)) no-repeat 0 60% / 100% 70%;
  padding: 0 2px;
  margin: 0 -2px;
}

.record {
  background: var(--ink);
  color: #e9edf6;
  padding: 22px 22px 18px;
  margin: 64px 0 0 -12px;
  position: relative;
  z-index: 2;
  border-radius: 6px;
  box-shadow: 0 24px 48px -28px rgb(29 43 79 / 60%);
}

.record-title {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  margin-bottom: 12px;
}

.record dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0;
  font-size: 13.5px;
}

.record dt {
  color: #a9b3cc;
}

.record dd {
  margin: 0;
  font-weight: 500;
  color: #fff;
  min-height: 1.5em;
}

.bank-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2px 10px;
  margin-top: 16px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  border-radius: 4px;
  font-size: 12.5px;
}

.bank-line .mono {
  grid-column: 1 / -1;
  grid-row: 2;
  font-family: var(--mono);
  font-size: 12px;
}

.bank-line .amount {
  font-weight: 600;
  color: var(--ink);
}

.matched {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #9fe0bf;
  display: flex;
  align-items: center;
  gap: 8px;
}

.matched::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--approve);
  flex: none;
}

/* One orchestrated sequence on load: marks are drawn, fields fill, payment matches. */
@media (prefers-reduced-motion: no-preference) {
  .mark {
    animation: draw 0.45s ease-out both;
  }

  .fill {
    animation: fill 0.35s ease-out both;
  }

  .bank-line {
    animation: slide 0.5s ease-out 4.1s both;
  }

  .matched {
    animation: appear 0.4s ease-out 4.7s both;
  }

  .m1 { animation-delay: 0.6s; }
  .m2 { animation-delay: 1s; }
  .m3 { animation-delay: 1.4s; }
  .m4 { animation-delay: 1.8s; }
  .m5 { animation-delay: 2.1s; }
  .m6 { animation-delay: 2.4s; }
  .m7 { animation-delay: 2.8s; }

  .f1 { animation-delay: 0.9s; }
  .f2 { animation-delay: 1.3s; }
  .f3 { animation-delay: 1.7s; }
  .f4 { animation-delay: 2.1s; }
  .f5 { animation-delay: 2.4s; }
  .f6 { animation-delay: 2.7s; }
  .f7 { animation-delay: 3.3s; }
}

/* The hero copy rises in on load; later sections ease in as they scroll into view (see the script in index.html). */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero-copy > :nth-child(2) { animation-delay: 0.12s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.24s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.36s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.48s; }

  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.6s ease var(--reveal-delay, 0s),
      transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0s);
  }

  .reveal.in {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes draw {
  from { background-size: 0% 70%; }
  to { background-size: 100% 70%; }
}

@keyframes fill {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- journey: a real sequence, so it is numbered ---------------------------------------- */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 48px 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.steps li {
  counter-increment: step;
  padding: 0 20px 0 0;
  position: relative;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

/* the line connecting the steps */
.steps li::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 40px;
  right: 0;
  border-top: 2px solid var(--rule);
}

.steps li:last-child::after {
  display: none;
}

.steps p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 15.5px;
}

/* ---- modules ------------------------------------------------------------------------------ */
.modules-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 48px;
  align-items: end;
}

.modules-head h2,
.modules-head .section-intro {
  grid-column: 1;
}

.legend {
  grid-column: 2;
  grid-row: 1 / span 2;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.legend .status {
  margin-right: 8px;
}

.module-groups {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 64px;
}

.group h3 {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.group li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 2px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 15.5px;
}

.group li strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 16.5px;
}

.group li .status {
  grid-row: span 2;
  align-self: start;
  margin-top: 3px;
}

.status {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 4px;
  text-align: center;
}

.status.built {
  background: var(--approve-bg);
  color: var(--approve);
}

.status.next {
  background: var(--next-bg);
  color: var(--next-text);
}

.status.planned {
  background: var(--planned-bg);
  color: var(--ink-soft);
}

/* ---- roles -------------------------------------------------------------------------------- */
.table-wrap {
  margin-top: 40px;
  overflow-x: auto;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.role-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 760px;
}

.role-table th,
.role-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}

.role-table thead th {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

.role-table tbody th {
  color: var(--ink);
  font-weight: 650;
}

/* the role stays in view while the table scrolls sideways on a phone */
.role-table tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--sheet);
  box-shadow: inset -1px 0 0 var(--rule);
}

.role-table tbody tr:last-child > * {
  border-bottom: 0;
}

.role-table td::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
}

.role-table td.full::before {
  background: var(--ink);
}

.role-table td.part::before {
  background: linear-gradient(90deg, var(--ink) 50%, var(--rule) 50%);
}

.role-table td.none {
  color: #9aa1ae;
}

.role-table td.none::before {
  border: 1px solid var(--rule);
}

/* ---- hosting ------------------------------------------------------------------------------ */
.hosting-cols {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 32px 64px;
}

.hosting-text {
  display: grid;
  gap: 16px;
  align-content: start;
}

.hosting-cols p {
  margin: 0;
  max-width: 48ch;
  font-size: 18px;
}

.stack {
  display: grid;
  grid-template-columns: auto 1fr;
  margin: 0;
}

.stack dt,
.stack dd {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.stack dt {
  color: var(--muted);
  padding-right: 24px;
}

.stack dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

/* ---- footer ------------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  color: var(--muted);
  font-size: 14px;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ---- responsive ----------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .steps li {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 0 18px;
    padding: 0;
  }

  .steps li::before {
    grid-row: span 2;
    margin: 0;
  }

  .steps li::after {
    top: 40px;
    left: 19px;
    right: auto;
    bottom: -28px;
    border-top: 0;
    border-left: 2px solid var(--rule);
  }

  .steps p {
    grid-column: 2;
  }

  .module-groups,
  .hosting-cols {
    grid-template-columns: 1fr;
  }

  .modules-head {
    grid-template-columns: 1fr;
  }

  .legend {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 599px) {
  body {
    font-size: 16px;
  }

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

  .paper {
    transform: none;
  }

  .record {
    margin: -12px 8px 0;
  }

  .hero h1 {
    font-size: clamp(34px, 11vw, 42px);
  }

  /* brand and "Log in" on the first line, the four section links on one line under them */
  .site-header nav {
    order: 3;
    width: 100%;
    gap: 6px 16px;
    font-size: 15px;
  }

  .site-header .login {
    height: 38px;
    padding: 0 12px 0 16px;
    font-size: 15px;
  }
}
