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

:root {
    --bg-dark: #0a0a0a;
    --bg-secondary: #1a1515;
    --bg-card: #1a1a1a;
    --text-primary: #d4d4d4;
    --text-secondary: #8a8a8a;
    --accent: #8b0000;
    --accent-light: #a8a8a8;
    --border: #2a2a2a;
}

body {
    font-family: 'Garamond', 'Georgia', 'Times New Roman', serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.8;
    letter-spacing: 0.5px;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

html {
    height: -webkit-fill-available;
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

header {
    padding: 20px 0 10px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-dark);
}

.top-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.main-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

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

.logo-link {
    display: inline-block;
    text-align: center;
    width: auto;
}

.logo {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: grayscale(100%) contrast(1.3) brightness(0.9);
    box-shadow: none;
    opacity: 0.95;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero {
    padding: 40px 0 30px;
    text-align: center;
    background: var(--bg-dark);
    flex-shrink: 0;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 300;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-family: 'Georgia', serif;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.5rem;
        letter-spacing: 3px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    letter-spacing: 2px;
    text-transform: none;
}

@media (max-width: 768px) {
    .tagline {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .tagline {
        font-size: 0.65rem;
    }
}

.content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 20px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

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

.poem-card {
    background-color: var(--bg-card);
    padding: 40px 30px;
    border-radius: 0;
    border: 1px solid var(--border);
    transition: all 0.4s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.poem-card:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.3);
    transform: translateY(-2px);
}

.domain-card {
    background-color: var(--bg-card);
    padding: 40px 30px;
    border-radius: 0;
    border: 1px solid var(--border);
    transition: all 0.4s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.domain-card:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.3);
    transform: translateY(-2px);
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 40px;
}

.domain-text {
    background-color: var(--bg-card);
    padding: 30px;
    border: 1px solid var(--border);
}

.domain-text h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.domain-text p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.domain-text a {
    color: var(--accent);
    text-decoration: none;
}

.domain-text a:hover {
    text-decoration: underline;
}

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

@media (max-width: 768px) {
    .poem-card, .domain-card {
        padding: 30px 20px;
        min-height: 120px;
    }
}

.poem-card h2, .domain-card h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--accent-light);
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: 'Georgia', serif;
}

@media (max-width: 768px) {
    .poem-card h2, .domain-card h2 {
        font-size: 1rem;
        letter-spacing: 2px;
    }
}

.poem-card p, .domain-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    font-style: italic;
}

/* Page content styles */
.page-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page-content h2 {
    font-size: 1.5rem;
    color: var(--accent-light);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.page-content h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 300;
}

.page-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.page-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.page-content li {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.page-content li:before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.page-content a {
    color: var(--accent-light);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s ease;
}

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

.back-link {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.back-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.back-link a:hover {
    color: var(--accent-light);
    border-bottom: none;
}

footer {
    background-color: var(--bg-dark);
    padding: 20px 0;
    text-align: center;
    border-top: 2px solid var(--border);
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: none;
    font-style: italic;
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
    }
    
    .logo {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 120px;
    }
    
    header {
        padding: 15px 0;
    }
    
    .hero {
        padding: 30px 0 20px;
    }
    
    footer {
        padding: 15px 0;
    }
}

/* Landscape mode for tablets and phones */
@media (max-width: 1024px) and (orientation: landscape) {
    body {
        overflow-y: auto;
        height: auto;
    }
    
    .hero {
        padding: 20px 0 15px;
    }
    
    .hero h1 {
        font-size: 1.3rem;
        letter-spacing: 3px;
        margin-bottom: 10px;
    }
    
    .tagline {
        font-size: 0.65rem;
    }
    
    .content {
        padding: 15px 0;
    }
    
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .poem-card {
        padding: 25px 20px;
        min-height: auto;
    }
    
    header, footer {
        padding: 10px 0;
    }
    
    .logo {
        max-width: 100px;
    }
}

/* Support for notched devices (iPhone X+) */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Highlights Grid */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 40px 0;
}

.highlight-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.highlight-item a:hover h3 {
    color: var(--accent);
}

.highlight-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    transition: all 0.3s ease;
}

.highlight-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Fine-art page images - larger with cover */
.highlight-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.highlight-item img.crop-top { 
    object-position: top center !important; 
}

/* High-tech page images - smaller with contain */
.highlight-item.tech-highlight img {
    height: 80px;
    object-fit: contain;
    border: none;
}

.highlight-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.highlight-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

/* Language Navigation */
.language-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.language-nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: 1.2rem;
    transition: all 0.4s ease;
    background-color: var(--bg-card);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    line-height: 1;
}

.language-nav a:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.3);
    transform: translateY(-2px);
}

.language-nav a.active {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .top-menu {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav {
        gap: 15px;
        font-size: 0.9rem;
    }
    
    .language-nav {
        gap: 6px;
    }
    
    .language-nav a {
        padding: 6px 10px;
        font-size: 1rem;
    }
}
