/* Black and White Design - Code & Math Typography */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #000000;
    --accent-hover: #000000;
    --border-color: #000000;
    --secondary-text: #333333;
    --card-bg: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
nav {
    padding: 2rem 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 3rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 400;
    transition: all 0.2s;
}

nav a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Typography - JetBrains Mono for headings (code/AI feel), Inter for body */
h1, h2, h3, h4, h5, h6 {
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 500;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--text-color);
    text-decoration-thickness: 2px;
}

/* Header Image Section */
.header-image-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    margin-bottom: 3rem;
    overflow: hidden;
    position: relative;
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 500px;
}

/* Hero Intro Section */
.hero-intro {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 4rem;
    border-bottom: 2px solid var(--border-color);
}

.hero-tagline {
    font-size: 1.5rem;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto 1rem;
    font-family: 'Inter', sans-serif;
}

.hero-description {
    margin-top: 1rem;
}

.hero-description a {
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    text-decoration: none;
}

/* Hero Section (legacy - keeping for backward compatibility) */
.hero {
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--secondary-text);
    max-width: 700px;
    margin: 0 auto 1.2rem;
}

/* Book Section */
.book-section {
    margin-bottom: 5rem;
    padding: 3rem 0;
    border-bottom: 2px solid var(--border-color);
}

.book-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}

.book-cover-wrapper {
    text-align: center;
}

.book-cover {
    max-width: 100%;
    width: 100%;
    border: 2px solid var(--border-color);
    box-shadow: 4px 4px 0 var(--text-color);
    display: block;
}

.book-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.book-title {
    font-size: 2.5rem;
    margin: 0;
    line-height: 1.2;
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.book-subtitle {
    font-size: 1.25rem;
    color: var(--secondary-text);
    font-style: italic;
    margin: 0;
}

.book-description {
    font-size: 1rem;
    line-height: 1.7;
    margin: 1rem 0;
}

.book-release {
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin: 0.5rem 0;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: 2px solid var(--text-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 0.8rem;
}

.cta-button:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
}

/* Featured Sections */
.featured-section {
    margin-bottom: 5rem;
    padding: 3rem 0;
    border-bottom: 2px solid var(--border-color);
}

.featured-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

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

.featured-item {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.featured-item:hover {
    background-color: var(--card-bg);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 var(--text-color);
}

.featured-item h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.featured-item h3 a {
    text-decoration: none;
    color: var(--text-color);
}

.featured-item h3 a:hover {
    text-decoration: underline;
}

.featured-meta {
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin: 0;
}

.section-link {
    text-align: center;
    margin-top: 2rem;
}

.section-link a {
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    text-decoration: none;
    font-size: 1rem;
}

.section-link a:hover {
    text-decoration: underline;
}

/* Content Sections */
.content {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 4rem;
}

/* Article List */
.article-list {
    list-style: none;
}

.article-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.article-item h3 {
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.article-item p {
    color: var(--secondary-text);
    margin-bottom: 0.5rem;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--secondary-text);
}

/* Blog Posts */
.blog-list {
    list-style: none;
}

#blog-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.blog-post {
    padding: 3rem 0;
    border-bottom: 2px solid var(--border-color);
}

.blog-post:first-child {
    padding-top: 0;
}

.blog-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.blog-post h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.blog-post h2 a {
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
}

.blog-post h2 a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.blog-post-meta {
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.blog-content {
    margin-top: 0;
}

.blog-content h1,
.blog-content h2,
.blog-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-content p {
    margin-bottom: 1rem;
}

.blog-content ul,
.blog-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.blog-content code {
    background-color: var(--card-bg);
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
}

.blog-content pre {
    background-color: var(--card-bg);
    padding: 1rem;
    border: 2px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.blog-content pre code {
    background-color: transparent;
    padding: 0;
}

/* About Page */
.about-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: start;
}

.about-photo {
    width: 100%;
    border: 2px solid var(--border-color);
    box-shadow: 4px 4px 0 var(--text-color);
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-tagline {
        font-size: 1.25rem;
    }
    
    .book-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .book-cover-wrapper {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .book-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .book-subtitle {
        text-align: center;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Tic-Tac-Toe Game Styles */
.game-container {
    max-width: 600px;
    margin: 0 auto;
}

.player-setup {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
}

.player-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-input label {
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 400;
}

.player-input input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.player-input input:focus {
    outline: none;
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.game-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: 2px solid var(--text-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.game-button:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.game-button:active {
    transform: translateY(1px);
}

.hidden {
    display: none;
}

.game-section {
    margin-bottom: 3rem;
}

.game-info {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    width: 300px;
    height: 300px;
    background-color: var(--text-color);
    padding: 4px;
}

.cell {
    background-color: var(--bg-color);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 3rem;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.cell:hover:not(.occupied) {
    background-color: var(--card-bg);
}

.cell.occupied {
    cursor: not-allowed;
}

.cell.winning {
    background-color: var(--card-bg);
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.game-actions {
    text-align: center;
}

.leaderboard-section {
    margin-top: 3rem;
    padding: 2rem;
    border: 2px solid var(--border-color);
}

.leaderboard-section h2,
.leaderboard-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
}

.leaderboard {
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background-color 0.2s;
}

.leaderboard-item:hover {
    background-color: var(--card-bg);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item .player-name {
    font-weight: 400;
    font-size: 1rem;
}

.leaderboard-item .stat-value {
    text-align: center;
    color: var(--text-color);
    font-size: 1rem;
}

.leaderboard-item .stat-label {
    display: none;
}

.no-stats {
    color: var(--secondary-text);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

@media (max-width: 768px) {
    .tic-tac-toe-board {
        width: 250px;
        height: 250px;
    }
    
    .cell {
        font-size: 2.5rem;
    }
    
    .leaderboard-section {
        padding: 1.5rem;
    }
    
    .leaderboard-header,
    .leaderboard-item {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 0.5rem;
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .leaderboard-header {
        font-size: 0.75rem;
    }
}

/* Spelling Bee Game Styles */
.spelling-bee-container {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.spelling-bee-game-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.spelling-bee-letters-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spelling-bee-hexagon {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spelling-bee-letter {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border-color);
    background-color: var(--bg-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 2rem;
    font-weight: 400;
    user-select: none;
    transition: all 0.2s;
}

.spelling-bee-letter-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--text-color);
    color: var(--bg-color);
    font-weight: 600;
    z-index: 10;
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
}

.spelling-bee-letter-outer {
    background-color: var(--card-bg);
}

.spelling-bee-letter-outer:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.spelling-bee-letter-outer:nth-child(2) {
    top: 25%;
    right: 0;
}

.spelling-bee-letter-outer:nth-child(4) {
    bottom: 25%;
    right: 0;
}

.spelling-bee-letter-outer:nth-child(5) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.spelling-bee-letter-outer:nth-child(6) {
    bottom: 25%;
    left: 0;
}

.spelling-bee-letter-outer:nth-child(7) {
    top: 25%;
    left: 0;
}

.spelling-bee-input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spelling-bee-input-group {
    display: flex;
    gap: 1rem;
}

.spelling-bee-input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    text-transform: uppercase;
}

.spelling-bee-input-group input:focus {
    outline: none;
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.spelling-bee-feedback {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9rem;
    min-height: 1.5rem;
    text-align: center;
}

.spelling-bee-feedback-success {
    background-color: var(--card-bg);
    color: var(--text-color);
}

.spelling-bee-feedback-error {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--text-color);
}

.spelling-bee-feedback-info {
    background-color: var(--card-bg);
    color: var(--secondary-text);
}

.spelling-bee-score-section {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spelling-bee-score-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.spelling-bee-score-label {
    font-size: 1rem;
}

.spelling-bee-score-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.spelling-bee-progress-container {
    width: 100%;
    height: 20px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-color);
    overflow: hidden;
}

.spelling-bee-progress-bar {
    height: 100%;
    background-color: var(--card-bg);
    transition: width 0.3s ease;
    width: 0%;
}

.spelling-bee-progress-bar.spelling-bee-great {
    background-color: var(--card-bg);
}

.spelling-bee-progress-bar.spelling-bee-amazing {
    background-color: var(--card-bg);
}

.spelling-bee-progress-bar.spelling-bee-genius {
    background-color: var(--text-color);
}

.spelling-bee-genius-target {
    text-align: center;
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin: 0;
}

.spelling-bee-actions {
    text-align: center;
}

.spelling-bee-words-section {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
}

.spelling-bee-words-section h3 {
    margin-top: 0;
    margin-bottom: 0;
    text-align: center;
}

.spelling-bee-found-words-container {
    overflow-y: auto;
    flex: 1;
}

.spelling-bee-no-words {
    color: var(--secondary-text);
    font-style: italic;
    text-align: center;
    padding: 2rem;
    margin: 0;
}

.spelling-bee-words-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spelling-bee-word-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-family: 'JetBrains Mono', 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace;
    transition: background-color 0.2s;
}

.spelling-bee-word-item:hover {
    background-color: var(--card-bg);
}

.spelling-bee-word-item:last-child {
    border-bottom: none;
}

.spelling-bee-word-text {
    flex: 1;
    font-size: 1rem;
}

.spelling-bee-pangram {
    background-color: var(--card-bg);
    font-weight: 600;
}

.spelling-bee-pangram-badge {
    color: var(--text-color);
    margin: 0 0.5rem;
    font-size: 1.2rem;
}

.spelling-bee-word-score {
    color: var(--secondary-text);
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
}

@media (max-width: 768px) {
    .spelling-bee-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .spelling-bee-hexagon {
        width: 250px;
        height: 250px;
    }
    
    .spelling-bee-letter {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .spelling-bee-letter-center {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .spelling-bee-input-group {
        flex-direction: column;
    }
    
    .spelling-bee-words-section {
        max-height: 400px;
    }
}

