:root {
    --bg: #f4f4f0;
    --surface: #ffffff;
    --text: #14161b;
    --muted: #5d6471;
    --border: #e2e2da;
    --accent: #3b6cff;
    --accent2: #14b8a6;
    --glass: rgba(255, 255, 255, 0.62);
    --shadow: 0 12px 32px rgba(20, 24, 40, 0.09);
    --radius: 24px;
    --gap: 14px;
}

:root[data-theme="dark"] {
    --bg: #0b0e14;
    --surface: #151a24;
    --text: #eef1f6;
    --muted: #98a2b3;
    --border: #252c3a;
    --accent: #7b97ff;
    --accent2: #2dd4bf;
    --glass: rgba(21, 26, 36, 0.58);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* soft colour blobs so the glass tiles have something to blur */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(620px 420px at 8% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
        radial-gradient(520px 420px at 96% 28%, color-mix(in srgb, var(--accent2) 20%, transparent), transparent 70%);
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    padding-left: 1.1rem;
}

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

/* ---------- Shared tile look ---------- */
.stat,
.card,
.skill-group,
.project,
.edu-card,
.hero-text,
.hero-visual,
.stage,
.result,
.note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.glass,
.hero-text,
.nav {
    background: var(--glass);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
}

/* ---------- Nav ---------- */
.nav {
    position: sticky;
    top: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 5vw 0;
    padding: 0.7rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
}

.logo span {
    color: var(--accent);
}

.nav nav {
    display: flex;
    gap: 1.4rem;
}

.nav nav a {
    color: var(--muted);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav nav a:hover {
    color: var(--text);
}

#themeToggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.05rem;
}

/* ---------- Layout ---------- */
.section {
    padding: 4.5rem 5vw;
    max-width: 1200px;
    margin: 0 auto;
}

h1,
h2,
h3 {
    line-height: 1.15;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 0.5rem;
}

.hint {
    color: var(--muted);
    margin-bottom: 1.8rem;
}

/* ---------- Hero ---------- */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 5vw 1rem;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: var(--gap);
    align-items: stretch;
}

.hero-text {
    padding: clamp(1.5rem, 4vw, 3rem);
}

.hero-visual {
    padding: 1.5rem;
    display: grid;
    place-items: center;
}

.hero-id {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hero-id .eyebrow {
    margin-bottom: 0;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

.eyebrow {
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.6rem);
    margin-bottom: 1.1rem;
}

.hero em {
    font-style: normal;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sub {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 34rem;
    margin-bottom: 1.4rem;
}

.open-to {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.hero-actions,
.links {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.3rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font: inherit;
    font-weight: 600;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pipeline {
    width: 100%;
}

.flow-line {
    animation: dash 1.5s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -28;
    }
}

.node circle {
    fill: var(--surface);
    stroke: var(--accent);
    stroke-width: 3;
}

.node text {
    text-anchor: middle;
    font-weight: 700;
    fill: var(--text);
    font-size: 15px;
}

.lbl {
    text-anchor: middle;
    fill: var(--muted);
    font-size: 12px;
}

/* ---------- Stats (4 small tiles) ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    max-width: 1200px;
    margin: var(--gap) auto 0;
    padding: 0 5vw;
}

.stat {
    padding: 1.3rem;
    text-align: center;
}

.stat .num,
.stat .plus {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--accent);
}

.stat p {
    color: var(--muted);
    font-size: 0.9rem;
}

.stat:first-child {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
}

.stat:first-child .num,
.stat:first-child .plus,
.stat:first-child p {
    color: #fff;
}

/* ---------- Journey (bento tiles) ---------- */
.timeline {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap);
    align-items: start;
}

.timeline::before,
.dot {
    display: none;
}

.tl-item {
    grid-column: span 6;
    outline: none;
}

.tl-item:nth-child(1) {
    grid-column: span 7;
}

.tl-item:nth-child(2) {
    grid-column: span 5;
}

.tl-item:nth-child(3) {
    grid-column: span 12;
}

.card {
    padding: 1.3rem 1.5rem;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.org {
    color: var(--muted);
}

.date {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.4s;
}

.tl-item.open .card-body {
    max-height: 700px;
    margin-top: 1rem;
}

.card-body li {
    margin-bottom: 0.4rem;
    color: var(--muted);
}

.mini-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.mini-flow span {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

.mini-flow i {
    color: var(--accent);
    font-style: normal;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.chips span {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.chips.big {
    margin-top: 0;
}

.chips.big span {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
}

/* ---------- Skills (bento tiles) ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap);
}

.skill-group {
    grid-column: span 4;
    padding: 1.4rem;
    transition: transform 0.25s, box-shadow 0.25s;
}

.skill-group:nth-child(1) {
    grid-column: span 7;
}

.skill-group:nth-child(2) {
    grid-column: span 5;
}

.skill-group:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.skill-group h3 {
    margin-bottom: 1rem;
}

.bar {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.bar em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.8rem;
    margin-left: 0.4rem;
}

.track {
    height: 8px;
    background: var(--bg);
    border-radius: 999px;
    margin-top: 0.35rem;
    overflow: hidden;
}

.fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width 1.2s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Projects (bento tiles) ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap);
    margin-top: 1.5rem;
}

.project {
    grid-column: span 4;
    padding: 1.2rem;
    transition: transform 0.25s, box-shadow 0.25s;
}

.project:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.project.featured {
    grid-column: span 12;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1.6rem;
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.project.featured .btn {
    margin-top: 1rem;
}

.project-visual {
    background: var(--bg);
    border-radius: 16px;
    padding: 0.8rem;
    margin-bottom: 1rem;
}

.project.featured .project-visual {
    margin-bottom: 0;
}

.project-visual svg {
    width: 100%;
    height: auto;
}

.project-visual .b1 {
    fill: color-mix(in srgb, var(--accent) 18%, transparent);
    stroke: var(--accent);
}

.project-visual .b2 {
    fill: color-mix(in srgb, var(--accent2) 18%, transparent);
    stroke: var(--accent2);
}

.project-visual .b3 {
    fill: var(--accent);
    stroke: var(--accent);
}

.project-visual .t {
    text-anchor: middle;
    font-size: 11px;
    font-weight: 600;
    fill: var(--text);
}

.project-visual .b3+.t {
    fill: #fff;
}

.project-visual .line {
    stroke: var(--muted);
    stroke-width: 2;
    fill: none;
}

.project h3 {
    margin-bottom: 0.3rem;
}

.project p {
    color: var(--muted);
    font-size: 0.95rem;
}

.link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent);
    font-weight: 600;
}

.badge {
    display: inline-block;
    background: var(--accent2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
}

/* ---------- Education ---------- */
.edu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

.edu-card {
    padding: 1.5rem;
}

/* ---------- Contact (one big tile) ---------- */
.contact {
    text-align: center;
    max-width: 1100px;
    margin: 2rem auto 3rem;
    padding: 4rem 5vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 32px;
}

.contact p {
    color: var(--muted);
    margin: 0 auto 2rem;
    max-width: 36rem;
}

.contact .links {
    justify-content: center;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---------- Demo pages (age & mood) ---------- */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap);
}

.stage {
    grid-column: span 7;
    padding: 1rem;
}

.result {
    grid-column: span 5;
    padding: 1.5rem;
}

.note {
    grid-column: span 12;
    padding: 1.2rem 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.note b {
    color: var(--text);
}

.canvas-wrap {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg);
    min-height: 260px;
    display: grid;
    place-items: center;
}

#video,
#photo {
    display: none;
    width: 100%;
    height: auto;
}

#video.show,
#photo.show {
    display: block;
}

#overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mirror {
    transform: scaleX(-1);
}

#placeholder {
    color: var(--muted);
    padding: 2rem;
    text-align: center;
}

.controls {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.status {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.big {
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1;
    margin: 0.6rem 0 0.2rem;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.big small {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    -webkit-text-fill-color: var(--muted);
    margin-left: 0.4rem;
}

.mood {
    margin: 0.8rem 0 1.2rem;
}

.exp {
    display: grid;
    grid-template-columns: 84px 1fr 42px;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 0.45rem;
}

.exp .track {
    margin: 0;
}

.exp .fill {
    transition: width 0.25s ease;
}

.exp b {
    text-align: right;
    font-weight: 600;
    color: var(--muted);
}

/* ---------- Reveal on scroll (only hides content when JS is running) ---------- */
.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 800px) {

    .hero,
    .edu {
        grid-template-columns: 1fr;
    }

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

    .timeline,
    .skills-grid,
    .project-grid,
    .demo-grid {
        grid-template-columns: 1fr;
    }

    .tl-item,
    .skill-group,
    .project,
    .stage,
    .result,
    .note {
        grid-column: 1 / -1 !important;
    }

    .project.featured {
        grid-template-columns: 1fr;
    }

    .nav nav {
        display: none;
    }
}

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

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