/*
 * monrdv.ca — public site.
 *
 * Tokens are lifted verbatim from packages/ui/src/tokens.css so this site and the
 * applications cannot drift on colour, type or spacing. See DESIGN.md ("Atelier").
 *
 * Brand accent is `sarcelle` (#0e7fa8) — the same teal the app uses for a scheduled
 * job. Primary actions stay `blueprint` (#1f4fd8), matching --accent in the portal.
 */

:root {
  /* raw palette: galvanized steel, drafting blue, oxidized copper */
  --zinc-900: #171c21;
  --zinc-800: #1f262c;
  --zinc-700: #2c343c;
  --zinc-600: #3d4750;
  --zinc-500: #5b6670;
  --zinc-400: #8e989f;
  --zinc-300: #c3cacf;
  --zinc-200: #dde2e5;
  --zinc-100: #edf0f2;
  --zinc-050: #f6f8f9;
  --white: #fff;

  --blueprint-700: #163ba6;
  --blueprint-600: #1f4fd8;
  --blueprint-500: #3d6ce8;
  --blueprint-100: #e4ebfc;

  --cuivre-600: #b4643a;
  --vert-air-600: #1f8a70;
  --ambre-600: #d98a0b;

  /* brand accent */
  --sarcelle-600: #0e7fa8;
  --sarcelle-500: #2ba3cf;

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --tracking-display: -0.021em;
  --tracking-label: 0.055em;

  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 2px rgb(23 28 33 / 0.06), 0 0 0 1px rgb(23 28 33 / 0.04);
  --shadow-md: 0 2px 8px rgb(23 28 33 / 0.08), 0 0 0 1px rgb(23 28 33 / 0.05);
  --shadow-lg: 0 12px 32px -8px rgb(23 28 33 / 0.22), 0 0 0 1px rgb(23 28 33 / 0.07);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-quick: 120ms;

  --shell: 1200px;
}

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

html {
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--zinc-100);
  color: var(--zinc-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
  font-weight: 700;
  margin: 0;
  text-wrap: pretty;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--blueprint-600);
  text-decoration: none;
}

a:hover {
  color: var(--blueprint-700);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--blueprint-600);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Every number is an instrument reading: monospaced, tabular, slashed zero. */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'zero' 1;
}

/* Drawing-annotation label — the one place tracking opens up. */
.label {
  font-size: 0.6875rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--zinc-500);
}

.shell {
  width: min(var(--shell), 100% - 3rem);
  margin-inline: auto;
}

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

.skip-link:focus {
  left: 1rem;
  top: 0.5rem;
  z-index: 100;
  background: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ---------------------------------------------------------------- wordmark ---- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark__mark {
  display: block;
  flex: none;
}

.wordmark__text {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  line-height: 1;
  color: var(--zinc-900);
  font-size: 1.5rem;
}

.wordmark__tld {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.6875rem;
  color: var(--sarcelle-600);
  margin-left: 3px;
}

/* ------------------------------------------------------------------ buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px; /* touch target floor */
  padding: 0 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-quick) var(--ease-out);
  text-decoration: none;
  white-space: nowrap; /* a wrapped call-to-action reads as broken layout */
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--blueprint-600);
  color: var(--white);
  font-weight: 700;
}

.btn--primary:hover {
  background: var(--blueprint-700);
  color: var(--white);
}

.btn--ghost {
  background: var(--zinc-050);
  border-color: var(--zinc-200);
  color: var(--zinc-500);
  font-weight: 500;
}

.btn--ghost:hover {
  background: var(--white);
  color: var(--zinc-700);
}

/*
 * On the near-black CTA band the primary action is white, not blue. Blue on
 * #171c21 reads as just another accent; white is the only thing on that ground
 * that cannot be mistaken for secondary. On the light sections the primary stays
 * blue — a white button there is indistinguishable from the ghost button beside
 * it, which collapses the distinction between the two actions.
 */
.btn--on-dark {
  background: var(--white);
  color: var(--zinc-900);
  font-weight: 700;
}

.btn--on-dark:hover {
  background: var(--zinc-100);
  color: var(--zinc-900);
}

.btn--block {
  width: 100%;
}

/* ------------------------------------------------------------------- topbar ---- */

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--zinc-200);
}

.topbar__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.75rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--zinc-700);
  white-space: nowrap;
}

/* The call to action carries a short label on narrow screens. */
.btn__short {
  display: none;
}

.nav a.nav__muted {
  color: var(--zinc-500);
}

.nav a.nav__accent {
  color: var(--blueprint-600);
}

.nav .btn {
  min-height: 38px;
  font-size: 0.875rem;
  padding: 0 1rem;
}

/*
 * Small screens: drop the in-page section links rather than wrapping the bar into a
 * stack. They only jump to sections that are a short scroll away anyway, so nothing
 * is lost — while sign-in and the one call to action must stay reachable.
 */
@media (max-width: 900px) {
  .topbar__inner {
    gap: 0.875rem;
  }
  .nav {
    gap: 1rem;
    flex-wrap: nowrap;
  }
  .nav__section {
    display: none;
  }
}

@media (max-width: 560px) {
  .nav .btn {
    padding: 0 0.875rem;
  }
  /* Both actions must survive: shorten the CTA rather than dropping sign-in. */
  .nav .btn__long {
    display: none;
  }
  .nav .btn__short {
    display: inline;
  }
}

@media (max-width: 400px) {
  .shell {
    width: min(var(--shell), 100% - 2rem);
  }
  .wordmark__text {
    font-size: 1.25rem;
  }
  .nav {
    gap: 0.75rem;
  }
}

/*
 * Below ~380px the bar cannot hold the wordmark and both actions. The mark alone
 * still identifies the site (the link keeps its aria-label), so the lettering goes
 * rather than sign-in or the call to action.
 */
@media (max-width: 380px) {
  .topbar .wordmark__text {
    display: none;
  }
}

/* ---------------------------------------------------------------- watermark ---- */

/*
 * The mark, oversized and nearly invisible, anchoring an otherwise empty ground.
 * Decorative only: aria-hidden in the markup, and it never intercepts a click.
 */
.watermark {
  position: absolute;
  right: -140px;
  bottom: -120px;
  width: 720px;
  height: 540px;
  pointer-events: none;
  z-index: 0;
}

.watermark path {
  stroke: #e4e8ea;
}

.watermark--dark path {
  stroke: #212930;
}

@media (max-width: 900px) {
  .watermark {
    right: -180px;
    bottom: -160px;
    width: 460px;
    height: 345px;
  }
}

/* --------------------------------------------------------------------- hero ---- */

.hero {
  position: relative;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  align-items: center;
  gap: 4rem;
  padding-block: 4.5rem 4rem;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.125rem, 4.6vw, 3.375rem);
  font-weight: 800;
  line-height: 1.08;
}

.hero__lede {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--zinc-500);
  max-width: 30rem;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero__fineprint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--zinc-400);
}

@media (max-width: 1000px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-block: 3rem;
  }
}

/* ------------------------------------------------------------- jobs vignette ---- */

.vignette {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem 1.5rem;
  min-width: 0;
}

.vignette__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.75rem;
}

.vignette__title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 96px;
  align-items: center;
  gap: 1rem;
  padding-block: 0.75rem;
  border-top: 1px solid var(--zinc-200);
}

.job__name {
  font-size: 0.875rem;
  font-weight: 600;
  display: block;
}

.job__service {
  font-size: 0.75rem;
  color: var(--zinc-500);
  display: block;
}

.job__run {
  display: block;
  width: 100%;
  height: auto;
}

.job__amount {
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 500;
}

.job__amount--paid {
  color: var(--vert-air-600);
}

@media (max-width: 560px) {
  .job {
    grid-template-columns: minmax(0, 1fr) 84px;
  }
  .job__run {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ---------------------------------------------------------------- proof band ---- */

.band {
  background: var(--white);
  border-top: 1px solid var(--zinc-200);
  border-bottom: 1px solid var(--zinc-200);
}

.band__inner {
  padding-block: 1.375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.band__note {
  font-size: 0.875rem;
  color: var(--zinc-500);
}

.band__trades {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--zinc-400);
}

/* ------------------------------------------------------------------ section ---- */

.section {
  padding-block: 4.75rem;
}

.section--tight {
  padding-block: 4.5rem;
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 40rem;
}

.section h2 {
  font-size: clamp(1.625rem, 3vw, 2rem);
}

.section__lede {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--zinc-500);
}

/* --------------------------------------------------------------- duct panel ---- */

.duct {
  background: var(--white);
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem 1.375rem;
  box-shadow: var(--shadow-sm);
  margin-top: 2.5rem;
  overflow-x: auto;
}

.duct__runwrap {
  min-width: 620px;
}

.duct__run {
  display: block;
  width: 100%;
  height: 34px;
}

.duct__stages {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 0.625rem;
  list-style: none;
  padding: 0;
}

.duct__stages li {
  font-size: 0.6875rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--zinc-400);
  text-align: center;
}

.duct__stages li:first-child {
  text-align: left;
}

.duct__stages li:last-child {
  text-align: right;
}

.duct__stages li[aria-current='step'] {
  font-weight: 700;
  color: var(--zinc-900);
}

/* --------------------------------------------------------------------- grid ---- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-size: 1.0625rem;
}

.card p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--zinc-500);
}

.card--dark {
  background: var(--zinc-900);
  border-color: var(--zinc-900);
}

.card--dark h3 {
  color: #f2f5f6;
}

.card--dark p {
  color: var(--zinc-400);
}

.card__icon {
  display: block;
}

.card__window {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--zinc-500);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ------------------------------------------------------------- conversation ---- */

.convo {
  background: var(--white);
  border-top: 1px solid var(--zinc-200);
  border-bottom: 1px solid var(--zinc-200);
}

.convo__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  align-items: center;
  gap: 4.5rem;
  padding-block: 4.5rem;
}

.convo__copy {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.convo__copy p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--zinc-500);
  max-width: 30rem;
}

.thread {
  background: var(--zinc-100);
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.thread__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.thread__customer {
  font-size: 0.875rem;
  font-weight: 600;
}

.thread__phone {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--zinc-400);
}

.bubble {
  max-width: 20rem;
  border-radius: var(--radius-lg);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.bubble--in {
  background: var(--white);
  border: 1px solid var(--zinc-200);
  color: var(--zinc-700);
}

.bubble--out {
  align-self: flex-end;
  background: var(--blueprint-100);
  color: var(--zinc-900);
}

.thread__event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--zinc-500);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--vert-air-600);
  flex: none;
}

@media (max-width: 1000px) {
  .convo__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-block: 3rem;
  }
}

/* ---------------------------------------------------------------------- cta ---- */

.cta {
  background: var(--zinc-900);
  position: relative;
  overflow: hidden;
}

.cta__inner {
  position: relative;
  z-index: 1;
  padding-block: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
  align-items: flex-start;
}

.cta h2 {
  color: #f2f5f6;
  font-size: clamp(1.75rem, 3.2vw, 2.125rem);
}

.cta__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cta__actions a.cta__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blueprint-500);
}

/* ------------------------------------------------------------------- footer ---- */

.footer__inner {
  padding-block: 2.25rem 2.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.75rem;
  color: var(--zinc-400);
}

.footer__brand .mono {
  font-size: 0.6875rem;
  font-weight: 500;
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer__links a,
.footer__links span {
  font-size: 0.8125rem;
  color: var(--zinc-500);
}

/* ================================================================ centred ==== */

/*
 * Shared shell for the standalone pages — sign-in, signed-out, 404. A single
 * centred column on the zinc ground, with the watermark behind it.
 */
.centred {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.centred__lang {
  position: absolute;
  top: 1.75rem;
  right: 2.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--zinc-500);
  z-index: 1;
}

.panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel__intro {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.panel__intro h1 {
  font-size: 1.375rem;
}

.panel__intro p {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--zinc-500);
}

.panel__note {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--zinc-400);
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.field__row a {
  font-size: 0.75rem;
  font-weight: 500;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type='email'],
input[type='password'] {
  height: 44px;
  border: 1px solid var(--zinc-300);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 0 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--zinc-900);
  width: 100%;
}

input::placeholder {
  color: var(--zinc-400);
}

input:focus-visible {
  border-color: var(--blueprint-600);
}

.centred__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.75rem;
  color: var(--zinc-400);
}

.centred__foot .mono {
  font-size: 0.6875rem;
  font-weight: 500;
}

/* ------------------------------------------------------------------ signed out ---- */

.capped {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.capped__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  color: var(--zinc-500);
}

/* ------------------------------------------------------------------------ 404 ---- */

.notfound {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.625rem;
  max-width: 35rem;
  text-align: center;
}

.notfound__run {
  display: block;
  width: min(340px, 100%);
  height: auto;
}

.notfound__code {
  font-family: var(--font-mono);
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
  font-feature-settings: 'zero' 1;
  display: block;
}

.notfound h1 {
  font-size: clamp(1.375rem, 3.6vw, 1.625rem);
  margin-top: 0.5rem;
}

.notfound__lede {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--zinc-500);
}

.notfound__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  border: 1px solid var(--zinc-300);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  color: var(--zinc-400);
}

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