:root {
    --bg: #0a0a0b;
    --surface: #141416;
    --surface-hover: #1c1c1f;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --accent: #2dd4bf;
    --accent-strong: #14b8a6;
    --border: #27272a;
    --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.6);
}

body {
    font-family: "Fira Code", monospace;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

.page {
    min-height: 100vh;
    padding: 3rem clamp(1.25rem, 4vw, 3rem);
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    line-height: 1.7;
    color: var(--text-muted);
}

.tag {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.hero {
    margin-bottom: 3rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.section {
    margin-bottom: 3rem;
    width: 100%;
}

.section-title {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 400;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    height: 210px;
    display: flex;
    flex-direction: column;
    transition:
        border-color 180ms ease,
        background-color 180ms ease;
}

.project-card:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}

.project-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.project-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    line-clamp: 3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

.project-card-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent);
    font-weight: 400;
}

.project-card-link {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.75rem;
    transition: color 180ms ease;
}

.project-card-link:hover {
    color: var(--accent-strong);
}

.contact-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 180ms ease;
}

.contact-link:hover {
    color: var(--accent);
}

.dot-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.dot-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 260vmax;
    height: 260vmax;
    transform-origin: center;
    background-repeat: repeat;
    background-image: radial-gradient(
        circle,
        rgba(45, 212, 191, 0.22) 1px,
        transparent 1px
    );
    transition: translate 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: translate, rotate;
}

.dot-layer--far {
    background-size: 48px 48px;
    translate: calc(-50% + (var(--mx, 0) * 1px - 50vw) * 0.04)
        calc(-50% + (var(--my, 0) * 1px - 50vh) * 0.04);
    opacity: 0.38;
    animation: spin-far 140s linear infinite;
}

.dot-layer--mid {
    background-size: 32px 32px;
    translate: calc(-50% + (var(--mx, 0) * 1px - 50vw) * 0.08)
        calc(-50% + (var(--my, 0) * 1px - 50vh) * 0.08);
    opacity: 0.28;
    animation: spin-mid 96s linear infinite reverse;
}

.dot-layer--near {
    background-size: 20px 20px;
    translate: calc(-50% + (var(--mx, 0) * 1px - 50vw) * 0.14)
        calc(-50% + (var(--my, 0) * 1px - 50vh) * 0.14);
    opacity: 0.2;
    animation: spin-near 68s linear infinite;
}

@keyframes spin-far {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 360deg;
    }
}

@keyframes spin-mid {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 360deg;
    }
}

@keyframes spin-near {
    from {
        rotate: 0deg;
    }
    to {
        rotate: 360deg;
    }
}

.dot-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        600px circle at calc(var(--mx, 0) * 1px) calc(var(--my, 0) * 1px),
        rgba(45, 212, 191, 0.1),
        transparent 60%
    );
    opacity: var(--glow, 0);
    transition: opacity 400ms ease;
    pointer-events: none;
}

.page {
    position: relative;
    z-index: 1;
}

.app-container {
    position: relative;
    min-height: 100vh;
    perspective: 1200px;
}

.cycle-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--accent);
    font-family: "Fira Code", monospace;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease;
    box-shadow: var(--shadow);
    -webkit-tap-highlight-color: transparent;
}

.cycle-btn:focus {
    outline: none;
}

.cycle-btn:focus-visible {
    border-color: var(--accent);
    box-shadow:
        var(--shadow),
        0 0 0 3px rgba(45, 212, 191, 0.25);
}

.cycle-btn:active {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateX(-50%) scale(0.95);
}

.cycle-btn .icon {
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .cycle-btn:hover:not(:active) {
        background: var(--surface-hover);
        border-color: var(--accent);
        transform: translateX(-50%) scale(1.08);
    }
}

@keyframes rotate-in {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.95);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.page-transition {
    animation: rotate-in 250ms ease both;
}

@media (max-width: 640px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .page {
        justify-content: flex-start;
        padding-bottom: 7rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}
