/*
 * Newton's Games – Modern Static Site Stylesheet
 * A clean, modern design with smooth animations and beautiful typography.
 * Color palette: Deep blues, soft teals, and warm accents.
 */

/* CSS Variables */
:root {
    --color-primary: #1a56db;
    --color-primary-dark: #1e40af;
    --color-primary-light: #3b82f6;
    --color-secondary: #0d9488;
    --color-accent: #f59e0b;
    --color-dark: #0f172a;
    --color-text: #334155;
    --color-text-light: #64748b;
    --color-bg: #f8fafc;
    --color-bg-alt: #f1f5f9;
    --color-white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Base styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'Vollkorn', Georgia, serif;
    margin-top: 0;
    color: var(--color-dark);
    line-height: 1.3;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background-color: var(--color-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.navbar nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar nav a {
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.navbar nav a:hover {
    color: var(--color-primary);
    background-color: var(--color-bg-alt);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-dark);
}

.logo img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    transition: transform var(--transition-base);
}

.logo:hover img {
    transform: rotate(-5deg) scale(1.05);
}

.logo:hover {
    color: var(--color-dark);
    text-decoration: none;
}

/* Section styles */
section {
    padding: 5rem 0;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    text-align: center;
    padding: 6rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: var(--color-white);
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 auto 2rem;
    max-width: 650px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Buttons */
.button {
    display: inline-block;
    background: var(--color-white);
    color: var(--color-primary);
    padding: 0.9rem 2rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    color: var(--color-primary-dark);
    text-decoration: none;
}

.button.small {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
}

.button.primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
}

.button.primary:hover {
    color: var(--color-white);
}

/* About section */
.about {
    background-color: var(--color-white);
}

.about h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.about p {
    max-width: 800px;
    margin: 1rem auto;
    font-size: 1.05rem;
    color: var(--color-text);
}

/* Values section */
.values {
    background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.values h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.value-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.value {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.value:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.value .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.value h3 {
    margin-bottom: 0.75rem;
    color: var(--color-dark);
}

.value p {
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* Projects section */
.projects {
    background-color: var(--color-white);
}

.projects h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-grid-centered {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.project-grid-centered .project-card {
    flex: 0 1 350px;
    max-width: 350px;
}

.project-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    text-decoration: none;
}

.project-card:hover .card-button {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 86, 219, 0.4);
}

.project-card img,
.project-card .placeholder-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-card h3 {
    margin: 1.25rem 0 0.5rem;
    padding: 0 1.5rem;
    color: var(--color-dark);
}

.project-card p {
    flex-grow: 1;
    color: var(--color-text-light);
    font-size: 0.95rem;
    padding: 0 1.5rem;
}

.card-button {
    display: block;
    margin: 1rem 1.5rem 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.25);
}

/* Project images with icons */
.project-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

.project-image::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 -20px 40px -20px rgba(0, 0, 0, 0.04);
    pointer-events: none;
}

.project-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    transition: transform var(--transition-base);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

/* Contact section */
.contact {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
}

.contact h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.contact-grid > div {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.contact-grid > div:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.contact-grid h3 {
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.contact-grid p {
    margin: 0;
}

.contact-grid a {
    font-weight: 600;
}

/* Project detail pages */
.project-detail {
    background-color: var(--color-white);
}

.project-detail h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.project-detail h2:first-child {
    margin-top: 0;
}

.project-detail p {
    font-size: 1.05rem;
    line-height: 1.8;
}

.project-detail ul {
    padding-left: 1.5rem;
    margin: 1rem 0 1.5rem;
}

.project-detail li {
    margin-bottom: 0.75rem;
    color: var(--color-text);
    line-height: 1.7;
}

.project-detail li::marker {
    color: var(--color-primary);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--color-dark) 0%, #1e293b 100%);
    color: rgba(255, 255, 255, 0.9);
    padding: 3rem 1.5rem;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.footer-container img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
}

.footer-container p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scroll animations - elements fade in when visible */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Book page overrides (for elements using shared styles) */
.book-page .navbar,
.book-page footer {
    display: none;
}

/* Mobile hamburger menu (hidden by default) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-dark);
    margin: 5px 0;
    transition: var(--transition-fast);
}

/* Responsive Design */
@media (max-width: 768px) {
    section {
        padding: 3.5rem 0;
    }
    
    .hero {
        padding: 4rem 1rem;
    }
    
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .navbar nav {
        width: 100%;
        justify-content: center;
        margin-top: 0.75rem;
        gap: 0.25rem;
    }
    
    .navbar nav a {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .value-grid,
    .project-grid,
    .contact-grid {
        gap: 1.5rem;
    }
    
    .project-card {
        margin: 0 auto;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .button {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .navbar nav a {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* Legacy book page styles (kept for compatibility) */
.book-header-section,
.book-sections,
.book-section,
.book-grid,
.book-info,
.book-image,
.purchase-buttons,
.purchase-buttons-vertical,
.share-button,
.cta-button,
.note,
.paragraph-2 {
    /* These styles are now handled in book.html inline styles */
}
