:root {
    --bg: #070912;
    --bg-2: #0d1324;
    --panel: rgba(15, 24, 43, 0.88);
    --panel-2: rgba(22, 36, 64, 0.72);
    --text: #f5f8ff;
    --muted: #a8b4cc;
    --line: rgba(140, 165, 210, 0.22);
    --cyan: #55e7ff;
    --blue: #7aa2ff;
    --amber: #ffca6a;
    --green: #74f2b5;
    --danger: #ff6f91;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
    --radius: 24px;
    --font-sans: 'Inter', -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--text);
    line-height: 1.6;
    background:
        radial-gradient(circle at 20% 10%, rgba(85, 231, 255, 0.20), transparent 28%),
        radial-gradient(circle at 85% 0%, rgba(255, 202, 106, 0.16), transparent 26%),
        linear-gradient(135deg, var(--bg), #0b1021 55%, #05070e);
    overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 78%);
}

a {
    color: var(--cyan);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

#page {
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(7, 9, 18, 0.84);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.navbar {
    width: min(1180px, 92%);
    margin: 0 auto;
    padding: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 2px;
    border: 1px solid rgba(85, 231, 255, 0.75);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(85, 231, 255, 0.18), rgba(122, 162, 255, 0.12));
    box-shadow: 0 0 32px rgba(85, 231, 255, 0.18), inset 0 0 20px rgba(85, 231, 255, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.brand:hover {
    box-shadow: 0 0 44px rgba(85, 231, 255, 0.3), inset 0 0 20px rgba(85, 231, 255, 0.12);
    transform: translateY(-1px);
}

.menu-button {
    display: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    background: rgba(15, 24, 43, 0.92);
    cursor: pointer;
    transition: border-color 0.18s ease;
}

.menu-button[aria-expanded="true"] {
    border-color: rgba(85, 231, 255, 0.6);
    color: var(--cyan);
}

.menu {
    list-style: none;
    margin: 0;
    padding: 7px;
    display: flex;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 24, 43, 0.58);
}

.menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.94rem;
}

.menu a:hover,
.menu a.active {
    color: #07101b;
    background: linear-gradient(135deg, var(--cyan), var(--amber));
    text-decoration: none;
}

main,
footer {
    width: min(1180px, 92%);
    margin: 0 auto;
}

.hero,
.page-title,
.section {
    position: relative;
    padding: 70px 0;
}

.hero {
    min-height: 78vh;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(310px, 0.8fr);
    gap: 34px;
    align-items: center;
}

.hero::after {
    content: "";
    position: absolute;
    right: -80px;
    top: 18%;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(85, 231, 255, 0.26);
    transform: rotate(25deg);
    border-radius: 60px;
    z-index: -1;
}

.eyebrow {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: var(--amber);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 3.5px;
    font-weight: 700;
    font-size: 0.76rem;
    margin: 0 0 14px;
}

.eyebrow::before {
    content: "";
    width: 34px;
    height: 2px;
    background: var(--amber);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 920px;
    font-size: clamp(2.8rem, 7.2vw, 6.5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -2.5px;
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(1.35rem, 3vw, 2.2rem);
    line-height: 1.15;
    margin-bottom: 14px;
}

h3 {
    color: var(--text);
    margin-bottom: 8px;
}

.hero-text h2 {
    color: var(--cyan);
    font-weight: 700;
}

.hero-text p,
.page-title p,
.card p,
.project-card p,
.timeline-content li,
.contact-card p,
.form-card p,
.split p,
.console-line,
.subtle {
    color: var(--muted);
}

.hero-text p,
.page-title p {
    max-width: 760px;
    font-size: 1.05rem;
}

.hero-actions,
.quick-stats,
.tag-list,
.security-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions {
    margin-top: 30px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.button.primary {
    color: #061019;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    box-shadow: 0 18px 38px rgba(85, 231, 255, 0.18);
}

.button.secondary {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(15, 24, 43, 0.72);
}

.button:hover,
.button:focus {
    transform: translateY(-2px);
    text-decoration: none;
}

.hero-card,
.card,
.project-card,
.contact-card,
.form-card,
.timeline-content,
.stat,
.command-panel,
.table-wrap {
    background: linear-gradient(180deg, rgba(20, 32, 58, 0.88), rgba(8, 13, 25, 0.92));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card,
.card,
.project-card,
.contact-card,
.form-card,
.timeline-content,
.command-panel {
    padding: 26px;
}

.hero-card {
    overflow: hidden;
}

.console-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
}

.dot:nth-child(2) {
    background: var(--amber);
}

.dot:nth-child(3) {
    background: var(--green);
}

.console-title {
    margin-left: auto;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.console-line {
    font-family: var(--font-mono);
    font-size: 0.92rem;
}

.console-line .highlight::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 1em;
    margin-left: 4px;
    background: var(--green);
    vertical-align: text-bottom;
    animation: cursor-blink 1.1s steps(1) infinite;
}

@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-card {
    position: relative;
}

.hero-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(85, 231, 255, 0.05), transparent);
    animation: scan-sweep 6s linear infinite;
    pointer-events: none;
}

@keyframes scan-sweep {
    0% { top: -40%; }
    100% { top: 100%; }
}

.hero-card ul,
.timeline-content ul,
.project-card ul {
    padding-left: 20px;
}

.hero-card li,
.project-card li,
.timeline-content li {
    margin-bottom: 10px;
}

.hero-card span,
.tech,
.metric,
.highlight {
    color: var(--amber);
    font-weight: 800;
}

.quick-stats {
    margin-top: 28px;
}

.stat {
    flex: 1 1 150px;
    padding: 16px;
}

.metric {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.3rem;
}

.card-grid {
    display: grid;
    gap: 22px;
}

.card-grid.three {
    grid-template-columns: repeat(3, 1fr);
}

.card-grid.two,
.split {
    grid-template-columns: repeat(2, 1fr);
}

.split {
    display: grid;
    gap: 24px;
}

.card,
.project-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.project-card:hover {
    transform: translateY(-3px);
    border-color: rgba(85, 231, 255, 0.4);
    box-shadow: 0 32px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(85, 231, 255, 0.08);
}

.card::before,
.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--amber));
}

.project-card .tech {
    display: inline-block;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.security-strip {
    margin-top: 22px;
}

.security-strip span,
.tag-list li {
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 13px;
    background: rgba(85, 231, 255, 0.08);
}

.tag-list {
    list-style: none;
    padding: 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(8, 13, 25, 0.45);
}

th,
td {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--amber);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(85, 231, 255, 0.08);
}

.timeline {
    display: grid;
    gap: 28px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 22px;
}

.timeline-date {
    color: var(--cyan);
    font-family: var(--font-mono);
    font-weight: 600;
    padding-top: 24px;
}

.timeline-item {
    position: relative;
    padding-left: 26px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 30px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 4px rgba(85, 231, 255, 0.16);
}

.timeline-item::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 44px;
    bottom: -28px;
    width: 1px;
    background: var(--line);
}

.timeline-item:last-child::after {
    display: none;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    background: rgba(5, 8, 16, 0.82);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(85, 231, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(85, 231, 255, 0.16);
}

textarea {
    resize: vertical;
    min-height: 140px;
}

.input-error {
    border-color: var(--danger);
}

.input-error:focus {
    box-shadow: 0 0 0 3px rgba(255, 111, 145, 0.18);
}

.error-message {
    color: var(--danger);
    font-size: 0.88rem;
    margin: 6px 0 0;
}

.form-feedback {
    color: var(--danger);
    font-size: 0.92rem;
    min-height: 1.2em;
}

.char-count {
    display: block;
    text-align: right;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    margin-top: 4px;
}

.success-message {
    border-left: 4px solid var(--green);
    padding-left: 18px;
}

.form-card .button.primary {
    margin-top: 18px;
}

footer {
    padding: 34px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

@media (max-width: 840px) {
    .menu-button {
        display: inline-block;
    }

    .menu {
        display: none;
        position: absolute;
        top: 78px;
        left: 4%;
        right: 4%;
        padding: 12px;
        border-radius: 18px;
        flex-direction: column;
        background: rgba(7, 9, 18, 0.96);
    }

    .menu.open {
        display: flex;
    }

    .hero,
    .card-grid.three,
    .card-grid.two,
    .split,
    .timeline-item {
        grid-template-columns: 1fr;
    }

    .timeline-date {
        padding-top: 0;
    }

    h1 {
        letter-spacing: -2px;
    }
}
