/**
 * Formant Aesthetics - Classless CSS
 * Version: 2026.1-theme
 * 
 * WHAT IS CLASSLESS CSS?
 * ----------------------
 * A classless CSS framework styles standard HTML elements directly using
 * element selectors (like `h1`, `p`, `button`, `input`) rather than requiring
 * you to add CSS classes to every element. Just write semantic HTML and
 * it looks great automatically.
 * 
 * BENEFITS:
 * - No need to learn or remember CSS class names
 * - Clean, semantic HTML markup
 * - Rapid prototyping - just write HTML
 * - Accessible by default (proper contrast, focus states, etc.)
 * - Consistent styling across all standard elements
 * 
 * HOW TO USE:
 *   1. Include the stylesheet: <link rel="stylesheet" href="formant-aesthetics.css">
 *   2. Write standard HTML elements - they are automatically styled
 *   3. Optional: Use data attributes like data-variant, data-theme for variations
 * 
 * FEATURES:
 * - Complete Formant Design System styling
 * - Dark mode (default) and light mode support
 * - Responsive typography and spacing
 * - Styled forms, tables, buttons, and all semantic elements
 * - Accessible focus states and color contrast
 * 
 * Design System Reference: ~/formant/aesthetics/DESIGN.md
 * 
 * Usage:
 *   <link rel="stylesheet" href="formant-aesthetics.css">
 * 
 * Light mode:
 *   <html data-theme="light">
 */

/* ==========================================================================
   1. Font Imports
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap");

/* ==========================================================================
   2. Design Tokens (CSS Custom Properties)
   ========================================================================== */
:root {
  /* -- THEME COLORS - Neutrals (0-3) ------------------------------------ */
  --theme-neutrals-0: #0a0f11;
  --theme-neutrals-0-rgb: 10, 15, 17;
  --theme-neutrals-1: #202428;
  --theme-neutrals-1-rgb: 32, 36, 40;
  --theme-neutrals-2: #a3aba9;
  --theme-neutrals-2-rgb: 163, 171, 169;
  --theme-neutrals-3: #f2f3f4;
  --theme-neutrals-3-rgb: 242, 243, 244;

  /* -- THEME COLORS - Atmospheric Accents (0-2) ------------------------- */
  --theme-atmospheric-accents-0: #2c4142;
  --theme-atmospheric-accents-0-rgb: 44, 65, 66;
  --theme-atmospheric-accents-1: #4b5e53;
  --theme-atmospheric-accents-1-rgb: 75, 94, 83;
  --theme-atmospheric-accents-2: #acc3b3;
  --theme-atmospheric-accents-2-rgb: 172, 195, 179;

  /* -- THEME COLORS - Functional Accents (0-1) -------------------------- */
  --theme-functional-accents-0: #e8ab7f;
  --theme-functional-accents-0-rgb: 232, 171, 127;
  --theme-functional-accents-1: #8b8cf4;
  --theme-functional-accents-1-rgb: 139, 140, 244;

  /* -- SEMANTIC MAPPINGS - Backgrounds ---------------------------------- */
  --formant-bg-primary: var(--theme-neutrals-0);
  --formant-bg-secondary: var(--theme-neutrals-1);
  --formant-bg-elevated: var(--theme-neutrals-1);
  --formant-bg-interactive: rgba(var(--theme-atmospheric-accents-0-rgb), 0.2);

  /* -- SEMANTIC MAPPINGS - Text ----------------------------------------- */
  --formant-text-primary: var(--theme-neutrals-3);
  --formant-text-secondary: var(--theme-neutrals-2);
  --formant-text-muted: rgba(var(--theme-neutrals-2-rgb), 0.6);

  /* -- SEMANTIC MAPPINGS - Interactive/Accent ---------------------------- */
  --formant-accent-primary: var(--theme-atmospheric-accents-2);
  --formant-accent-secondary: var(--theme-atmospheric-accents-0);
  --formant-accent-warning: var(--theme-functional-accents-0);
  --formant-accent-ai: var(--theme-functional-accents-1);

  /* -- SEMANTIC MAPPINGS - Status --------------------------------------- */
  --formant-status-success: var(--theme-atmospheric-accents-2);
  --formant-status-warning: var(--theme-functional-accents-0);
  --formant-status-error: var(--theme-functional-accents-0);
  --formant-status-info: var(--theme-functional-accents-1);
  --formant-status-ai-active: var(--theme-functional-accents-1);

  /* -- BORDER SYSTEM ---------------------------------------------------- */
  --formant-border-subtle: rgba(var(--theme-neutrals-2-rgb), 0.1);
  --formant-border-default: rgba(var(--theme-neutrals-2-rgb), 0.2);
  --formant-border-strong: rgba(var(--theme-neutrals-2-rgb), 0.4);
  --formant-border-focus: var(--theme-atmospheric-accents-2);

  /* -- TYPOGRAPHY - Font Families --------------------------------------- */
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-monospace: "JetBrains Mono", monospace;
  --formant-font-heading: var(--font-display);
  --formant-font-body: var(--font-body);
  --formant-font-mono: var(--font-monospace);

  /* -- TYPOGRAPHY - Weights --------------------------------------------- */
  --formant-weight-light: 300;
  --formant-weight-regular: 400;
  --formant-weight-medium: 500;
  --formant-weight-semibold: 600;
  --formant-weight-bold: 700;

  /* -- TYPOGRAPHY - Letter Spacing -------------------------------------- */
  --formant-tracking-tight: -0.02em;
  --formant-tracking-normal: 0;
  --formant-tracking-wide: 0.02em;
  --formant-tracking-wider: 0.08em;
  --formant-tracking-mono: 0.1em;
  --formant-tracking-eyebrow: 0.2em;

  /* -- TYPOGRAPHY - Line Heights ---------------------------------------- */
  --formant-leading-tight: 1.2;
  --formant-leading-normal: 1.6;
  --formant-leading-relaxed: 1.75;
  --formant-leading-data: 2.2;

  /* -- TYPOGRAPHY - Sizes ----------------------------------------------- */
  --formant-text-xs: 0.625rem;
  --formant-text-sm: 0.75rem;
  --formant-text-base: 0.875rem;
  --formant-text-md: 1rem;
  --formant-text-lg: 1.0625rem;
  --formant-text-xl: 1.25rem;
  --formant-text-2xl: 1.5rem;
  --formant-text-3xl: 2rem;
  --formant-text-4xl: 3.25rem;
  --formant-text-5xl: 6rem;

  /* -- SPACING SCALE ---------------------------------------------------- */
  --formant-space-0: 0;
  --formant-space-1: 0.25rem;
  --formant-space-2: 0.5rem;
  --formant-space-3: 0.75rem;
  --formant-space-4: 1rem;
  --formant-space-5: 1.25rem;
  --formant-space-6: 1.5rem;
  --formant-space-8: 2rem;
  --formant-space-10: 2.5rem;
  --formant-space-12: 3rem;
  --formant-space-16: 4rem;
  --formant-space-20: 5rem;
  --formant-space-24: 6rem;
  --formant-space-32: 8rem;

  /* -- BORDER RADIUS ---------------------------------------------------- */
  --formant-radius-none: 0;
  --formant-radius-sm: 2px;
  --formant-radius-md: 4px;
  --formant-radius-lg: 6px;
  --formant-radius-xl: 8px;
  --formant-radius-full: 9999px;

  /* -- SHADOWS & ELEVATION ---------------------------------------------- */
  --formant-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --formant-shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --formant-shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --formant-shadow-glow: 0 0 20px
    rgba(var(--theme-atmospheric-accents-2-rgb), 0.15);
  --formant-shadow-glow-strong: 0 0 30px
    rgba(var(--theme-atmospheric-accents-2-rgb), 0.25);

  /* -- FOCUS & ACCESSIBILITY -------------------------------------------- */
  --formant-focus-ring:
    0 0 0 2px var(--theme-neutrals-0),
    0 0 0 4px var(--theme-atmospheric-accents-2);
  --formant-focus-ring-offset: 2px;

  /* -- TRANSITIONS & ANIMATION ------------------------------------------ */
  --formant-transition-fast: 150ms ease;
  --formant-transition-base: 200ms ease;
  --formant-transition-slow: 300ms ease;

  /* -- Z-INDEX SCALE ---------------------------------------------------- */
  --formant-z-base: 0;
  --formant-z-dropdown: 100;
  --formant-z-sticky: 200;
  --formant-z-fixed: 300;
  --formant-z-modal-backdrop: 400;
  --formant-z-modal: 500;
  --formant-z-popover: 600;
  --formant-z-tooltip: 700;

  /* -- LAYOUT ----------------------------------------------------------- */
  --formant-container-max: 1200px;
  --formant-container-padding: 2.5rem;
  --formant-container-padding-mobile: 1.25rem;

  /* -- SCROLLBAR -------------------------------------------------------- */
  --formant-scrollbar-width: 8px;
  --formant-scrollbar-track: var(--theme-neutrals-0);
  --formant-scrollbar-thumb: var(--theme-atmospheric-accents-1);
  --formant-scrollbar-thumb-hover: var(--theme-atmospheric-accents-2);

  /* -- SELECTION -------------------------------------------------------- */
  --formant-selection-bg: rgba(var(--theme-atmospheric-accents-2-rgb), 0.3);
  --formant-selection-text: var(--theme-neutrals-3);
}

/* ==========================================================================
   3. Light Theme (color variable overrides only)
   Apply with <html data-theme="light"> or <body data-theme="light">
   ========================================================================== */
[data-theme="light"] {
  --theme-neutrals-0: #ffffff;
  --theme-neutrals-0-rgb: 255, 255, 255;
  --theme-neutrals-1: #f2f3f4;
  --theme-neutrals-1-rgb: 242, 243, 244;
  --theme-neutrals-2: #6b7370;
  --theme-neutrals-2-rgb: 107, 115, 112;
  --theme-neutrals-3: #0a0f11;
  --theme-neutrals-3-rgb: 10, 15, 17;

  --theme-atmospheric-accents-0: #d6e5dc;
  --theme-atmospheric-accents-0-rgb: 214, 229, 220;
  --theme-atmospheric-accents-1: #8fa69a;
  --theme-atmospheric-accents-1-rgb: 143, 166, 154;
  --theme-atmospheric-accents-2: #3b6b52;
  --theme-atmospheric-accents-2-rgb: 59, 107, 82;

  --theme-functional-accents-0: #c07840;
  --theme-functional-accents-0-rgb: 192, 120, 64;
  --theme-functional-accents-1: #5b5cd4;
  --theme-functional-accents-1-rgb: 91, 92, 212;

  --formant-border-subtle: rgba(var(--theme-neutrals-3-rgb), 0.08);
  --formant-border-default: rgba(var(--theme-neutrals-3-rgb), 0.15);
  --formant-border-strong: rgba(var(--theme-neutrals-3-rgb), 0.3);
  --formant-border-focus: var(--theme-atmospheric-accents-2);
  --formant-text-muted: rgba(var(--theme-neutrals-3-rgb), 0.5);
  --formant-selection-bg: rgba(59, 107, 82, 0.2);
  --formant-selection-text: var(--theme-neutrals-3);
  --formant-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --formant-shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --formant-shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --formant-shadow-glow: 0 0 20px rgba(59, 107, 82, 0.12);
  --formant-focus-ring:
    0 0 0 2px var(--theme-neutrals-0),
    0 0 0 4px var(--theme-atmospheric-accents-2);
}

/* ==========================================================================
   5. Base Reset & Document Styles
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: var(--formant-weight-regular);
  font-size: 1rem;
  line-height: var(--formant-leading-normal);
  color: var(--formant-text-secondary);
  background-color: var(--theme-neutrals-1);
  min-height: 100vh;
  accent-color: var(--theme-atmospheric-accents-2);
}

/* ==========================================================================
   6. Typography - Headings
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--formant-weight-medium);
  line-height: var(--formant-leading-tight);
  letter-spacing: var(--formant-tracking-tight);
  color: var(--formant-text-primary);
  margin-bottom: var(--formant-space-4);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: var(--formant-weight-medium);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--formant-weight-medium);
}

h3 {
  font-size: 1.25rem;
  font-weight: var(--formant-weight-semibold);
  color: var(--theme-atmospheric-accents-2);
}

h4 {
  font-size: 1.125rem;
  font-weight: var(--formant-weight-semibold);
}

h5 {
  font-size: 1rem;
  font-weight: var(--formant-weight-semibold);
}

h6 {
  font-size: 0.875rem;
  font-weight: var(--formant-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--formant-tracking-wide);
  color: var(--formant-text-muted);
}

/* ==========================================================================
   7. Typography - Text Elements
   ========================================================================== */
p {
  margin-bottom: var(--formant-space-4);
  max-width: 65ch;
}

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  font-weight: var(--formant-weight-semibold);
  color: var(--formant-text-primary);
}

em,
i {
  font-style: italic;
}

small {
  font-size: 0.875rem;
  color: var(--formant-text-muted);
}

del {
  text-decoration: line-through;
  color: var(--formant-text-muted);
}

ins {
  text-decoration: underline;
  color: var(--theme-atmospheric-accents-2);
}

mark {
  background-color: rgba(var(--theme-atmospheric-accents-2-rgb), 0.2);
  color: var(--formant-text-primary);
  padding: 0.125rem 0.25rem;
  border-radius: var(--formant-radius-sm);
}

sub,
sup {
  font-size: 0.75rem;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

abbr[title] {
  border-bottom: 1px dotted var(--formant-border-strong);
  text-decoration: none;
  cursor: help;
}

/* ==========================================================================
   5. Typography - Links
   ========================================================================== */
a {
  color: var(--theme-atmospheric-accents-2);
  text-decoration: none;
  transition:
    color var(--formant-transition-base),
    box-shadow var(--formant-transition-base);
}

a:hover {
  color: var(--theme-neutrals-3);
  text-decoration: underline;
}

a:focus-visible {
  outline: none;
  box-shadow: var(--formant-focus-ring);
  border-radius: var(--formant-radius-sm);
}

a:active {
  color: var(--theme-atmospheric-accents-2);
}

/* ==========================================================================
   6. Typography - Code & Preformatted
   ========================================================================== */
code,
kbd,
samp {
  font-family: var(--font-monospace);
  font-size: 0.75rem;
  background-color: var(--formant-bg-primary);
  padding: 0.125rem 0.25rem;
  border-radius: 2px;
  color: var(--formant-text-primary);
}

kbd {
  background-color: var(--formant-bg-primary);
  border: 1px solid var(--formant-border-default);
  box-shadow: 0 2px 0 var(--formant-border-strong);
  font-size: 0.75rem;
}

pre {
  font-family: var(--font-monospace);
  font-size: 0.75rem;
  line-height: var(--formant-leading-normal);
  background-color: var(--formant-bg-primary);
  border-radius: 3px;
  padding: var(--formant-space-3);
  margin-bottom: var(--formant-space-4);
  overflow-x: auto;
  color: var(--formant-text-primary);
}

pre code {
  background-color: transparent;
  padding: 0;
  font-size: inherit;
}

/* ==========================================================================
   7. Typography - Quotes & Citations
   ========================================================================== */
blockquote {
  border-left: 3px solid var(--theme-atmospheric-accents-2);
  padding-left: var(--formant-space-4);
  margin: var(--formant-space-6) 0;
  font-style: italic;
  color: var(--formant-text-secondary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

cite {
  font-style: normal;
  font-family: var(--font-monospace);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: var(--formant-tracking-mono);
  color: var(--theme-atmospheric-accents-1);
  display: block;
  margin-top: var(--formant-space-2);
}

q {
  quotes: '"' '"' "'" "'";
}

q::before {
  content: open-quote;
  color: var(--theme-atmospheric-accents-2);
}

q::after {
  content: close-quote;
  color: var(--theme-atmospheric-accents-2);
}

/* ==========================================================================
   8. Lists
   ========================================================================== */
ul,
ol {
  margin-bottom: var(--formant-space-2);
  padding-left: var(--formant-space-4);
}

li {
  margin-bottom: var(--formant-space-1);
}

li:last-child {
  margin-bottom: 0;
}

ul {
  list-style-type: disc;
}

ul ul {
  list-style-type: circle;
  margin-top: var(--formant-space-2);
}

ol {
  list-style-type: decimal;
}

ol ol {
  list-style-type: lower-alpha;
  margin-top: var(--formant-space-2);
}

dl {
  margin-bottom: var(--formant-space-4);
}

dt {
  font-family: var(--font-monospace);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: var(--formant-tracking-mono);
  color: var(--theme-atmospheric-accents-1);
  margin-bottom: var(--formant-space-1);
}

dd {
  margin-left: 0;
  margin-bottom: var(--formant-space-3);
  color: var(--formant-text-secondary);
}

dd:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   9. Horizontal Rules
   ========================================================================== */
hr {
  border: none;
  border-top: 1px solid var(--formant-border-default);
  margin: var(--formant-space-8) 0;
}

hr[data-variant="gradient"] {
  border-top: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--formant-border-default),
    transparent
  );
}

/* ==========================================================================
   10. Tables
   ========================================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--formant-space-6);
  font-size: 0.9375rem;
}

caption {
  font-family: var(--font-monospace);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: var(--formant-tracking-mono);
  color: var(--formant-text-muted);
  text-align: left;
  margin-bottom: var(--formant-space-2);
}

th,
td {
  padding: var(--formant-space-3) var(--formant-space-4);
  text-align: left;
  border-bottom: 1px solid var(--formant-border-subtle);
}

th {
  font-family: var(--font-monospace);
  font-size: 0.625rem;
  font-weight: var(--formant-weight-regular);
  text-transform: uppercase;
  letter-spacing: var(--formant-tracking-mono);
  color: var(--theme-neutrals-2);
  background-color: transparent;
}

tbody tr:hover {
  background-color: rgba(var(--theme-atmospheric-accents-0-rgb), 0.2);
}

tbody tr:last-child td {
  border-bottom: none;
}

table[data-variant="data"] {
  font-family: var(--font-monospace);
  font-size: 0.8125rem;
  line-height: var(--formant-leading-data);
}

table[data-variant="data"] th {
  font-size: 0.625rem;
  letter-spacing: var(--formant-tracking-mono);
}

table[data-variant="data"] td {
  color: var(--formant-text-primary);
}

/* ==========================================================================
   11. Forms - Input Fields
   ========================================================================== */
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
textarea,
select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--theme-neutrals-3);
  background-color: var(--theme-neutrals-0);
  border: 1px solid rgba(var(--theme-neutrals-2-rgb), 0.2);
  border-radius: 3px;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

input::placeholder,
textarea::placeholder {
  color: rgba(var(--theme-neutrals-2-rgb), 0.5);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--theme-atmospheric-accents-2);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--theme-atmospheric-accents-2);
  box-shadow: 0 0 0 1px var(--theme-atmospheric-accents-2);
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--formant-bg-secondary);
}

input:read-only,
textarea:read-only {
  background-color: var(--formant-bg-secondary);
}

/* Search input clear button */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background-color: var(--theme-neutrals-2);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E")
    no-repeat center;
  mask-size: 10px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

input[type="search"]::-webkit-search-cancel-button:hover {
  opacity: 1;
  background-color: var(--theme-neutrals-3);
}

/* ==========================================================================
   12. Forms - Textarea
   ========================================================================== */
textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--formant-leading-normal);
}

/* ==========================================================================
   13. Forms - Select
   ========================================================================== */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%23A3ABA9' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--formant-space-4) center;
  padding-right: var(--formant-space-10);
  cursor: pointer;
}

select[multiple] {
  background-image: none;
  padding-right: var(--formant-space-4);
  min-height: 120px;
}

/* ==========================================================================
   14. Forms - Checkboxes & Radios
   ========================================================================== */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 1px solid var(--formant-border-default);
  background-color: var(--formant-bg-primary);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  margin-right: var(--formant-space-2);
  transition:
    border-color var(--formant-transition-base),
    background-color var(--formant-transition-base);
}

input[type="checkbox"] {
  border-radius: var(--formant-radius-sm);
}

input[type="radio"] {
  border-radius: var(--formant-radius-full);
}

input[type="checkbox"]:checked {
  background-color: var(--theme-atmospheric-accents-2);
  border-color: var(--theme-atmospheric-accents-2);
  box-shadow: 0 0 8px rgba(var(--theme-atmospheric-accents-2-rgb), 0.4);
}

/* Industrial indicator - filled square centered in checkbox */
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background-color: var(--theme-neutrals-0);
  border-radius: 2px;
}

input[type="radio"]:checked {
  border-color: var(--theme-atmospheric-accents-2);
  background-color: var(--theme-atmospheric-accents-2);
  box-shadow:
    0 0 8px rgba(var(--theme-atmospheric-accents-2-rgb), 0.4),
    inset 0 0 0 3px var(--formant-bg-primary);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: var(--formant-focus-ring);
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Checkbox/Radio labels - reset to body text style */
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]),
label:has(+ input[type="checkbox"]),
label:has(+ input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: var(--formant-space-2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: var(--formant-weight-regular);
  text-transform: none;
  letter-spacing: normal;
  color: var(--formant-text-secondary);
  margin-bottom: 0;
  margin-right: var(--formant-space-4);
}

/* ==========================================================================
   15. Forms - File Input
   ========================================================================== */
input[type="file"] {
  font-size: 0.875rem;
  color: var(--formant-text-secondary);
  padding: var(--formant-space-3) 0;
}

input[type="file"]::file-selector-button {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: var(--formant-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--theme-atmospheric-accents-2);
  background-color: transparent;
  border: 1px solid var(--theme-atmospheric-accents-2);
  border-radius: var(--formant-radius-md);
  padding: var(--formant-space-2) var(--formant-space-4);
  margin-right: var(--formant-space-4);
  cursor: pointer;
  transition: background-color var(--formant-transition-base);
}

input[type="file"]::file-selector-button:hover {
  background-color: rgba(var(--theme-atmospheric-accents-2-rgb), 0.1);
}

/* ==========================================================================
   16. Forms - Range Slider
   ========================================================================== */
input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  background-color: var(--theme-atmospheric-accents-1);
  border-radius: var(--formant-radius-full);
  outline: none;
  padding: 0;
  border: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background-color: var(--theme-atmospheric-accents-2);
  border-radius: var(--formant-radius-full);
  cursor: pointer;
  transition:
    transform var(--formant-transition-base),
    box-shadow var(--formant-transition-base);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(var(--theme-atmospheric-accents-2-rgb), 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background-color: var(--theme-atmospheric-accents-2);
  border-radius: var(--formant-radius-full);
  cursor: pointer;
  border: none;
}

/* ==========================================================================
   17. Forms - Color Picker
   ========================================================================== */
input[type="color"] {
  appearance: none;
  width: 3rem;
  height: 2.5rem;
  padding: 2px;
  border: 1px solid var(--formant-border-default);
  border-radius: 3px;
  background-color: var(--formant-bg-secondary);
  cursor: pointer;
  overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

/* ==========================================================================
   18. Forms - Fieldset & Legend
   ========================================================================== */
fieldset {
  border: 1px solid var(--formant-border-subtle);
  border-radius: var(--formant-radius-md);
  padding: var(--formant-space-4);
  margin-bottom: var(--formant-space-4);
}

fieldset + fieldset {
  margin-top: var(--formant-space-4);
}

fieldset > div + div {
  margin-top: var(--formant-space-4);
}

legend {
  font-family: var(--font-monospace);
  font-size: 0.625rem;
  font-weight: var(--formant-weight-regular);
  text-transform: uppercase;
  letter-spacing: var(--formant-tracking-mono);
  color: var(--theme-functional-accents-0);
  padding: 0 var(--formant-space-2);
}

/* ==========================================================================
   19. Forms - Labels
   ========================================================================== */
label {
  display: block;
  font-family: var(--font-monospace);
  font-size: 0.625rem;
  font-weight: var(--formant-weight-regular);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--theme-neutrals-2);
  margin-bottom: var(--formant-space-2);
}

label:has(+ [required])::after,
label:has(~ [required])::after {
  content: " *";
  color: var(--theme-functional-accents-0);
}

/* ==========================================================================
   20. Forms - Progress & Meter
   ========================================================================== */
progress {
  appearance: none;
  width: 100%;
  height: 0.5rem;
  border-radius: var(--formant-radius-full);
  background-color: var(--formant-bg-secondary);
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background-color: var(--formant-bg-secondary);
  border-radius: var(--formant-radius-full);
}

progress::-webkit-progress-value {
  background-color: var(--theme-atmospheric-accents-2);
  border-radius: var(--formant-radius-full);
  transition: width 0.3s ease;
}

progress::-moz-progress-bar {
  background-color: var(--theme-atmospheric-accents-2);
  border-radius: var(--formant-radius-full);
}

meter {
  width: 100%;
  height: 0.5rem;
  border-radius: var(--formant-radius-full);
  background-color: var(--formant-bg-secondary);
}

meter::-webkit-meter-bar {
  background-color: var(--formant-bg-secondary);
  border-radius: var(--formant-radius-full);
  border: none;
}

meter::-webkit-meter-optimum-value {
  background-color: var(--theme-atmospheric-accents-2);
  border-radius: var(--formant-radius-full);
}

meter::-webkit-meter-suboptimum-value {
  background-color: var(--theme-functional-accents-0);
  border-radius: var(--formant-radius-full);
}

meter::-webkit-meter-even-less-good-value {
  background-color: var(--theme-functional-accents-0);
  border-radius: var(--formant-radius-full);
}

/* ==========================================================================
   21. Buttons
   ========================================================================== */
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: var(--formant-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--formant-space-3) var(--formant-space-6);
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--formant-space-2);
  text-decoration: none;
}

button:not([type]):not([class]),
button[type="submit"],
input[type="submit"] {
  background-color: var(--theme-atmospheric-accents-2);
  color: var(--theme-neutrals-0);
}

button:not([type]):not([class]):hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background-color: var(--theme-neutrals-3);
  box-shadow: var(--formant-shadow-glow);
}

button[type="button"],
input[type="button"] {
  background-color: transparent;
  color: var(--theme-atmospheric-accents-2);
  border: 1px solid rgba(var(--theme-atmospheric-accents-2-rgb), 0.4);
}

button[type="button"]:hover,
input[type="button"]:hover {
  background-color: rgba(var(--theme-atmospheric-accents-2-rgb), 0.08);
  border-color: var(--theme-atmospheric-accents-2);
}

button[type="reset"],
input[type="reset"] {
  background-color: transparent;
  color: var(--theme-neutrals-2);
  border: 1px solid rgba(var(--theme-neutrals-2-rgb), 0.2);
}

button[type="reset"]:hover,
input[type="reset"]:hover {
  color: var(--theme-neutrals-3);
  border-color: var(--theme-neutrals-2);
}

button[data-variant="warning"] {
  background-color: var(--theme-functional-accents-0);
  color: var(--theme-neutrals-0);
}

button[data-variant="warning"]:hover {
  background-color: rgba(var(--theme-functional-accents-0-rgb), 0.8);
}

button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible,
input[type="reset"]:focus-visible {
  outline: none;
  box-shadow: var(--formant-focus-ring);
}

button:active,
input[type="submit"]:active,
input[type="button"]:active,
input[type="reset"]:active {
  transform: translateY(1px);
}

button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled,
input[type="reset"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   22. Media Elements
   ========================================================================== */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--formant-radius-md);
}

img[src$=".svg"] {
  border-radius: 0;
}

figure {
  margin: var(--formant-space-6) 0;
}

figure > img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

figcaption {
  font-family: var(--font-monospace);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: var(--formant-tracking-mono);
  color: var(--formant-text-muted);
  text-align: center;
  margin-top: var(--formant-space-2);
}

video {
  max-width: 100%;
  height: auto;
  border-radius: var(--formant-radius-md);
  background-color: var(--formant-bg-secondary);
}

audio {
  width: 100%;
  border-radius: var(--formant-radius-full);
}

/* ==========================================================================
   23. Details & Summary (Accordion)
   ========================================================================== */
details {
  background-color: var(--formant-bg-secondary);
  border: 1px solid var(--formant-border-subtle);
  border-radius: var(--formant-radius-md);
  margin-bottom: var(--formant-space-3);
  overflow: hidden;
}

summary {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: var(--formant-weight-medium);
  color: var(--formant-text-primary);
  padding: var(--formant-space-4);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color var(--formant-transition-base);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-family: var(--font-monospace);
  font-size: 1.25rem;
  color: var(--theme-atmospheric-accents-2);
  transition: transform var(--formant-transition-base);
}

details[open] summary::after {
  content: "−";
}

summary:hover {
  background-color: rgba(var(--theme-atmospheric-accents-0-rgb), 0.2);
}

details > *:not(summary) {
  padding: 0 var(--formant-space-4) var(--formant-space-4);
}

/* ==========================================================================
   24. Dialog & Popover
   ========================================================================== */
dialog {
  background-color: var(--formant-bg-secondary);
  border: 1px solid var(--formant-border-default);
  border-radius: var(--formant-radius-lg);
  padding: var(--formant-space-6);
  color: var(--formant-text-secondary);
  max-width: min(90vw, 600px);
  box-shadow: var(--formant-shadow-lg);
}

dialog::backdrop {
  background-color: rgba(var(--theme-neutrals-0-rgb), 0.8);
  backdrop-filter: blur(4px);
}

dialog[open] {
  animation: dialogFadeIn 0.3s ease;
}

@keyframes dialogFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   25. Navigation
   ========================================================================== */
nav {
  background-color: rgba(var(--theme-neutrals-0-rgb), 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--formant-border-subtle);
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--formant-space-6);
}

nav li {
  margin: 0;
}

nav a {
  font-size: 0.875rem;
  font-weight: var(--formant-weight-medium);
  color: var(--theme-neutrals-2);
  text-decoration: none;
  padding: var(--formant-space-3) 0;
  display: block;
  transition: color var(--formant-transition-base);
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--theme-neutrals-3);
  text-decoration: none;
}

/* ==========================================================================
   26. Article, Section, Aside, Main, Header, Footer
   ========================================================================== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--formant-space-8) var(--formant-space-6);
}

/* Site header - fixed navigation bar (direct child of body) */
body > header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: rgba(var(--theme-neutrals-0-rgb), 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--formant-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
}

body > header a:first-child {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--theme-neutrals-3);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

body > header a:first-child img {
  height: 32px;
  width: auto;
  display: block;
}

body > header nav {
  flex: 1;
  margin: 0 2rem;
  border-bottom: none;
  background-color: transparent;
  backdrop-filter: none;
}

body > header nav ul {
  justify-content: center;
}

body > header nav a {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body > header input[type="search"] {
  width: 200px;
}

/* Headings inside site header - match logo styling */
body > header h1,
body > header h2,
body > header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--theme-neutrals-3);
  margin: 0;
  line-height: 1;
}

/* Content headers - inside main, article, section (boxed styling) */
main > header,
article > header,
section > header {
  background-color: var(--theme-neutrals-1);
  border: 1px solid var(--formant-border-subtle);
  padding: var(--formant-space-6) var(--formant-space-8);
  margin-bottom: var(--formant-space-12);
  border-bottom-left-radius: var(--formant-radius-md);
  border-bottom-right-radius: var(--formant-radius-md);
}

/* Unset h1, h2 margins when inside content headers */
main > header h1,
main > header h2,
article > header h1,
article > header h2,
section > header h1,
section > header h2 {
  margin: 0;
}

/* Site footer (direct child of body) */
body > footer {
  margin-top: var(--formant-space-12);
  padding-top: var(--formant-space-8);
  border-top: 1px solid var(--formant-border-subtle);
  font-size: 0.875rem;
  color: var(--formant-text-muted);
}

/* Content footers - inside main, article, section (boxed styling) */
main > footer,
article > footer,
section > footer {
  background-color: var(--theme-neutrals-1);
  border: 1px solid var(--formant-border-subtle);
  padding: var(--formant-space-6) var(--formant-space-8);
  margin-top: var(--formant-space-12);
  border-top-left-radius: var(--formant-radius-md);
  border-top-right-radius: var(--formant-radius-md);
  font-size: 0.875rem;
  color: var(--formant-text-muted);
}

article {
  margin-bottom: var(--formant-space-12);
}

section {
  margin-bottom: var(--formant-space-10);
}

aside {
  background-color: var(--formant-bg-secondary);
  border: 1px solid var(--formant-border-subtle);
  border-radius: var(--formant-radius-md);
  padding: var(--formant-space-4);
  margin-bottom: var(--formant-space-4);
  font-size: 0.9375rem;
}

/* ==========================================================================
   27. Address & Time
   ========================================================================== */
address {
  font-style: normal;
  font-family: var(--font-monospace);
  font-size: 0.875rem;
  line-height: var(--formant-leading-normal);
  color: var(--formant-text-secondary);
  margin-bottom: var(--formant-space-4);
}

time {
  font-family: var(--font-monospace);
  font-size: 0.875rem;
  color: var(--theme-atmospheric-accents-1);
}

/* ==========================================================================
   28. Definition & Variables (for technical content)
   ========================================================================== */
var {
  font-family: var(--font-monospace);
  font-style: italic;
  color: var(--theme-functional-accents-1);
}

dfn {
  font-style: italic;
  border-bottom: 1px dashed var(--formant-border-strong);
  cursor: help;
}

/* ==========================================================================
   29. Data Attributes for Eyebrow Pattern
   ========================================================================== */
[data-eyebrow] {
  font-family: var(--font-monospace);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--theme-functional-accents-0);
  display: flex;
  align-items: center;
  gap: var(--formant-space-3);
  margin-bottom: var(--formant-space-3);
}

[data-eyebrow]::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  background-color: var(--theme-functional-accents-0);
}

/* ==========================================================================
   30. Status Tags via Data Attributes
   ========================================================================== */
[data-tag] {
  font-family: var(--font-monospace);
  font-size: 0.6875rem;
  letter-spacing: var(--formant-tracking-mono);
  text-transform: uppercase;
  padding: var(--formant-space-1) var(--formant-space-3);
  border-radius: var(--formant-radius-sm);
  display: inline-flex;
  align-items: center;
}

[data-tag="resolved"],
[data-tag="verified"] {
  background-color: rgba(var(--theme-atmospheric-accents-1-rgb), 0.3);
  color: var(--theme-atmospheric-accents-2);
  border: 1px solid rgba(var(--theme-atmospheric-accents-1-rgb), 0.4);
}

[data-tag="investigating"] {
  background-color: rgba(var(--theme-atmospheric-accents-0-rgb), 0.4);
  color: var(--theme-atmospheric-accents-2);
}

[data-tag="warning"] {
  background-color: rgba(var(--theme-functional-accents-0-rgb), 0.1);
  color: var(--theme-functional-accents-0);
}

[data-tag="ai-active"] {
  background-color: rgba(var(--theme-functional-accents-1-rgb), 0.1);
  color: var(--theme-functional-accents-1);
}

/* ==========================================================================
   31. Alert Boxes via Data Attributes
   ========================================================================== */
[data-alert] {
  padding: var(--formant-space-4);
  border-radius: var(--formant-radius-md);
  margin-bottom: var(--formant-space-4);
  font-size: 0.9375rem;
  display: flex;
  align-items: flex-start;
  gap: var(--formant-space-3);
}

[data-alert]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--formant-radius-full);
  flex-shrink: 0;
  margin-top: 0.5em;
}

[data-alert="info"] {
  background-color: rgba(var(--theme-atmospheric-accents-0-rgb), 0.3);
  color: var(--theme-atmospheric-accents-2);
}

[data-alert="info"]::before {
  background-color: var(--theme-atmospheric-accents-2);
}

[data-alert="warning"] {
  background-color: rgba(var(--theme-functional-accents-0-rgb), 0.08);
  color: var(--theme-functional-accents-0);
}

[data-alert="warning"]::before {
  background-color: var(--theme-functional-accents-0);
}

[data-alert="ai"] {
  background-color: rgba(var(--theme-functional-accents-1-rgb), 0.08);
  color: var(--theme-functional-accents-1);
}

[data-alert="ai"]::before {
  background-color: var(--theme-functional-accents-1);
}

/* ==========================================================================
   32. Scrollbar Styling
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--theme-neutrals-0);
}

::-webkit-scrollbar-thumb {
  background: var(--theme-atmospheric-accents-1);
  border-radius: var(--formant-radius-md);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--theme-atmospheric-accents-2);
}

/* ==========================================================================
   33. Selection Styling
   ========================================================================== */
::selection {
  background-color: rgba(var(--theme-atmospheric-accents-2-rgb), 0.3);
  color: var(--theme-neutrals-3);
}

/* ==========================================================================
   34. Focus Visible (Global)
   ========================================================================== */
:focus-visible {
  outline: none;
}

/* ==========================================================================
   35. Section Variants - Hero
   ========================================================================== */
section[data-variant="hero"] {
  position: relative;
  width: 100%;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  /* Set --hero-bg-image: url('your-image.jpg') to add background */
}

section[data-variant="hero"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--theme-neutrals-0);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(8px) brightness(0.6);
  transform: scale(1.1);
  z-index: 0;
}

section[data-variant="hero"][style*="hero-bg-image"]::before {
  background-image: var(--hero-bg-image);
}

section[data-variant="hero"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(
    to top,
    var(--theme-neutrals-1) 0%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
}

section[data-variant="hero"] > * {
  position: relative;
  z-index: 2;
}

section[data-variant="hero"] > div {
  max-width: 800px;
  padding: var(--formant-space-8);
}

section[data-variant="hero"] h1 {
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--theme-neutrals-3);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: var(--formant-space-6);
}

section[data-variant="hero"] h2 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--theme-neutrals-3);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: var(--formant-space-5);
}

section[data-variant="hero"] p {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  color: var(--theme-neutrals-2);
  font-size: 1.0625rem;
}

section[data-variant="hero"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(8px) brightness(0.6);
  transform: scale(1.1);
  z-index: 0;
}

section[data-variant="hero"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(
    to top,
    var(--theme-neutrals-1) 0%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
}

section[data-variant="hero"] > * {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   36. Data Variant - Lead Paragraph
   ========================================================================== */
p[data-variant="lead"] {
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 600px;
  color: var(--formant-text-secondary);
}

/* ==========================================================================
   37. Data Variant - Icon Buttons (square, no text)
   ========================================================================== */
button[data-variant="icon"] {
  width: 40px;
  height: 40px;
  padding: 0;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ==========================================================================
   38. Section Variant - Chat Component
   ========================================================================== */
section[data-variant="chat"] {
  border: 1px solid var(--formant-border-subtle);
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--theme-neutrals-0);
  margin-top: var(--formant-space-8);
}

section[data-variant="chat"] > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background-color: var(--formant-bg-secondary);
  border-bottom: 1px solid var(--formant-border-subtle);
  margin-bottom: 0;
}

section[data-variant="chat"] > header h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--theme-neutrals-3);
  margin: 0;
}

section[data-variant="chat"] > section {
  height: 300px;
  overflow-y: auto;
  padding: 1.5rem;
  background-color: var(--theme-neutrals-0);
  margin-bottom: 0;
}

section[data-variant="chat"] > footer {
  border-top: 1px solid var(--formant-border-subtle);
  padding: 1rem 1.5rem;
  background-color: var(--formant-bg-secondary);
  margin-top: 0;
}

section[data-variant="chat"] > footer form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

section[data-variant="chat"] > footer p {
  font-family: var(--font-monospace);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--theme-neutrals-2);
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0;
  width: 100%;
}

/* Chat avatar */
[data-variant="avatar"] {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-variant="avatar-lg"] {
  width: 64px;
  height: 64px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   39. Footer - Full Width with Inner Container
   ========================================================================== */
body > footer {
  padding: 5rem 0;
  margin-top: 0;
}

body > footer > * {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

body > footer address {
  font-family: var(--font-monospace);
  font-size: 0.6875rem;
  color: var(--theme-neutrals-2);
  line-height: 2;
  text-align: right;
  font-style: normal;
}

body > footer address p {
  margin: 0;
}

/* ==========================================================================
   40. Form Element Spacing (without fieldset)
   ========================================================================== */
form > label {
  margin-top: var(--formant-space-4);
}

form > label:first-child {
  margin-top: 0;
}

form > label + input,
form > label + textarea,
form > label + select {
  margin-bottom: var(--formant-space-4);
}

form > div + div {
  margin-top: var(--formant-space-4);
}

form > button,
form > div:last-child {
  margin-top: var(--formant-space-6);
}

/* ==========================================================================
   41. Date/Time Input Styling
   ========================================================================== */
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"] {
  color-scheme: dark;
}

[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="datetime-local"],
[data-theme="light"] input[type="month"],
[data-theme="light"] input[type="week"],
[data-theme="light"] input[type="time"] {
  color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"]
  input[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="week"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator {
  filter: none;
}

/* ==========================================================================
   42. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  main {
    padding: var(--formant-space-6) var(--formant-space-5);
  }

  nav ul {
    gap: var(--formant-space-4);
  }

  table {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: var(--formant-space-2) var(--formant-space-3);
  }

  section[data-variant="hero"] {
    min-height: 60vh;
  }

  body > footer > * {
    padding: 0 var(--formant-space-5);
  }
}

@media (max-width: 600px) {
  main {
    padding: var(--formant-space-4) var(--formant-space-4);
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  nav ul {
    gap: var(--formant-space-3);
    flex-wrap: wrap;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  section[data-variant="hero"] {
    min-height: 50vh;
  }

  section[data-variant="hero"] > div {
    padding: var(--formant-space-4);
  }

  body > footer > * {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--formant-space-8);
  }

  body > footer address {
    text-align: left;
  }

  dialog {
    max-width: 95vw;
    padding: var(--formant-space-4);
  }
}

/* ==========================================================================
   43. Print Styles
   ========================================================================== */
@media print {
  body {
    background-color: white;
    color: black;
  }

  nav,
  aside,
  details,
  dialog {
    display: none;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  pre,
  code {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
  }
}
