/* cadtomesh — fresh-light design system */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-700.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-600.woff2") format("woff2");
}

:root {
  /* dominant teal family */
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --teal-200: #99f6e4;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;

  /* full-chroma accents */
  --orange: #ea580c;
  --orange-soft: #fff7ed;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --magenta: #db2777;

  /* semantic */
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;

  /* neutrals: cool mint surfaces, deep teal ink */
  --bg: #f0fdfa;
  --bg-deep: #e6faf5;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --overlay: rgba(15, 118, 110, 0.08);
  --scrim: rgba(19, 78, 74, 0.45);
  --ink: #134e4a;
  --ink-strong: #042f2e;
  --muted: #475569;
  --muted-2: #64748b;
  --faint: #94a3b8;
  --border: #d7efe9;
  --border-strong: #99f6e4;
  --hairline: #e2e8f0;

  --primary: var(--teal-600);
  --primary-hover: var(--teal-700);
  --on-primary: #ffffff;
  --ring: var(--teal-500);

  /* type */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", monospace;

  /* brand wordmark lockup (S1) */
  --wm-track: -0.026em;   /* measured at 18px: leaves 0.41px of C->A gap, floor is -0.049em */
  --wm-gap-seg: 2px;
  --wm-gap-icon: 4px;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: clamp(2.5rem, 5vw, 3.75rem);
  --text-hero: clamp(2.75rem, 6vw, 4.5rem);

  /* space */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(19, 78, 74, 0.06), 0 1px 3px rgba(19, 78, 74, 0.08);
  --shadow: 0 4px 12px rgba(19, 78, 74, 0.08), 0 2px 4px rgba(19, 78, 74, 0.05);
  --shadow-lg: 0 12px 32px rgba(19, 78, 74, 0.12), 0 4px 8px rgba(19, 78, 74, 0.06);
  --shadow-xl: 0 24px 64px rgba(19, 78, 74, 0.16), 0 8px 16px rgba(19, 78, 74, 0.08);
  --shadow-teal: 0 8px 24px rgba(13, 148, 136, 0.28);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur: 240ms;
  --dur-slow: 420ms;

  --nav-h: 64px;
  --maxw: 1200px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink-strong);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p { margin: 0; }
a { color: var(--teal-700); text-decoration: none; }
a:hover { color: var(--teal-600); }
img, svg, canvas { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

::selection { background: var(--teal-200); color: var(--ink-strong); }

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

/* palette scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--teal-300) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--teal-300);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--teal-500); }

.mono { font-family: var(--font-mono); }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-5); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-600);
}

/* brand wordmark: three weight-segmented pieces, CAD in caps */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: var(--wm-gap-seg);
  letter-spacing: var(--wm-track);
  white-space: nowrap;
}
.wordmark .wm-cad,
.wordmark .wm-mesh { font-weight: 700; }
.wordmark .wm-cad {
  color: var(--ink-strong);
  position: relative;
  top: -0.018em;   /* caps (698u) sit below the h-ascender (740u) of mesh */
}
.wordmark .wm-mesh { color: var(--teal-600); }
.wordmark .wm-to {
  font-weight: 400;
  font-size: 0.9em;
  color: var(--muted);
}
a.brand:hover .wm-cad { color: var(--teal-700); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
  color: var(--on-primary);
  box-shadow: var(--shadow-teal);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--teal-600), var(--teal-700)); color: #fff; box-shadow: 0 10px 28px rgba(13, 148, 136, 0.36); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--border-strong); color: var(--teal-700); background: var(--teal-50); }
.btn-lg { padding: 16px 30px; font-size: var(--text-base); border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@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;
  }
}