/* ============================================================================
   thirdmind Design System — Colors & Type
   ----------------------------------------------------------------------------
   Calm Intelligence: structured, quiet, confident.
   Off-white surfaces, dark green typography, lime accent used rarely.
============================================================================ */

/* ---------- FONT FACES ----------------------------------------------------- */

@font-face {
  font-family: "PolySans";
  src: url("fonts/PolySans-Neutral.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter_18pt-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter_18pt-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter_18pt-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter_18pt-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter_18pt-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Larger optical sizes for display use */
@font-face {
  font-family: "Inter Display";
  src: url("fonts/Inter_28pt-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("fonts/Inter_28pt-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- TOKENS --------------------------------------------------------- */

:root {
  /* Brand color palette ---------------------------------------------------- */
  --tm-bg:                 #F7F6F4;   /* page background, off-white */
  --tm-bg-subtle:          #F1EFEA;   /* alt section surface */
  --tm-surface:            #FFFFFF;   /* card / modal */
  --tm-border:             #E2E0DC;   /* hairline */
  --tm-fg:                 #052D23;   /* dark green — primary text */
  --tm-fg-muted:           #6B7D6F;   /* secondary text */
  --tm-accent:             #DAFF99;   /* lime accent — rare, intentional */
  --tm-warn:               #FFB347;   /* warm highlight */

  /* Semantic foreground/background pairs ---------------------------------- */
  --tm-fg-on-accent:       #052D23;   /* dark green on lime */
  --tm-fg-on-dark:         #F7F6F4;   /* off-white on dark green */
  --tm-fg-on-surface:      #052D23;
  --tm-fg-on-subtle:       #052D23;

  /* Functional --- */
  --tm-link:               #052D23;
  --tm-focus-ring:         #052D23;

  /* Type families --------------------------------------------------------- */
  --tm-font-display:       "PolySans", "Trebuchet MS", Arial, sans-serif;
  --tm-font-body:          "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tm-font-mono:          ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  /* Type scale (per spec) -------------------------------------------------- */
  --tm-text-display:       4.5rem;    /* 72 */
  --tm-text-h1:            3rem;      /* 48 */
  --tm-text-h2:            1.5rem;    /* 24 */
  --tm-text-h3:            1.25rem;   /* 20 — feature title */
  --tm-text-body-lg:       1.125rem;  /* 18 */
  --tm-text-body:          1rem;      /* 16 */
  --tm-text-caption:       0.8125rem; /* 13 */
  --tm-text-label:         0.75rem;   /* 12 */

  --tm-leading-display:    1.05;
  --tm-leading-h1:         1.10;
  --tm-leading-h2:         1.30;
  --tm-leading-h3:         1.40;
  --tm-leading-body:       1.60;
  --tm-leading-caption:    1.50;
  --tm-leading-label:      1.40;

  --tm-track-display:      -1.2px;
  --tm-track-h1:           -0.6px;
  --tm-track-h2:           -0.2px;
  --tm-track-h3:           0;
  --tm-track-label:        0.4px;

  /* Spacing (8pt grid; 4 used for hairline pairs) ------------------------- */
  --tm-space-1:            4px;
  --tm-space-2:            8px;
  --tm-space-3:            12px;
  --tm-space-4:            16px;
  --tm-space-6:            24px;
  --tm-space-8:            32px;
  --tm-space-12:           48px;
  --tm-space-16:           64px;
  --tm-space-24:           96px;

  /* Radius scale --- */
  --tm-radius-sm:          6px;       /* small inputs */
  --tm-radius-md:          8px;       /* default buttons / cards */
  --tm-radius-lg:          12px;      /* prominent cards */
  --tm-radius-xl:          16px;      /* large containers */

  /* Elevation — depth via contrast & spacing, not shadow ------------------ */
  --tm-elev-0:             none;
  --tm-elev-1:             0 1px 0 rgba(5, 45, 35, 0.04);
  --tm-elev-2:             0 1px 2px rgba(5, 45, 35, 0.06), 0 4px 12px rgba(5, 45, 35, 0.04);

  /* Layout --- */
  --tm-container-max:      1280px;
  --tm-container-wide:     1440px;
  --tm-content-max:        72ch;

  /* Motion --- */
  --tm-ease:               cubic-bezier(0.2, 0.6, 0.2, 1);
  --tm-dur-fast:           120ms;
  --tm-dur-base:           180ms;
  --tm-dur-slow:           260ms;
}

/* ---------- BASE / SEMANTIC ELEMENT STYLES --------------------------------- */

html, body {
  background: var(--tm-bg);
  color: var(--tm-fg);
  font-family: var(--tm-font-body);
  font-size: var(--tm-text-body);
  line-height: var(--tm-leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, h5 {
  font-family: var(--tm-font-display);
  color: var(--tm-fg);
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}

h1 {                                       /* Display / Hero */
  font-size: var(--tm-text-display);
  line-height: var(--tm-leading-display);
  letter-spacing: var(--tm-track-display);
}
h2 {                                       /* Section heading */
  font-size: var(--tm-text-h1);
  line-height: var(--tm-leading-h1);
  letter-spacing: var(--tm-track-h1);
}
h3 {                                       /* Sub-heading */
  font-size: var(--tm-text-h2);
  line-height: var(--tm-leading-h2);
  letter-spacing: var(--tm-track-h2);
}
h4 {                                       /* Feature title (card heading) */
  font-size: var(--tm-text-h3);
  line-height: var(--tm-leading-h3);
  font-weight: 600;
  letter-spacing: var(--tm-track-h3);
}

p, li {
  font-size: var(--tm-text-body);
  line-height: var(--tm-leading-body);
  color: var(--tm-fg);
  margin: 0;
  text-wrap: pretty;
}

.tm-lead {
  font-size: var(--tm-text-body-lg);
  line-height: var(--tm-leading-body);
}

.tm-caption {
  font-size: var(--tm-text-caption);
  line-height: var(--tm-leading-caption);
  color: var(--tm-fg-muted);
}

.tm-label {
  font-family: var(--tm-font-body);
  font-size: var(--tm-text-label);
  font-weight: 500;
  line-height: var(--tm-leading-label);
  letter-spacing: var(--tm-track-label);
  text-transform: uppercase;
  color: var(--tm-fg-muted);
}

a {
  color: var(--tm-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--tm-dur-fast) var(--tm-ease);
}
a:hover { border-bottom-color: currentColor; }

code, kbd, pre, samp {
  font-family: var(--tm-font-mono);
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: 1px solid var(--tm-border);
  margin: var(--tm-space-8) 0;
}

button {
  font-family: var(--tm-font-body);
  font-size: var(--tm-text-body);
  cursor: pointer;
}

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

/* ---------- BUTTON UTILITIES ---------------------------------------------- */

.tm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tm-space-2);
  height: 44px;
  padding: 0 var(--tm-space-6);
  border-radius: var(--tm-radius-md);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: var(--tm-text-body);
  line-height: 1;
  transition: background-color var(--tm-dur-base) var(--tm-ease),
              border-color var(--tm-dur-base) var(--tm-ease),
              color var(--tm-dur-base) var(--tm-ease);
  white-space: nowrap;
}
.tm-btn--primary   { background: var(--tm-fg); color: var(--tm-fg-on-dark); }
.tm-btn--primary:hover { background: #0a3d31; }
.tm-btn--secondary { background: transparent; color: var(--tm-fg); border-color: var(--tm-border); }
.tm-btn--secondary:hover { background: var(--tm-bg-subtle); }
.tm-btn--accent    { background: var(--tm-accent); color: var(--tm-fg-on-accent); }
.tm-btn--accent:hover { background: #c9f07f; }
.tm-btn--ghost     { background: transparent; color: var(--tm-fg); }
.tm-btn--ghost:hover { background: var(--tm-bg-subtle); }
.tm-btn--sm        { height: 36px; padding: 0 var(--tm-space-4); font-size: var(--tm-text-caption); }
.tm-btn--lg        { height: 52px; padding: 0 var(--tm-space-8); font-size: var(--tm-text-body-lg); }

/* ---------- INPUT UTILITIES ----------------------------------------------- */

.tm-input {
  width: 100%;
  height: 44px;
  padding: 0 var(--tm-space-4);
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-md);
  font-family: var(--tm-font-body);
  font-size: var(--tm-text-body);
  color: var(--tm-fg);
  transition: border-color var(--tm-dur-base) var(--tm-ease);
}
.tm-input::placeholder { color: var(--tm-fg-muted); }
.tm-input:focus {
  outline: none;
  border-color: var(--tm-fg);
}

/* ---------- CARD UTILITY -------------------------------------------------- */

.tm-card {
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-lg);
  padding: var(--tm-space-6);
}

/* ---------- BADGE --------------------------------------------------------- */

.tm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  font-size: var(--tm-text-label);
  font-weight: 500;
  letter-spacing: var(--tm-track-label);
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--tm-bg-subtle);
  color: var(--tm-fg);
  border: 1px solid var(--tm-border);
}
.tm-badge--accent { background: var(--tm-accent); border-color: transparent; }
.tm-badge--solid  { background: var(--tm-fg); color: var(--tm-fg-on-dark); border-color: transparent; }
