/* ============================================================
   James McLaughlin — homepage
   Custom layer on top of Pico CSS.
   Centred layout on a plain black background.
   ============================================================ */

:root {
    --bg:        #000000;
    --text:      #ffffff;
    --text-soft: rgba(255, 255, 255, 0.86);
    --border:    rgba(255, 255, 255, 0.55);
    --teal:      #116466;
    --maroon:    #6a1d28;

    --font:         "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;

    --pico-font-family: var(--font);
}

/* ---- Base -------------------------------------------------- */

body {
    margin: 0;
    min-height: 100svh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--teal); color: #fff; }

/* ---- Shader background ------------------------------------- */

#canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

/* readability scrim — dark over the centre, shader stays vivid at the edges */
.scrim {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse 72% 62% at 50% 50%,
                rgba(0, 0, 0, 0.62) 0%,
                rgba(0, 0, 0, 0.34) 56%,
                rgba(0, 0, 0, 0.12) 100%);
}

/* ---- Layout ------------------------------------------------ */

.hero {
    position: relative;
    z-index: 2;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
    padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 3rem);
}

/* ---- Name & role ------------------------------------------- */

.hero__name {
    margin: 0;
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: clamp(1.35rem, 3.8vw, 2.2rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.005em;
    color: var(--text);
}

.hero__role {
    margin: 0.5rem 0 0;
    font-size: clamp(0.72rem, 1.4vw, 0.86rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--text-soft);
}

.hero__sep {
    margin: 0 0.3em;
    color: rgba(255, 255, 255, 0.38);
}

/* ---- Audio players (kept at full size) --------------------- */

.players {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: clamp(1.4rem, 3.5vw, 2.1rem);
}

.player {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    transition: border-color 0.25s ease;
}

.player:hover { border-color: rgba(255, 255, 255, 0.85); }

.player__vol {
    width: 22px;
    height: 22px;
    fill: var(--text);
    opacity: 0.9;
    flex: none;
}

.player__btn {
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.player__btn svg { width: 29px; height: 29px; fill: currentColor; display: block; }
.player__btn:hover { transform: scale(1.08); }
.player__btn:active { transform: scale(0.96); }

.player__label {
    margin-left: 0.2rem;
    font-size: 0.95rem;
    font-weight: 400;
    white-space: nowrap;
    color: var(--text);
}

/* ---- Call to action ---------------------------------------- */

.cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-top: clamp(1.5rem, 3.5vw, 2.3rem);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.6rem 1.4rem;
    border: 0;
    border-radius: 7px;
    font-family: var(--font);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 20px rgba(0, 0, 0, 0.55);
    filter: brightness(1.12);
}
.btn:active { transform: translateY(0); }

.btn--request,
.btn--send  { background: var(--teal); }
.btn--login { background: var(--maroon); }

/* equal-width CTA buttons on desktop (mobile rule below sets 100%) */
.btn--request,
.btn--login { width: 14rem; }

/* ---- Portfolio request form -------------------------------- */

.request {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.request__form { display: none; gap: 0.45rem; flex-wrap: wrap; justify-content: center; }
.request.is-open .request__form { display: flex; }
.request.is-open [data-open] { display: none; }
.request.is-sent .request__form { display: none; }

.request__input {
    width: clamp(190px, 55vw, 240px);
    margin: 0;
    padding: 0.56rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.65rem;
    transition: border-color 0.2s ease;
}
.request__input::placeholder { color: rgba(255, 255, 255, 0.5); }
.request__input:focus {
    outline: none;
    border-color: var(--teal);
    background: rgba(255, 255, 255, 0.09);
}

.request__msg {
    display: none;
    max-width: 30rem;
    margin: 0.1rem 0 0;
    font-size: 0.6rem;
    line-height: 1.5;
}
.request__msg.is-shown  { display: block; }
.request__msg.is-error  { color: #ff8a7a; }
.request__msg.is-success { color: #7fd1a8; }

/* ---- Focus ------------------------------------------------- */

:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

/* ---- Gentle entrance --------------------------------------- */

@keyframes fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero__name,
.hero__role,
.players,
.cta {
    animation: fade-up 0.7s ease both;
}

.hero__name { animation-delay: 0.05s; }
.hero__role { animation-delay: 0.16s; }
.players    { animation-delay: 0.28s; }
.cta        { animation-delay: 0.40s; }

/* ---- Responsive -------------------------------------------- */

@media (max-width: 480px) {
    .player { width: 100%; justify-content: center; }
    .btn { width: 100%; }
    .request, .request__form { width: 100%; }
    .request__input { width: 100%; }
}

/* ---- Reduced motion ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.001ms !important;
    }
}
