/* Aireframes — design tokens. See SPEC.md §5.13. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/Inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/Inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/Inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/InstrumentSerif-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/JetBrainsMono-400.woff2") format("woff2");
}

:root {
  --surface-0: #FAFAF9;
  --surface-1: #FFFFFF;
  --surface-2: #F4F4F2;
  --surface-3: #EDEBE7;
  --surface-hover: #F7F6F3;

  --border:         #E7E5E1;
  --border-strong:  #D6D3CD;

  --text-1: #171614;
  --text-2: #57534E;
  --text-3: #8B8680;

  --accent:         #15803D;
  --accent-hover:   #166534;
  --accent-active:  #14532D;
  --accent-weak:    #DCFCE7;
  --accent-softer:  #F0FDF4;
  --accent-text:    #FFFFFF;

  --warn:       #D97706;
  --warn-weak:  #FEF3C7;
  --warn-text:  #78350F;

  --danger:        #BE123C;
  --danger-weak:   #FEE2E2;

  --ring:        0 0 0 3px rgba(21, 128, 61, 0.18);
  --ring-offset: 0 0 0 1px var(--surface-1), 0 0 0 4px rgba(21, 128, 61, 0.22);
  --ring-danger: 0 0 0 3px rgba(190, 18, 60, 0.16);

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  /* Layered shadow system. -xs/-sm for resting elevation, -md for hover lift,
     -pop for detached surfaces (menus, toasts, FAB), -lg for modals. */
  --shadow-xs:  0 1px 1px rgba(23, 22, 20, 0.04);
  --shadow-sm:  0 1px 2px rgba(23, 22, 20, 0.04), 0 1px 1px rgba(23, 22, 20, 0.03);
  --shadow-md:  0 2px 4px rgba(23, 22, 20, 0.05), 0 4px 12px rgba(23, 22, 20, 0.05);
  --shadow-pop: 0 1px 2px rgba(23, 22, 20, 0.04), 0 8px 24px rgba(23, 22, 20, 0.08), 0 2px 6px rgba(23, 22, 20, 0.04);
  --shadow-lg:  0 2px 4px rgba(23, 22, 20, 0.04), 0 20px 40px rgba(23, 22, 20, 0.14), 0 8px 16px rgba(23, 22, 20, 0.06);
  --shadow-accent: 0 6px 16px rgba(21, 128, 61, 0.24), 0 2px 6px rgba(21, 128, 61, 0.18);

  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono:    "JetBrains Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* Motion. Strong ease-out variants so state changes feel instant and
     responsive — the default CSS easings feel weak. Custom curves from
     easing.dev, kept tight to stay under 300ms. */
  --ease:         cubic-bezier(0.2, 0, 0, 1);
  --ease-quick:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:     cubic-bezier(0.23, 1, 0.32, 1);    /* strong out */
  --ease-out-expo:cubic-bezier(0.16, 1, 0.3, 1);     /* confident, decisive */
  --ease-out-back:cubic-bezier(0.34, 1.3, 0.64, 1);  /* tiny overshoot for decorative enters only */
  --ease-in-out:  cubic-bezier(0.77, 0, 0.175, 1);
  /* Legacy alias — many surfaces already reference --ease-spring. */
  --ease-spring:  cubic-bezier(0.34, 1.3, 0.64, 1);

  --dur-1: 100ms;
  --dur-2: 160ms;
  --dur-3: 220ms;
  --dur-4: 320ms;
}

/* Light mode only — UX designers need accurate colour perception. */
html { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--surface-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "ss03";
  font-variant-numeric: tabular-nums;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; transition: color var(--dur-1) var(--ease); }
a:hover { color: var(--accent); }

::selection { background: var(--accent-weak); color: var(--text-1); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--surface-0); transition: background var(--dur-2) var(--ease); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
::-webkit-scrollbar-corner { background: transparent; }

:focus-visible { outline: none; }

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

/* Utility building blocks */
.surface-1 { background: var(--surface-1); }
.surface-2 { background: var(--surface-2); }
.border-1  { border: 1px solid var(--border); }
.rounded   { border-radius: var(--radius); }
.rounded-lg{ border-radius: var(--radius-lg); }
.mono      { font-family: var(--font-mono); font-size: 12px; }
.display   {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  font-feature-settings: "liga", "dlig";
}
