/* ============================================
   TheGuitarTuner.com - Premium Guitar Tuner
   Aesthetic: Vintage Warmth meets Modern Precision
   ============================================ */

:root {
    /* Core palette - warm amber/gold on deep mahogany */
    --gold: #D4A84B;
    --gold-light: #E8C97A;
    --gold-dark: #B8922F;
    --amber: #F5A623;
    --cream: #FFF8E7;
    --cream-muted: #E8DCC8;
    
    /* Dark wood tones */
    --mahogany: #1A0F0A;
    --mahogany-light: #2D1810;
    --walnut: #3D2519;
    --rosewood: #4A2C1C;
    
    /* Status colors */
    --green: #4ADE80;
    --green-glow: rgba(74, 222, 128, 0.4);
    --red: #F87171;
    --red-glow: rgba(248, 113, 113, 0.4);
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Instrument Sans', -apple-system, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--mahogany);
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Noise texture overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Ambient glow effect */
.ambient-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 150vw;
    height: 150vh;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, 
        rgba(212, 168, 75, 0.08) 0%, 
        rgba(26, 15, 10, 0) 50%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   Header & Navigation
   ============================================ */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(to bottom, 
        rgba(26, 15, 10, 0.95) 0%, 
        rgba(26, 15, 10, 0) 100%);
    backdrop-filter: blur(10px);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--cream);
    transition: transform 0.3s var(--ease-out-back);
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(212, 168, 75, 0.5);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px rgba(212, 168, 75, 0.5); }
    50% { text-shadow: 0 0 30px rgba(212, 168, 75, 0.8); }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-links a {
    color: var(--cream-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.3s var(--ease-out-expo);
}

.nav-links a:hover {
    color: var(--gold);
}

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

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

.hero {
    padding: calc(100px + var(--space-xl)) var(--space-lg) var(--space-lg);
    text-align: center;
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hero-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: reveal-up 0.8s var(--ease-out-expo) forwards;
}

.hero-line:nth-child(1) { animation-delay: 0.1s; }
.hero-line:nth-child(2) { animation-delay: 0.2s; }
.hero-line:nth-child(3) { animation-delay: 0.3s; }

.hero-line.accent {
    color: var(--gold);
    text-shadow: 0 0 60px rgba(212, 168, 75, 0.4);
}

@keyframes reveal-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tagline {
    font-size: 1.1rem;
    color: var(--cream-muted);
    margin-top: var(--space-md);
    opacity: 0;
    animation: fade-in 0.8s ease 0.5s forwards;
}

@keyframes fade-in {
    to { opacity: 1; }
}

/* ============================================
   Tuner Container
   ============================================ */

.tuner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-lg);
}

@media (max-width: 900px) {
    .tuner-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Main Tuner
   ============================================ */

.tuner {
    background: linear-gradient(145deg, 
        var(--mahogany-light) 0%, 
        var(--mahogany) 100%);
    border: 1px solid rgba(212, 168, 75, 0.2);
    border-radius: 24px;
    padding: var(--space-xl);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.tuner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(212, 168, 75, 0.3) 50%, 
        transparent 100%);
}

/* Note Display */
.tuner-display {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.note-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.current-note {
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 700;
    color: var(--cream);
    text-shadow: 0 0 40px rgba(212, 168, 75, 0.3);
    transition: all 0.2s ease;
    min-width: 120px;
}

.current-note.in-tune {
    color: var(--green);
    text-shadow: 0 0 60px var(--green-glow);
}

.flat-indicator, .sharp-indicator {
    font-size: 2rem;
    color: var(--cream-muted);
    opacity: 0.3;
    transition: all 0.2s ease;
}

.flat-indicator.active {
    color: var(--red);
    opacity: 1;
    text-shadow: 0 0 20px var(--red-glow);
}

.sharp-indicator.active {
    color: var(--amber);
    opacity: 1;
    text-shadow: 0 0 20px rgba(245, 166, 35, 0.4);
}

.frequency-display {
    font-size: 1.4rem;
    color: var(--gold);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.octave-display {
    font-size: 0.9rem;
    color: var(--cream-muted);
    margin-top: var(--space-xs);
}

/* ============================================
   Tuning Meter
   ============================================ */

.meter-container {
    margin: var(--space-xl) 0;
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--cream-muted);
    margin-bottom: var(--space-sm);
    padding: 0 10px;
}

.meter {
    position: relative;
    padding: var(--space-md) 0;
}

.meter-track {
    position: relative;
    height: 60px;
    background: linear-gradient(to bottom, 
        var(--walnut) 0%, 
        var(--mahogany) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 168, 75, 0.15);
    overflow: hidden;
}

.meter-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 0 10%;
}

.marker {
    width: 2px;
    background: rgba(212, 168, 75, 0.2);
    border-radius: 1px;
}

.marker.center {
    width: 4px;
    background: linear-gradient(to bottom, 
        var(--green) 0%, 
        rgba(74, 222, 128, 0.3) 100%);
    box-shadow: 0 0 15px var(--green-glow);
}

.meter-glow-track {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 4px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, 
        var(--red) 0%, 
        var(--amber) 25%, 
        var(--green) 50%, 
        var(--amber) 75%, 
        var(--red) 100%);
    opacity: 0.2;
    border-radius: 2px;
}

.meter-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 40px;
    background: linear-gradient(to bottom, 
        var(--gold-light) 0%, 
        var(--gold) 50%, 
        var(--gold-dark) 100%);
    border-radius: 3px;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 20px rgba(212, 168, 75, 0.6),
        0 0 40px rgba(212, 168, 75, 0.3);
    transition: left 0.1s ease-out;
}

.meter-needle::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid var(--gold);
}

.tuning-status {
    text-align: center;
    margin-top: var(--space-md);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-text {
    color: var(--cream-muted);
    transition: color 0.3s ease;
}

.status-text.in-tune {
    color: var(--green);
    text-shadow: 0 0 20px var(--green-glow);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-text.flat {
    color: var(--red);
}

.status-text.sharp {
    color: var(--amber);
}

/* ============================================
   Audio Visualizer
   ============================================ */

.visualizer-container {
    position: relative;
    margin: var(--space-lg) 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--mahogany);
    border: 1px solid rgba(212, 168, 75, 0.1);
}

#visualizer {
    width: 100%;
    height: 120px;
    display: block;
}

.visualizer-reflection {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(26, 15, 10, 0.8) 100%);
    pointer-events: none;
}

/* ============================================
   Start Button
   ============================================ */

.start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(145deg, 
        var(--gold) 0%, 
        var(--gold-dark) 100%);
    color: var(--mahogany);
    border: none;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-back);
    box-shadow: 
        0 4px 20px rgba(212, 168, 75, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(212, 168, 75, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start-btn:active {
    transform: translateY(0);
}

.start-btn.active {
    background: linear-gradient(145deg, 
        var(--red) 0%, 
        #c44 100%);
    color: white;
}

.btn-icon {
    width: 24px;
    height: 24px;
}

.btn-icon svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   Strings Panel
   ============================================ */

.strings-panel {
    background: linear-gradient(145deg, 
        var(--mahogany-light) 0%, 
        var(--mahogany) 100%);
    border: 1px solid rgba(212, 168, 75, 0.2);
    border-radius: 24px;
    padding: var(--space-lg);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.strings-panel h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold);
    margin-bottom: var(--space-md);
    text-align: center;
}

.strings {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.string-btn {
    display: grid;
    grid-template-columns: 30px 40px 1fr;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(61, 37, 25, 0.5);
    border: 1px solid rgba(212, 168, 75, 0.1);
    border-radius: 12px;
    color: var(--cream);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.string-btn:hover {
    background: rgba(61, 37, 25, 0.8);
    border-color: rgba(212, 168, 75, 0.3);
    transform: translateX(4px);
}

.string-btn:active {
    transform: translateX(2px);
}

.string-btn.playing {
    background: rgba(212, 168, 75, 0.2);
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 168, 75, 0.2);
}

.string-number {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--walnut);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cream-muted);
}

.string-note {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.string-freq {
    font-size: 0.85rem;
    color: var(--cream-muted);
    text-align: right;
}

.strings-hint {
    font-size: 0.8rem;
    color: var(--cream-muted);
    text-align: center;
    margin-top: var(--space-md);
    opacity: 0.7;
}

/* ============================================
   Features Section
   ============================================ */

.features {
    max-width: 1200px;
    margin: var(--space-xl) auto;
    padding: var(--space-xl) var(--space-lg);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

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

.feature {
    text-align: center;
    padding: var(--space-lg);
    background: linear-gradient(145deg, 
        rgba(45, 24, 16, 0.5) 0%, 
        rgba(26, 15, 10, 0.5) 100%);
    border: 1px solid rgba(212, 168, 75, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 168, 75, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, 
        var(--gold) 0%, 
        var(--gold-dark) 100%);
    border-radius: 16px;
    color: var(--mahogany);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
    color: var(--cream);
}

.feature p {
    font-size: 0.9rem;
    color: var(--cream-muted);
    line-height: 1.6;
}

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

footer {
    border-top: 1px solid rgba(212, 168, 75, 0.1);
    padding: var(--space-xl) var(--space-lg);
    margin-top: var(--space-xl);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--cream);
    margin-bottom: var(--space-md);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--cream-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--gold);
}

.copyright {
    font-size: 0.85rem;
    color: var(--cream-muted);
    opacity: 0.6;
}

/* ============================================
   Page Layout (for sub-pages)
   ============================================ */

.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: calc(100px + var(--space-xl)) var(--space-lg) var(--space-xl);
}

.page-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--gold);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.page-content h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--cream);
    margin: var(--space-lg) 0 var(--space-md);
}

.page-content p {
    color: var(--cream-muted);
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.page-content ul, .page-content ol {
    color: var(--cream-muted);
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

.page-content li {
    margin-bottom: var(--space-sm);
}

.page-content a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 168, 75, 0.3);
    transition: border-color 0.2s ease;
}

.page-content a:hover {
    border-color: var(--gold);
}

/* Contact Form */
.contact-form {
    background: linear-gradient(145deg, 
        var(--mahogany-light) 0%, 
        var(--mahogany) 100%);
    border: 1px solid rgba(212, 168, 75, 0.2);
    border-radius: 24px;
    padding: var(--space-xl);
    margin-top: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--cream);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    background: rgba(61, 37, 25, 0.5);
    border: 1px solid rgba(212, 168, 75, 0.2);
    border-radius: 12px;
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 168, 75, 0.2);
}

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

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(145deg, 
        var(--gold) 0%, 
        var(--gold-dark) 100%);
    color: var(--mahogany);
    border: none;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-back);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 168, 75, 0.4);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 600px) {
    header {
        padding: var(--space-sm) var(--space-md);
    }
    
    .nav-links {
        gap: var(--space-md);
        font-size: 0.85rem;
    }
    
    .tuner {
        padding: var(--space-lg);
    }
    
    .current-note {
        font-size: 4rem;
    }
    
    .meter-labels {
        font-size: 0.65rem;
    }
    
    .features {
        padding: var(--space-lg) var(--space-md);
    }
    
    .footer-links {
        gap: var(--space-md);
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Tuner active state animations */
.tuner.active .meter-needle {
    animation: needle-active 2s ease-in-out infinite;
}

@keyframes needle-active {
    0%, 100% { box-shadow: 0 0 20px rgba(212, 168, 75, 0.6); }
    50% { box-shadow: 0 0 30px rgba(212, 168, 75, 0.8); }
}
