/* ══════════════════════════════════════════════════
   WING NOTEBOOKS — Base Styles
   Reset, typography, global elements.
   ══════════════════════════════════════════════════ */

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

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

body {
    font-family: var(--font-body);
    font-size: var(--type-body);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

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

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

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

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

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--color-text);
    line-height: var(--leading-snug);
}

h1 {
    font-size: 1.75rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.25;
}

h3 {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

h4 {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
}

/* Responsive type scale (mobile-first → desktop) */
@media (min-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
}

@media (min-width: 1024px) {
    h1 { font-size: var(--type-h1); }
    h2 { font-size: var(--type-h2); }
    h3 { font-size: var(--type-h3); }
    h4 { font-size: var(--type-h4); }
}

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

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

.wing-display {
    font-family: var(--font-display);
    font-size: 2.25rem;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .wing-display { font-size: 2.75rem; }
}

@media (min-width: 1024px) {
    .wing-display { font-size: var(--type-display); }
}

.wing-lead {
    font-size: var(--type-body-large);
    color: var(--color-text-secondary);
}

.wing-small {
    font-size: var(--type-small);
}

.wing-caption {
    font-size: var(--type-caption);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.wing-muted {
    color: var(--color-text-muted);
}

.wing-label {
    font-size: var(--type-small);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
}

strong, b {
    font-weight: 600;
}

/* ── Focus ── */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ── Skip Link ── */
.wing-skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: var(--z-toast);
    padding: var(--space-3) var(--space-6);
    background: var(--color-brand-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: top var(--duration-fast) var(--ease-default);
}

.wing-skip-link:focus {
    top: var(--space-4);
    color: #fff;
}

/* ── Container ── */
.wing-container {
    width: 100%;
    max-width: var(--grid-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--grid-padding);
    padding-right: var(--grid-padding);
}

.wing-container--narrow {
    max-width: var(--grid-narrow);
}

.wing-container--wide {
    max-width: var(--grid-wide);
}

/* ── Main ── */
.wing-main {
    min-height: 60vh;
    padding-top: var(--space-8);
    padding-bottom: var(--space-16);
}

@media (min-width: 1024px) {
    .wing-main {
        padding-top: var(--space-12);
        padding-bottom: var(--space-20);
    }
}

/* ── Section ── */
.wing-section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

@media (min-width: 768px) {
    .wing-section {
        padding-top: var(--space-16);
        padding-bottom: var(--space-16);
    }
}

@media (min-width: 1024px) {
    .wing-section {
        padding-top: var(--space-20);
        padding-bottom: var(--space-20);
    }
}

.wing-section__title {
    text-align: center;
    margin-bottom: var(--space-8);
}

@media (min-width: 1024px) {
    .wing-section__title {
        margin-bottom: var(--space-12);
    }
}

/* ── Divider ── */
.wing-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-8) 0;
}

/* ── 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;
}

/* ── Selection ── */
::selection {
    background: var(--color-accent-light);
    color: var(--color-brand-primary);
}

/* ══════════════════════════════════════════════════
   Stationery, Paper Textures & Notebook Rulings
   ══════════════════════════════════════════════════ */

/* Organic Paper Grain Background */
.wing-paper-bg {
    background-color: var(--color-paper-cream);
    background-image: 
        radial-gradient(var(--color-paper-warm) 15%, transparent 16%),
        radial-gradient(var(--color-neutral-200) 15%, transparent 16%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
}

/* Classic Ruled Notebook Lines with Margin */
.wing-ruled-bg {
    background-color: var(--color-paper-ivory);
    background-image: 
        linear-gradient(90deg, transparent 48px, var(--color-paper-margin) 48px, var(--color-paper-margin) 50px, transparent 50px),
        linear-gradient(var(--color-paper-line) 1px, transparent 1px);
    background-size: 100% 100%, 100% 28px;
    background-position: 0 0, 0 14px;
}

/* 5mm Dot Grid Bullet Journal Pattern */
.wing-dotgrid-bg {
    background-color: var(--color-paper-ivory);
    background-image: radial-gradient(var(--color-paper-dot) 1.2px, transparent 1.2px);
    background-size: 20px 20px;
    background-position: 10px 10px;
}

/* Engineering / Math Grid Pattern */
.wing-grid-bg {
    background-color: var(--color-paper-ivory);
    background-image: 
        linear-gradient(var(--color-paper-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-paper-line) 1px, transparent 1px);
    background-size: 20px 20px, 20px 20px;
}

/* Handwriting Typography Accent */
.wing-handwritten {
    font-family: var(--font-handwriting);
    font-size: 1.35rem;
    line-height: 1.2;
    color: var(--color-ink-blue);
    font-weight: 600;
}

.wing-handwritten--accent {
    color: var(--color-accent);
}

.wing-handwritten--black {
    color: var(--color-ink-black);
}

/* Margin Notes & Sticky Accents */
.wing-margin-note {
    display: inline-block;
    font-family: var(--font-handwriting);
    font-size: 1.15rem;
    color: var(--color-accent);
    transform: rotate(-3deg);
    padding: 2px 8px;
    letter-spacing: 0.01em;
}

/* Washi Tape Strip */
.wing-tape {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%) rotate(-1.5deg);
    width: 90px;
    height: 24px;
    background: rgba(220, 208, 192, 0.7);
    backdrop-filter: blur(2px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 5;
    border-left: 2px dashed rgba(0,0,0,0.15);
    border-right: 2px dashed rgba(0,0,0,0.15);
}

/* Stitched Border (Saddle-Stitch / Smyth-Sewn Effect) */
.wing-stitched-border {
    position: relative;
    border: 1px dashed var(--color-neutral-400);
    border-radius: var(--radius-md);
}

/* Gold Foil Text */
.wing-foil-text {
    background: linear-gradient(135deg, #BF953F 0%, #FCF6BA 25%, #B38728 50%, #FBF5B7 75%, #AA771C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

