/**
 * DhanGenie Base & Typography Styles
 * Reset, typography hierarchy, accessibility, and foundational elements
 */

/* Box sizing rules */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Prevent font scaling on orientation changes */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

h1 {
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-4);
}

h2 {
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.25;
    margin-bottom: var(--space-3);
}

h3 {
    font-size: 1.35rem;
    line-height: 1.35;
    margin-bottom: var(--space-2);
}

h4 {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: var(--space-2);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-body);
}

p.lead {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

p.subtext {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

small, .text-muted {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Links */
a {
    color: var(--primary-bright);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* List resets */
ul, ol {
    list-style: none;
}

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

/* Form Controls Base */
button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

/* Focus styles for accessibility (WCAG 2.1 AA) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-color: var(--border-focus);
}

/* Text Selection */
::selection {
    background-color: var(--primary-border);
    color: var(--primary);
}

/* Inline code / tags */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--primary);
}
