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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #161412;
    background-image: url('../public/aurora_2.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 2rem;
    scroll-margin-top: 4rem;
}

.section-content {
    text-align: center;
    max-width: 900px;
    width: 100%;
}

h1 {
    font-size: 4rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

/* Section bubbles */
#home .section-content,
#about .section-content,
#projects .section-content {
    background: rgba(10, 9, 8, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 3rem;
}

/* Home */
#home .section-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#home h1 {
    animation: fadeIn 1s ease-in;
}

#home .subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

#home .bio {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.75rem;
}

.download-cv {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.65rem 1.75rem;
    border: 1px solid rgba(200, 168, 130, 0.6);
    border-radius: 4px;
    color: #C8A882;
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    animation: fadeIn 1s ease-in 0.3s both;
}

.download-cv:hover {
    background: rgba(200, 168, 130, 0.12);
    border-color: #C8A882;
    color: white;
}

.scroll-cta {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-top: 3rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    animation: fadeIn 1s ease-in 0.5s both;
}

.scroll-cta:hover {
    color: rgba(255, 255, 255, 0.9);
}

.scroll-cta svg {
    width: 1.5rem;
    height: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* About */
#about .section-content {
    text-align: left;
}

#about > .section-content > p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 65ch;
    margin-bottom: 2.5rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
    align-items: start;
}

.skill-group h3 {
    color: #C8A882;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.skill-group ul {
    list-style: none;
    color: rgba(255, 255, 255, 0.75);
}

.skill-group li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0;
}

.skill-group li i {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.skill-group li.featured {
    color: white;
    font-weight: 600;
}

.skill-group li.featured i {
    font-size: 1.7rem;
}

.skill-group li.featured span.label {
    border-bottom: 1px solid rgba(200, 168, 130, 0.6);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
    transition: background 0.2s;
    display: block;
    text-decoration: none;
    cursor: default;
}

a.project-card {
    cursor: pointer;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.09);
}

.project-card h3 {
    color: white;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.project-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(200, 168, 130, 0.12);
    color: rgba(200, 168, 130, 0.9);
    border: 1px solid rgba(200, 168, 130, 0.25);
}

/* =========================================================
   Thirteen Card Game
   ========================================================= */

#thirteen {
    min-height: auto;
    padding-bottom: 6rem;
}

.thirteen-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Wrapper — fixed height so all screens overlay each other */
.tg-wrap {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    min-height: 480px;
    background: rgba(10, 9, 8, 0.70);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

/* Every screen fills the wrapper */
.tg-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    padding: 1.5rem;
}
.tg-screen.tg-active { display: flex; }

/* Game board needs its own layout */
.tg-board {
    justify-content: space-between;
    padding: 1rem;
}
.tg-board.tg-active { display: flex; }

/* Centered info blocks (start / transition / win) */
.tg-center-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.tg-big-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.04em;
}
.tg-sub-title {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

/* Transition screen */
.tg-tr-name {
    font-size: 2rem;
    font-weight: 700;
    color: #C8A882;
}
.tg-tr-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    max-width: 28ch;
    line-height: 1.5;
}

/* Win screen */
.tg-win-crown {
    font-size: 3rem;
    color: #C8A882;
    line-height: 1;
}
.tg-win-name {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}
.tg-win-sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

/* Muted text (loading) */
.tg-muted {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Buttons */
.tg-btn {
    padding: 0.55rem 1.4rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.tg-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}
.tg-btn-primary {
    border-color: rgba(200, 168, 130, 0.55);
    color: #C8A882;
}
.tg-btn-primary:hover {
    background: rgba(200, 168, 130, 0.12);
    border-color: #C8A882;
    color: white;
}
.tg-btn-sort {
    font-size: 0.78rem;
    padding: 0.5rem 0.9rem;
}

/* ── Opponents row ── */
.tg-opponents {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}
.tg-opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.tg-opp-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.04em;
}
.tg-opp-hand {
    display: flex;
    position: relative;
}
.tg-opp-count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}
.tg-more {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    align-self: center;
    padding-left: 4px;
}

/* ── Play area ── */
.tg-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}
.tg-play-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
}
.tg-play-area {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 78px;
    align-items: center;
}
.tg-no-play {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
}
.tg-status {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    min-height: 1.2em;
    text-align: center;
    max-width: 38ch;
}

/* ── Current player hand ── */
.tg-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
.tg-hand-label {
    font-size: 0.75rem;
    color: #C8A882;
    letter-spacing: 0.06em;
    align-self: flex-start;
    padding-left: 2px;
}
.tg-hand-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
}
.tg-hand {
    display: flex;
    flex-direction: row;
    padding: 10px 0 4px;
}
.tg-hand .tg-card { margin-right: -18px; }
.tg-hand .tg-card:last-child { margin-right: 0; }

.tg-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Cards ── */
.tg-card {
    width: 48px;
    height: 68px;
    background: #fafafa;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-shadow: 1px 2px 5px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3px 4px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    flex-shrink: 0;
    user-select: none;
    position: relative;
    z-index: 0;
}
.tg-card:hover:not(.tg-inert):not(.tg-back) {
    transform: translateY(-6px);
    z-index: 10;
}
.tg-card.tg-selected {
    transform: translateY(-16px);
    box-shadow: 2px 6px 12px rgba(0,0,0,0.5);
    z-index: 10;
    border-color: #C8A882;
}
.tg-card.tg-inert { cursor: default; }

.tg-cr {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}
.tg-cs {
    font-size: 16px;
    line-height: 1;
    align-self: flex-end;
}
.tg-card.tg-red  .tg-cr,
.tg-card.tg-red  .tg-cs { color: #c0392b; }
.tg-card.tg-black .tg-cr,
.tg-card.tg-black .tg-cs { color: #1a1a2e; }

/* Small face-down card (opponents) */
.tg-card.tg-small {
    width: 22px;
    height: 32px;
    margin-right: -10px;
    border-radius: 3px;
    cursor: default;
}
.tg-card.tg-small:last-child { margin-right: 0; }

/* Face-down card back */
.tg-card.tg-back {
    background: repeating-linear-gradient(
        45deg,
        #1e3a5f 0px, #1e3a5f 4px,
        #16304f 4px, #16304f 8px
    );
    border-color: #2a4a6f;
    cursor: default;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .tg-wrap { min-height: 440px; }
    .tg-card  { width: 42px; height: 60px; }
    .tg-cr    { font-size: 12px; }
    .tg-cs    { font-size: 14px; }
    .tg-hand .tg-card { margin-right: -16px; }
}

/* Ray Tracer */
#raytracer {
    min-height: auto;
    padding-bottom: 6rem;
}

.raytracer-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.rt-wrap {
    position: relative;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

#rt-canvas {
    display: block;
    background: #0a0908;
}

.rt-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(10, 9, 8, 0.7);
    color: rgba(255, 255, 255, 0.75);
    transition: background 0.2s, color 0.2s;
}

.rt-overlay svg {
    width: 3rem;
    height: 3rem;
    color: #C8A882;
    transition: transform 0.2s;
}

.rt-overlay span {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.rt-wrap:hover .rt-overlay {
    background: rgba(10, 9, 8, 0.5);
    color: white;
}

.rt-wrap:hover .rt-overlay svg {
    transform: scale(1.1);
}

.rt-overlay.rendering {
    cursor: default;
    pointer-events: none;
    background: rgba(10, 9, 8, 0.85);
}

.rt-overlay.rendering svg {
    display: none;
}

.rt-hint {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

/* Footer */
.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    background: rgba(10, 9, 8, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.photo-credit {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-links i {
    font-size: 1.6rem;
}

.footer-links svg {
    width: 1.5rem;
    height: 1.5rem;
}

.footer-links span {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 5rem 1.25rem 2rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

}
