/* Guilherme Gomes Correia · Portfolio · página "em breve" */

@font-face {
    font-family: "Instrument Serif";
    src: url("../fonts/instrument-serif.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Instrument Serif";
    src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono.woff2") format("woff2");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #0b0a09;
    --ink: #efe8dc;
    --ink-dim: rgba(239, 232, 220, .55);
    --ink-faint: rgba(239, 232, 220, .22);
    --accent: #e0442b;          /* vermelho do REC */
    --amber: #d9a35b;           /* luz de projetor */
    --serif: "Instrument Serif", "Times New Roman", serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
    --edge: clamp(16px, 3.2vw, 40px);
    --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--mono);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    cursor: crosshair;
}

/* ---------------------------------------------------------------------------
   Camadas de atmosfera
   ------------------------------------------------------------------------- */

/* Luz de projetor que respira ao fundo */
body::before {
    content: "";
    position: fixed;
    inset: -20%;
    background:
        radial-gradient(ellipse 45% 38% at 50% 46%, rgba(217, 163, 91, .16), transparent 70%),
        radial-gradient(ellipse 70% 60% at 50% 50%, rgba(224, 68, 43, .05), transparent 75%);
    animation: flicker 6s infinite steps(1);
    pointer-events: none;
    z-index: 0;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    7%  { opacity: .86; }
    8%  { opacity: 1; }
    31% { opacity: .93; }
    32% { opacity: 1; }
    54% { opacity: .8; }
    55% { opacity: .97; }
    78% { opacity: .9; }
    79% { opacity: 1; }
}

.grain {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .11;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 5;
}

.vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .78) 100%);
    pointer-events: none;
    z-index: 4;
}

/* Foco suave que segue o cursor */
.spot {
    position: fixed;
    left: 0;
    top: 0;
    width: 560px;
    height: 560px;
    margin: -280px 0 0 -280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 232, 220, .07), transparent 65%);
    transform: translate3d(50vw, 50vh, 0);
    pointer-events: none;
    z-index: 1;
    transition: opacity .6s;
}

/* Riscos verticais de película gasta */
body::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: 23%;
    width: 1px;
    background: rgba(239, 232, 220, .12);
    box-shadow: 41vw 0 0 rgba(239, 232, 220, .07);
    animation: scratch 3.4s infinite steps(1);
    pointer-events: none;
    z-index: 6;
}

@keyframes scratch {
    0%   { transform: translateX(0);     opacity: 0; }
    12%  { transform: translateX(3vw);   opacity: 1; }
    14%  { opacity: 0; }
    46%  { transform: translateX(-9vw);  opacity: .8; }
    49%  { opacity: 0; }
    71%  { transform: translateX(18vw);  opacity: .6; }
    72%  { opacity: 0; }
}

/* ---------------------------------------------------------------------------
   Enquadramento de câmara
   ------------------------------------------------------------------------- */

.frame {
    position: fixed;
    inset: var(--edge);
    pointer-events: none;
    z-index: 7;
    font-size: 11px;
    letter-spacing: .14em;
    color: var(--ink-dim);
}

.corner {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 0 solid var(--ink-dim);
}
.corner.tl { top: 0;    left: 0;  border-top-width: 1px;    border-left-width: 1px; }
.corner.tr { top: 0;    right: 0; border-top-width: 1px;    border-right-width: 1px; }
.corner.bl { bottom: 0; left: 0;  border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.hud {
    position: absolute;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hud-top    { top: 6px; }
.hud-bottom { bottom: 6px; }

.rec {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}
.rec i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: blink 1.2s infinite steps(1);
}
@keyframes blink { 50% { opacity: 0; } }

.tc { font-variant-numeric: tabular-nums; color: var(--ink); }

/* Seletor de idioma, ao centro da linha de baixo do HUD */
.langs {
    position: fixed;
    left: 50%;
    bottom: calc(var(--edge) + 6px);
    transform: translate(-50%, 50%);
    z-index: 8;
    display: flex;
    gap: 4px;
    font-size: 11px;
    letter-spacing: .14em;
}
.langs a {
    padding: 8px 10px;
    color: var(--ink-dim);
    text-decoration: none;
    cursor: pointer;
    transition: color .3s;
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 5px;
}
.langs a:focus-visible { outline: 1px solid var(--amber); outline-offset: 2px; }

/* ---------------------------------------------------------------------------
   Palco
   ------------------------------------------------------------------------- */

.stage {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* o fundo fica para a fita de película */
    padding: 0 var(--edge) clamp(60px, 13vh, 130px);
    transform-style: preserve-3d;
    will-change: transform;
}

.eyebrow {
    margin: 0 0 clamp(14px, 2.4vh, 28px);
    font-size: 12px;
    letter-spacing: .5em;
    text-transform: uppercase;
    color: var(--amber);
    padding-left: .5em; /* compensa o espaçamento da última letra */
}

.name {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(52px, min(11.5vw, 19vh), 190px);
    line-height: .86;
    letter-spacing: -.02em;
}

.name .line {
    display: block;
    overflow: hidden;
    padding: 0 .06em .04em;
}

.name .word { display: inline-block; }

.name .italic {
    font-style: italic;
    color: transparent;
    -webkit-text-stroke: 1px var(--ink);
    background: linear-gradient(100deg, var(--ink) 0 40%, var(--amber) 50%, var(--ink) 60% 100%);
    background-size: 300% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    animation: sheen 7s 3.6s infinite var(--ease);
}

@keyframes sheen {
    0%        { background-position: 100% 0; }
    40%, 100% { background-position: 0 0; }
}

.crafts {
    list-style: none;
    margin: clamp(22px, 4vh, 44px) 0 0;
    padding: 0;
    display: flex;
    gap: clamp(14px, 3vw, 36px);
    font-size: 12px;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.crafts li { display: flex; align-items: center; gap: clamp(14px, 3vw, 36px); }
.crafts li + li::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.soon {
    margin: clamp(34px, 7vh, 70px) 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.soon-label {
    position: relative;
    font-size: 13px;
    letter-spacing: .6em;
    text-transform: uppercase;
    padding: 12px 18px 12px calc(18px + .6em);
    border: 1px solid var(--ink-faint);
    overflow: hidden;
}
.soon-label::after {
    /* barra de carregamento, como a revelação de um negativo */
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 100%;
    background: var(--amber);
    transform-origin: left;
    animation: develop 3.8s 3.4s infinite var(--ease);
    transform: scaleX(0);
}
@keyframes develop {
    0%   { transform: scaleX(0); transform-origin: left; }
    55%  { transform: scaleX(1); transform-origin: left; }
    56%  { transform: scaleX(1); transform-origin: right; }
    100% { transform: scaleX(0); transform-origin: right; }
}

.soon-sub {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(17px, 2vw, 21px);
    letter-spacing: .01em;
    color: var(--ink-dim);
}

/* ---------------------------------------------------------------------------
   Fita de película
   ------------------------------------------------------------------------- */

.filmstrip {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--edge) + 34px);
    height: 64px;
    overflow: hidden;
    z-index: 2;
    opacity: .5;
    transform: rotate(-2deg) scale(1.05);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.filmstrip-track {
    display: flex;
    width: max-content;
    animation: roll 38s linear infinite;
}

.filmstrip-set { display: flex; }

.cell {
    position: relative;
    width: 104px;
    height: 64px;
    flex: none;
    border-left: 1px solid rgba(239, 232, 220, .08);
    background:
        /* perfurações em cima e em baixo */
        repeating-linear-gradient(90deg, rgba(239, 232, 220, .22) 0 7px, transparent 7px 17px) top 4px left 6px / 100% 5px no-repeat,
        repeating-linear-gradient(90deg, rgba(239, 232, 220, .22) 0 7px, transparent 7px 17px) bottom 4px left 6px / 100% 5px no-repeat,
        linear-gradient(rgba(217, 163, 91, .06), rgba(217, 163, 91, .02)) center / 100% 70% no-repeat,
        #14110e;
}
.cell em {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-style: normal;
    font-size: 9px;
    letter-spacing: .2em;
    color: rgba(217, 163, 91, .55);
}

@keyframes roll { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------------------
   Entrada: contagem de abertura e revelação
   ------------------------------------------------------------------------- */

.leader {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: #1a1714;
    transition: opacity .5s ease, visibility .5s;
}
.leader.done { opacity: 0; visibility: hidden; }

.leader-dial {
    position: absolute;
    width: min(62vmin, 460px);
    height: min(62vmin, 460px);
}
.leader-dial .ring  { fill: none; stroke: rgba(239, 232, 220, .55); stroke-width: 1.4; }
.leader-dial .thin  { stroke-width: .7; stroke: rgba(239, 232, 220, .3); }
.leader-dial .cross { stroke: rgba(239, 232, 220, .3); stroke-width: .7; }
.leader-dial .sweep {
    fill: none;
    stroke: rgba(239, 232, 220, .16);
    stroke-width: 88;
    stroke-dasharray: 0 100;
    transform: rotate(-90deg);
    transform-origin: center;
}
.leader.tick .sweep { animation: sweep .62s linear forwards; }
@keyframes sweep { to { stroke-dasharray: 100 0; } }

.leader-num {
    position: relative;
    font-family: var(--serif);
    font-size: min(34vmin, 260px);
    line-height: 1;
    color: var(--ink);
}

.reveal {
    opacity: 0;
    transform: translateY(40%);
    filter: blur(8px);
}
.name .reveal { transform: translateY(105%); filter: none; }

body.on .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
        opacity 1.1s var(--ease),
        transform 1.4s var(--ease),
        filter 1.1s var(--ease);
}
body.on .d0 { transition-delay: .05s; }
body.on .d1 { transition-delay: .2s; }
body.on .d2 { transition-delay: .38s; }
body.on .d3 { transition-delay: .75s; }
body.on .d4 { transition-delay: 1s; }
body.on .d5 { transition-delay: 1.2s; }

/* ---------------------------------------------------------------------------
   Telemóvel
   ------------------------------------------------------------------------- */

@media (max-width: 640px) {
    .hud { left: 30px; right: 30px; font-size: 10px; letter-spacing: .1em; }
    .hud-mid { display: none; }
    .corner { width: 18px; height: 18px; }
    .name { font-size: clamp(52px, 17vw, 110px); }
    .crafts { font-size: 11px; letter-spacing: .24em; }
    .soon-label { font-size: 12px; letter-spacing: .45em; padding-left: calc(18px + .45em); }
    .filmstrip { height: 48px; bottom: calc(var(--edge) + 30px); }
    .cell { width: 78px; height: 48px; }
    .spot { display: none; }
    body::after { display: none; }
}

@media (max-height: 720px) {
    .filmstrip { display: none; }
    .stage { padding-bottom: 0; }
}

/* Quem pediu menos movimento vê a página já composta, sem cortinas */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .leader, body::after { display: none; }
    .reveal { opacity: 1; transform: none; filter: none; }
}
