/* ============================================
   The Raven Witch — Design System
   Color Palette: Deep crimson on near-black
   Typography: Cinzel (display) + Raleway (body)
   ============================================ */

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

:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    --bg-surface: #1a1a1a;
    --bg-elevated: #222222;
    --accent-crimson: #6b0000;
    --accent-crimson-light: #8b0000;
    --accent-crimson-glow: rgba(107, 0, 0, 0.3);
    --accent-gold: #8b7355;
    --text-primary: #f0ece4;
    --text-muted: #9a9090;
    --border-dark: #5a1a1a;
    --border-subtle: #2a2020;

    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-display-decorative: 'Cinzel Decorative', serif;
    --font-body: 'Raleway', sans-serif;
    --font-serif: 'EB Garamond', serif;

    /* Spacing */
    --section-padding: 7rem 0;
    --container-max: 1200px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--accent-crimson-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

::selection {
    background: var(--accent-crimson);
    color: var(--text-primary);
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: background 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.97);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--border-subtle);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-brand:hover {
    color: var(--accent-crimson-light);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    padding: 0.5rem 0.25rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-crimson-light);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    gap: 5px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-primary);
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(139, 0, 0, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(90, 26, 26, 0.06) 0%, transparent 50%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.4) 0%, rgba(10, 10, 10, 0.75) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    letter-spacing: 2px;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 44px;
    min-height: 44px;
}

.btn-primary {
    background: var(--accent-crimson);
    border-color: var(--accent-crimson);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--accent-crimson-light);
    border-color: var(--accent-crimson-light);
    color: var(--text-primary);
    box-shadow: 0 0 30px var(--accent-crimson-glow);
}

.btn-secondary {
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-crimson-light);
    color: var(--accent-crimson-light);
}

.btn-large {
    padding: 1.2rem 3rem;
    font-size: 0.95rem;
}

/* ============================================
   Section Shared Styles
   ============================================ */

.section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.section-subtitle {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3.5rem;
}

/* Thin divider accent */
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--accent-crimson);
    margin: 1rem auto 0;
}

/* ============================================
   About Section
   ============================================ */

.about {
    padding: var(--section-padding);
    background: var(--bg-primary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
}

.about-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.about-text p {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    line-height: 1.8;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
    padding-top: 3rem;
    border-top: 1px solid var(--border-subtle);
}

.highlight-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.highlight h3 {
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.highlight p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   Gallery / Creations Section
   ============================================ */

.creations {
    padding: var(--section-padding);
    background: var(--bg-surface);
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--accent-crimson);
    color: var(--text-primary);
    background: rgba(139, 0, 0, 0.1);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border-subtle);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus .gallery-overlay,
.gallery-item:focus-within .gallery-overlay {
    opacity: 1;
}

.gallery-item-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.gallery-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-crimson-light);
    border-bottom: 1px solid var(--accent-crimson-light);
    padding: 0.5rem 1rem;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
}

.gallery-link:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.gallery-item.hidden {
    display: none;
}

.gallery-empty {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

/* ============================================
   Markets Section
   ============================================ */

.markets {
    padding: var(--section-padding);
    background: var(--bg-primary);
}

.markets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.market-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.market-card:hover {
    border-color: var(--accent-crimson);
    transform: translateY(-4px);
}

.market-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.market-date {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--accent-crimson-light);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.market-location {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.market-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.market-link:hover {
    color: var(--accent-crimson-light);
}

.markets-note {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-muted);
    font-size: 1rem;
}

.market-card--placeholder {
    border-style: dashed;
    text-align: center;
}

.market-card--placeholder h3 {
    color: var(--text-muted);
}

/* ============================================
   Shop CTA Section
   ============================================ */

.shop-cta {
    padding: 6rem 0;
    background: var(--bg-surface);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.shop-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(139, 0, 0, 0.08) 0%, transparent 70%);
}

.shop-cta .container {
    position: relative;
}

.shop-cta h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.shop-cta p {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* ============================================
   Contact Section
   ============================================ */

.contact {
    padding: var(--section-padding);
    background: var(--bg-primary);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--accent-crimson-light);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-crimson);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239a9090' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.char-count {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.char-count.at-limit {
    color: var(--accent-crimson-light);
}

.form-success {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: rgba(139, 0, 0, 0.1);
    border: 1px solid var(--accent-crimson);
    text-align: center;
}

.form-success p {
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-style: italic;
}

.form-error {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: rgba(139, 0, 0, 0.15);
    border: 1px solid var(--accent-crimson-light);
    text-align: center;
}

.form-error p {
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-style: italic;
}

.btn.submitting {
    opacity: 0.7;
    pointer-events: none;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    padding: 4rem 0 2rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.75rem;
}

.footer-tagline {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.footer-nav a:hover {
    color: var(--text-primary);
}

.footer-social {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}

.footer-social a {
    color: var(--text-muted);
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.footer-social a:hover {
    color: var(--accent-crimson-light);
    transform: translateY(-2px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   Responsive — Mobile First Overrides
   ============================================ */

@media (max-width: 1023px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    /* Mobile Nav */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: transform 0.4s ease;
        transform: translateX(100%);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu a {
        font-size: 1.1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-highlights {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-filters {
        gap: 0.4rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
        min-height: 44px;
        min-width: 44px;
    }

    /* Markets - single column now handled by dedicated 600px breakpoint below */

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-nav ul {
        align-items: center;
    }
}

/* ============================================
   Markets — Single column below 600px
   ============================================ */

@media (max-width: 600px) {
    .markets-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Animations — Fade in on scroll
   ============================================ */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Utility
   ============================================ */

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--accent-crimson-light);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}