:root {
    --bg: #000;
    --fg: #fff;
    --muted: #8c8c8c;
    --dim: #5a5a5a;
    --line: rgba(255, 255, 255, 0.12);
    --line-hi: rgba(255, 255, 255, 0.38);
    --card: #0a0a0a;
    --radius: 20px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --accent-color: #fff;
}

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

html { color-scheme: dark; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Dotted grid + soft top light, fading out downward */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 100%);
}
body::after {
    content: "";
    position: fixed;
    top: -260px;
    left: 50%;
    width: 900px;
    height: 520px;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.10), transparent 70%);
}

a { color: inherit; }

/* ---------- Top nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.05rem;
}
.nav-brand img { width: 26px; height: 26px; border-radius: 6px; display: block; }
.nav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.nav-links a[aria-current="page"] { color: #000; background: #fff; }

/* ---------- Layout ---------- */
.page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 72px;
    flex: 1;
}

.back {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 28px;
    transition: color 0.2s ease, transform 0.2s ease;
}
.back:hover { color: #fff; transform: translateX(-3px); }

.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.lead { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.lead strong { color: #fff; }

/* ---------- Cards ---------- */
.card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.09), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.card:hover { border-color: var(--line-hi); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 999px;
    background: #fff;
    color: #000;
    border: 1px solid #fff;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn:hover { background: transparent; color: #fff; }
.btn:active { transform: scale(0.98); }
.btn-ghost { background: transparent; color: #fff; border-color: var(--line-hi); }
.btn-ghost:hover { background: #fff; color: #000; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 22px 24px;
    text-align: center;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.76rem;
    letter-spacing: 0.1em;
}
.site-footer a { text-decoration: none; transition: color 0.2s ease; }
.site-footer a:hover { color: #fff; }

/* ---------- Icon tiles (home) ---------- */
.tile { display: flex; color: #fff; text-decoration: none; }
.tile-icon {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 12px;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.tile-icon svg { width: 30px; height: 30px; fill: #fff; transition: fill 0.25s ease; }
.tile:hover .tile-icon { background: #fff; border-color: #fff; }
.tile:hover .tile-icon svg { fill: #000; }
.tile-arrow {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s ease, stroke 0.25s ease;
}
.tile:hover .tile-arrow { transform: translate(3px, -3px); stroke: #fff; }

.project .tile-icon { width: 120px; height: 120px; border-radius: 22px; }
.project .tile-icon svg { width: 72px; height: 72px; stroke: #fff; transition: fill 0.25s ease, stroke 0.25s ease; }
.project.tile:hover .tile-icon svg { stroke: #000; }

/* ---------- Ticker ---------- */
.ticker {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track {
    display: inline-flex;
    gap: 40px;
    padding: 14px 20px;
    animation: scroll 40s linear infinite;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.ticker-track span b { color: #fff; font-weight: 600; margin-left: 8px; }
@keyframes scroll { to { transform: translateX(-50%); } }

@media (max-width: 520px) {
    .nav-inner { padding: 10px 16px; }
    .nav-brand span { display: none; }
    .nav-links a { padding: 7px 11px; font-size: 0.82rem; }
    .page { padding: 32px 16px 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; }
    html { scroll-behavior: auto; }
    .card, .tile-arrow, .back { transition: none; }
}
