/* =========================================================
   Miro III | Portfolio - style.css

   1.  Variables & base
   2.  Background effects (stars + vignette)
   3.  Layout (main grid, header, nav)
   4.  Content sections & text helpers
   5.  Hero & shared buttons
   6.  About page components
   7.  Cursor circle
   8.  Projects page
   9.  Contact page & form
   10. Responsive & touch
   ========================================================= */


/* ---------- 1. Variables & base ---------- */
:root {
    --bg: #232a35;
    --text: #f2f2f2;
    --line-faint: rgba(255, 255, 255, 0.1);
    --line: rgba(255, 255, 255, 0.15);
    --line-soft: rgba(255, 255, 255, 0.3);
    --line-bold: rgba(255, 255, 255, 0.5);
}

body {
    font-family: "Outfit", sans-serif;
    background-color: var(--bg);
    color: var(--text);
}


/* ---------- 2. Background effects ---------- */

/* falling stars (canvas is created in main.js) */
#stars {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* vignette */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(0, 0, 0, 0.6) 100%
    );
}


/* ---------- 3. Layout ---------- */

/* 1:2:1 grid, content sits in the middle column */
main {
    display: grid;
    grid-template-columns: 1fr minmax(0, 2fr) 1fr;
    align-content: start;
    min-height: 100vh;
    min-height: 100dvh; /* accounts for mobile browser bars */
}

main > * {
    grid-column: 2;
}

/* header overhangs the content column into the side walls */
header {
    margin: 5vh -8vw 0 -8vw;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10vh;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul a {
    position: relative;
    color: inherit;
    text-decoration: none;
    padding-bottom: 4px;
}

/* underline that grows in on hover */
nav ul a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

nav ul a:hover::after,
nav ul a:focus-visible::after {
    transform: scaleX(1);
}

#logo {
    width: 60px;
    height: 60px;
    filter: invert(1); /* turns the black logo white */
}


/* ---------- 4. Content sections & text helpers ---------- */
.content-section {
    padding: 0 2rem;
    margin: 4vh 0;
    border-left: 2px solid gray;
}

.content-section h2,
.content-section p {
    margin: 0;
}

.circle-emoji::before {
    content: "\26AB ";
}

.text-meta {
    font-style: italic;
    font-weight: 800;
    color: rgb(223, 41, 41);
    word-spacing: 0.2vw;
}

#cert-link {
    text-decoration: none;
    background-color: rgb(105, 105, 105);
    color: white;
    font-weight: 800;
    transition: 0.4s;
}

#cert-link:hover {
    background-color: rgb(202, 202, 202);
    color: black;
}


/* ---------- 5. Hero & shared buttons ---------- */
#hero-name {
    text-transform: uppercase;
    letter-spacing: clamp(2px, 0.6vw, 8px);
    font-size: clamp(1.8rem, 6vw, 3rem);
}

#hero-name span {
    background-color: rgb(172, 172, 172);
    color: white;
    padding: 1px;
}

#welcome p {
    word-spacing: 0.3rem;
}

.page-hero {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
}

.hero-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* pill button style shared by hero links and the form button */
.hero-links a,
button {
    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid var(--line-bold);
    border-radius: 999px;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

button {
    align-self: flex-start;
    margin-top: 1.5rem;
    padding: 0.7rem 1.8rem;
    cursor: pointer;
}

/* hover fill only on devices that can really hover (stops it sticking on touch) */
@media (hover: hover) {
    .hero-links a:hover,
    button:hover {
        background: #fff;
        color: var(--bg);
    }
}


/* ---------- 6. About page components ---------- */
.playlist {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 10px;
    margin-top: 15px;
}

.playlist:hover {
    background-color: rgba(165, 165, 165, 0.05);
}

.thumbnail {
    transition: 0.3s;
}

.thumbnail:hover {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}


/* ---------- 7. Cursor circle ---------- */
.cursor-circle {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.cursor-circle.visible {
    opacity: 1;
}


/* ---------- 8. Projects page ---------- */
#projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-tile a {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--line-faint);
    color: #fff;
    text-decoration: none;
}

.project-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.project-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    background: linear-gradient(
        to top,
        rgba(11, 14, 20, 0.92) 0%,
        rgba(11, 14, 20, 0.4) 60%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-overlay > * {
    transform: translateY(12px);
    transition: transform 0.4s ease;
}

.project-overlay h3 {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}

.project-overlay p {
    margin: 0 0 0.75rem;
    opacity: 0.8;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
}

.tags li {
    padding: 0.2rem 0.7rem;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
}

/* reveal on hover or keyboard focus */
.project-tile a:hover .project-overlay,
.project-tile a:focus-visible .project-overlay {
    opacity: 1;
}

.project-tile a:hover .project-overlay > *,
.project-tile a:focus-visible .project-overlay > * {
    transform: translateY(0);
}

.project-tile a:hover img,
.project-tile a:focus-visible img {
    transform: scale(1.05);
}


/* ---------- 9. Contact page & form ---------- */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 1.3rem;
}

.contact-list a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 2px;
    transition: border-color 0.3s;
}

.contact-list a:hover {
    border-color: #fff;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 1rem;
}

input,
textarea {
    font: inherit;
    color: inherit;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}


/* ---------- 10. Responsive & touch ---------- */

/* small tablets and phones: projects go single column */
@media (max-width: 768px) {
    #projects-grid {
        grid-template-columns: 1fr;
    }
}

/* tablets and phones: single column layout */
@media (max-width: 900px) {
    main {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 1.25rem;
    }

    main > * {
        grid-column: 1;
    }

    header {
        margin: 3vh 0 0 0; /* no overhang, or the page scrolls sideways */
    }

    nav {
        margin-bottom: 6vh;
    }

    nav ul {
        gap: 1rem;
    }

    nav ul a {
        display: inline-block;
        padding: 0.6rem 0.25rem; /* bigger tap area */
    }

    #logo {
        width: 48px;
        height: 48px;
    }

    .content-section {
        padding: 0 0 0 1rem;
        margin: 3vh 0;
    }

    .contact-list {
        font-size: 1.1rem;
        overflow-wrap: anywhere; /* stops long emails overflowing */
    }

    input,
    textarea {
        font-size: 1rem; /* under 16px makes iPhones zoom in on tap */
    }
}

/* touch screens: no cursor circle, and project details always visible */
@media (hover: none) {
    .cursor-circle {
        display: none;
    }

    .project-overlay {
        opacity: 1;
    }

    .project-overlay > * {
        transform: none;
    }
}