/**
 * Base Styles
 *
 * Reset, typography, and global element styles.
 *
 * @package enhed
 */

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

/* Headings - Fraunces (never italic) */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-accent);
    font-weight: var(--font-normal);
    font-style: normal;
    line-height: var(--leading-tight);
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

h1, .h1 {
    font-size: clamp(2.5rem, 5vw, var(--text-5xl));
    letter-spacing: -0.02em;
}

h2, .h2 {
    font-size: clamp(2rem, 4vw, var(--text-4xl));
    letter-spacing: -0.01em;
}

h3, .h3 {
    font-size: clamp(1.5rem, 3vw, var(--text-3xl));
}

h4, .h4 {
    font-size: var(--text-2xl);
}

h5, .h5 {
    font-size: var(--text-xl);
}

h6, .h6 {
    font-size: var(--text-lg);
}

/* Body text - Manrope */
p {
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
}

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

.lead {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

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

/* UI text - Quicksand */
.ui-text {
    font-family: var(--font-ui);
    font-weight: var(--font-medium);
}

/* Links */
a:not([class]) {
    color: var(--color-action);
    transition: color var(--transition-fast);
}

a:not([class]):hover {
    color: var(--color-greige);
}

/* Strong/Bold */
strong, b {
    font-weight: var(--font-semibold);
}

/* Blockquotes - Manrope */
blockquote {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-style: normal;
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
    padding-left: var(--space-6);
    border-left: 3px solid var(--color-sand);
    margin: var(--space-8) 0;
}

blockquote cite {
    display: block;
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    font-family: var(--font-ui);
    color: var(--color-greige);
}

/* Code */
code {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: var(--color-secondary);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
}

pre {
    background: var(--color-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}

/* ==========================================================================
   Selection
   ========================================================================== */

::selection {
    background: var(--color-sand);
    color: var(--color-chokolade);
}

/* ==========================================================================
   Focus States
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--color-action);
    outline-offset: 2px;
}

/* ==========================================================================
   Screen Reader Only
   ========================================================================== */

.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;
}

/* ==========================================================================
   Skip Link
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: var(--z-toast);
    padding: var(--space-3) var(--space-4);
    background: var(--color-chokolade);
    color: var(--color-paper);
    font-family: var(--font-ui);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}
