/* ==========================================================================
   Looponia - Base Styles
   Reset, typography, scrollbar, and foundational styles
   ========================================================================== */

/* -------------------------------------------------------------------------
   CSS Reset (Modern)
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Remove default margin and set defaults */
html {
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* For fixed navbar */
}

body {
    min-height: 100vh;
    line-height: var(--leading-normal);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Reset for specific elements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
}

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

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

ul,
ol {
    list-style: none;
}

/* Remove animations for people who've turned them off */
@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;
    }
}

/* -------------------------------------------------------------------------
   Typography
   ------------------------------------------------------------------------- */

/* Display font - Corinthia for brand */
.font-display {
    font-family: var(--font-display);
}

/* Headings */
h1,
.h1 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

h2,
.h2 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

h3,
.h3 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-snug);
}

h4,
.h4 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-snug);
}

h5,
.h5 {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    line-height: var(--leading-normal);
}

h6,
.h6 {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: var(--leading-normal);
}

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

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

/* Links */
a {
    color: var(--primary);
    transition: color var(--transition-fast);
}

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

/* Text utilities */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.text-accent {
    color: var(--text-accent);
}

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

.text-gradient {
    background: var(--gradient-serenity);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Brand title */
.brand-title {
    font-family: var(--font-display);
    font-size: var(--text-hero);
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-logo);
    color: var(--splash-purple);
    line-height: var(--leading-none);
}

/* Lead text */
.lead {
    font-size: var(--text-xl);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
}

/* Small text */
.small,
small {
    font-size: var(--text-sm);
}

.tiny {
    font-size: var(--text-xs);
}

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

em,
i {
    font-style: italic;
}

/* Highlight */
mark,
.highlight {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
    padding: 0.1em 0.3em;
    border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------------------
   Custom Scrollbar
   ------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) var(--bg-secondary);
}

/* -------------------------------------------------------------------------
   Selection
   ------------------------------------------------------------------------- */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* -------------------------------------------------------------------------
   Focus Styles
   ------------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Utility Classes
   ------------------------------------------------------------------------- */

/* Text alignment */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Font weights */
.font-light {
    font-weight: var(--font-light);
}

.font-normal {
    font-weight: var(--font-regular);
}

.font-medium {
    font-weight: var(--font-medium);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-bold {
    font-weight: var(--font-bold);
}

/* Display */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.grid {
    display: grid;
}

/* Visibility */
.invisible {
    visibility: hidden;
}

.visible {
    visibility: visible;
}

/* Overflow */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* Position */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}

.cursor-default {
    cursor: default;
}

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