@layer reset, foundation, layouts-base, components, layouts, app-frame, patterns, screens, utilities;

:root {
  color-scheme: light;
  --bg-app: #f3f2ed;
  --bg-surface: #faf9f6;
  --bg-elevated: #ffffff;
  --bg-subtle: #eeede8;
  --bg-hover: #e9e8e2;
  --bg-label: #ebe8db;

  --text-primary: #20231f;
  --text-secondary: #70756d;
  --text-muted: #6b7068;

  --border-default: #deddd7;
  --border-strong: #c8c7c0;

  --accent: #48604d;
  --accent-soft: #e8ece7;

  --button-default-bg: var(--bg-surface);
  --button-default-fg: var(--text-primary);
  --button-default-hover-bg: var(--bg-hover);
  --button-primary-bg: #20231f;
  --button-primary-fg: #f7f7f3;
  --button-primary-hover-bg: #30342f;

  --danger: #9b5149;
  --warning: #a67a3d;
  --success: #6f816c;
  --favorite: #9a7738;
  --favorite-soft: #f0eadc;
  --label-paper: #ebe8db;
  --label-ink: #262721;
  --label-line: #d1cdbc;
  --print-paper: #ffffff;
  --print-ink: #050505;
  --print-line: #666666;
  --print-muted: #aaaaaa;
  --camera-bg: #171a17;
  --camera-ink: #d8dbd5;
  --camera-muted: #979d95;
  --overlay-backdrop: rgba(21, 23, 20, .66);
  --overlay-backdrop-soft: rgba(21, 23, 20, .38);
  --shadow-ambient: rgba(21, 23, 20, .08);
  --skeleton-highlight: rgba(255, 255, 255, .28);
  --media-caption-bg: rgba(0, 0, 0, .72);
  --media-caption-fg: #ffffff;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --radius-control: 5px;
  --radius-surface: 8px;
  --radius-overlay: 12px;
  --radius-round: 999px;

  /* Compatibility aliases. New styles use the role-based names above. */
  --radius-sm: var(--radius-control);
  --radius-md: var(--radius-surface);
  --radius-lg: var(--radius-overlay);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --type-micro: 11px;
  --type-caption: 12px;
  --type-body: 14px;
  --type-heading: 16px;
  --type-mobile-input: 16px;
  --type-section: 20px;
  --type-page: 28px;
  --type-hero: 40px;

  --type-workbench-meta: 11px;
  --type-workbench-caption: 12px;
  --type-workbench-body: 13px;
  --type-workbench-section: 15px;
  --type-workbench-title: 24px;
  --type-specimen-display: 32px;

  --leading-tight: 1.25;
  --leading-body: 1.6;

  --control-height: 40px;
  --touch-target: 44px;
  --motion-fast: 140ms;
  --motion-standard: 160ms;
  --ease-standard: cubic-bezier(.2, 0, 0, 1);

  --app-rail-width: 216px;
  --collection-inspector-width: 300px;
  --registry-thumbnail-size: 48px;
  --status-indicator-size: 8px;
  --active-indicator-width: 2px;
  --collection-card-min-width: 240px;
  --collection-photo-card-min-width: 200px;
  --collection-photo-card-min-width-mobile: 160px;
  --dialog-width: 640px;
  --specimen-intake-width: 960px;
  --specimen-intake-section-width: 176px;
  --specimen-intake-section-width-medium: 152px;
  --specimen-intake-max-height: 960px;
  --specimen-identity-width: 320px;
  --specimen-activity-date-width: 72px;
  --specimen-media-min-width: 160px;
  --action-menu-width: 220px;
  --combobox-list-max-height: 320px;

  --sidebar-width: var(--app-rail-width);
  --sidebar-collapsed-width: 64px;
  --topbar-height: 52px;
  --bottom-nav-height: 68px;
  --content-max-width: 1440px;
  --content-reading-width: 960px;
  --content-workspace-width: 1180px;
  --content-collection-width: 1360px;

  --font-ui: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-taxon: Georgia, "Times New Roman", serif;
  --font-editorial: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-app: #151714;
  --bg-surface: #1b1d1a;
  --bg-elevated: #222420;
  --bg-subtle: #22241f;
  --bg-hover: #292c27;
  --bg-label: #302f29;

  --text-primary: #f1f3f0;
  --text-secondary: #aeb5ae;
  --text-muted: #7e867f;

  --border-default: #292e2a;
  --border-strong: #39403a;

  --accent: #77aa98;
  --accent-soft: #1e362e;

  --button-default-bg: var(--bg-surface);
  --button-default-fg: var(--text-primary);
  --button-default-hover-bg: var(--bg-hover);
  --button-primary-bg: #f1f3f0;
  --button-primary-fg: #151714;
  --button-primary-hover-bg: #d9ddd8;

  --danger: #d98278;
  --warning: #d1a15c;
  --success: #8fa98c;
  --favorite: #d2b36f;
  --favorite-soft: #3a3222;
  --shadow-ambient: rgba(0, 0, 0, .28);
  --skeleton-highlight: rgba(255, 255, 255, .08);
}
