/* ==========================================================================
   marble.sh — shared portfolio theme
   One dark "terminal aurora" theme for the landing page and all project pages.
   ========================================================================== */

:root {
    --bg: #080c14;
    --bg-alt: #0a111d;
    --surface: #0f1727;
    --surface-raised: #131d31;
    --text: #e8eef8;
    --muted: #93a1b8;
    --line: rgba(126, 156, 206, 0.16);
    --accent: #4cc9f0; /* cyan   */
    --accent-2: #9d7bff; /* violet */
    --accent-3: #ff6ba9; /* pink   */
    --ok: #3ddc97;
    --warn: #ffb454;
    --plan: #b8a7ff;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    --radius: 16px;
    --radius-lg: 24px;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
    --content-width: 1120px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

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

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

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

strong,
b {
    color: var(--text);
}

h1,
h2,
h3 {
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    margin: 0.3em 0;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-top: 42px;
}

h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-raised);
    border-radius: 8px;
    border: 2px solid var(--bg);
}

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 1000;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 8px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 16px;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Custom cursor (landing page, fine pointers only — driven by inline JS)
   -------------------------------------------------------------------------- */

.cursor,
.cursor-ring {
    display: none;
}

@media (pointer: fine) {
    .cursor,
    .cursor-ring {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        pointer-events: none;
        z-index: 999;
    }

    .cursor {
        width: 12px;
        height: 12px;
        background: var(--accent);
        mix-blend-mode: screen;
        transition:
            width 0.2s ease,
            height 0.2s ease;
    }

    .cursor-ring {
        width: 36px;
        height: 36px;
        border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
        transition:
            width 0.25s ease,
            height 0.25s ease;
    }
}

/* --------------------------------------------------------------------------
   Ambient background glow
   -------------------------------------------------------------------------- */

.glow-blob {
    position: fixed;
    width: 44vw;
    height: 44vw;
    min-width: 380px;
    min-height: 380px;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.14;
    pointer-events: none;
    z-index: -1;
}

.glow-blob.b1 {
    top: -12%;
    left: -10%;
    background: radial-gradient(circle, var(--accent), transparent 65%);
}

.glow-blob.b2 {
    top: 30%;
    right: -14%;
    background: radial-gradient(circle, var(--accent-2), transparent 65%);
}

.glow-blob.b3 {
    bottom: -18%;
    left: 22%;
    background: radial-gradient(circle, var(--accent-3), transparent 65%);
}

/* --------------------------------------------------------------------------
   Navigation (landing page bar + project-page pill row)
   -------------------------------------------------------------------------- */

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: var(--content-width);
    margin: 0 auto 24px;
    padding: 16px 24px;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
    margin-right: auto;
}

.nav-logo:hover {
    color: var(--accent);
    text-decoration: none;
}

nav a:not(.nav-logo),
.button {
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 15px;
    font-size: 0.92rem;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

nav a:not(.nav-logo):hover,
.button:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    text-decoration: none;
}

nav a.selected {
    color: var(--bg);
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-color: transparent;
    font-weight: 700;
}

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

/* --------------------------------------------------------------------------
   Landing page sections (#main-content) — full-bleed bands, centered content
   -------------------------------------------------------------------------- */

#main-content > section {
    padding: 72px max(24px, calc((100% - var(--content-width)) / 2));
}

.section-alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-label,
.eyebrow,
.hero-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Hero — full-height opener on the landing page, gradient panel on subpages
   -------------------------------------------------------------------------- */

.hero h1 {
    background: linear-gradient(95deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 110%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#main-content .hero {
    min-height: 82vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 40px;
}

#main-content .hero h1 {
    font-size: clamp(3rem, 9vw, 5.6rem);
    margin: 0.1em 0 0.2em;
}

#main-content .hero h1 span {
    display: block;
}

#main-content .hero > p {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--muted);
    max-width: 620px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.btn {
    display: inline-block;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 12px 22px;
    border-radius: 999px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-primary {
    color: var(--bg);
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-primary:hover {
    box-shadow: 0 10px 32px color-mix(in srgb, var(--accent) 50%, transparent);
}

.btn-outline {
    color: var(--text);
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 44px;
    margin-top: 56px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

/* Project-page hero: gradient panel card */
.wrap .hero {
    background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--accent-2) 14%, var(--surface)));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 48px;
    align-items: start;
}

.about-grid p {
    color: var(--muted);
}

.about-grid p strong {
    color: var(--text);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.contact-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 10px var(--ok);
}

/* --------------------------------------------------------------------------
   Cards, grids, tags
   -------------------------------------------------------------------------- */

.grid,
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.card,
.item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition:
        transform 0.25s ease,
        border-color 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.card p {
    color: var(--muted);
}

.card a {
    font-weight: 700;
}

.item {
    margin: 16px 0;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tag.purple {
    color: var(--accent-2);
    border-color: color-mix(in srgb, var(--accent-2) 40%, transparent);
    background: color-mix(in srgb, var(--accent-2) 10%, transparent);
}

.tag.pink {
    color: var(--accent-3);
    border-color: color-mix(in srgb, var(--accent-3) 40%, transparent);
    background: color-mix(in srgb, var(--accent-3) 10%, transparent);
}

/* --------------------------------------------------------------------------
   Timeline (landing page)
   -------------------------------------------------------------------------- */

.timeline {
    position: relative;
    margin-top: 32px;
    padding-left: 32px;
}

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

.timeline-item {
    position: relative;
    padding-bottom: 48px;
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: none;
}

/* Keep content readable without JS or with reduced motion */
@media (scripting: none), (prefers-reduced-motion: reduce) {
    .timeline-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.timeline-item-last {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    top: 6px;
    left: -31px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
}

.timeline-period {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.08em;
}

.timeline-company {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 2px 0 6px;
}

.timeline-role {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.timeline-role-sub {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--muted);
    margin-top: 4px;
}

.timeline-item ul {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.timeline-item li {
    margin: 8px 0;
}

/* --------------------------------------------------------------------------
   Recent work (landing page)
   -------------------------------------------------------------------------- */

.work-intro {
    color: var(--muted);
    max-width: 760px;
}

.recent-work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.work-card {
    display: flex;
    flex-direction: column;
    color: var(--text);
}

.work-card:hover {
    text-decoration: none;
}

.work-icon {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.work-meta {
    margin-top: auto;
    padding-top: 16px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
}

.work-meta::after {
    content: " →";
}

.work-highlights {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.work-highlights li {
    margin: 8px 0;
}

/* --------------------------------------------------------------------------
   Project pages (.wrap)
   -------------------------------------------------------------------------- */

.wrap {
    max-width: var(--content-width);
    margin: auto;
    padding: 0 24px 80px;
}

.wrap nav {
    padding-left: 0;
    padding-right: 0;
}

.lede {
    font-size: 1.16rem;
    color: var(--muted);
    max-width: 800px;
}

.meta {
    font-family: var(--font-mono);
    color: var(--muted);
    font-size: 0.85rem;
    margin: 4px 0 2px;
}

.status {
    display: inline-block;
    font-family: var(--font-mono);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid currentColor;
}

.completed {
    color: var(--ok);
    background: color-mix(in srgb, var(--ok) 10%, transparent);
}

.ongoing {
    color: var(--warn);
    background: color-mix(in srgb, var(--warn) 10%, transparent);
}

.planned {
    color: var(--plan);
    background: color-mix(in srgb, var(--plan) 10%, transparent);
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.fact {
    border-left: 3px solid var(--accent-2);
    padding-left: 12px;
    color: var(--muted);
    font-size: 0.95rem;
}

.fact b {
    display: block;
    color: var(--text);
    margin-bottom: 2px;
}

.sources {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.note {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-left: 4px solid var(--accent);
    padding: 14px 16px;
    border-radius: 8px;
}

.skills li {
    margin: 10px 0;
    color: var(--muted);
}

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

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    max-width: var(--content-width);
    margin: 40px auto 0;
    padding: 28px 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.wrap footer {
    padding-left: 0;
    padding-right: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 820px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    #main-content > section {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .hero-stats {
        gap: 28px;
    }
}

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

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
