:root {
    --bg: rgb(28 28 28);
    --line: rgb(70 70 70);
    --text: rgb(235 235 235);
    --muted: rgb(165 165 165);
    --accent: aquamarine;
    --teal: rgb(42 123 155);
    --yellow: rgb(237 221 83);
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.55;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; }

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

header {
    border-bottom: 1px solid var(--line);

    nav {
        max-width: 760px;
        margin: 0 auto;
        padding: 14px 16px;
        display: flex;
        align-items: center;
        gap: 22px;
    }

    a {
        color: var(--text);
        text-decoration: none;
        font-size: 16px;

        &:hover {
            color: var(--accent);
            text-decoration: underline;
            text-underline-offset: 4px;
        }
    }

    .brand {
        font-weight: bold;
        span { color: var(--accent); }
    }

    .ButtonsRight {
        margin-left: auto;
    }

    .lang {
        font-size: 20px;
        line-height: 1;
        &:hover { text-decoration: none; }
    }
}

main {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 72px 16px 0;

    p {
        max-width: 60ch;
        margin: 0 0 14px;
    }
}

.name {
    font-size: clamp(52px, 12vw, 104px);
    font-weight: 900;
    line-height: 0.95;
    margin: 0 0 36px;

    span { display: block; }

    .LastName {
        background: linear-gradient(90deg, var(--teal) 0%, var(--yellow) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        width: fit-content;
        padding-bottom: 0.08em;
    }
}

.projects {
    margin-top: 80px;
    scroll-margin-top: 20px;

    h2 {
        font-size: 15px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--muted);
        margin: 0 0 8px;
    }
}

.project-card {
    display: block;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;

    &:last-child { border-bottom: 1px solid var(--line); }

    h3 {
        font-size: 22px;
        margin: 0 0 4px;
    }

    p {
        color: var(--muted);
        margin: 0 0 6px;
    }

    .project-tags {
        font-size: 14px;
        color: var(--muted);
    }

    &:hover h3 {
        color: var(--accent);
        text-decoration: underline;
        text-underline-offset: 4px;
    }
}

.contact {
    margin-top: 80px;
    scroll-margin-top: 20px;

    h2 {
        font-size: 15px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--muted);
        margin: 0 0 8px;
    }
}

.contact-form {
    display: flex;
    flex-direction: column;
    max-width: 560px;
    margin-top: 24px;

    label {
        font-size: 15px;
        color: var(--muted);
        margin-bottom: 6px;
    }

    input, textarea {
        font: inherit;
        color: var(--text);
        background: rgb(20 20 20);
        border: 1px solid var(--line);
        padding: 10px 12px;
        margin-bottom: 22px;

        &:focus {
            outline: none;
            border-color: var(--accent);
        }
    }

    textarea { resize: vertical; }

    button {
        align-self: flex-start;
        font: inherit;
        font-weight: bold;
        color: var(--bg);
        background: var(--accent);
        border: none;
        padding: 10px 28px;
        cursor: pointer;

        &:hover { filter: brightness(0.9); }
    }
}

.red-button {
    margin-top: auto;
    display: flex;
    justify-content: center;
    padding: 130px 0 24px;
}

.rb-housing {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 16px;
    background:
        radial-gradient(circle, rgb(35 35 35) 55%, transparent 56%),
        repeating-linear-gradient(45deg, #f5c400 0 12px, #111 12px 24px);
    box-shadow: 0 6px 16px rgb(0 0 0 / 0.6), inset 0 0 0 4px rgb(20 20 20);
    perspective: 600px;
}

.rb-press {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 90px;
    margin: -45px 0 0 -45px;
    border: 6px solid rgb(60 60 60);
    border-radius: 50%;
    cursor: pointer;
    background: radial-gradient(circle at 40% 35%, #ff5c5c, #e00000 50%, #a00000 100%);
    box-shadow:
        0 0 0 2px rgb(20 20 20),
        inset 0 0 0 3px rgb(0 0 0 / 0.25),
        inset 0 -4px 8px rgb(0 0 0 / 0.3);
    transition: transform 0.08s, filter 0.08s;

    &:active:not(:disabled) {
        transform: scale(0.94);
        filter: brightness(0.85);
    }

    &:disabled { cursor: default; }
}

.rb-flap {
    position: absolute;
    inset: 10px;
    padding: 0;
    cursor: pointer;
    border: 2px solid rgb(255 255 255 / 0.45);
    border-radius: 12px;
    background: linear-gradient(135deg,
        rgb(255 255 255 / 0.35) 0%,
        rgb(180 220 255 / 0.12) 40%,
        rgb(180 220 255 / 0.08) 60%,
        rgb(255 255 255 / 0.25) 100%);
    backdrop-filter: blur(1.5px);
    box-shadow: inset 0 0 12px rgb(255 255 255 / 0.25);
    transform-origin: top center;
    transition: transform 0.6s ease-in-out;

    &.open {
        transform: rotateX(180deg);
    }
}

.rb-handle {
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 40px;
    height: 10px;
    transform: translateX(-50%);
    border-radius: 0 0 6px 6px;
    background: rgb(220 235 255 / 0.55);
    border: 1px solid rgb(255 255 255 / 0.6);
}

.rb-tape {
    position: absolute;
    top: 50%;
    left: 50%;
    padding: 4px 14px;
    transform: translate(-50%, -50%) rotate(-12deg);
    white-space: nowrap;
    font-family: "Permanent Marker", "Comic Sans MS", cursive;
    font-size: 17px;
    color: rgb(30 30 30);
    background: rgb(240 230 200 / 0.92);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
    clip-path: polygon(0 8%, 3% 0, 97% 4%, 100% 0, 98% 50%, 100% 100%, 96% 94%, 2% 100%, 0 92%, 3% 50%);
}

.shake { animation: shake 0.4s; }

@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-6px, 3px); }
    40% { transform: translate(6px, -3px); }
    60% { transform: translate(-4px, -2px); }
    80% { transform: translate(4px, 2px); }
}

.countdown {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: min(60vw, 60vh);
    font-weight: 900;
    line-height: 1;
    color: #ff1a1a;
    text-shadow:
        0 0 20px rgb(255 0 0 / 0.8),
        0 0 60px rgb(255 0 0 / 0.6),
        0 8px 0 #6a0000;
    background: radial-gradient(circle, rgb(120 0 0 / 0.35), rgb(0 0 0 / 0.6));

    &[hidden] { display: none; }
}

.countdown-number { display: inline-block; }
.countdown-number.tick { animation: tick 1s ease-out; }

@keyframes tick {
    0%   { transform: scale(1.4); opacity: 0; }
    15%  { transform: scale(1);   opacity: 1; }
    85%  { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
    .rb-flap, .rb-press { transition: none; }
    .shake, .countdown-number.tick { animation: none; }
}

footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    padding: 14px;
}
