/* =========================================================
   PIVETAO SAURO . RACE MODE
   Design system: dark, editorial, cinematografico.
   ========================================================= */

:root {
    --bg: #080808;
    --surface: #101010;
    --text: #F2F0EA;
    --white: #FFFFFF;
    --muted: #707070;
    --accent: #B7FF00;
    --border: rgba(242, 240, 234, 0.12);

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    --gutter: clamp(20px, 5vw, 64px);
    --section-pad: clamp(64px, 12vh, 160px);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent); color: var(--bg); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.02em;
}

.eyebrow {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.accent { color: var(--accent); }

/* ---------- layout helpers ---------- */

.section {
    position: relative;
    padding: var(--section-pad) var(--gutter);
}

.section-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: -40px; left: 0;
    background: var(--accent);
    color: var(--bg);
    padding: 10px 16px;
    z-index: 999;
    font-weight: 600;
}
.skip-link:focus { top: 0; }

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

/* ---------- custom cursor (desktop only) ---------- */

.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width .2s ease, height .2s ease, background .2s ease;
    mix-blend-mode: difference;
}
.cursor-dot.is-active { width: 44px; height: 44px; background: var(--text); }

@media (hover: none), (pointer: coarse) {
    .cursor-dot { display: none; }
}

/* ---------- top nav ---------- */

.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px var(--gutter);
    mix-blend-mode: difference;
}

.site-nav__mark {
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 0.05em;
    color: var(--white);
}

.site-nav__progress {
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--white);
    display: flex;
    gap: 8px;
    align-items: baseline;
}

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

.hero {
    position: relative;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
    background: #000;
}

.hero__frame {
    position: absolute;
    inset: 0;
}

.hero__photo {
    position: absolute;
    inset: -6% -6% -6% -6%;
    width: 112%;
    height: 112%;
    object-fit: cover;
    object-position: 55% 25%;
    will-change: transform;
}

.hero__cutout {
    position: absolute;
    left: 50%;
    bottom: 0;
    height: 92%;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    will-change: transform;
}
.hero__cutout[hidden] { display: none; }

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8,8,8,.55) 0%, rgba(8,8,8,.15) 32%, rgba(8,8,8,.35) 70%, rgba(8,8,8,.85) 100%);
    z-index: 2;
}

.hero__content {
    position: relative;
    z-index: 4;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--gutter);
    padding-bottom: clamp(40px, 6vh, 80px);
}

.hero__title {
    font-size: clamp(48px, 10vw, 128px);
    line-height: 0.92;
    color: var(--white);
    text-transform: uppercase;
    max-width: 16ch;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line span { display: inline-block; will-change: transform; }
.hero__title .line em { font-style: normal; color: var(--accent); }

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-top: 28px;
}

.hero__athlete-name {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.4vw, 30px);
    color: var(--white);
}

.hero__tags {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.hero__tags span::before { content: '/ '; color: var(--accent); }
.hero__tags span:first-child::before { content: ''; }

.hero__scroll {
    position: absolute;
    left: var(--gutter);
    bottom: 28px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--white);
}

.hero__scroll-bar {
    width: 1px;
    height: 34px;
    background: rgba(255,255,255,.3);
    position: relative;
    overflow: hidden;
}
.hero__scroll-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: var(--accent);
    animation: scrollTick 1.8s ease-in-out infinite;
}
@keyframes scrollTick {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(250%); }
}

/* =========================================================
   02 IDENTIDADE
   ========================================================= */

.identity {
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.identity__statement {
    font-size: clamp(30px, 5vw, 64px);
    line-height: 1.08;
    max-width: 15ch;
    text-transform: uppercase;
}

.identity__grid {
    margin-top: 56px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}

.identity__bio {
    font-size: clamp(16px, 1.4vw, 19px);
    color: var(--text);
    max-width: 60ch;
}
.identity__bio p + p { margin-top: 1em; }

.identity__facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 24px;
    border-top: 1px solid var(--border);
    padding-top: 28px;
}

.fact__value {
    font-family: var(--font-display);
    font-size: clamp(26px, 2.6vw, 38px);
    color: var(--white);
}
.fact__label {
    margin-top: 6px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* =========================================================
   03 PERFORMANCE
   ========================================================= */

.performance {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.performance__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.stat {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: clamp(32px, 5vw, 64px) clamp(24px, 3vw, 48px);
    position: relative;
    overflow: hidden;
}

.stat__number {
    font-family: var(--font-display);
    font-size: clamp(56px, 9vw, 140px);
    line-height: 0.9;
    color: var(--white);
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.stat__number .unit {
    font-size: clamp(16px, 1.6vw, 22px);
    color: var(--accent);
    font-family: var(--font-body);
    letter-spacing: 0.08em;
}

.stat__label {
    margin-top: 18px;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat__ruler {
    position: absolute;
    right: 20px;
    top: 20px;
    bottom: 20px;
    width: 1px;
    background: repeating-linear-gradient(to bottom, var(--border) 0 6px, transparent 6px 14px);
}

/* =========================================================
   04 TRAJETORIA
   ========================================================= */

.trajectory { background: var(--bg); }

.trajectory__line-wrap {
    position: relative;
    margin-top: 64px;
    padding-left: 40px;
}

.trajectory__line-track {
    position: absolute;
    left: 0; top: 0;
    width: 1px;
    height: 100%;
    background: var(--border);
}
.trajectory__line-fill {
    position: absolute;
    left: 0; top: 0;
    width: 1px;
    height: 0%;
    background: var(--accent);
    transform-origin: top;
}

.trajectory__item {
    position: relative;
    padding: 0 0 clamp(48px, 7vw, 96px) 40px;
}
.trajectory__item::before {
    content: '';
    position: absolute;
    left: -45px;
    top: 4px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--muted);
}
.trajectory__item.is-active::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(183,255,0,.15);
}

.trajectory__year {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 56px);
    color: var(--muted);
}
.trajectory__item.is-active .trajectory__year { color: var(--white); }

.trajectory__title {
    margin-top: 6px;
    font-size: clamp(18px, 1.8vw, 24px);
    text-transform: uppercase;
}
.trajectory__desc {
    margin-top: 10px;
    max-width: 60ch;
    color: var(--muted);
    font-size: 15px;
}

/* =========================================================
   05 NEXT RACE
   ========================================================= */

.next-race {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.next-race__grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: end;
}

.next-race__date {
    display: flex;
    align-items: baseline;
    gap: 16px;
}
.next-race__day {
    font-family: var(--font-display);
    font-size: clamp(72px, 12vw, 180px);
    line-height: 0.85;
    color: var(--white);
}
.next-race__month {
    font-size: clamp(18px, 2vw, 28px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.next-race__name {
    margin-top: 12px;
    font-size: clamp(24px, 3.4vw, 46px);
    text-transform: uppercase;
    max-width: 20ch;
}

.next-race__facts {
    margin-top: 16px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.next-race__facts strong { color: var(--text); }

.countdown {
    display: flex;
    gap: clamp(14px, 2vw, 28px);
}
.countdown__unit { text-align: right; }
.countdown__value {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 56px);
    color: var(--white);
    font-variant-numeric: tabular-nums;
}
.countdown__label {
    margin-top: 4px;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.next-race__empty {
    color: var(--muted);
    font-size: 18px;
    max-width: 40ch;
}

/* =========================================================
   06 CALENDARIO
   ========================================================= */

.calendar__list { margin-top: 48px; }

.race-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    transition: padding-left .3s ease;
}
.calendar__list li:last-child .race-row { border-bottom: 1px solid var(--border); }

.race-row__date {
    font-family: var(--font-display);
    color: var(--white);
}
.race-row__date .d { font-size: 32px; line-height: 1; display: block; }
.race-row__date .m { font-size: 11px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }

.race-row__name { font-size: clamp(18px, 2vw, 26px); text-transform: uppercase; }
.race-row__sub {
    margin-top: 6px;
    display: flex;
    gap: 16px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.status-tag {
    justify-self: end;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid var(--border);
    white-space: nowrap;
}
.status-tag[data-status="inscricoes_abertas"] { color: var(--accent); border-color: var(--accent); }
.status-tag[data-status="proxima"] { color: var(--white); border-color: var(--muted); }
.status-tag[data-status="realizada"],
.status-tag[data-status="encerrada"] { color: var(--muted); }

.empty-state {
    color: var(--muted);
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

/* =========================================================
   07 RESULTADOS
   ========================================================= */

.results__list {
    margin-top: 48px;
    display: grid;
    gap: 1px;
    background: var(--border);
}

.result-card {
    background: var(--bg);
    padding: clamp(24px, 3vw, 40px);
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 24px;
    align-items: center;
}

.result-card__race {
    font-size: clamp(16px, 1.6vw, 20px);
    text-transform: uppercase;
}
.result-card__meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.result-card__block { text-align: right; }
.result-card__num {
    font-family: var(--font-display);
    font-size: clamp(22px, 2.4vw, 32px);
    color: var(--white);
}
.result-card__tag {
    margin-top: 4px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.result-card__num.accent { color: var(--accent); }

/* =========================================================
   08 PATROCINADORES
   ========================================================= */

.sponsors__grid {
    margin-top: 56px;
    display: flex;
    flex-wrap: wrap;
    gap: clamp(32px, 6vw, 80px);
    align-items: center;
}

.sponsor-item {
    opacity: .7;
    transition: opacity .3s ease, transform .3s ease;
    filter: grayscale(1);
}
.sponsor-item:hover { opacity: 1; filter: grayscale(0); transform: translateY(-2px); }
.sponsor-item img { height: 40px; width: auto; }
.sponsor-item.text-only {
    font-family: var(--font-display);
    font-size: 18px;
    letter-spacing: 0.04em;
    color: var(--text);
    filter: none;
}

/* =========================================================
   09 MOMENTOS
   ========================================================= */

.moments__grid {
    margin-top: 48px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 14vw;
    gap: 12px;
}

.moment {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
}
.moment img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.22,.61,.36,1);
}
.moment:hover img { transform: scale(1.06); }

.moment__caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 16px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s ease, transform .3s ease;
}
.moment:hover .moment__caption { opacity: 1; transform: translateY(0); }

.moment--a { grid-column: span 3; grid-row: span 2; }
.moment--b { grid-column: span 2; grid-row: span 1; }
.moment--c { grid-column: span 2; grid-row: span 2; }
.moment--d { grid-column: span 4; grid-row: span 1; }
.moment--e { grid-column: span 3; grid-row: span 1; }
.moment--f { grid-column: span 3; grid-row: span 1; }

/* =========================================================
   10 INSTAGRAM
   ========================================================= */

.instagram__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}
.instagram__handle {
    font-family: var(--font-display);
    font-size: clamp(20px, 2vw, 26px);
    color: var(--accent);
}

.instagram__grid {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.instagram__item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface);
}
.instagram__item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s ease;
}
.instagram__item:hover img { transform: scale(1.05); }

/* =========================================================
   11 CONTATO
   ========================================================= */

.contact {
    background: var(--bg);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid var(--border);
}

.contact__statement {
    font-size: clamp(40px, 9vw, 110px);
    line-height: 0.94;
    text-transform: uppercase;
    max-width: 14ch;
}

.contact__links {
    margin-top: 56px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
}
.contact__links a {
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.contact__links a:hover { border-color: var(--accent); color: var(--accent); }

.site-footer {
    padding: 28px var(--gutter);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* =========================================================
   responsive
   ========================================================= */

@media (max-width: 1024px) {
    .identity__grid { grid-template-columns: 1fr; }
    .moments__grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 22vw; }
    .instagram__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .next-race__grid { grid-template-columns: 1fr; }
    .countdown { justify-content: flex-start; }
    .countdown__unit { text-align: left; }
    .performance__grid { grid-template-columns: 1fr; }
    .result-card { grid-template-columns: 1fr 1fr; row-gap: 16px; }
    .result-card__race { grid-column: 1 / -1; }
    .result-card__block { text-align: left; }
    .race-row { grid-template-columns: 70px 1fr; row-gap: 10px; }
    .status-tag { grid-column: 1 / -1; justify-self: start; }
    .moments__grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 42vw; }
    .moment--a, .moment--b, .moment--c, .moment--d, .moment--e, .moment--f { grid-column: span 1; grid-row: span 1; }
    .instagram__grid { grid-template-columns: repeat(2, 1fr); }
    .identity__facts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    :root { --section-pad: 64px; }
    .hero__tags { gap: 10px 16px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
