/* =========================
   DESIGN TOKENS
   ========================= */

:root {
    /* Accent: dark garnet / berry red — premium, nods to the watermelon handle
       without going literally watermelon-green-and-pink */
    --accent: #8b1e3f;
    --accent-dark: #6b1530;
    --accent-soft: #8b1e3f33;
    --accent-text: #fffef5;

    /* Surfaces */
    --bg: antiquewhite;
    --bg-soft: #f5e9d3;
    --ink: #1a1a1a;
    --ink-soft: #454545;
    --ink-muted: #6e6e6e;
    --border: #c9bfae;
    --glass: rgba(255, 254, 245, 0.55);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.14);
}


/* =========================
   RESET
   ========================= */

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 8vh;
    scrollbar-width: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    ::selection {
        background: var(--accent);
        color: var(--accent-text);
    }
}

html::-webkit-scrollbar {
    display: none;
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}


/* =========================
   TYPOGRAPHY UTILITIES
   ========================= */

.h1 {
    font-family: 'DM Serif Display', serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 5vh, 4.5rem);
    color: var(--ink);
    padding:0%;
    margin:0%;
    padding-left: 5vw;
    margin-top: 5vw;
    display: flex;
    align-items: center;
    gap: 0.6em;
    line-height: 1.1;
}

.h1 svg {
    width: 1em;
    height: 1em;
    color: var(--accent);
    flex-shrink: 0;
}

.para {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    color: var(--ink-soft);
    line-height: 1.6;
    padding-left: 5vw;
    padding-right: 5vw;
    max-width: 900px;
}


/* =========================
   HONEYCOMB BACKGROUND
   ========================= */

.honeycomb-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104' viewBox='0 0 120 104'%3E%3Cg fill='none' stroke='%23000000' stroke-width='1' opacity='0.08'%3E%3Cpath d='M30 2h60l28 50-28 50H30L2 52z'/%3E%3Cpath d='M-30 54h60l28 50-28 50h-60l-28-50z'/%3E%3Cpath d='M90 54h60l28 50-28 50H90l-28-50z'/%3E%3C/g%3E%3C/svg%3E");

    background-repeat: repeat;
    background-size: 120px 104px;

    animation: honeycomb-drift 2s linear infinite;
}

@keyframes honeycomb-drift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 120px 104px;
    }
}


/* =========================
   HERO
   ========================= */

.hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 22vh;
    padding-bottom: 18vh;
    gap: 2.5rem;
    text-align: center;
    padding-left: 5vw;
    padding-right: 5vw;
}

.hero-title {
    color: var(--ink);
    font-family: 'DM Serif Display', serif;
    font-weight: 600;
    font-size: clamp(3.5rem, 10vw, 9rem);
    line-height: 1;
    letter-spacing: -0.02em;
}

.hero-description {
    color: var(--ink-soft);
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(1.3rem, 3vw, 2.4rem);
    line-height: 1.3;
    max-width: 900px;
}

.hero-description-italic {
    color: var(--accent);
    font-style: italic;
}


/* =========================
   MAIN CTA
   ========================= */

.cta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.cta-button,
.cta-button-secondary,
.cta-button-small {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 6px;
    padding: 0.7em 1.2em;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease,
        gap 0.2s ease;
}

.cta-button {
    background-color: var(--accent);
    color: var(--accent-text);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    box-shadow: 0 2px 8px rgba(139, 30, 63, 0.18);
}

.cta-button:hover {
    background-color: var(--accent-dark);
    gap: 0.7rem;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(139, 30, 63, 0.28);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(139, 30, 63, 0.2);
}

.cta-button:visited {
    color: var(--accent-text);
}

.cta-button-secondary {
    background-color: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--border);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    box-shadow: var(--shadow);
}

.cta-button-secondary:hover {
    background-color: #fffef5;
    color: var(--ink);
    gap: 0.7rem;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.cta-button-secondary:visited {
    color: var(--ink-soft);
}

.cta-arrow {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}


/* =========================
   SECTIONS
   ========================= */

.section {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


/* =========================
   HOBBIES
   ========================= */

.hobbies {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding-left: 5vw;
    padding-right: 5vw;
    margin-top: 1rem;
}

.hobby-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--border);
    background-color: rgba(255, 254, 245, 0.6);
    backdrop-filter: blur(6px);
    padding: 1.4rem 1.25rem 1.25rem;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: var(--shadow);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
    cursor: default;
}

.hobby-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.hobby-card canvas,
.hobby-card .hobby-glyph-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* Effect layers fade out together when the cursor leaves, instead of the
   contents being cut off mid-animation. JS adds .fx-out on mouseleave and
   clears the layer once the transition has finished. */
.hobby-card canvas,
.hobby-card .hobby-glyph-layer,
.hobby-card .hobby-pixel-layer {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.hobby-card canvas.fx-out,
.hobby-card .hobby-glyph-layer.fx-out,
.hobby-card .hobby-pixel-layer.fx-out {
    opacity: 0;
}

.hobby-card .hobby-glyph-layer {
    overflow: hidden;
}

.hobby-card .hobby-glyph {
    position: absolute;
    color: var(--accent);
    opacity: 0;
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    line-height: 1;
    user-select: none;
    animation: hobby-glyph-float linear forwards;
    will-change: transform, opacity;
}

@keyframes hobby-glyph-float {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0deg) scale(0.85);
    }

    15% {
        opacity: 0.55;
    }

    85% {
        opacity: 0.45;
    }

    100% {
        opacity: 0;
        transform: translate(var(--drift-x, 0), var(--drift-y, -60px)) rotate(var(--rot, 25deg)) scale(1.05);
    }
}

.hobby-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hobby-label {
    font-family: 'DM Serif Display', serif;
    font-weight: 600;
    color: var(--ink);
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hobby-label svg {
    width: 1.1em;
    height: 1.1em;
    color: var(--accent);
}

.hobby-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--ink-soft);
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    line-height: 1.45;
}

/* Minecraft pixel grid */
.hobby-card .hobby-pixel-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hobby-pixel {
    position: absolute;
    width: 16px;
    height: 16px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
    opacity: 0;
    /* Chunky stepped pop in, then a smooth fade so blocks dissolve near the
       end of their 2.4s life instead of blinking out when JS removes them. */
    animation:
        pixel-pop 0.4s steps(2) forwards,
        pixel-fade 0.7s ease 1.7s forwards;
}

@keyframes pixel-pop {
    0% {
        opacity: 0;
        transform: scale(0) translateY(8px);
    }

    60% {
        opacity: 1;
        transform: scale(1.15) translateY(0);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pixel-fade {
    to {
        opacity: 0;
        transform: scale(0.9) translateY(4px);
    }
}


/* =========================
   PROJECTS
   ========================= */

.projects {
    display: flex;
    flex-direction: column;
    padding-left: 5vw;
    padding-right: 5vw;
    gap: 2rem;
}

.project-card-left,
.project-card-right {
    display: flex;
    flex-direction: row;
    background-color: rgba(255, 254, 245, 0.55);
    backdrop-filter: blur(4px);
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 14px;
    gap: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card-left:hover,
.project-card-right:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.project-card-right {
    padding-left: 20px;
}

.project-screenshot {
    width: 40vw;
    max-width: 500px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    background: #00000010;
}

.project-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.project-title {
    color: var(--ink);
    font-family: 'DM Serif Display', serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 3.4vw, 2.8rem);
    line-height: 1.1;
}

.project-description {
    color: var(--ink-soft);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.15vw, 1.1rem);
    line-height: 1.55;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.project-tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    line-height: 1;
}

.project-tech-tag svg {
    width: 0.85em;
    height: 0.85em;
}

.cta-small {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.cta-button-small {
    background-color: var(--accent);
    color: var(--accent-text);
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    box-shadow: 0 2px 6px rgba(139, 30, 63, 0.18);
}

.cta-button-small:visited {
    color: var(--accent-text);
}

.cta-button-small:hover {
    background-color: var(--accent-dark);
    gap: 0.7rem;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(139, 30, 63, 0.28);
}

.cta-button-small:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(139, 30, 63, 0.2);
}


/* =========================
   CONTACT
   ========================= */

.contact {
    padding-bottom: 8vh;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 5vw;
    padding-right: 5vw;
    margin-top: 0.5rem;
    max-width: 720px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: rgba(255, 254, 245, 0.65);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    color: var(--ink);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.contact-icon {
    width: 1.4rem;
    height: 1.4rem;
    color: var(--accent);
    flex-shrink: 0;
}

.contact-label {
    color: var(--ink-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    min-width: 80px;
}

.contact-value {
    font-weight: 500;
    color: var(--ink);
    flex: 1;
    font-family: 'Inter', sans-serif;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.copy-btn:hover {
    background: var(--accent);
    color: var(--accent-text);
    transform: translateY(-1px);
}

.copy-btn svg {
    width: 0.95em;
    height: 0.95em;
}

.copy-btn.copied {
    background: var(--accent);
    color: var(--accent-text);
}

a.contact-link {
    color: var(--ink);
}

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


/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1100px) {
    .hobbies {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .hobbies {
        grid-template-columns: 1fr;
    }

    .project-card-left,
    .project-card-right {
        flex-direction: column;
        gap: 1rem;
        padding: 12px;
    }

    .project-card-right {
        flex-direction: column-reverse;
    }

    .project-screenshot {
        width: 100%;
        max-width: 100%;
    }

    .h1,
    .para {
        padding-left: 6vw;
        padding-right: 6vw;
    }

    .projects,
    .hobbies,
    .contact-list {
        padding-left: 6vw;
        padding-right: 6vw;
    }

    .contact-item {
        flex-wrap: wrap;
    }

    .contact-label {
        min-width: auto;
    }
}


/* =========================
   REDUCED MOTION
   ========================= */

@media (prefers-reduced-motion: reduce) {
    .honeycomb-bg {
        animation: none;
    }

    .hobby-glyph,
    .hobby-pixel {
        animation: none;
        opacity: 0.35;
    }

    .cta-button,
    .cta-button-secondary,
    .cta-button-small,
    .project-card-left,
    .project-card-right,
    .contact-item,
    .copy-btn {
        transition: none;
    }

    .cta-button:hover,
    .cta-button-secondary:hover,
    .cta-button-small:hover,
    .project-card-left:hover,
    .project-card-right:hover,
    .contact-item:hover,
    .copy-btn:hover {
        transform: none;
    }
}
