/* ============================================================
   style.css — Website público guilhermequeiros.pt
   Mobile-first · breakpoints @768px e @1200px
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    --bg: #0a0a0a;
    --text: #ffffff;
    --accent: #2E7D32;
    --accent-light: #43a047;
    --card: #1a1a1a;
    --muted: #8a8a8a;
    --border: rgba(255, 255, 255, 0.08);

    --font-head: "Bebas Neue", system-ui, sans-serif;
    --font-body: "Space Grotesk", system-ui, sans-serif;

    --max: 1280px;
    --pad: 1.25rem;
    --radius: 14px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Tipografia base ---------- */
h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: 400;
    text-transform: uppercase;
    line-height: 0.92;
    letter-spacing: 0.01em;
}

/* ============================================================
   NAV (pill flutuante)
   ============================================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem var(--pad);
    transition: padding 0.3s ease, background 0.3s ease;
}

.nav--scrolled {
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(10px);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.nav__brand {
    font-family: var(--font-head);
    font-size: 1.6rem;
    letter-spacing: 0.05em;
}

.nav__pill {
    display: none;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: rgba(26, 26, 26, 0.7);
    border: 1px solid var(--border);
    border-radius: 999px;
    backdrop-filter: blur(12px);
}

.nav__link {
    padding: 0.45rem 0.95rem;
    font-size: 0.85rem;
    border-radius: 999px;
    color: var(--muted);
    transition: color 0.2s ease, background 0.2s ease;
}

.nav__link:hover,
.nav__link.is-active {
    color: var(--text);
    background: var(--accent);
}

/* Toggle mobile */
.nav__toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 11px 9px;
    background: rgba(26, 26, 26, 0.7);
    border: 1px solid var(--border);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    cursor: pointer;
}
.nav__toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile aberto: a pill vira coluna full-width */
.nav__pill.is-open {
    display: flex;
    position: fixed;
    top: 72px;
    left: var(--pad);
    right: var(--pad);
    flex-direction: column;
    gap: 0.2rem;
    border-radius: var(--radius);
    padding: 0.6rem;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 15vh var(--pad) 3rem;
    overflow: hidden;
}

.hero__left {
    position: relative;
    z-index: 3;
    max-width: 640px;
}

.hero__location {
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.2rem;
}

.hero__name {
    font-family: var(--font-head);
    font-size: clamp(4.5rem, 20vw, 11rem);
    color: var(--text);
}
.hero__name-line { display: block; }

.hero__subtitle {
    margin-top: 1rem;
    font-size: clamp(0.95rem, 3vw, 1.25rem);
    letter-spacing: 0.08em;
    color: var(--accent-light);
}

.hero__bio {
    margin-top: 1.5rem;
    max-width: 46ch;
    color: #cfcfcf;
}

/* Botão */
.btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.9rem 1.8rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-light); transform: translateY(-2px); }

/* Foto à direita com fade para a esquerda */
.hero__right {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 55vh;
}
.hero__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    /* fusão natural com o fundo escuro (esquerda transparente -> direita visível) */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 45%);
            mask-image: linear-gradient(to right, transparent 0%, #000 45%);
}
/* Performance hint aplicado via JS antes de animar */
.will-change { will-change: transform, opacity; }

/* Scroll indicator */
.hero__scroll {
    position: absolute;
    bottom: 1.5rem;
    left: var(--pad);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}
.hero__scroll-line {
    width: 48px;
    height: 1px;
    background: var(--muted);
    transform-origin: left;
}

/* ============================================================
   SECÇÕES genéricas
   ============================================================ */
.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 120px var(--pad);
}

.section__head {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
}
.section__index {
    font-family: var(--font-head);
    font-size: 4rem;
    line-height: 1;
    color: var(--accent);
    opacity: 0.3;
    letter-spacing: 0.02em;
}
.section__title {
    font-size: clamp(2.5rem, 10vw, 5.5rem);
    color: var(--text);
}

.loading { color: var(--muted); font-size: 0.95rem; }

/* ---------- Sobre / Atletismo ---------- */
.about {
    display: grid;
    gap: 2.5rem;
    margin-bottom: 7.5rem;
}
.about__lead {
    font-size: clamp(1.2rem, 4vw, 2rem);
    line-height: 1.8;
    font-weight: 300;
    color: #eaeaea;
}
.about__photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.about__photo {
    width: 100%;
    min-height: 380px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
}
.about__photo--2 { margin-top: 3rem; }

/* ---------- Competições ---------- */
.competitions { margin-top: 5rem; }
.competitions__title {
    font-family: var(--font-head);
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(2rem, 7vw, 3.5rem);
    color: var(--text);
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
}
.competitions__list { display: grid; gap: 1rem; }

.competition-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.competition-card__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.competition-card__name {
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: none;
    font-size: 1.15rem;
}
.competition-card__meta { color: var(--muted); font-size: 0.85rem; }
.competition-card__events { display: grid; gap: 0.5rem; }
.event-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: baseline;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.event-row__name { font-weight: 500; }
.event-row__result { color: var(--accent-light); }
.event-row__class { color: var(--muted); font-size: 0.85rem; }
.event-row__badge {
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
}

/* ---------- Projetos ---------- */
.projects {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}
.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.project-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.project-card__name {
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: none;
    font-size: 1.4rem;
}
.project-card__arrow { color: var(--accent-light); font-size: 1.4rem; }
.project-card__desc { color: #cfcfcf; margin-bottom: 1.25rem; }
.project-card__stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.project-card__stack li {
    padding: 0.35rem 0.9rem;
    font-size: 0.78rem;
    background: rgba(46, 125, 50, 0.2);
    border-radius: 999px;
    color: var(--accent);
    font-weight: 500;
}
.project-card__link { color: var(--accent-light); font-size: 0.9rem; }
.project-card__link:hover { text-decoration: underline; }

/* ---------- Fotografia (galeria masonry) ---------- */
.gallery {
    column-count: 1;
    column-gap: 12px;
}
.gallery__item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 12px;
}
.gallery__item img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease;
}
.gallery__item:hover img { transform: scale(1.05); }

/* ---------- Skeletons (loading) ---------- */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
.skeleton {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton--card { height: 150px; }
.skeleton--photo {
    break-inside: avoid;
    margin-bottom: 12px;
    height: 220px;
}
.skeleton--photo:nth-child(2n)   { height: 300px; }
.skeleton--photo:nth-child(3n)   { height: 180px; }

/* ---------- Estados empty / error ---------- */
.state-msg {
    color: var(--muted);
    font-size: 0.95rem;
    padding: 1.5rem 0;
}
.state-msg--error { color: #c87a7a; }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.92);
}
.lightbox.is-open { display: flex; }
.lightbox__img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: var(--radius);
}
.lightbox__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
}

/* ============================================================
   FOOTER / CONTACTO
   ============================================================ */
.footer {
    max-width: var(--max);
    margin: 4rem auto 0;
    padding: 5rem var(--pad) 2rem;
    border-top: 1px solid var(--border);
}
.footer__inner {
    display: grid;
    gap: 3rem;
    margin-bottom: 4rem;
}
.footer__label {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 1rem;
}
.footer__title {
    font-size: clamp(2.8rem, 13vw, 7rem);
    color: var(--text);
    margin-bottom: 1.5rem;
}
.footer__email {
    font-size: clamp(1.1rem, 4vw, 1.6rem);
    color: var(--text);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 0.2rem;
    transition: color 0.2s ease;
}
.footer__email:hover { color: var(--accent-light); }

/* Formulário de contacto */
.contact-form {
    margin-top: 2.5rem;
    display: grid;
    gap: 1rem;
    max-width: 480px;
}
.contact-form__field input,
.contact-form__field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s ease;
}
.contact-form__field input::placeholder,
.contact-form__field textarea::placeholder { color: var(--muted); }
.contact-form__field input:focus,
.contact-form__field textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.contact-form__field textarea { resize: vertical; min-height: 110px; }

.contact-form .btn { margin-top: 0; justify-self: start; }
.contact-form .btn:disabled { opacity: 0.6; cursor: not-allowed; }

.contact-form__status {
    font-size: 0.9rem;
    min-height: 1.2em;
}
.contact-form__status--success { color: var(--accent-light); }
.contact-form__status--error { color: #e57373; }

.footer__meta { display: grid; gap: 2rem; }
.footer__group { display: grid; gap: 0.4rem; }
.footer__group-label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
}
.footer__group-value { font-size: 1rem; }
.footer__links { display: flex; gap: 1.25rem; }
.footer__links a {
    position: relative;
    color: var(--text);
}
.footer__links a:hover { color: var(--accent-light); }

.footer__bottom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
}

/* ============================================================
   BREAKPOINT @768px (tablet)
   ============================================================ */
@media (min-width: 768px) {
    :root { --pad: 2rem; }

    .nav__pill { display: flex; }
    .nav__toggle { display: none; }

    .hero {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
    }
    .hero__left {
        flex: 0 1 50%;
        max-width: 50%;
        padding-right: 2rem;
    }
    /* Foto ocupa toda a altura do hero (100vh) e a metade direita, sem sobrepor o texto */
    .hero__right {
        position: absolute;
        top: 0;
        right: 0;
        width: 50%;
        height: 100%;
    }
    .hero__photo {
        height: 100%;
        object-fit: cover;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%);
                mask-image: linear-gradient(to right, transparent 0%, #000 30%);
    }

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

    .gallery { column-count: 2; }

    .footer__inner { grid-template-columns: 1fr 1fr; align-items: end; }
    .footer__meta { grid-template-columns: 1fr 1fr; }
    .footer__bottom { flex-direction: row; justify-content: space-between; }
}

/* ============================================================
   BREAKPOINT @1200px (desktop)
   ============================================================ */
@media (min-width: 1200px) {
    :root { --pad: 3rem; }

    .hero { max-width: var(--max); margin: 0 auto; }
    .hero__name { font-size: clamp(7rem, 12vw, 13rem); }

    .gallery { column-count: 3; }
}

/* ---------- Acessibilidade: reduzir movimento ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
