/* ===== CSS Variables & Root ===== */
:root {
    /* Tamil Traditional Colors */
    --primary-brown: #5D4037;
    --primary-dark: #3E2723;
    --accent-gold: #D4AF37;
    --accent-copper: #B87333;
    --parchment: #FFF8E1;
    --parchment-dark: #F5E6C8;
    --text-dark: #2C1810;
    --text-light: #FFF8E1;
    
    /* Fonts */
    --font-heading: 'Cinzel', serif;
    --font-tamil: 'Noto Serif Tamil', serif;
    --font-body: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Spacing */
    --section-padding: 100px 0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--parchment);
    color: var(--text-dark);
    line-height: 1.7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
}

.tamil-text {
    font-family: var(--font-tamil);
}

/* ===== Header & Navigation ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, var(--primary-dark), transparent);
    padding: 20px 0;
    transition: background 0.3s ease;
}

.header.scrolled {
    background: var(--primary-dark);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-tamil {
    font-family: var(--font-tamil);
    font-size: 1.8rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.logo-english {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-light);
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-tamil);
    font-size: 1rem;
    transition: color 0.3s ease;
}

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

.btn-nav {
    background: var(--accent-gold);
    color: var(--primary-dark) !important;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
}

.btn-nav:hover {
    background: var(--accent-copper) !important;
    color: var(--text-light) !important;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="%233E2723" width="100" height="100"/><pattern id="pattern" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="%23D4AF37" opacity="0.1"/></pattern><rect fill="url(%23pattern)" width="100" height="100"/></svg>'),
        linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-brown) 100%);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(184, 115, 51, 0.15) 0%, transparent 40%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.hero-title .tamil-text {
    font-family: var(--font-tamil);
    font-size: 5rem;
    color: var(--accent-gold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.1;
}

.hero-title .english-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-light);
    letter-spacing: 4px;
}

.hero-subtitle {
    font-family: var(--font-tamil);
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
}

.hero-desc {
    color: var(--parchment);
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-heading);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-copper) 100%);
    color: var(--primary-dark);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    background: transparent;
}

.btn-secondary:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

/* Hero Visual - Dice Animation */
.hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dice-container {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.dayakattai {
    width: 100px;
    height: 60px;
    background: linear-gradient(145deg, #D4AF37, #B87333);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.4),
        inset 0 -5px 15px rgba(0,0,0,0.2),
        inset 0 5px 15px rgba(255,255,255,0.2);
    animation: diceBounce 2s ease-in-out infinite;
}

.dice-1 {
    animation-delay: 0s;
}

.dice-2 {
    animation-delay: 0.3s;
}

@keyframes diceBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.dice-face {
    font-size: 1.5rem;
    color: var(--primary-dark);
    letter-spacing: 5px;
}

.board-preview {
    background: var(--parchment-dark);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(7, 30px);
    gap: 3px;
}

.grid-cell {
    width: 30px;
    height: 30px;
    background: var(--parchment);
    border: 1px solid var(--primary-brown);
    border-radius: 3px;
}

.grid-cell.safe {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-copper));
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-gold);
    font-size: 2rem;
    animation: bounce 1s infinite;
}

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

/* ===== Section Base ===== */
.section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-label {
    font-family: var(--font-tamil);
    color: var(--accent-copper);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 10px;
}

.section-title {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--accent-gold), var(--accent-copper));
}

/* ===== History Section ===== */
.history {
    background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
}

.history-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.history-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    border-top: 4px solid var(--accent-gold);
}

.history-card:hover {
    transform: translateY(-10px);
}

.history-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.history-card h3 {
    margin-bottom: 15px;
    color: var(--primary-brown);
}

.history-quote {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.history-quote blockquote {
    font-family: var(--font-tamil);
    font-size: 1.5rem;
    color: var(--primary-brown);
    font-style: italic;
    position: relative;
    padding: 30px 40px;
}

.history-quote blockquote::before,
.history-quote blockquote::after {
    content: '"';
    font-size: 4rem;
    color: var(--accent-gold);
    position: absolute;
    opacity: 0.3;
}

.history-quote blockquote::before {
    top: 0;
    left: 0;
}

.history-quote blockquote::after {
    bottom: -20px;
    right: 0;
}

.history-quote cite {
    display: block;
    margin-top: 20px;
    font-style: normal;
    color: var(--accent-copper);
}

/* ===== Features Section ===== */
.features {
    background: var(--primary-dark);
    color: var(--text-light);
}

.features .section-label {
    color: var(--accent-gold);
}

.features .section-title {
    color: var(--text-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: rgba(255,255,255,0.05);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-gold);
    transform: scale(1.03);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
}

.feature-card p {
    color: rgba(255,255,255,0.8);
}

/* ===== Rules Section ===== */
.rules {
    background: var(--parchment);
}

.rules-content {
    max-width: 800px;
    margin: 0 auto;
}

.rule-step {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-start;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-copper));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-dark);
    flex-shrink: 0;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

.step-content h3 {
    margin-bottom: 10px;
    color: var(--primary-brown);
}

/* ===== Download Section ===== */
.download {
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    text-align: center;
}

.download-content h2 {
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.tamil-tagline {
    font-family: var(--font-tamil);
    font-size: 1.5rem;
    color: var(--parchment);
    margin-bottom: 20px;
}

.download-content > p {
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0.9;
}

.store-badge img {
    transition: transform 0.3s ease;
}

.store-badge:hover img {
    transform: scale(1.05);
}

/* ===== Footer ===== */
.footer {
    background: var(--primary-dark);
    color: var(--parchment);
    padding: 60px 0 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
    font-family: var(--font-tamil);
    font-size: 2rem;
    color: var(--accent-gold);
}

.footer-brand p {
    margin-top: 5px;
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--parchment);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    opacity: 0.6;
}

.tamil-copyright {
    font-family: var(--font-tamil);
    margin-top: 5px;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .history-content,
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-title .tamil-text {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .rule-step {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
}
