/*
================================================================================
  ML Software, LLC
  Copyright 2026. All rights reserved.

  IQ Platform - _app/assets/css/base.css

  Platform: 0.1.1
  Version: 0.1.1
  Created: 2026-04-27
  Updated: 2026-04-27

  Description: Reset and base styles. Box-sizing reset, margin reset,
  font defaults, link defaults, focus-visible defaults. The
  "make every browser behave the same before component styles begin"
  layer.

  Load order: base.css MUST load AFTER tokens.css (uses --bg-base,
  --text-primary, --font-ui, etc.) and BEFORE any component CSS.

  Version History:
    0.1.1 - 2026-04-27 - Session 3 cont'd. Readability floor pass:
                         <small> 12px -> 13px (matches new
                         --font-min-secondary). h6 stays at 12px
                         (display-font small caps, --font-min-display
                         floor). Added a touch-override block that
                         bumps body text 14->15 on coarse pointers.
    0.1.0 - 2026-04-27 - Session 3 initial. Reset extracted from JQiq
                         lines 54-128, RIQ equivalent block, and DZIQ
                         equivalent block (all three apps shared the
                         same reset). Added platform-level
                         focus-visible defaults that views-core.js
                         components depend on.
================================================================================
*/

/* ============================================================================
   Reset
   ============================================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  color-scheme: dark;
}

button, [role="button"], a {
  touch-action: manipulation;
}


/* ============================================================================
   Base body
   ============================================================================ */

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


/* ============================================================================
   Headings
   Defaults only. Component CSS handles in-component heading sizes.
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1.25;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
h5 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
h6 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }


/* ============================================================================
   Paragraphs and inline text
   ============================================================================ */

p {
  margin: 0 0 12px 0;
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: 700;
  color: var(--text-primary);
}

em, i {
  font-style: italic;
}

small {
  font-size: 13px;
  color: var(--text-secondary);
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 13px;
}

code {
  background: var(--bg-raised);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
}

pre code {
  background: transparent;
  padding: 0;
  border: none;
}


/* ============================================================================
   Links
   ============================================================================ */

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ============================================================================
   Lists
   Reset by default; component code can re-style as needed.
   ============================================================================ */

ul, ol {
  list-style: none;
}


/* ============================================================================
   Images
   ============================================================================ */

img, svg {
  max-width: 100%;
  display: block;
}


/* ============================================================================
   Horizontal rule
   ============================================================================ */

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}


/* ============================================================================
   Selection
   ============================================================================ */

::selection {
  background: var(--accent-dim);
  color: var(--text-primary);
}


/* ============================================================================
   Focus visible (platform default)
   Component CSS may override per-element, but this is the floor.
   ============================================================================ */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ============================================================================
   Scrollbar (WebKit / Blink)
   Platform-styled scrollbars. Dark theme.
   ============================================================================ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--bg-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}


/* ============================================================================
   Touch override (coarse pointer)
   On phones and tablets, body text reads small at desktop sizes.
   Bump body and small text up a notch on coarse pointers for field
   readability. Component-level rules may bump further -- this is the
   floor.
   ============================================================================ */

@media (pointer: coarse) {

  body {
    font-size: 15px;  /* up from 14 */
  }

  small {
    font-size: 14px;  /* up from 13 */
  }

  code, pre, code, kbd, samp {
    font-size: 14px;  /* up from 13 */
  }

  h5 { font-size: 14px; }  /* up from 13 */
  h6 { font-size: 13px; }  /* up from 12 */

}