/* =============================================================
   Connect N — Base Styles
   Depends on: design-tokens.css, fonts.css
   ============================================================= */

/* ---------- Modern Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-family: var(--font-sans);
    line-height: var(--leading-normal);
    tab-size: 4;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--surface-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background var(--duration-normal) var(--ease-out),
                color var(--duration-normal) var(--ease-out);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-4xl); font-weight: var(--weight-black); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); font-weight: var(--weight-semibold); }

p { line-height: var(--leading-relaxed); }
small { font-size: var(--text-sm); color: var(--text-secondary); }

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--text-link-hover); text-decoration: underline; }

strong, b { font-weight: var(--weight-semibold); }

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

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

/* ---------- Media ---------- */
img, svg, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- Form defaults ---------- */
input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

/* ---------- Focus (accessibility) ---------- */
:focus { outline: none; }
:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    z-index: var(--z-tooltip);
    transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus { top: 8px; }

/* ---------- Selection ---------- */
::selection {
    background: var(--lh-gold-200);
    color: var(--lh-navy);
}

/* ---------- Scrollbar (subtle, branded) ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
    border: 2px solid var(--surface-bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- Utility classes ---------- */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.text-muted      { color: var(--text-muted); }
.text-secondary  { color: var(--text-secondary); }
.text-primary    { color: var(--text-primary); }
.text-success    { color: var(--color-success); }
.text-warning    { color: var(--color-warning); }
.text-urgent     { color: var(--color-urgent); }
.text-gold       { color: var(--lh-gold-dark); }
.text-navy       { color: var(--lh-navy); }

.text-xs         { font-size: var(--text-xs); }
.text-sm         { font-size: var(--text-sm); }
.text-lg         { font-size: var(--text-lg); }

.font-medium     { font-weight: var(--weight-medium); }
.font-semibold   { font-weight: var(--weight-semibold); }
.font-bold       { font-weight: var(--weight-bold); }

.uppercase       { text-transform: uppercase; letter-spacing: var(--tracking-wider); }

.bg-card         { background: var(--surface-card); }
.bg-sunken       { background: var(--surface-sunken); }

.rounded         { border-radius: var(--radius-md); }
.rounded-lg      { border-radius: var(--radius-lg); }
.rounded-full    { border-radius: var(--radius-full); }

.shadow-sm       { box-shadow: var(--shadow-sm); }
.shadow-md       { box-shadow: var(--shadow-md); }
.shadow-lg       { box-shadow: var(--shadow-lg); }

/* ---------- Print ---------- */
@media print {
    body { background: white; }
    .no-print, nav, aside { display: none !important; }
}
