/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--parchment-light);
    background-image: var(--parchment-texture);
    overflow-x: hidden;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
}

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h1::after {
    content: "";
    position: absolute;
    left: 25%;
    right: 25%;
    bottom: 0;
    height: 2px;
    background: var(--ink-faded);
    opacity: 0.3;
}

/* Accessibility helpers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--focus-outline);
    outline-offset: 2px;
}

button:focus-visible,
select:focus-visible,
.quiz-option:focus-visible,
.flashcard-inner:focus-visible {
    outline: 3px solid var(--focus-outline);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--focus-outline);
}
