:root {
    --page-bg:
        radial-gradient(1200px 600px at 10% -10%, rgba(74, 126, 255, 0.18), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(19, 32, 62, 0.55), transparent 55%),
        #0b1020;
    --surface: #141b2f;
    --surface-strong: #0f1628;
    --ink: #f4f6ff;
    --ink-soft: #c3c9de;
    --primary: #7aa2ff;
    --primary-deep: #4b6cb7;
    --border: rgba(122, 162, 255, 0.18);
    --border-strong: rgba(122, 162, 255, 0.45);
    --shadow-soft: rgba(0, 0, 0, 0.25);
    --shadow-strong: rgba(0, 0, 0, 0.4);
    --header-bg: linear-gradient(90deg, #2b4377 0%, #0d1628 100%);
    --footer-bg: #0f1422;
    --accent-soft: rgba(122, 162, 255, 0.16);
    --accent-soft-2: rgba(75, 108, 183, 0.08);
}

html[data-theme="light"] {
    --page-bg:
        radial-gradient(1200px 600px at 10% -10%, rgba(75, 108, 183, 0.18), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(24, 40, 72, 0.18), transparent 55%),
        #f2f4f8;
    --surface: #ffffff;
    --surface-strong: #f5f7fb;
    --ink: #1a1f2e;
    --ink-soft: #3b4663;
    --primary: #4b6cb7;
    --primary-deep: #182848;
    --border: rgba(75, 108, 183, 0.12);
    --border-strong: rgba(75, 108, 183, 0.35);
    --shadow-soft: rgba(0, 0, 0, 0.12);
    --shadow-strong: rgba(0, 0, 0, 0.16);
    --header-bg: linear-gradient(90deg, #4B6CB7 0%, #182848 100%);
    --footer-bg: #ececec;
    --accent-soft: rgba(75, 108, 183, 0.12);
    --accent-soft-2: rgba(24, 40, 72, 0.04);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--page-bg);
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    overflow-x: hidden;
}
*, *::before, *::after {
    box-sizing: border-box;
}

.page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--header-bg);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-soft);
}

header h1 {
    margin: 0;
    font-size: 3rem;
    letter-spacing: 6px;
    word-break: break-word;
}

.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.theme-toggle {
    --theme-toggle-y: -50%;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(var(--theme-toggle-y));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

@media (hover: hover) {
    .theme-toggle:hover {
        transform: translateY(var(--theme-toggle-y)) scale(1.02);
        border-color: var(--border-strong);
        box-shadow: 0 10px 20px var(--shadow-soft);
    }
}


.theme-toggle:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

main {
    flex: 1;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 10px;
    width: 100%;
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    padding: 28px;
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 18px 34px var(--shadow-soft);
}

.eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--ink-soft);
    margin: 0 0 12px;
}

.hero-title {
    margin: 0 0 12px;
    font-size: 2.4rem;
    letter-spacing: 1px;
}

.hero-sub {
    margin: 0 0 20px;
    color: var(--ink-soft);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: white;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 12px 24px var(--shadow-soft);
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    background: var(--surface-strong);
}

.hero-panel {
    background: var(--surface-strong);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
}

.hero-panel h3 {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.hero-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.hero-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.section {
    margin-top: 36px;
}

.section-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.section-head-center {
    align-items: center;
    text-align: center;
}

.section-title {
    margin: 0;
    font-size: 1.6rem;
}

.section-title-center {
    text-align: center;
}

.section-sub {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.6;
}

.section-sub-center {
    text-align: center;
}

.menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.menu-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 10px 16px;
    min-height: 200px;
    padding: 22px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 16px 30px var(--shadow-soft);
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--border);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    overflow: hidden;
    isolation: isolate;
}

.menu-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, var(--accent-soft), var(--accent-soft-2));
    opacity: 0;
    transition: opacity 0.25s;
    z-index: -1;
}

.menu-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.6rem;
    box-shadow: 0 10px 20px var(--shadow-soft);
}

.menu-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 4px;
}

.menu-sub {
    grid-column: 1 / -1;
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.menu-cta {
    grid-column: 1 / -1;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary);
}

.menu-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 36px var(--shadow-strong);
    border-color: var(--border-strong);
}

.menu-item:hover::before {
    opacity: 1;
}

.menu-item:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.project-grid {
    display: grid;
    gap: 20px;
}

.project {
    display: block;
    background: var(--surface);
    padding: 22px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 24px var(--shadow-soft);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    max-width: 100%;
}

.project:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px var(--shadow-strong);
    border-color: var(--border-strong);
}

.project h2 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.5rem;
}

.project p {
    margin-bottom: 0;
    line-height: 1.6;
    color: var(--ink-soft);
}

footer {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 30px;
    background: var(--footer-bg);
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.footer-left {
    position: absolute;
    left: 30px;
}

.footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

.email-icon {
    font-size: 1.6rem;
    color: var(--primary);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.email-icon:hover {
    color: var(--primary-deep);
    transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
    .menu-item {
        animation: none;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2.2rem;
        letter-spacing: 4px;
    }

    .header-inner {
        flex-direction: column;
        gap: 10px;
    }

    .theme-toggle {
        --theme-toggle-y: 0;
        position: static;
        transform: none;
        transition: border-color 0.2s, box-shadow 0.2s;
        margin-inline: auto;
    }

    .theme-toggle:hover,
    .theme-toggle:focus,
    .theme-toggle:active {
        transform: none;
    }

    main {
        margin: 20px auto;
    }

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

    .hero-title {
        font-size: 1.9rem;
    }

    .menu-item {
        grid-template-columns: auto 1fr;
        min-height: 160px;
        padding: 18px;
        border-radius: 18px;
    }

    .menu-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .menu-title {
        font-size: 1.4rem;
        letter-spacing: 0.5px;
    }

    .menu-sub {
        font-size: 0.95rem;
    }

    .project h2 {
        font-size: 1.3rem;
    }
}
