/* ==========================================================================
   NTE Desk
   Expensive-looking, plain-talking. Light theme only.
   ========================================================================== */

/* Fallback faces, metric-matched to the web fonts so text keeps its place
   while Newsreader and Schibsted Grotesk load (display=swap). */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  font-weight: 100 900;
  size-adjust: 96.12%;
  ascent-override: 76.47%;
  descent-override: 27.57%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader Fallback Noto";
  src: local("Noto Serif Regular"), local("NotoSerif-Regular");
  font-weight: 100 900;
  size-adjust: 89.09%;
  ascent-override: 82.51%;
  descent-override: 29.75%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Schibsted Fallback";
  src: local("Arial"), local("ArialMT");
  font-weight: 100 900;
  size-adjust: 104.49%;
  ascent-override: 93.46%;
  descent-override: 24.67%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Schibsted Fallback Roboto";
  src: local("Roboto Regular"), local("Roboto-Regular");
  font-weight: 100 900;
  size-adjust: 104.72%;
  ascent-override: 93.25%;
  descent-override: 24.62%;
  line-gap-override: 0%;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  color-scheme: light;

  --paper: #F6F5F1;
  --ink: #161616;
  --stone: #E3E1DA;
  --graphite: #2A2C29;

  /* Product screen only */
  --rejected: #B4321F;
  --approved: #2E6A4C;
  --highlighter: #F2E2A0;
  --surface: #FBFAF8; /* Paper lifted toward white: the app window */

  /* Secondary text, derived from Ink (all pass WCAG AA on Paper) */
  --ink-2: color-mix(in srgb, var(--ink) 76%, var(--paper));
  --ink-3: color-mix(in srgb, var(--ink) 64%, var(--paper));
  --ink-hover: #2C2C2B; /* Ink 90% toward Paper */

  --serif: "Newsreader", "Newsreader Fallback", "Newsreader Fallback Noto", Georgia, serif;
  --sans: "Schibsted Grotesk", "Schibsted Fallback", "Schibsted Fallback Roboto", system-ui, sans-serif;

  --max: 1200px;
  --gutter: max(24px, 5vw);
  --section: clamp(72px, 10vw, 128px);
  --bar: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar) + 32px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

::selection {
  background: var(--graphite);
  color: var(--paper);
}

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

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

.nowrap {
  white-space: nowrap;
}

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

h1,
h2,
.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1,
.display {
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.08;
}

.lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

p,
dd,
li {
  text-wrap: pretty;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.button:hover {
  background: var(--ink-hover);
}

/* Secondary action: plain text, underline on hover. The invisible ::before
   gives it a 44px tap target without inflating the focus ring. */
.text-link {
  position: relative;
  font-weight: 500;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: transparent;
}

.text-link::before {
  content: "";
  position: absolute;
  inset: -12px -8px;
}

.text-link:hover {
  text-decoration-color: currentColor;
}

.text-link:focus-visible {
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 30;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* --- Top bar -------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--stone);
  opacity: 0;
}

.topbar.is-scrolled::after {
  opacity: 1;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  height: var(--bar);
}

.wordmark {
  position: relative;
  margin-right: auto;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.015em;
}

a.wordmark::before {
  content: "";
  position: absolute;
  inset: -11px -8px;
}

/* Optical alignment: Newsreader's capitals ride high in their line box,
   so the wordmark drops 2px to share a baseline with the nav. */
.topbar .wordmark {
  top: 2px;
}

.topnav ul {
  display: flex;
  gap: 32px;
}

.topnav .text-link {
  font-size: 16px;
  color: var(--ink-2);
}

.topnav .text-link:hover {
  color: var(--ink);
}

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

.hero {
  padding-block: clamp(48px, 6.5vw, 88px) clamp(48px, 5.5vw, 72px);
}

.hero h1 {
  max-width: 14em;
}

.hero .lead {
  max-width: 33em;
  margin-top: 24px;
}

.hero-terms {
  margin-top: 20px;
  font-weight: 500;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: 32px;
}

.actions .text-link {
  font-size: 16px;
}

/* --- Product screen ------------------------------------------------------- */

.showcase {
  position: relative;
  isolation: isolate;
  padding-block: clamp(40px, 5vw, 72px);
  background: var(--graphite);
  color: var(--paper);
}

/* Fine grain: contrast-stretched grey noise overlaid at low strength, so it adds
   texture without shifting the Graphite tone. */
.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.18;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.window {
  --pad: 20px;
  --gap: 24px;
  --c-wo: 112px;

  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  box-shadow:
    0 2px 6px rgb(0 0 0 / 0.2),
    0 32px 64px -24px rgb(0 0 0 / 0.55);
}

.window-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--stone);
}

.window-title,
.window-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.window-name {
  font-size: 15px;
  font-weight: 600;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--stone);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding-inline: 10px 12px;
  border: 1px solid var(--stone);
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 13px;
}

.filter::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.example-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding-inline: 10px;
  border: 1px dashed color-mix(in srgb, var(--ink) 38%, var(--surface));
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.wo-row {
  display: grid;
  grid-template-columns: var(--c-wo) minmax(0, 1fr) minmax(0, 1.5fr) 88px 120px;
  column-gap: var(--gap);
  align-items: center;
  min-height: 52px;
  padding: 10px var(--pad);
}

.wo-head {
  min-height: 40px;
  padding-block: 8px;
  border-bottom: 1px solid var(--stone);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.wo-row:not(.wo-head) + .wo-row,
.wo-fix + .wo-row {
  border-top: 1px solid var(--stone);
}

/* Tabular figures for the number columns only: in Schibsted Grotesk the
   tabular set also widens commas and full stops, so running text keeps
   proportional figures, and the one comma in an amount is set apart. */
.c-wo,
.c-amount,
.count,
.num {
  font-variant-numeric: tabular-nums;
}

.c-amount .sep {
  font-variant-numeric: normal;
}

.c-wo {
  font-weight: 500;
}

.c-store {
  color: var(--ink-2);
}

.c-amount {
  text-align: right;
  font-weight: 500;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding-inline: 8px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.chip[data-status="rejected"] {
  color: var(--rejected);
  background: color-mix(in srgb, var(--rejected) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--rejected) 22%, var(--surface));
}

.chip[data-status="resubmitted"] {
  color: var(--ink);
  background: var(--paper);
  border-color: color-mix(in srgb, var(--ink) 22%, var(--surface));
}

.chip[data-status="approved"] {
  color: var(--approved);
  background: color-mix(in srgb, var(--approved) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--approved) 24%, var(--surface));
}

/* The fix line under row 1. Closed until the work order is resubmitted. */
.wo-fix {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
}

.wo-fix-cell {
  min-height: 0;
  overflow: hidden;
}

.wo-fix-text {
  padding: 0 var(--pad) 14px calc(var(--pad) + var(--c-wo) + var(--gap));
  color: var(--ink-2);
}

.wo-fix-text mark {
  position: relative;
  z-index: 0;
  margin-left: 2px;
  padding: 2px 4px;
  background: none;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.wo-fix-text mark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--highlighter);
  transform-origin: left center;
}

.product:not([data-state="rejected"]) .wo-fix {
  grid-template-rows: 1fr;
  visibility: visible;
}

.product[data-state="rejected"] .wo-fix-text mark::before {
  transform: scaleX(0);
}

/* "NTE Desk moved WO 48213 from Rejected to Approved, just now." */
.activity {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  color: rgb(246 245 241 / 0.7);
  font-size: 14px;
  line-height: 1.4;
  visibility: hidden;
  opacity: 0;
}

.product[data-state="approved"] .activity {
  visibility: visible;
  opacity: 1;
}

.activity strong {
  color: var(--paper);
  font-weight: 500;
}

.activity-mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

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

.section {
  padding-top: var(--section);
}

.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}

.split-aside {
  grid-column: 1 / span 5;
}

.split-main {
  grid-column: 6 / -1;
  align-self: start;
}

.sticky {
  position: sticky;
  top: calc(var(--bar) + 40px);
  max-width: 11em;
}

/* Five reasons */
.reasons {
  border-bottom: 1px solid var(--stone);
}

.reason {
  padding-block: 32px 36px;
  border-top: 1px solid var(--stone);
}

.reason h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
  margin-top: 16px;
}

.pair dt {
  color: var(--ink-3);
  font-weight: 500;
}

.pair dd {
  margin-top: 4px;
}

/* How the free look works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 24px;
  margin-top: 56px;
}

.step-num {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* The hairline that joins the three steps runs on into the gap,
   stopping just short of the next number. */
.step-num::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-right: -8px;
  background: var(--stone);
}

.step:last-child .step-num::after {
  margin-right: 0;
}

.step p {
  max-width: 30em;
  margin-top: 24px;
  padding-right: 16px;
}

/* Terms. A real table (with explicit roles, so it stays a table to screen
   readers) laid out on the same two-column grid as "What happens / What we do"
   above, so the Price column lines up with "What we do". */
.terms,
.terms thead,
.terms tbody {
  display: block;
}

.terms tr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  border-top: 1px solid var(--stone);
}

.terms thead tr {
  border-top: 0;
}

.terms tbody tr:last-child {
  border-bottom: 1px solid var(--stone);
}

.terms th,
.terms td {
  display: block;
  padding: 20px 0;
  font-weight: 400;
  text-align: left;
}

.terms thead th {
  padding-block: 0 12px;
  color: var(--ink-3);
  font-weight: 500;
}

.terms tbody th {
  font-weight: 500;
}

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

/* Every week, handled / Your data: a quiet Stone panel. Hairlines on it are
   Ink at low strength, since Stone-on-Stone would vanish. */
.band {
  --rule: color-mix(in srgb, var(--ink) 13%, var(--stone));

  margin-top: var(--section);
  background: var(--stone);
}

.band-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  padding-block: clamp(56px, 7vw, 96px);
}

.band-col:first-child {
  grid-column: 1 / span 5;
  padding-right: 24px;
}

.band-col:last-child {
  grid-column: 6 / -1;
}

.band-col h2 + * {
  margin-top: 20px;
}

.band-col p {
  max-width: 30em;
}

.ruled li {
  padding-block: 14px;
  border-top: 1px solid var(--rule, var(--stone));
}

.ruled li:first-child {
  padding-top: 0;
  border-top: 0;
}

.ruled li:last-child {
  padding-bottom: 0;
}

/* Closing */
.closing {
  padding-bottom: var(--section);
}

.closing .display {
  max-width: 13em;
}

.closing .lead {
  margin-top: 20px;
}

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

.footer {
  padding-block: 40px 56px;
  border-top: 1px solid var(--stone);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 16px;
  align-items: baseline;
}

.footer-mark {
  grid-column: 1 / span 5;
  color: var(--ink);
  font-size: 20px;
}

.footer-email {
  grid-column: 6 / -1;
  color: var(--ink);
  font-size: 17px;
}

.footer-copy {
  grid-column: 1 / span 5;
}

.footer-note {
  grid-column: 6 / -1;
  max-width: 60ch;
}

/* --- Tablet --------------------------------------------------------------- */

@media (max-width: 959px) {
  .split {
    display: block;
  }

  .split-aside {
    margin-bottom: 32px;
  }

  .sticky {
    position: static;
    max-width: 16em;
  }

  .window {
    --pad: 16px;
    --gap: 16px;
    --c-wo: 84px;
  }

  .wo-row {
    grid-template-columns: var(--c-wo) minmax(0, 1fr) minmax(0, 1.35fr) 64px 100px;
  }

  /* Store number above the city, so every row has the same two-line rhythm. */
  .c-store .nowrap {
    display: block;
  }
}

/* --- Phone ---------------------------------------------------------------- */

@media (max-width: 719px) {
  .topnav {
    display: none;
  }

  .lead {
    font-size: 18px;
  }

  .actions {
    gap: 16px 28px;
  }

  /* Title and the Example tag share the first line; the filter sits under them. */
  .window-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title tag"
      "filter filter";
    padding-block: 12px;
  }

  .window-tools {
    display: contents;
  }

  .window-title { grid-area: title; }
  .example-tag { grid-area: tag; }
  .filter { grid-area: filter; justify-self: start; }

  /* Each row becomes a two-line item: work order and amount, then reason and status. */
  .wo-head,
  .c-store {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .wo-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "wo amount"
      "reason status";
    gap: 6px 16px;
    align-items: start;
    padding-block: 14px;
  }

  .c-wo { grid-area: wo; }
  .c-amount { grid-area: amount; }
  .c-reason { grid-area: reason; color: var(--ink-2); padding-top: 2px; }
  .c-status { grid-area: status; justify-self: end; }

  .wo-fix-text {
    padding-left: var(--pad);
  }

  .steps {
    grid-template-columns: 1fr;
    row-gap: 40px;
    margin-top: 40px;
  }

  .step-num::after {
    margin-right: 0;
  }

  .step p {
    margin-top: 20px;
    padding-right: 0;
  }

  .band-grid {
    display: block;
  }

  .band-col:first-child {
    padding-right: 0;
  }

  .band-col + .band-col {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--rule);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 12px;
  }

  .footer-grid > * {
    grid-column: 1;
  }

  .footer-email {
    margin-bottom: 8px;
  }
}

@media (max-width: 599px) {
  .reason {
    padding-block: 24px 28px;
  }

  .pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 12px;
  }

  .pair dd {
    margin-top: 2px;
  }

  /* Terms stack: the item, then its price. */
  .terms thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .terms tr {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
    padding-block: 18px;
  }

  .terms tbody tr:first-child {
    border-top: 1px solid var(--stone);
  }

  .terms th,
  .terms td {
    padding: 0;
  }
}

/* --- Motion: one orchestrated moment, and only when it's welcome ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero {
    animation: hero-in 300ms var(--ease) both;
  }

  @keyframes hero-in {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
  }

  .button,
  .text-link {
    transition: background-color 150ms ease, color 150ms ease, text-decoration-color 150ms ease;
  }

  .topbar::after {
    transition: opacity 200ms ease;
  }

  .chip {
    transition: color 250ms ease, background-color 250ms ease, border-color 250ms ease;
  }

  .wo-fix {
    transition: grid-template-rows 450ms var(--ease), visibility 0s linear 450ms;
  }

  .product:not([data-state="rejected"]) .wo-fix {
    transition: grid-template-rows 450ms var(--ease), visibility 0s;
  }

  .wo-fix-text mark::before {
    transition: transform 500ms var(--ease) 250ms;
  }

  .activity {
    transform: translateY(4px);
    transition: opacity 300ms var(--ease), transform 300ms var(--ease), visibility 0s linear 300ms;
  }

  .product[data-state="approved"] .activity {
    transform: none;
    transition: opacity 300ms var(--ease) 250ms, transform 300ms var(--ease) 250ms, visibility 0s linear 250ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
