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

html {
    scroll-behavior: smooth;
}

:root {
    --bg: #FAFAF7;
    --bg-elev: #FFFFFF;
    --ink: #14213D;
    --muted: #6B7280;
    --line: rgba(20, 33, 61, 0.12);
    --accent: #E0A000;
    --accent-soft: rgba(224, 160, 0, 0.12);

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --container: 880px;
    --section-pad: 120px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0B0E14;
        --bg-elev: #12161F;
        --ink: #ECEDEE;
        --muted: #93989F;
        --line: rgba(255, 255, 255, 0.1);
        --accent: #F2B705;
        --accent-soft: rgba(242, 183, 5, 0.12);
    }
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    position: relative;
    overflow-x: hidden;
}

#home, #skill, #projects, #achievements, #contacts {
    scroll-margin-top: 90px;
}

/* subtle technical grid backdrop */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

/* ---------- Nav ---------- */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
    border-bottom: 1px solid transparent;
    background-color: transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(from var(--bg) r g b / 82%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.nav-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 19px;
    color: var(--ink);
    text-decoration: none;
}

.nav-name .dot {
    color: var(--accent);
}

.navs {
    display: flex;
    flex-direction: row;
    gap: 36px;
    list-style: none;
}

.navs li a {
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.navs li a:hover {
    color: var(--ink);
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger-btn i {
    color: var(--ink);
    font-size: 20px;
}

.mobile-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 998;
    display: none;
    flex-direction: column;
    background-color: rgba(from var(--bg) r g b / 96%);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu ul li a {
    display: block;
    padding: 16px 24px;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    font-family: var(--font-mono);
}

.mobile-menu ul li a:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .navs { display: none; }
    .hamburger-btn { display: flex; }
    .mobile-menu.open { display: flex; }
}

/* ---------- Shared ---------- */

.eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--accent);
    margin-bottom: 16px;
}

.eyebrow.center {
    text-align: center;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 36px;
    color: var(--ink);
    text-align: center;
    margin-bottom: 56px;
}

section {
    padding: var(--section-pad) 48px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ---------- Hero ---------- */

#home {
    min-height: 92vh;
    display: flex;
    align-items: center;
    padding-top: 90px;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 64px;
    max-width: 1100px;
    width: 100%;
}

.hero-text {
    flex: 1;
    min-width: 0;
    max-width: 560px;
}

.hero-visual {
    flex-shrink: 0;
    width: 300px;
}

.hero-visual img {
    width: 100%;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 60px;
    line-height: 1.08;
    color: var(--ink);
    margin-bottom: 20px;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    flex-shrink: 0;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent);
}

.hero-role {
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--ink);
    min-height: 26px;
    margin-bottom: 20px;
}

.hero-role::after {
    content: "";
}

.hero-desc {
    font-size: 18px;
    line-height: 1.65;
    color: var(--muted);
    max-width: 560px;
    margin-bottom: 36px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.cta-container {
    display: flex;
    gap: 12px;
}

.cta-container a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 18px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.cta-container a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

#see-works {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    width: auto;
    height: 44px;
    border-radius: 16px;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 16px;
    text-decoration: none;
    transition: all 0.25s ease;
}

#see-works:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

/* ---------- Skills ---------- */

#skill {
    padding-top: 60px;
    padding-bottom: 60px;
}

.badge {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--bg-elev);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.badge-item:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.badge-item i, .badge-item svg {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--ink);
    fill: var(--ink);
}

.badge-item:hover i, .badge-item:hover svg {
    color: var(--accent);
    fill: var(--accent);
}

.badge-label {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
}

/* ---------- Projects ---------- */

.card-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.card {
    background-color: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.card-img {
    aspect-ratio: 16 / 9;
    background-color: var(--line);
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 24px 28px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tag {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    background-color: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 14px;
}

.card h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 10px;
    line-height: 1.3;
}

.card p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
}

/* ---------- Achievements ---------- */

.comp-con {
    display: flex;
    justify-content: center;
}

.comp {
    position: relative;
    max-width: 700px;
    width: 100%;
    list-style: none;
}

.comp::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 108px;
    width: 1px;
    background-color: var(--line);
}

.comp-item {
    position: relative;
    margin-bottom: 28px;
}

.comp-item::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 102px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background-color: var(--bg);
    border: 2px solid var(--accent);
}

.comp-timestamp {
    position: absolute;
    width: 90px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    top: 8px;
}

.comp-content {
    margin-left: 132px;
    background-color: var(--bg-elev);
    border: 1px solid var(--line);
    padding: 18px 20px;
    border-radius: 10px;
}

.comp-content h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
    line-height: 1.4;
}

.comp-organizer {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 400;
    color: var(--accent);
    margin-bottom: 6px;
}

.comp-content p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

/* ---------- Contact ---------- */

#contacts {
    max-width: 100%;
    padding-bottom: 80px;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.contact-desc {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

.contact {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 56px;
}

.contact a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 22px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.contact a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

footer {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Scroll reveal ---------- */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .cursor { animation: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    :root { --section-pad: 80px; }

    section { padding: var(--section-pad) 28px; }

    .hero {
        flex-direction: column-reverse;
        gap: 36px;
        text-align: center;
    }

    .hero-text { max-width: 100%; }
    .hero-visual { width: 220px; }
    .cta-container { justify-content: center; }
    .status-line { justify-content: center; }
    .hero-desc { margin-left: auto; margin-right: auto; }

    .hero h1 { font-size: 44px; }
    .hero-desc { font-size: 16px; }

    .card-container { grid-template-columns: 1fr; }

    .section-title { font-size: 28px; }
}

@media (max-width: 630px) {
    .navbar { padding: 16px 20px; }

    #home { min-height: auto; padding-top: 110px; padding-bottom: 60px; }

    .comp::before { left: 78px; }
    .comp-item::before { left: 72px; }
    .comp-timestamp { width: 64px; font-size: 11px; }
    .comp-content { margin-left: 96px; }
}