:root {
    --bg: #040404;
    --panel: rgba(255, 255, 255, 0.06);
    --panel-border: rgba(255, 255, 255, 0.12);
    --text: #f5f5f5;
    --muted: rgba(245, 245, 245, 0.72);
    --accent: #a5e1ff;
    --accent-strong: #4fd1c5;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --max-width: 1040px;
    --nav-height: 70px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(79, 209, 197, 0.09), transparent 40%);
}

body[data-theme="light"] {
    background: #ffffff;
    background-image: none;
    color: #111111;
    --panel: rgba(255, 255, 255, 0.95);
    --panel-border: rgba(0, 0, 0, 0.08);
    --text: #111111;
    --muted: rgba(0, 0, 0, 0.7);
}

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

a:hover {
    text-decoration: none;
}


.theme-toggle-fab {
    position: fixed;
    bottom: 2.4rem;
    right: 2.4rem;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: linear-gradient(135deg, rgba(34, 34, 34, 0.9), rgba(12, 12, 12, 0.7));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    z-index: 1300;
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.65);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.theme-toggle-fab:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 46px -22px rgba(0, 0, 0, 0.7);
}

.theme-toggle-fab:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 4px;
}

body[data-theme="light"] .theme-toggle-fab {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(235, 235, 235, 0.7));
    color: #111111;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 14px 30px -24px rgba(0, 0, 0, 0.22);
}

body[data-theme="light"] .theme-toggle-fab:hover {
    box-shadow: 0 18px 34px -22px rgba(0, 0, 0, 0.3);
}

img {
    max-width: 100%;
    border-radius: 20px;
}

.page {
    width: min(92%, var(--max-width));
    margin: 0 auto;
    padding: clamp(2rem, 4vw, 3.5rem) 0 5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
}

.back-link:hover {
    color: var(--accent);
}

.hero {
    margin-top: 1.5rem;
    padding-top: clamp(4rem, 10vw, 6.5rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 3.8rem);
    margin: 0;
    line-height: 1.2;
}

.hero p {
    color: var(--muted);
    max-width: 640px;
    font-size: 1.1rem;
}

body[data-theme="light"] .hero h1 {
    color: #111111;
}

body[data-theme="light"] .hero p {
    color: rgba(0, 0, 0, 0.75);
}

.hero-gallery {
    margin-top: 1.5rem;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meta {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 24px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.meta-item span {
    display: block;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.meta-item strong {
    font-size: 1.05rem;
}

body[data-theme="light"] .meta-item span {
    color: rgba(0, 0, 0, 0.55);
}

body[data-theme="light"] .meta-item strong {
    color: #111111;
}

.panel {
    margin-top: 2rem;
    padding: clamp(1.5rem, 3vw, 2.4rem);
    border-radius: 28px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
}

.panel h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-top: 0;
}

.panel p {
    margin-bottom: 1.1rem;
    color: var(--muted);
}

body[data-theme="light"] .panel h2 {
    color: #111111;
}

body[data-theme="light"] .panel p {
    color: rgba(0, 0, 0, 0.78);
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tech-list li {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
}

body[data-theme="light"] .tech-list li {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
    color: #111111;
}

.gallery {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.gallery img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.gallery-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.gallery-pair img {
    border-radius: 22px;
}

body[data-theme="light"] .gallery img {
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.book-gallery-grid {
    margin-top: 1.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.book-card {
    display: block;
    border-radius: 24px;
    padding: 1.1rem;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.02);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    text-decoration: none;
}

.book-card figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: center;
    text-align: center;
}

.book-card img {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.book-card figcaption {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--muted);
    min-height: 3.6em;
    display: flex;
    align-items: center;
    justify-content: center;
}

body[data-theme="light"] .book-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .book-card img {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.1);
}

.books {
    margin-top: 1.5rem;
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.books li {
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cta {
    margin-top: 3rem;
    text-align: center;
}

.cta a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 2.6rem;
    border-radius: 999px;
    border: 1px solid var(--accent);
    color: var(--bg);
    background: linear-gradient(120deg, var(--accent), var(--accent-strong));
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cta a:hover {
    opacity: 0.9;
    text-decoration: none;
}

@media (max-width: 768px) {
    .theme-toggle-fab {
        bottom: 1.6rem;
        right: 1.6rem;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}
