:root {
    color-scheme: dark;
    
    --bg: #050816;

    --surface: rgba(10, 15, 40, 0.75);
    --surface-strong: rgba(10, 15, 40, 0.92);

    --accent: #7de0e6;       
    --accent-soft: #f9a8d4;  

    --accent-warm: #f9a8d4; 
    --accent-star: #fde68a; 
    --accent-deep: #818cf8; 
    --accent-comet: #6ee7b7;

    --text: #ece8ff;
    --muted: #8b9cc0;

    --border: rgba(129, 140, 248, 0.08);

    --shadow:
        0 1.5rem 5rem rgba(4, 12, 34, 0.4);

    font-family: "IBM Plex Sans", sans-serif;

    font-size: 1rem;
    line-height: 1.65;

    scroll-behavior: smooth;
}

/* =========================================================
   RESET
========================================================= */

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

html,
body {
    margin: 0;
    min-height: 100vh;

    overflow-x: hidden;

    background:
        radial-gradient(
            circle at top,
            rgba(100, 242, 255, 0.08),
            transparent 28%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(187, 140, 255, 0.08),
            transparent 24%
        ),
        var(--bg);

    color: var(--text);
}

body {
    position: relative;
}

img,
svg,
canvas {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

/* =========================================================
   BACKGROUND
========================================================= */

.noise {
    pointer-events: none;

    position: fixed;
    inset: 0;

    z-index: -1;

    opacity: 0.35;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

/* =========================================================
   LAYOUT
========================================================= */

main,
.topbar,
.footer-content,
.footer-bottom {
    width: min(73.75rem, calc(100% - 2rem));
    margin: 0 auto;
}

main {
    position: relative;
    z-index: 1;
}

.panel {
    padding: clamp(3rem, 5vw, 6rem) 0;
}

.panel-glass {
    padding: clamp(2rem, 4vw, 4rem);

    border-radius: 2rem;

    background: var(--surface);

    border: 0.0625rem solid var(--border);

    backdrop-filter: blur(1.375rem);

    box-shadow: var(--shadow);
}

/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    position: sticky;
    top: 0;

    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    padding: 1rem 0;

    backdrop-filter: blur(1.125rem);
}

.brand {
    font-family: "Space Grotesk", sans-serif;

    font-size: 1rem;
    font-weight: 700;

    letter-spacing: 0.22em;
    text-transform: uppercase;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
}

nav a {
    color: var(--muted);

    font-size: 0.94rem;

    transition:
        color 0.25s ease,
        opacity 0.25s ease;
}

nav a:hover,
nav a:focus-visible {
    color: var(--accent);
}

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

.hero-panel {
    min-height: min(100vh, 57.5rem);

    display: grid;
    align-items: center;
}

.hero-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(30rem, 1fr);

    gap: clamp(2rem, 5vw, 6rem);

    align-items: center;
}

.hero-copy {
    max-width: 43.75rem;
}

.eyebrow {
    display: inline-block;

    margin-bottom: 1.4rem;

    color: var(--accent);

    font-size: 0.76rem;
    font-weight: 600;

    letter-spacing: 0.22em;
    text-transform: uppercase;
}

h1 {
    margin: 0;

    font-family: "Space Grotesk", sans-serif;

    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;

    line-height: 0.92;
    letter-spacing: -0.05em;
}

h1 span {
    color: var(--accent-soft);
}

.hero-intro,
.hero-subtitle {
    max-width: 40rem;

    color: var(--muted);
}

.hero-intro {
    margin: 1.8rem 0 1rem;
}

.hero-subtitle {
    min-height: 3rem;

    margin-bottom: 2rem;

    font-weight: 500;
}

/* =========================================================
   BUTTONS
========================================================= */

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/**
 * Base button and ghost styles with shared transitions and layout
 */
.button,
.ghost {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.85rem 1.6rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 1em;
    border: 0.0625rem solid transparent;
    cursor: pointer;
    font-weight: 600;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
}

/*
 * Primary button with cyan accent gradient
 */
.button {
    color: var(--accent);
    border-color: rgba(125, 211, 252, 0.24);
    background:
        linear-gradient(
            135deg,
            rgba(100, 242, 255, 0.16),
            rgba(187, 140, 255, 0.14)
        );
    box-shadow: 0 0.1875rem 0.75rem rgba(125, 211, 252, 0.08);
}

/*
 * Ghost button with subtle border and transparent background 
 */
.ghost {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

/*
 * Shine effect overlay for all buttons
 */
.button::before, .ghost::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            120deg,
            transparent,
            rgba(255, 255, 255, 0.12),
            transparent
        );
    transform: translateX(-120%);
    transition: transform 0.7s ease;
}

/*
 * Hover state for all buttons
 */
.button:hover,
.ghost:hover {
    transform: translateY(-0.125rem);
    border-color: rgba(100, 242, 255, 0.34);
    box-shadow: 0 0.25rem 0.8125rem rgba(100, 242, 255, 0.12);
}

.button:hover::before,
.ghost:hover::before {
    transform: translateX(120%);
}

/*
 * Active/pressed state for all buttons
 */
.button:active,
.ghost:active {
    transform: scale(0.97);
}

/*
 * Loading state with spinner animation
 */
.button.loading {
    pointer-events: none;
    opacity: 0.72;
}

.button.loading::after {
    content: "";
    width: 1rem;
    height: 1rem;
    margin-left: 0.8rem;
    border-radius: 50%;
    border: 0.125rem solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    animation: button-spin 0.7s linear infinite;
}

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   CANVAS
========================================================= */

.hero-visual {
    position: relative;
    overflow: hidden;
    border-radius: 2.4rem;
    
    /* Maintain square aspect ratio */
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 100%;
    
    /* Responsive layout does not require a fixed min-height */
    /* min-height: 42rem; */
    
    background: transparent;
}

.hero-visual::before {
    display: none;
}

#simulation-canvas {
    position: relative;

    z-index: 1;

    width: 100%;
    height: 100%;

    background: transparent;
}

/* =========================================================
   CONTENT
========================================================= */

.section-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    margin-bottom: 2rem;
}

.section-header h2 {
    margin: 0;

    font-size: clamp(2rem, 4vw, 3rem);

    letter-spacing: -0.04em;
}

.section-header p {
    margin: 0;

    max-width: 45rem;

    color: var(--muted);
}

.content-shell {
    max-width: 51.25rem;
}

/* =========================================================
   CARDS
========================================================= */

.project-card,
.skill-block,
.timeline-item,
.contact-card {
    border-radius: 2rem;

    border: 0.0625rem solid rgba(255,255,255,0.08);

    background:
        rgba(255,255,255,0.03);

    backdrop-filter: blur(1.125rem);

    box-shadow:
        0 1.25rem 3.75rem rgba(2, 8, 24, 0.24);

    transition:
        transform 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.project-card,
.skill-block,
.timeline-item {
    padding: 1.8rem;
}

.project-card:hover,
.skill-block:hover,
.timeline-item:hover,
.contact-card:hover {
    transform: translateY(-0.25rem);

    border-color:
        rgba(100, 242, 255, 0.22);

    box-shadow:
        0 1.75rem 2.375rem rgba(2, 8, 24, 0.3);
}

/* =========================================================
   CONTACT
========================================================= */

.contact-card {
    max-width: 47.5rem;
    margin: 0 auto;
    padding: 2rem;
}

.contact-form {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.contact-form label {
    display: grid;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.95rem;
}

/**
 * Form input fields with focus and transition effects
 */
.contact-form input,
.contact-form textarea {
    width: 100%;
    min-height: 3.8rem;
    padding: 1rem 1.2rem;
    border-radius: 1.4rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    resize: vertical;
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.contact-form textarea {
    min-height: 10rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: rgba(100, 242, 255, 0.34);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 0.05rem rgba(100, 242, 255, 0.1);
}

/* Progressive form step reveal with smooth transitions */
.form-step {
    overflow: hidden;
    max-height: 18rem;
    opacity: 1;
    transform: translateY(0);
    transition:
        max-height 0.35s ease,
        opacity 0.35s ease,
        transform 0.35s ease;
}

.form-step.hidden {
    max-height: 0;
    opacity: 0;
    transform: translateY(0.75rem);
    pointer-events: none;
}

/* Status message display for form feedback */
.form-status {
    display: none;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(0.5rem);
    font-size: 0.95rem;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.form-status.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.form-status.success {
    color: #9ff7c2;
}

.form-status.error {
    color: #ff8d8d;
}

/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    margin-top: 6rem;
    padding: 4rem 0 2rem;
    border-top: 0.0625rem solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.01),
            rgba(255, 255, 255, 0.03)
        );
    backdrop-filter: blur(0.875rem);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-brand h3 {
    margin: 0 0 0.8rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.5rem;
}

.footer-brand p {
    margin: 0;
    max-width: 26.25rem;
    color: var(--muted);
}

/* Social media links with hover animation */
.footer-socials {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.375rem;
    height: 3.375rem;
    border-radius: 50%;
    border: 0.0625rem solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        background 0.25s ease;
}

.footer-socials a svg {
    width: 1.375rem;
    height: 1.375rem;
    fill: currentColor;
}

.footer-socials a:hover {
    transform: translateY(-0.1875rem);
    color: var(--accent);
    border-color: rgba(100, 242, 255, 0.22);
    background: rgba(100, 242, 255, 0.06);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 0.0625rem solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
}

.footer-bottom small {
    font-size: 0.84rem;
}

/* =========================================================
   REVEAL
========================================================= */

/**
 * Scroll reveal animation - elements fade in as they enter viewport
 */
.reveal {
    opacity: 0;
    transform: translateY(2rem);
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   RESPONSIVE DESIGN - TABLET
========================================================= */

@media (max-width: 880px) {
    .topbar {
        position: relative;
    }

    .hero-panel {
        min-height: auto;
        padding-top: 4rem;
    }

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

    .hero-visual {
        order: -1;

        min-height: 32rem;

        aspect-ratio: 1 / 1;
    }

    .simulation-info {
        font-size: 0.7rem;
        min-width: 15rem;
    }

    h1 {
        font-size: clamp(2.8rem, 12vw, 5rem);
    }
}

/* =========================================================
   RESPONSIVE DESIGN - MOBILE
========================================================= */

@media (max-width: 640px) {
    :root {
        font-size: 0.9375rem;
    }

    main,
    .topbar,
    .footer-content,
    .footer-bottom {
        width: min(calc(100% - 1.2rem), 73.75rem);
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    nav {
        gap: 0.9rem;
    }

    .panel {
        padding: 2.5rem 0;
    }

    .hero-panel {
        padding-top: 2rem;
    }

    h1 {
        font-size: clamp(2.5rem, 14vw, 4rem);
    }

    .hero-subtitle {
        min-height: 2.4rem;
    }

    .hero-actions {
        content-visibility: hidden;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   RESPONSIVE DESIGN - SMALL MOBILE
========================================================= */

@media (max-width: 420px) {
    h1 {
        font-size: 2.2rem;
    }

    .hero-intro,
    .hero-subtitle {
        font-size: 0.92rem;
    }

    .eyebrow {
        font-size: 0.64rem;
    }
}

/* =========================================================
   RESPONSIVE DESIGN - LARGE SCREENS
========================================================= */

@media (min-width: 896px) {
    .hero-panel {
        min-height: 100vh;
        min-width: 57.5vw;
    }
}