@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Lexend:wght@400;500;600&display=swap');

/* ===== COMPREHENSIVE CSS RESET ===== */
/* Modern reset with accessibility, performance, and UX improvements */

/* Use border-box universally - the way box-sizing should have always been */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Remove all default margins and padding */
* {
    margin: 0;
    padding: 0;
    font: inherit;
}

/* Prevent font size inflation on mobile devices */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Smooth scroll for anchor links, but respect user preferences */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Improve text rendering and set sensible defaults */
html, body {
    height: 100%;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

/* Improve media defaults - responsive by default */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Avoid text overflow */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Remove list styles */
ul, ol {
    list-style: none;
}

/* Improve table defaults */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Form elements inherit font properties and remove annoying defaults */
input, button, textarea, select {
    font: inherit;
    color: inherit;
}

/* Better button defaults */
button, [type="button"], [type="reset"], [type="submit"] {
    -webkit-appearance: button;
    appearance: button;
    cursor: pointer;
    border: none;
    background: none;
}

/* Disabled buttons shouldn't have pointer cursor */
button:disabled, [type="button"]:disabled, [type="reset"]:disabled, [type="submit"]:disabled {
    cursor: not-allowed;
}

/* Remove default button focus outline but maintain accessibility */
button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Input appearance resets */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

/* Number input buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Textarea shouldn't be resizable horizontally by default */
textarea {
    resize: vertical;
}

/* Better link defaults */
a {
    color: inherit;
    text-decoration: none;
}

a:not([class]) {
    text-decoration-skip-ink: auto;
}

/* Make sure dialog elements are hidden by default */
dialog:not([open]) {
    display: none;
}

/* Ensure interactive elements have pointer cursor */
label[for], summary {
    cursor: pointer;
}

/* Remove animations for people who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Improve quote defaults */
blockquote, q {
    quotes: none;
}

blockquote::before, blockquote::after,
q::before, q::after {
    content: '';
    content: none;
}

/* Better horizontal rule */
hr {
    border: none;
    border-top: 1px solid currentColor;
    color: inherit;
    height: 0;
    overflow: visible;
}

/* Ensure code blocks are scrollable */
pre {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Better defaults for hidden attribute */
[hidden] {
    display: none !important;
}

/* Improve focus visibility for keyboard navigation */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Better selection styling */
::selection {
    background-color: rgba(0, 0, 0, 0.2);
    color: inherit;
}

::-moz-selection {
    background-color: rgba(0, 0, 0, 0.2);
    color: inherit;
}

:root {
    /* Font Family Scale */
    --font-sans: 'Lexend', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;

    /* Line Height Scale */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
}

/* ===== ANIMATION & TRANSITIONS ===== */
:root {
    /* Cubic Bezier Curves */
    --ease-fast-spatial-curve: cubic-bezier(0.42, 1.67, 0.21, 0.9);
    --ease-default-spatial-curve: cubic-bezier(0.38, 1.21, 0.22, 1);
    --ease-slow-spatial-curve: cubic-bezier(0.39, 1.29, 0.35, 0.98);
    --ease-fast-effects-curve: cubic-bezier(0.31, 0.94, 0.34, 1);
    --ease-default-effects-curve: cubic-bezier(0.34, 0.8, 0.34, 1);
    --ease-slow-effects-curve: cubic-bezier(0.34, 0.88, 0.34, 1);
    --std-fast-spatial-curve: cubic-bezier(0.27, 1.06, 0.18, 1);
    --std-default-spatial-curve: cubic-bezier(0.27, 1.06, 0.18, 1);
    --std-slow-spatial-curve: cubic-bezier(0.27, 1.06, 0.18, 1);
    --std-fast-effects-curve: cubic-bezier(0.31, 0.94, 0.34, 1);
    --std-default-effects-curve: cubic-bezier(0.34, 0.8, 0.34, 1);
    --std-slow-effects-curve: cubic-bezier(0.34, 0.88, 0.34, 1);

    /* Expressive Transitions: https://m3.material.io/styles/motion/overview/specs */
    --ease-fast-spatial: 350ms var(--ease-fast-spatial-curve);
    --ease-default-spatial: 500ms var(--ease-default-spatial-curve);
    --ease-slow-spatial: 650ms var(--ease-slow-spatial-curve);
    --ease-fast-effects: 150ms var(--ease-fast-effects-curve);
    --ease-default-effects: 200ms var(--ease-default-effects-curve);
    --ease-slow-effects: 300ms var(--ease-slow-effects-curve);

    /* Standard Transitions */
    --std-fast-spatial: 350ms var(--std-fast-spatial-curve);
    --std-default-spatial: 500ms var(--std-default-spatial-curve);
    --std-slow-spatial: 750ms var(--std-slow-spatial-curve);
    --std-fast-effects: 150ms var(--std-fast-effects-curve);
    --std-default-effects: 200ms var(--std-default-effects-curve);
    --std-slow-effects: 300ms var(--std-slow-effects-curve);
    --scale-up-subtle: 1.02;
    --scale-down-subtle: 0.98;
}
