/* =============================================================================
   MOFE Digital design system, v2.0 (2026-10-06; v1 2026-10-05)
   Base: Dub's design system (dub.co, as documented on styles.refero.design),
   adapted for MOFE. Rules and reasoning: DESIGN_SYSTEM.md in this folder.
   This file becomes the website's global stylesheet: tokens, then base
   styles, then components. Components use role tokens, never raw hex values.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Neutrals: Dub's scale, unchanged */
  --c-black: #0a0a0a;    /* Midnight Ink: primary button fill */
  --c-ink: #171717;      /* Charcoal: headings and primary text */
  --c-graphite: #262626; /* icon strokes, hover on dark buttons */
  --c-slate: #404040;    /* nav text, tertiary text */
  --c-steel: #525252;    /* supporting text and helper text */
  --c-fog: #737373;      /* captions and placeholders, on white only */
  --c-silver: #a3a3a3;   /* disabled states, decorative strokes */
  --c-smoke: #d4d4d4;    /* outlined button borders, emphasis edges */
  --c-ash: #e5e5e5;      /* the hairline: every container has one */
  --c-mist: #f5f5f5;     /* hover fills, nested panels */
  --c-paper-2: #fafafa;  /* alternate section band, muted cards */
  --c-paper: #ffffff;    /* canvas and cards */

  /* Accent: one ink blue does the talking (the same blue as the demo) */
  --c-accent: #2b3f9e;
  --c-accent-hover: #22327f;
  --c-accent-soft: #e4e8fb;

  /* The cast's carbon-copy paper tints (v2.0): characters and their sections' highlights only */
  --c-tint-blue: #e6ebfa;  /* Envelope, Follow-ups */
  --c-tint-pink: #fbe9f0;  /* Slip, Order entry */
  --c-tint-lilac: #eee9fb; /* Sheet, Updates */
  --c-tint-cream: #f7f2e4; /* Calendar page */

  /* Status: colour means status, never decoration (the demo's own values) */
  --c-stuck: #c23b2a;
  --c-stuck-soft: #fbe7e3;
  --c-watch: #9a5c00;
  --c-watch-soft: #fcefd6;
  --c-ok: #2f7a4b;
  --c-ok-soft: #e1f2e7;

  /* Roles: components use these, not the raw colours above */
  --bg: var(--c-paper);
  --bg-alt: var(--c-paper-2);
  --surface: var(--c-paper);
  --surface-hover: var(--c-mist);
  --text: var(--c-ink);
  --text-2: var(--c-steel);
  --text-3: var(--c-fog);
  --line: var(--c-ash);
  --line-strong: var(--c-smoke);
  --dot: rgb(0 0 0 / 0.14);
  --focus: var(--c-accent);

  /* Type families. On the live site next/font sets the --font-* variables;
     in the static previews the plain family names below are used. */
  --font-display: var(--font-satoshi, "Satoshi"), var(--font-inter, "Inter"), ui-sans-serif, system-ui, sans-serif;
  --font-sans: var(--font-inter, "Inter"), ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: var(--font-geist-mono, "Geist Mono"), ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

  /* Type scale: Dub's 1.125 steps from 14px, plus one larger display step */
  --text-12: 0.75rem;
  --text-14: 0.875rem;
  --text-16: 1rem;
  --text-18: 1.125rem;
  --text-20: 1.25rem;
  --text-24: 1.5rem;
  --text-30: 1.875rem;
  --text-h2: clamp(1.875rem, 1.4rem + 2vw, 3rem);  /* 30px on phones, 48px on desktop */
  --text-h1: clamp(2.5rem, 1.55rem + 4vw, 4rem);   /* 40px on phones, 64px on desktop */

  /* Spacing: 4px base, compact (Dub) */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --space-80: 80px;
  --space-96: 96px;
  --space-112: 112px;

  /* Radius vocabulary (Dub). Nothing outside these five. */
  --radius-input: 6px;
  --radius-button: 8px;
  --radius-card: 12px;
  --radius-panel: 16px;
  --radius-pill: 9999px;

  /* Elevation: borders first. Shadows only in the three places listed. */
  --shadow-button: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-ring: 0 0 0 4px rgb(0 0 0 / 0.04);
  --shadow-frame: 0 0 0 4px rgb(0 0 0 / 0.04), 0 10px 15px -3px rgb(0 0 0 / 0.08),
    0 4px 6px -4px rgb(0 0 0 / 0.08);

  /* Motion: the demo is the only thing that moves. Hover changes only. */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 150ms;

  /* Layout */
  --container: 1200px;
  --gutter: 16px;
  --section: 64px;
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
    --section: 96px;
  }
}

/* 2. Base ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-16);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
ul,
ol,
figure {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--c-accent-soft);
  color: var(--c-ink);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

.skip-link {
  position: absolute;
  left: var(--space-16);
  top: -100px;
  z-index: 10;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-button);
  background: var(--c-black);
  color: #fff;
  font-size: var(--text-14);
}

.skip-link:focus {
  top: var(--space-12);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 3. Typography ------------------------------------------------------------- */

.h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h1);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text);
}

.h1-line {
  display: block;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-20);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}

.lead {
  font-size: var(--text-18);
  line-height: 1.56;
  color: var(--text-2);
  text-wrap: pretty;
}

.lead strong {
  font-weight: 500;
  color: var(--text);
}

.prose {
  color: var(--text-2);
  text-wrap: pretty;
}

.small {
  font-size: var(--text-14);
  line-height: 1.43;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.mono {
  font-family: var(--font-mono);
}

.link {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}

.link:hover {
  color: var(--c-accent-hover);
  text-decoration-color: currentColor;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-14);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.arrow-link:hover {
  color: var(--c-accent);
}

@media (min-width: 768px) {
  .lead {
    font-size: var(--text-20);
    line-height: 1.5;
  }
}

/* 4. Layout ---------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: var(--space-16);
  max-width: 760px;
  margin-bottom: var(--space-40);
}

/* 5. Brand ----------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-sub {
  font-weight: 500;
  color: var(--text-2);
}

.brand-mark rect {
  fill: var(--c-accent);
}

/* 6. Navigation ------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 5;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  height: 64px;
}

.nav-links {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.menu {
  position: static;
}

.menu > summary {
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 60px;
  display: grid;
  gap: 2px;
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-frame);
}

.menu-panel a {
  padding: var(--space-12);
  border-radius: var(--radius-button);
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-16);
}

.menu-panel a:hover {
  background: var(--surface-hover);
}

@media (min-width: 960px) {
  .nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .nav-actions {
    grid-column: 3;
    justify-self: end;
  }
  .nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
  }
  .menu,
  .nav-actions .only-phone {
    display: none;
  }
}

@media (max-width: 959px) {
  .nav-actions .only-desktop {
    display: none;
  }
}

/* 7. Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  height: 44px;
  padding: 0 var(--space-16);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font-family: var(--font-sans);
  font-size: var(--text-14);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.btn--sm {
  height: 36px;
  padding: 0 var(--space-12);
}

/* The committed action: once per surface */
.btn--primary {
  background: var(--c-black);
  color: #fff;
  box-shadow: var(--shadow-button);
}

.btn--primary:hover {
  background: var(--c-graphite);
}

.btn--primary:active {
  background: var(--c-slate);
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn--secondary:hover {
  background: var(--surface-hover);
}

.btn--secondary:active {
  border-color: var(--c-silver);
}

.btn--ghost {
  height: 36px;
  padding: 0 var(--space-12);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--c-slate);
}

.btn--ghost:hover,
.btn--ghost[aria-current="page"] {
  background: var(--surface-hover);
  color: var(--text);
}

.btn[aria-disabled="true"] {
  background: var(--c-mist);
  color: var(--c-silver);
  border-color: transparent;
  box-shadow: none;
  cursor: not-allowed;
}

/* 8. Pills and badges ------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 34px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-button);
  color: var(--text);
  font-size: var(--text-14);
  line-height: 1.3;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

a.pill:hover {
  border-color: var(--line-strong);
}

.pill-index {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  font-weight: 500;
  color: var(--c-accent);
}

.pill-tag {
  flex: none;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--c-mist);
  color: var(--text);
  font-size: var(--text-12);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.badge::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-silver);
}

.badge--plain::before {
  display: none;
}

.badge--stuck {
  background: var(--c-stuck-soft);
}

.badge--stuck::before {
  background: var(--c-stuck);
}

.badge--watch {
  background: var(--c-watch-soft);
}

.badge--watch::before {
  background: var(--c-watch);
}

.badge--ok {
  background: var(--c-ok-soft);
}

.badge--ok::before {
  background: var(--c-ok);
}

/* 9. Cards ----------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-24);
}

.card--muted {
  background: var(--bg-alt);
}

.card--feature {
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-ring);
}

/* 10. Demo frame: the product mock-up container ---------------------------- */

.frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-frame);
  overflow: hidden;
}

.frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  min-height: 44px;
  padding: var(--space-8) var(--space-16);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  font-family: var(--font-mono);
  font-size: var(--text-12);
  line-height: 1.4;
  color: var(--text-2);
}

.frame-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.frame-bar > * {
  white-space: nowrap;
}

.frame-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-ok);
}

.frame iframe {
  width: 100%;
  height: 640px;
  border: 0;
  background: #eef1f6;
}

@media (min-width: 980px) {
  .frame iframe {
    height: 720px;
  }
}

/* 11. Facts strip: verifiable company facts where Dub puts a logo cloud ------ */

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.fact {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding: var(--space-16) var(--space-20);
  background: var(--surface);
}

.fact dt {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.fact dd {
  font-size: var(--text-14);
  font-weight: 500;
  color: var(--text);
}

@media (min-width: 768px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 12. Steps: a ruled table, not a row of identical icon cards -------------- */

.steps {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.step {
  display: grid;
  align-content: start;
  gap: var(--space-12);
  padding: var(--space-24);
  background: var(--surface);
}

.step-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: var(--space-8);
}

.step-index {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--c-accent);
}

.progress {
  display: inline-flex;
  gap: 3px;
}

.progress i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--line);
}

.progress i.on {
  background: var(--c-accent);
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .step {
    min-height: 280px;
    padding: var(--space-32) var(--space-24);
  }
}

/* 13. Dot grid: Dub's signature texture, read here as dot-grid paper -------- */

.dotgrid {
  position: relative;
  isolation: isolate;
}

.dotgrid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
  background-size: 18px 18px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / 0.5) 45%, transparent 80%);
  mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / 0.5) 45%, transparent 80%);
  pointer-events: none;
}
