/* ========================================
   V2 DESIGN SYSTEM - LITERARY AUTHOR PLATFORM
   "Ink + Paper" - PLAN2026
   ======================================== */

/* Color Tokens */
:root {
    /* V2 Core Palette */
    --v2-black: #010300;
    --v2-cream: #f0e8c9;
    --v2-red: #fd0009;
    --v2-gray: #bfb9a3;
    
    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

/* ========================================
   BASE STYLES
   ======================================== */

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--v2-black);
    color: var(--v2-cream);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Skip Navigation Link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: var(--v2-red);
    color: var(--v2-cream);
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: top 0.3s ease;
    font-family: var(--font-body);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.skip-to-content:focus {
    top: 0;
}

/* Enhanced Focus Indicators */
*:focus-visible {
    outline: 3px solid var(--v2-red);
    outline-offset: 3px;
    border-radius: 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-width: 0;
}

/* Reduced Motion Support */
@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 SCALE
   ======================================== */

.font-display {
    font-family: var(--font-display);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    padding: 0;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    line-height: 1.2;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.3;
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    line-height: 1.4;
}

p {
    line-height: 1.7;
    max-width: 65ch;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav-link {
    color: var(--v2-cream);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    font-size: 0.9375rem;
}

.nav-link:hover {
    color: var(--v2-red);
}

/* ========================================
   READING SURFACES - "Paper"
   ======================================== */

.reading-surface {
    background: var(--v2-cream);
    color: var(--v2-black);
    padding: 3rem 1.5rem;
    border-radius: 0.5rem;
}

.reading-surface h1,
.reading-surface h2,
.reading-surface h3,
.reading-surface h4,
.reading-surface h5,
.reading-surface h6 {
    color: var(--v2-black);
}

.reading-surface p {
    color: var(--v2-black);
    line-height: 1.8;
}

.reading-surface a {
    color: var(--v2-red);
    text-decoration: underline;
}

.reading-surface a:hover {
    color: var(--v2-black);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
    background: var(--v2-red);
    color: var(--v2-cream);
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: center;
}

.btn-primary:hover {
    background: var(--v2-black);
    box-shadow: 0 0 0 2px var(--v2-red);
}

.btn-secondary {
    background: transparent;
    color: var(--v2-cream);
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 2px solid var(--v2-cream);
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: center;
}

.btn-secondary:hover {
    border-color: var(--v2-red);
    color: var(--v2-red);
}

/* Buttons on reading surfaces */
.reading-surface .btn-primary {
    background: var(--v2-black);
    color: var(--v2-cream);
}

.reading-surface .btn-primary:hover {
    background: var(--v2-red);
}

.reading-surface .btn-secondary {
    color: var(--v2-black);
    border-color: var(--v2-black);
}

.reading-surface .btn-secondary:hover {
    border-color: var(--v2-red);
    color: var(--v2-red);
}

/* ========================================
   SECTIONS & CONTAINERS
   ======================================== */

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.section-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.section-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem;
}

/* ========================================
   CARDS & MODULES
   ======================================== */

.card {
    background: rgba(240, 232, 201, 0.03);
    border: 1px solid rgba(240, 232, 201, 0.1);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(240, 232, 201, 0.2);
    background: rgba(240, 232, 201, 0.05);
}

.card h3 {
    margin-bottom: 1rem;
}

/* ========================================
   DIVIDERS
   ======================================== */

.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--v2-gray), transparent);
    margin: 4rem 0;
    border: none;
}

/* ========================================
   STATS & METRICS
   ======================================== */

.stat-value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--v2-red);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--v2-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* ========================================
   ACCESSIBILITY - Remove red focus squares
   ======================================== */

a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--v2-red);
    border-radius: 4px;
}

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

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
    .section-container,
    .section-narrow {
        padding: 3rem 1.25rem;
    }
    
    .section-hero {
        min-height: 50vh;
        padding: 4rem 1.25rem;
    }
    
    .reading-surface {
        padding: 2rem 1.25rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
        width: 100%;
    }
}

/* ========================================
   FORMS
   ======================================== */

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    background: rgba(240, 232, 201, 0.05);
    border: 1px solid rgba(240, 232, 201, 0.2);
    color: var(--v2-cream);
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    width: 100%;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
    border-color: var(--v2-red);
    background: rgba(240, 232, 201, 0.08);
}

input::placeholder,
textarea::placeholder {
    color: var(--v2-gray);
}

/* Reading surface forms */
.reading-surface input[type="text"],
.reading-surface input[type="email"],
.reading-surface input[type="tel"],
.reading-surface textarea {
    background: rgba(1, 3, 0, 0.03);
    border-color: rgba(1, 3, 0, 0.2);
    color: var(--v2-black);
}

.reading-surface input::placeholder,
.reading-surface textarea::placeholder {
    color: var(--v2-gray);
}

/* ========================================
   NEWSLETTER SIGNUP
   ======================================== */

.newsletter-signup {
    background: rgba(240, 232, 201, 0.03);
    border: 1px solid rgba(240, 232, 201, 0.1);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-signup h3 {
    margin-bottom: 1rem;
}

.newsletter-signup p {
    color: var(--v2-gray);
    margin-bottom: 2rem;
}

/* ========================================
   MOBILE MENU
   ======================================== */

.mobile-menu {
    background: var(--v2-black);
    border-top: 1px solid rgba(240, 232, 201, 0.1);
}

.mobile-menu a {
    color: var(--v2-cream);
    padding: 1rem 1.5rem;
    display: block;
    border-bottom: 1px solid rgba(240, 232, 201, 0.05);
}

.mobile-menu a:hover {
    background: rgba(240, 232, 201, 0.03);
    color: var(--v2-red);
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: var(--v2-black);
    border-top: 1px solid rgba(240, 232, 201, 0.1);
    padding: 3rem 1.5rem 2rem;
    margin-top: 6rem;
}

footer a {
    color: var(--v2-cream);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--v2-red);
}

footer .text-sm {
    color: var(--v2-gray);
}
