:root {
    --bg: #ffffff;
    --fg: #1c1e21;
    --muted: #6b7280;
    --accent: #2f5fd0;
    --line: #e6e8eb;
    --dot: rgba(0, 0, 0, 0.07);
    --row-hover: rgba(47, 95, 208, 0.04);
}

[data-theme="dark"] {
    --bg: #0f1115;
    --fg: #e4e6eb;
    --muted: #8a8f98;
    --accent: #7aa2f7;
    --line: #23262d;
    --dot: rgba(255, 255, 255, 0.05);
    --row-hover: rgba(122, 162, 247, 0.05);
}

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

body {
    background-color: var(--bg);
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 22px 22px;
    color: var(--fg);
    font-family: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

main {
    max-width: 700px;
    margin: 0 auto;
    padding: 6rem 1.5rem 4rem;
}

h1 {
    font-size: 1.6rem;
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--muted);
    margin-top: 0.35rem;
}

.status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 var(--accent); opacity: 1; }
    70%  { box-shadow: 0 0 0 6px transparent; opacity: 0.75; }
    100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

.links {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
}

section {
    margin-top: 3rem;
}

h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.prompt {
    color: var(--accent);
    margin-right: 0.4rem;
}

section p + p {
    margin-top: 0.9rem;
}

.section-note {
    color: var(--muted);
    margin-bottom: 0.75rem;
}

/* Skills tags */
.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tags li {
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tags li:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.rows {
    list-style: none;
}

.rows li {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 1rem;
    padding: 0.65rem 0 0.65rem 0.85rem;
    border-bottom: 1px solid var(--line);
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.rows li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.4rem;
    bottom: 0.4rem;
    width: 2px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.25s ease;
}

.rows li:hover {
    background-color: var(--row-hover);
    transform: translateX(3px);
}

.rows li:hover::before {
    transform: scaleY(1);
}

.rows li:last-child {
    border-bottom: none;
}

.role,
.name {
    grid-column: 1;
}

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

.org,
.desc {
    grid-column: 1;
    color: var(--muted);
}

.when {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: var(--muted);
    white-space: nowrap;
}

a {
    position: relative;
    color: var(--accent);
    text-decoration: none;
}

a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s ease;
}

a:hover::after,
a:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left;
}

a:focus-visible,
.theme-toggle:focus-visible {
    outline: 1px dashed var(--accent);
    outline-offset: 4px;
}

.when a + a {
    margin-left: 0.75rem;
}

footer {
    margin-top: 3.5rem;
    color: var(--muted);
}

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

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

.theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.55;
    transition: opacity 0.25s ease, transform 0.4s ease;
}

.theme-toggle:hover {
    opacity: 1;
    transform: rotate(25deg);
}

.theme-toggle img {
    width: 20px;
    height: 20px;
    display: block;
}

[data-theme="dark"] .theme-toggle img {
    filter: invert(1);
}

/* Scroll reveal — JS adds .visible as each block enters the viewport */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

@media screen and (max-width: 600px) {
    main {
        padding: 4.5rem 1.25rem 3rem;
    }

    .rows li {
        grid-template-columns: 1fr;
    }

    .when {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}