:root {
    --bg: #000000;
    --surface: #0a0a0a;
    --surface-hover: #121212;
    --text: #ececec;
    --muted: #8a8a8a;
    --accent: #d6d6d6;
    --accent-dim: #fafafa;
    --border: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --font: "Inter", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
}

@property --beam-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@keyframes border-beam {
    to { --beam-angle: 360deg; }
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-dim);
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.wrap {
    max-width: 42rem;
    margin: 0 auto;
    padding: clamp(2.5rem, 8vw, 4.5rem) clamp(1.25rem, 5vw, 1.75rem) 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Header ── */

.site-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.header-photo {
    width: clamp(4.5rem, 16vw, 6rem);
    height: clamp(4.5rem, 16vw, 6rem);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border);
    background: var(--surface);
}

.header-text {
    min-width: 0;
}

.name {
    font-size: clamp(1.85rem, 5.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 0.3rem;
}

.role {
    margin: 0;
    font-size: 1rem;
    color: var(--muted);
    font-weight: 500;
}

.tagline {
    margin: 0.45rem 0 0;
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 400;
    line-height: 1.5;
    opacity: 0.7;
}

/* ── Main layout ── */

main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Cards ── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.65rem;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Revolving light beam on card borders */
.site-header::before,
.card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: calc(var(--radius) + 1px);
    padding: 1px;
    background: conic-gradient(
        from var(--beam-angle),
        transparent 0%,
        transparent 60%,
        rgba(255, 255, 255, 0.15) 72%,
        rgba(255, 255, 255, 0.55) 80%,
        rgba(255, 255, 255, 0.15) 88%,
        transparent 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: border-beam 8s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* Stagger each card so beams don't all sync up */
.site-header::before          { animation-delay:  0s;    }
.card:nth-child(1)::before    { animation-delay: -1.1s;  }
.card:nth-child(2)::before    { animation-delay: -2.4s;  }
.card:nth-child(3)::before    { animation-delay: -3.7s;  }
.card:nth-child(4)::before    { animation-delay: -5.0s;  }
.card:nth-child(5)::before    { animation-delay: -6.1s;  }
.card:nth-child(6)::before    { animation-delay: -7.3s;  }

.card h2 {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 1rem;
}

.card p {
    margin: 0;
    color: var(--text);
}

.card p + p {
    margin-top: 0.75rem;
}

/* ── Experience ── */

.job {
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.job:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.job-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.job-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    object-fit: contain;
    padding: 6px;
}

.job-head-text {
    min-width: 0;
}

.job-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.job-title a {
    color: var(--text);
}

.job-title a:hover {
    color: var(--accent);
}

.job-meta {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.job-tagline {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.55;
    font-style: italic;
}

.job-list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text);
}

.job-list li {
    margin-bottom: 0.55rem;
    line-height: 1.6;
}

.job-list li:last-child {
    margin-bottom: 0;
}

/* ── Projects ── */

.project-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.project-item {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.project-item:last-child {
    padding-bottom: 1.25rem;
    border-bottom: none;
}

.project-top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.65rem;
    margin-bottom: 0.4rem;
}

.project-name {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.project-lang {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.project-badge {
    font-family: var(--mono);
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.project-badge--active {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.05);
}

.project-desc {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.6;
    opacity: 0.85;
}

.projects-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ── Education ── */

.edu-block + .edu-block {
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border);
}

.edu-line {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.edu-detail {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

/* ── Skills ── */

.skill-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-group h3 {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.skill-tag {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* ── Contact ── */

.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.contact-list li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.contact-list .label {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--muted);
    min-width: 4.5rem;
    letter-spacing: 0.04em;
}

/* ── Links ── */

.inline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.inline-link::after {
    content: "→";
    transition: transform 0.2s ease;
}

.inline-link:hover::after {
    transform: translateX(4px);
}

.inline-link--cta {
    margin-top: 1.25rem;
    padding: 0.55rem 1.05rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.inline-link--cta:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
    color: var(--accent-dim);
}

/* ── Footer ── */

.site-footer {
    font-size: 0.8125rem;
    color: var(--muted);
    padding-top: 0.5rem;
}

/* ── Scroll fade-in ── */

[data-hidden] {
    opacity: 0;
    transform: translateY(14px);
}

[data-hidden].visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ── Contact intro ── */

.card p.contact-intro {
    margin: 0 0 1.1rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

/* ── Motion ── */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    a,
    .card,
    .site-header,
    .inline-link::after,
    .inline-link--cta {
        transition: none;
    }

    .site-header::before,
    .card::before {
        animation: none;
    }

    [data-hidden] {
        opacity: 1;
        transform: none;
    }
}
