/* ══════════════════════════════════════════════════════════════
   Aurora Glass — dark theme for Ye Chan Lin's portfolio
   ══════════════════════════════════════════════════════════════ */

/* ── Design tokens ────────────────────────────────────────────── */
:root {
    --bg-0: #08080f;
    --bg-1: #0d0b1a;

    --violet: #7c3aed;
    --cyan: #06b6d4;
    --blue: #3b82f6;
    --magenta: #ec4899;

    --text: #f4f4fb;
    --text-dim: rgba(244, 244, 251, .66);
    --text-mute: rgba(244, 244, 251, .42);

    --glass-bg: rgba(255, 255, 255, .045);
    --glass-bg-hover: rgba(255, 255, 255, .07);
    --glass-border: rgba(255, 255, 255, .1);
    --glass-border-hi: rgba(255, 255, 255, .18);

    --accent: linear-gradient(120deg, #7c3aed 0%, #06b6d4 100%);
    --accent-soft: linear-gradient(120deg, rgba(124, 58, 237, .18), rgba(6, 182, 212, .18));

    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 10px 40px rgba(0, 0, 0, .45);
    --shadow-glow: 0 0 0 1px var(--glass-border-hi), 0 18px 50px rgba(124, 58, 237, .25);

    --maxw: 1080px;
    --nav-h: 68px;
}

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

section[id] { scroll-margin-top: calc(var(--nav-h) + 24px); }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", system-ui, sans-serif;
    color: var(--text);
    background: var(--bg-0);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -.02em;
}

p { margin: 0; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ── Aurora background ────────────────────────────────────────── */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        radial-gradient(1200px 800px at 80% -10%, rgba(59, 130, 246, .12), transparent 60%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 55%);
}

.aurora::after {
    /* subtle grain / vignette to keep it from feeling flat */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 120% at 50% 0%, transparent 55%, rgba(0, 0, 0, .55));
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
    will-change: transform;
}

.blob-1 { width: 46vw; height: 46vw; left: -8vw;  top: -6vw;  background: var(--violet);  animation: drift-1 22s ease-in-out infinite; }
.blob-2 { width: 40vw; height: 40vw; right: -6vw; top: 8vw;   background: var(--cyan);    animation: drift-2 26s ease-in-out infinite; }
.blob-3 { width: 38vw; height: 38vw; left: 20vw;  top: 55vh;  background: var(--magenta); opacity: .32; animation: drift-3 30s ease-in-out infinite; }

@keyframes drift-1 { 50% { transform: translate(8vw, 6vh) scale(1.12); } }
@keyframes drift-2 { 50% { transform: translate(-6vw, 10vh) scale(1.08); } }
@keyframes drift-3 { 50% { transform: translate(4vw, -8vh) scale(1.15); } }

/* ── Nav ──────────────────────────────────────────────────────── */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: rgba(10, 10, 18, .55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--maxw);
    margin: 0 auto;
    height: var(--nav-h);
    padding: 0 24px;
    gap: 16px;
}

.nav-logo img { width: 132px; filter: brightness(0) invert(1); opacity: .92; }

.nav-content nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    position: relative;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 999px;
    transition: color .2s, background .2s;
}

.nav-link:hover { color: var(--text); background: var(--glass-bg-hover); }

.nav-link.active {
    color: var(--text);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--glass-border-hi);
}

/* ── Layout helpers ───────────────────────────────────────────── */
.section { padding: 84px 24px; position: relative; }

.section-inner { max-width: var(--maxw); margin: 0 auto; }

.section-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    margin-bottom: 40px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.section-title::before {
    content: "";
    width: 34px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.gradient-text {
    background: var(--accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Glass utility */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

/* ── Scroll reveal ────────────────────────────────────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}

[data-reveal].in-view { opacity: 1; transform: none; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    gap: 22px;
}

.hero-avatar {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    padding: 3px;
    background: var(--accent);
    box-shadow: 0 0 48px rgba(124, 58, 237, .45);
    animation: float 6s ease-in-out infinite;
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-1);
}

@keyframes float { 50% { transform: translateY(-10px); } }

.hero-eyebrow {
    font-size: 14px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-mute);
    font-weight: 600;
}

.hero h1 {
    font-size: clamp(44px, 9vw, 92px);
    font-weight: 700;
}

.hero-tagline {
    font-size: clamp(17px, 2.4vw, 22px);
    color: var(--text-dim);
    max-width: 620px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--glass-border-hi);
    color: var(--text);
    background: var(--glass-bg);
    transition: transform .2s, box-shadow .2s, background .2s;
}

.btn:hover { transform: translateY(-2px); background: var(--glass-bg-hover); }

.btn-primary {
    border: none;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 30px rgba(124, 58, 237, .4);
}

.btn-primary:hover { box-shadow: 0 14px 40px rgba(6, 182, 212, .5); }

.scroll-hint {
    margin-top: 26px;
    color: var(--text-mute);
    font-size: 22px;
    animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob { 50% { transform: translateY(8px); } }

/* ── Stats strip ──────────────────────────────────────────────── */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    max-width: var(--maxw);
    margin: -32px auto 0;
    padding: 0 24px;
}

.stat {
    text-align: center;
    padding: 26px 16px;
}

.stat-num {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: .02em;
}

/* ── About ────────────────────────────────────────────────────── */
.about-text { padding: 34px 38px; }
.about-text p { color: var(--text-dim); font-size: 17px; margin-bottom: 16px; }
.about-text p:last-child { margin-bottom: 0; }

/* ── Timeline (experience & education) ────────────────────────── */
.timeline { position: relative; padding-left: 34px; }

.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--violet), var(--cyan), transparent);
}

.tl-item { position: relative; margin-bottom: 22px; }
.tl-item:last-child { margin-bottom: 0; }

.tl-item::before {
    content: "";
    position: absolute;
    left: -34px;
    top: 26px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 16px rgba(124, 58, 237, .8), 0 0 0 4px var(--bg-0);
}

.card {
    padding: 22px 26px;
    transition: transform .25s, box-shadow .25s, border-color .25s, background .25s;
}

.card:hover {
    transform: translateY(-3px);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hi);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 10px;
}

.card-title { font-size: 19px; font-weight: 600; }
.card-title a:hover { color: var(--cyan); }
.card-subtitle { display: block; margin-top: 3px; font-size: 14px; color: var(--cyan); font-weight: 500; }

.card-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-mute);
    white-space: nowrap;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
}

.card-body { color: var(--text-dim); font-size: 15px; }

/* ── Projects ─────────────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

.project-card { display: flex; flex-direction: column; gap: 14px; padding: 26px; }

.project-award {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 600;
    color: #ffd76a;
    background: rgba(255, 200, 60, .1);
    border: 1px solid rgba(255, 200, 60, .3);
    padding: 5px 12px;
    border-radius: 999px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 5px 11px;
    border-radius: 999px;
    transition: color .2s, border-color .2s;
}

.card:hover .chip { border-color: var(--glass-border-hi); }

/* ── Skills ───────────────────────────────────────────────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.skill-group { padding: 24px 26px; }
.skill-category { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.skill-category::before { content: "◆ "; color: var(--cyan); }

/* ── Hobbies ──────────────────────────────────────────────────── */
.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.hobby-card { overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.hobby-card:hover { transform: translateY(-5px); border-color: var(--glass-border-hi); box-shadow: var(--shadow-glow); }

.hobby-img-wrap { height: 190px; overflow: hidden; background: var(--bg-1); }
.hobby-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hobby-card:hover .hobby-img-wrap img { transform: scale(1.07); }

.hobby-info { padding: 20px 22px; }
.hobby-info h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.hobby-info p { font-size: 14px; color: var(--text-dim); }

/* ── Travel ───────────────────────────────────────────────────── */
.travel-meta {
    color: var(--text-dim);
    font-size: 15px;
    margin: -24px 0 20px;
}
.travel-meta .travel-hint { color: var(--cyan); font-weight: 500; }

#travel-map {
    width: 100%;
    height: 440px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

/* Pulsing gradient markers */
.travel-pin .pin {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 0 12px rgba(124, 58, 237, .9);
}
.travel-pin .pin::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(6, 182, 212, .7);
    animation: ping 2.2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping {
    0%   { transform: scale(.7); opacity: .9; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* Flight-path arcs */
.travel-arc { filter: drop-shadow(0 0 3px rgba(124, 58, 237, .8)); }

/* keep Leaflet popups & controls on-theme */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip { background: #14121f; color: var(--text); box-shadow: var(--shadow); }
.leaflet-container { background: var(--bg-1); }
.leaflet-bar a {
    background: #14121f;
    color: var(--text);
    border-bottom-color: var(--glass-border);
}
.leaflet-bar a:hover { background: #1e1b2e; }

.location-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.location-list li {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--accent-soft);
    border: 1px solid var(--glass-border-hi);
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.location-list li:hover { transform: translateY(-2px); border-color: var(--cyan); }

.location-list li.active {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 18px rgba(124, 58, 237, .5);
}

/* ── Page hero (standalone /hobbies) ──────────────────────────── */
.page-hero {
    text-align: center;
    padding: 80px 24px 40px;
}

.page-hero h1 { font-size: clamp(36px, 7vw, 60px); font-weight: 700; margin-bottom: 12px; }
.page-hero p { color: var(--text-dim); font-size: 18px; }

/* ── Timeline page ────────────────────────────────────────────── */
.timeline-form {
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
}

.timeline-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.timeline-form input,
.timeline-form textarea {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    transition: border-color .2s, box-shadow .2s;
    resize: vertical;
}

.timeline-form input::placeholder,
.timeline-form textarea::placeholder { color: var(--text-mute); }

.timeline-form input:focus,
.timeline-form textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
}

.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.form-status { color: var(--cyan); font-size: 14px; }
.timeline-form .btn:disabled { opacity: .55; cursor: default; transform: none; }

.timeline-posts { display: flex; flex-direction: column; gap: 16px; }

.timeline-empty { color: var(--text-mute); text-align: center; padding: 24px; }

.timeline-post {
    display: flex;
    gap: 16px;
    padding: 20px 22px;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.timeline-post:hover {
    transform: translateY(-2px);
    border-color: var(--glass-border-hi);
    box-shadow: var(--shadow-glow);
}

.tl-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--glass-border-hi);
    background: var(--bg-1);
}

.tl-content { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; }
.tl-name { font-weight: 600; color: var(--text); }
.tl-date { font-size: 12px; color: var(--text-mute); }
.tl-body { color: var(--text-dim); font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 40px 24px;
    margin-top: 40px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-mute);
    font-size: 13px;
}

.footer-socials { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }

.footer-socials a {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    transition: color .2s, border-color .2s, background .2s;
}

.footer-socials a:hover { color: var(--text); border-color: var(--glass-border-hi); background: var(--glass-bg-hover); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 860px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
    .section { padding: 60px 20px; }
    .nav-content { flex-direction: column; height: auto; padding: 12px 20px; gap: 8px; }
    .nav-content nav { justify-content: center; }
    section[id] { scroll-margin-top: 120px; }
    .card-header { flex-direction: column; }
    .timeline-form .form-row { grid-template-columns: 1fr; }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    [data-reveal] { opacity: 1; transform: none; }
}
