/* ==========================================================================
   Dyadux — brand system
   Ink on paper. Depth comes from surface, never from colour.
   ========================================================================== */

:root {
  /* Surface ---------------------------------------------------------------
     Three neutral steps. Cards sit *above* the canvas — that contrast is
     what replaces an accent colour.                                        */
  --canvas:     #f3f3f1;   /* page background — off-white, no hue           */
  --paper:      #ffffff;   /* cards, elevated surfaces                      */
  --ink:        #121211;   /* headings, primary text                        */
  --ink-card:   #171817;   /* dark CTA card                                 */
  --hairline:   #e5e5e2;   /* 1px dividers, borders, ghost numerals         */
  --mute:       #6f6f6b;   /* secondary text — 5.4:1 on canvas, passes AA   */
  --grid:       rgba(0, 0, 0, 0.032);

  /* Accent — the only hue in the system ------------------------------------
     Ink is action, lime is state. Lime never carries text on a light
     background (it can't: too pale) — it marks highlights, active states,
     and exactly one loud moment. Used sparingly, on purpose.               */
  --accent:     #d3f04a;
  --accent-ink: #121211;   /* text that sits on top of the accent           */
  --accent-dim: #c3e02f;   /* accent hover                                  */

  /* Type ------------------------------------------------------------------ */
  --display: "Space Grotesk", "IBM Plex Sans", -apple-system, sans-serif;
  --sans:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Space — 8px grid ------------------------------------------------------ */
  --s1: 0.5rem;  --s2: 1rem;   --s3: 1.5rem;  --s4: 2rem;
  --s5: 2.5rem;  --s6: 3rem;   --s8: 4rem;    --s10: 5rem;

  /* Shape ----------------------------------------------------------------- */
  --r-card:  20px;
  --r-inner: 12px;
  --r-pill:  999px;

  --container: 1180px;
  --section-y: clamp(4.5rem, 9vw, 7.5rem);
}

/* Reset -------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
ul, ol   { margin: 0; padding: 0; list-style: none; }

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.75rem, 6.2vw, 4.5rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem);   line-height: 1.06; letter-spacing: -0.03em;  }
h3 { font-size: 1.375rem;                      line-height: 1.25; letter-spacing: -0.015em; }

p { margin: 0; }

.lead      { font-size: 1.125rem; color: var(--mute); max-width: 46ch; }
.body-text { color: var(--mute); max-width: 60ch; }
.small     { font-size: 0.875rem; color: var(--mute); }

/* Ghost numeral — the reference's strongest typographic device */
.numeral {
  font-family: var(--display);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--hairline);
}

/* Layout ------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s3);
}

.section { position: relative; padding-block: var(--section-y); }

/* Faint background grid — texture, not decoration */
.section--grid::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 140px 140px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.section--grid > .container { position: relative; }

/* Split section header: headline left · copy centre · CTA far right --------- */

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) auto;
  align-items: end;
  gap: var(--s4) var(--s6);
  margin-bottom: var(--s8);
}
.sec-head__badge { grid-column: 1 / -1; justify-self: start; }
.sec-head p      { padding-bottom: 0.4rem; }

/* Accessibility ------------------------------------------------------------ */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100%; left: var(--s3); z-index: 100;
  padding: var(--s1) var(--s2);
  background: var(--ink); color: var(--paper);
  border-radius: 0 0 var(--r-inner) var(--r-inner);
  text-decoration: none;
}
.skip-link:focus { top: 0; }

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

/* Ink rings vanish on dark surfaces — switch to the accent there */
.cta-card :focus-visible,
.step--on :focus-visible { outline-color: var(--accent); }

::selection { background: var(--accent); color: var(--accent-ink); }

/* Badge — pill eyebrow with a dot ------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.badge--onDark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Brand lockup ------------------------------------------------------------- */

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
  font-family: var(--display);
  font-weight: 600; font-size: 1.1875rem; letter-spacing: -0.02em;
}
.brand__mark { width: auto; height: 1.35em; color: currentColor; }
.brand--onDark { color: #fff; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(243, 243, 241, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s3);
  min-height: 4.75rem;
}

.nav { display: flex; align-items: center; gap: var(--s4); justify-self: center; }
.nav a {
  color: var(--mute); text-decoration: none;
  font-size: 0.9375rem;
  transition: color 150ms ease;
}
.nav a:hover { color: var(--ink); }

.site-header__cta { justify-self: end; display: flex; gap: 0.5rem; }

/* Buttons — fully rounded pills -------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.625rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn--primary       { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #33332f; }

.btn--ghost         { background: var(--paper); color: var(--ink); border-color: var(--hairline); }
.btn--ghost:hover   { border-color: var(--ink); }

.btn--onDark        { background: #fff; color: var(--ink); }
.btn--onDark:hover  { background: #e8e8e4; }

/* The single loudest element on the page. Used once. */
.btn--accent        { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover  { background: var(--accent-dim); }

.btn--outlineDark        { background: transparent; color: #fff; border-color: rgba(255,255,255,0.28); }
.btn--outlineDark:hover  { border-color: #fff; }

/* Pill button with an inset circular arrow (reference: "All Features ↗") */
.btn--arrow { padding-right: 0.35rem; }
.btn--arrow .btn__circle {
  display: grid; place-items: center;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--paper); color: var(--ink);
  transition: transform 160ms ease;
}
.btn--arrow:hover .btn__circle { transform: translate(2px, -2px); }
.btn--ghost.btn--arrow .btn__circle { background: var(--ink); color: var(--paper); }

/* Circular icon link (reference: "Learn More ↗") ---------------------------- */

.icon-link {
  display: inline-flex; align-items: center; gap: 0.75rem;
  color: var(--ink); text-decoration: none;
  font-size: 0.9375rem; font-weight: 500;
}
.icon-link__circle {
  display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.icon-link:hover .icon-link__circle {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

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

.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) var(--section-y); }
.hero h1        { margin-top: var(--s4); max-width: 16ch; }
.hero .lead     { margin-top: var(--s4); font-size: 1.25rem; max-width: 52ch; }
.hero__cta      { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--s5); }

/* Hero stat strip */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--s10);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  overflow: hidden;
}
.stat { padding: var(--s4); border-left: 1px solid var(--hairline); }
.stat:first-child { border-left: 0; }
.stat dt { font-size: 0.8125rem; color: var(--mute); }
.stat dd {
  margin: 0.5rem 0 0;
  font-family: var(--display); font-size: 1.5rem;
  font-weight: 600; letter-spacing: -0.02em;
}

/* Cards -------------------------------------------------------------------- */

.card {
  display: flex; flex-direction: column;
  padding: var(--s4);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
}
.card h3        { margin-block: var(--s3) 0.75rem; }
.card .body-text{ flex: 1; }
.card__foot     { margin-top: var(--s4); }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }

/* Product — split card with panel visual ----------------------------------- */

.product {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;   /* the shot gets the wider half */
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  overflow: hidden;
}
.product__copy   { padding: clamp(2rem, 4vw, 3.25rem); }
.product__copy h3{ font-size: clamp(1.5rem, 2.4vw, 2rem); }
.product__facts  { margin-top: var(--s4); }
.product__facts li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.9375rem; color: var(--mute);
}
.product__facts li:last-child { border-bottom: 1px solid var(--hairline); }
.product__facts strong { color: var(--ink); font-weight: 500; }
.product__foot { margin-top: var(--s5); }

/* Product shot — the Craft Order Pro dashboard, ported from that app's own
   landing mock (src/pages/Landing/sections/DashboardMockup.jsx) and restyled
   to this palette. Same layout, same sample data, no colour. ---------------- */

.shot {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.25rem, 2.6vw, 2.25rem);
  background: var(--canvas);
  border-left: 1px solid var(--hairline);
}

.mock {
  /* Craft Order Pro's own tokens, scoped to the mock so they never leak into
     the Dyadux system. Copied from the app's variables — this is a product
     shot, so it wears the product's colours, not ours. */
  --cop-primary:      #5e81f4;
  --cop-accent:       #0f8afd;
  --cop-success:      #1fb59e;
  --cop-warning:      #d98a12;
  --cop-primary-soft: rgba(94, 129, 244, 0.12);
  --cop-accent-soft:  rgba(15, 138, 253, 0.12);
  --cop-success-soft: rgba(31, 181, 158, 0.14);
  --cop-warning-soft: rgba(217, 138, 18, 0.14);

  width: 100%;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-inner);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 36px -10px rgba(0, 0, 0, 0.13);
}

.mock__bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.mock__dot   { width: 8px; height: 8px; border-radius: 50%; background: #d4d4cf; }
.mock__title { margin-left: 0.5rem; font-size: 0.6875rem; font-weight: 500; color: var(--mute); }

.mock__body { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }

.mock__kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.mock__kpi  { padding: 0.625rem; border: 1px solid var(--hairline); border-radius: 8px; }
.mock__kpi-icon {
  display: grid; place-items: center;
  width: 22px; height: 22px; margin-bottom: 0.4rem;
  border-radius: 6px;
}
.mock__kpi-icon--mr      { background: var(--cop-primary-soft); color: var(--cop-primary); }
.mock__kpi-icon--po      { background: var(--cop-accent-soft);  color: var(--cop-accent); }
.mock__kpi-icon--mr-rate { background: var(--cop-success-soft); color: var(--cop-success); }
.mock__kpi-icon--po-rate { background: var(--cop-primary-soft); color: var(--cop-primary); }
.mock__kpi-value {
  display: block;
  font-family: var(--display); font-size: 1rem; font-weight: 600; letter-spacing: -0.02em;
}
.mock__kpi-label { display: block; font-size: 0.625rem; line-height: 1.35; color: var(--mute); }

.mock__panel { padding: 0.75rem; border: 1px solid var(--hairline); border-radius: 8px; }
.mock__panel-title {
  margin-bottom: 0.6rem;
  font-size: 0.625rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute);
}

.mock__row {
  display: grid; grid-template-columns: 4.4rem 1fr 1.9rem;
  align-items: center; gap: 0.6rem;
}
.mock__row + .mock__row { margin-top: 0.4rem; }
.mock__row-label { font-size: 0.6875rem; color: var(--mute); }
.mock__track { height: 5px; border-radius: var(--r-pill); background: #ececea; overflow: hidden; }
.mock__fill  { display: block; height: 100%; border-radius: var(--r-pill); }
/* Matching the app: success / accent / warning */
.mock__fill--a { background: var(--cop-success); }
.mock__fill--b { background: var(--cop-accent); }
.mock__fill--c { background: var(--cop-warning); }
.mock__row-pct { font-size: 0.6875rem; font-weight: 500; text-align: right; }

.mock__item {
  display: grid; grid-template-columns: 3.4rem 1fr auto;
  align-items: center; gap: 0.6rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--hairline);
}
.mock__item:first-of-type { border-top: 0; }
.mock__item-id   { font-size: 0.625rem; font-weight: 600; color: var(--cop-primary); }
.mock__item-name {
  font-size: 0.6875rem; color: var(--mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Status pills, matching the app's Badge primitive: soft fill, coloured
   text, no border. Variants follow its STATUS_VARIANT_MAP. */
.mock__tag {
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-pill);
  font-size: 0.625rem; font-weight: 500; line-height: 1.2;
  white-space: nowrap;
}
.mock__tag--success { background: var(--cop-success-soft); color: var(--cop-success); }
.mock__tag--info    { background: var(--cop-primary-soft); color: var(--cop-primary); }
.mock__tag--warning { background: var(--cop-warning-soft); color: var(--cop-warning); }

.shot__cap { margin-top: 0.75rem; font-size: 0.75rem; color: var(--mute); text-align: center; }

/* Clients — divided logo strip ----------------------------------------------
   The 1px gap over a hairline background draws the dividers, so they stay
   correct however many cells there are and wherever the grid wraps. Built to
   look deliberate at 2–4 logos rather than like a grid with holes in it. */

.clients {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  overflow: hidden;
}

/* Dividers live on the cells; the negative margin pushes the trailing ones
   past the padding box where overflow:hidden clips them. A partial last row
   leaves plain paper rather than a gap-coloured hole. */
.clients__grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -1px -1px 0;
}

/* Flex, not grid: a leftover item on the last row grows to fill the width
   instead of leaving an empty cell. Holds for any number of logos. */
.client {
  flex: 1 1 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5) var(--s4);
  min-height: 8.5rem;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

/* Logos arrive at wildly different aspect ratios, so they're balanced
   optically rather than by a single shared height. Wide wordmarks cap on
   height; square marks need more of it to carry equal weight. */
.client img {
  width: auto;
  max-width: 100%;
  max-height: 38px;
  border-radius: 6px;       /* no-op on transparent art; tidies solid tiles */
  filter: grayscale(1);
  opacity: 0.8;             /* 0.62 lost the hairline wordmarks entirely */
  transition: filter 220ms ease, opacity 220ms ease;
}
/* Solid tiles carry far more ink than a wordmark, so they sit smaller than
   an area-matching rule would suggest — otherwise they read as a grey block. */
.client img.is-square { max-height: 46px; }

/* Let the real brand show on hover; greyscale keeps the page monochrome at rest */
.client:hover img { filter: none; opacity: 1; }

.clients-note { margin-top: var(--s3); text-align: center; }

/* Process — numbered cards, one emphasised --------------------------------- */

.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }

.step {
  padding: var(--s4);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
}
.step h3 { margin-block: var(--s3) 0.75rem; }

.step--on {
  background: var(--ink-card);
  border-color: var(--ink-card);
  color: #fff;
}
.step--on h3        { color: #fff; }
.step--on .numeral  { color: var(--accent); }
.step--on .body-text{ color: rgba(255, 255, 255, 0.66); }

/* Closing CTA card ---------------------------------------------------------- */

.cta-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: var(--s6);
  padding: clamp(2.5rem, 5vw, 4.5rem);
  background: var(--ink-card);
  border-radius: var(--r-card);
  color: #fff;
  overflow: hidden;
}
.cta-card h2    { color: #fff; margin-top: var(--s4); }
.cta-card .lead { color: rgba(255, 255, 255, 0.66); margin-top: var(--s3); }
.cta-card__cta  { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--s5); }
/* The mark in white — the logo's dark-surface lockup, at full strength */
.cta-card__mark { justify-self: center; width: min(100%, 240px); color: #fff; }

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

.site-footer { border-top: 1px solid var(--hairline); padding-block: var(--s8) var(--s4); }

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, auto));
  gap: var(--s6);
}
.site-footer__blurb { margin-top: var(--s3); font-size: 0.9375rem; color: var(--mute); max-width: 34ch; }

.fcol h4 {
  margin: 0 0 var(--s2);
  font-family: var(--sans);
  font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mute);
}
.fcol li + li { margin-top: 0.6rem; }
.fcol a {
  color: var(--ink); text-decoration: none; font-size: 0.9375rem;
  transition: opacity 150ms ease;
}
.fcol a:hover { opacity: 0.6; }

.site-footer__bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2);
  margin-top: var(--s8);
  padding-top: var(--s3);
  border-top: 1px solid var(--hairline);
}

/* Motion — one fade-up on first paint. Nothing else. ------------------------ */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.rise { animation: rise 560ms cubic-bezier(0.2, 0.6, 0.2, 1) both; }
.rise:nth-child(2) { animation-delay: 70ms; }
.rise:nth-child(3) { animation-delay: 140ms; }
.rise:nth-child(4) { animation-delay: 210ms; }
.rise:nth-child(5) { animation-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

@media (max-width: 1000px) {
  .sec-head { grid-template-columns: 1fr; align-items: start; }
  .sec-head p { padding-bottom: 0; }
  .sec-head .btn { justify-self: start; }   /* don't stretch to column width */

  .site-footer__top { grid-template-columns: 1fr 1fr; }
  .site-footer__brandcol { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .site-header__inner { grid-template-columns: 1fr auto; }

  .cards-3 { grid-template-columns: 1fr; }
  .steps   { grid-template-columns: 1fr; }

  .product { grid-template-columns: 1fr; }
  .product__visual { order: -1; }
  .shot { border-left: 0; border-bottom: 1px solid var(--hairline); }

  .cta-card { grid-template-columns: 1fr; text-align: left; }
  .cta-card__mark { display: none; }

  .stats { grid-template-columns: 1fr; }
  .stat  { border-left: 0; border-top: 1px solid var(--hairline); }
  .stat:first-child { border-top: 0; }
}

@media (max-width: 560px) {
  .hero .lead { font-size: 1.125rem; }
  .site-footer__top { grid-template-columns: 1fr; gap: var(--s5); }
  .mock__kpis { grid-template-columns: repeat(2, 1fr); }  /* 4-up is too tight here */
  .mock__row  { grid-template-columns: 3.9rem 1fr 1.9rem; }
}
