:root {
    --header-height: 5rem;
    --bg-main: #090d1c;
    --bg-secondary: #11182d;
    --surface: rgba(10, 15, 31, 0.7);
    --surface-strong: rgba(14, 21, 40, 0.92);
    --surface-soft: rgba(255, 255, 255, 0.08);
    --text-main: #f6f3ed;
    --text-soft: rgba(246, 243, 237, 0.76);
    --text-faint: rgba(246, 243, 237, 0.58);
    --line: rgba(255, 255, 255, 0.12);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    --accent: #ff7e5f;
    --accent-soft: rgba(255, 126, 95, 0.28);
    --hero-progress: 0;
    --timeline-progress: 0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Aptos", "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top, rgba(255, 172, 127, 0.08), transparent 34%),
        linear-gradient(180deg, #090d1c 0%, #0a1021 34%, #11172a 100%);
    transition: background 500ms ease, color 300ms ease;
}

body[data-theme="ember"] {
    --accent: #ff8a65;
    --accent-soft: rgba(255, 138, 101, 0.3);
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 143, 110, 0.16), transparent 26%),
        radial-gradient(circle at 80% 28%, rgba(255, 210, 150, 0.08), transparent 24%),
        linear-gradient(180deg, #100d1a 0%, #161120 42%, #1d1525 100%);
}

body[data-theme="aurora"] {
    --accent: #74f2ce;
    --accent-soft: rgba(116, 242, 206, 0.24);
    background:
        radial-gradient(circle at 24% 18%, rgba(116, 242, 206, 0.16), transparent 24%),
        radial-gradient(circle at 82% 20%, rgba(120, 183, 255, 0.12), transparent 26%),
        linear-gradient(180deg, #09151c 0%, #0c1d21 44%, #102127 100%);
}

body[data-theme="ocean"] {
    --accent: #78b7ff;
    --accent-soft: rgba(120, 183, 255, 0.26);
    background:
        radial-gradient(circle at 20% 18%, rgba(120, 183, 255, 0.18), transparent 25%),
        radial-gradient(circle at 82% 24%, rgba(130, 229, 255, 0.12), transparent 26%),
        linear-gradient(180deg, #08111e 0%, #0a1630 44%, #0c1d3a 100%);
}

body[data-theme="violet"] {
    --accent: #d2a7ff;
    --accent-soft: rgba(210, 167, 255, 0.24);
    background:
        radial-gradient(circle at 50% 18%, rgba(210, 167, 255, 0.16), transparent 24%),
        radial-gradient(circle at 18% 78%, rgba(255, 174, 228, 0.08), transparent 22%),
        linear-gradient(180deg, #120b1f 0%, #180f28 44%, #211338 100%);
}

body[data-theme="midnight"] {
    --accent: #ffd36b;
    --accent-soft: rgba(255, 211, 107, 0.24);
    background:
        radial-gradient(circle at 50% 12%, rgba(255, 211, 107, 0.08), transparent 22%),
        radial-gradient(circle at 82% 18%, rgba(126, 189, 255, 0.08), transparent 24%),
        linear-gradient(180deg, #0a1021 0%, #0d1424 44%, #12182b 100%);
}

img {
    display: block;
    max-width: 100%;
}

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

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

.page-noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 4px 4px, 5px 5px;
    mix-blend-mode: soft-light;
}

.scene-backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.backdrop-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 149, 112, 0.18), transparent 25%),
        radial-gradient(circle at 80% 18%, rgba(126, 189, 255, 0.18), transparent 24%),
        radial-gradient(circle at 50% 80%, rgba(142, 237, 198, 0.14), transparent 24%);
    filter: blur(10px);
}

.backdrop-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.7;
    transform: translate3d(0, var(--parallax-shift, 0px), 0);
}

.orb-one {
    top: 8%;
    left: -8%;
    width: 28rem;
    height: 28rem;
    background: radial-gradient(circle, rgba(255, 133, 102, 0.28), transparent 65%);
}

.orb-two {
    top: 28%;
    right: -12%;
    width: 32rem;
    height: 32rem;
    background: radial-gradient(circle, rgba(116, 190, 255, 0.22), transparent 70%);
}

.orb-three {
    bottom: -8%;
    left: 24%;
    width: 36rem;
    height: 36rem;
    background: radial-gradient(circle, rgba(171, 116, 255, 0.16), transparent 68%);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    background: rgba(6, 9, 18, 0.36);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-shell {
    width: min(1200px, calc(100% - 2rem));
    min-height: var(--header-height);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.brand {
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    color: var(--text-soft);
    font-size: 0.94rem;
}

.site-nav a {
    position: relative;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.28rem;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: right;
    background: var(--accent);
    transition: transform 220ms ease;
}

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

.header-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.lang-button {
    min-width: 2.25rem;
    min-height: 2rem;
    padding: 0 0.65rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font-family: "Consolas", "Cascadia Code", monospace;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 220ms ease, color 220ms ease, transform 220ms ease;
}

.lang-button:hover,
.lang-button:focus-visible {
    color: var(--text-main);
}

.lang-button.is-active {
    background: linear-gradient(135deg, #ffe3be, #ff9a73);
    color: #11172a;
}

.header-cta,
.button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid transparent;
    transition:
        transform 220ms ease,
        border-color 220ms ease,
        background 220ms ease,
        color 220ms ease,
        box-shadow 220ms ease;
}

.header-cta {
    min-height: 2.8rem;
    padding: 0 1.15rem;
    font-size: 0.92rem;
    color: #11172a;
    background: linear-gradient(135deg, #ffe3be, #ff9a73);
    box-shadow: 0 18px 40px rgba(255, 140, 95, 0.16);
}

.header-cta:hover,
.button:hover,
.header-cta:focus-visible,
.button:focus-visible {
    transform: translateY(-2px);
}

.header-cta::before,
.button::before {
    content: "";
    position: absolute;
    inset: auto;
    left: var(--mx, 50%);
    top: var(--my, 50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.34), transparent 68%);
    transform: translate(-50%, -50%);
    transition: width 260ms ease, height 260ms ease, opacity 260ms ease;
    opacity: 0;
    pointer-events: none;
}

.header-cta:hover::before,
.button:hover::before,
.header-cta:focus-visible::before,
.button:focus-visible::before {
    width: 12rem;
    height: 12rem;
    opacity: 1;
}

.story-shell {
    position: relative;
    z-index: 1;
}

.section {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
    scroll-margin-top: 6rem;
}

.hero {
    min-height: calc(100svh - 5rem);
    display: flex;
    align-items: center;
    padding: 2rem 0 4rem;
}

.hero-card {
    position: relative;
    width: 100%;
    min-height: 86svh;
    padding: clamp(1.6rem, 2.8vw, 2.4rem);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    overflow: hidden;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
        rgba(9, 14, 30, 0.6);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transform:
        translate3d(0, calc(var(--hero-progress) * 5rem), 0)
        scale(calc(1 - (var(--hero-progress) * 0.12)));
    transform-origin: center center;
    isolation: isolate;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: -10% 38% 32% -12%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 167, 120, 0.34), transparent 65%);
    filter: blur(20px);
}

.hero-card::after,
.floating-panel::after,
.about-card::after,
.project-panel::after,
.note-card::after,
.ending-card::after,
.playground-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(
            28rem circle at var(--mx, 50%) var(--my, 50%),
            rgba(255, 255, 255, 0.12),
            transparent 45%
        );
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
}

.hero-card:hover::after,
.floating-panel:hover::after,
.about-card:hover::after,
.project-panel:hover::after,
.note-card:hover::after,
.ending-card:hover::after,
.playground-stage:hover::after {
    opacity: 1;
}

.hero-copy,
.hero-visual,
.section-heading,
.floating-panel,
.terminal-intro,
.about-card,
.timeline-item,
.playground-shell,
.note-card,
.ending-card {
    opacity: 0;
    --reveal-y: 2.25rem;
    transform: translate3d(0, var(--reveal-y), 0);
    transition:
        opacity 760ms ease,
        transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-copy.is-visible,
.hero-visual.is-visible,
.section-heading.is-visible,
.floating-panel.is-visible,
.terminal-intro.is-visible,
.about-card.is-visible,
.timeline-item.is-visible,
.playground-shell.is-visible,
.note-card.is-visible,
.ending-card.is-visible {
    opacity: 1;
    --reveal-y: 0rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-soft);
    font-size: 0.86rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    display: inline-block;
    width: 2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent));
}

.hero-copy {
    position: relative;
    z-index: 2;
}

.hero-copy h1,
.section-heading h2,
.note-card h2,
.ending-card h2 {
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
    font-weight: 700;
    line-height: 0.96;
    letter-spacing: -0.04em;
}

.hero-copy h1 {
    font-size: clamp(3.8rem, 11vw, 8rem);
}

.hero-copy h1 span {
    display: block;
    color: var(--accent);
    text-shadow: 0 0 24px rgba(255, 255, 255, 0.12);
}

.hero-subtitle {
    margin-top: 1rem;
    color: #ffe8d0;
    font-size: clamp(1rem, 2vw, 1.35rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-description,
.section-heading p,
.floating-panel p,
.about-card p,
.project-copy p,
.timeline-card p,
.note-card p,
.ending-card p {
    max-width: 40rem;
    color: var(--text-soft);
    font-size: 1.04rem;
    line-height: 1.75;
}

.hero-description {
    margin-top: 1.4rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

.button {
    min-height: 3.15rem;
    padding: 0 1.35rem;
    font-weight: 600;
}

.button.primary {
    color: #0f1529;
    background: linear-gradient(135deg, #ffe6c0, var(--accent));
    box-shadow: 0 18px 40px rgba(255, 140, 95, 0.18);
}

.button.ghost {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.button.ghost:hover,
.button.ghost:focus-visible {
    border-color: var(--accent);
    color: #fff7ed;
}

.scroll-cue {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.6rem;
    color: var(--text-soft);
    animation: cueBlink 1.9s ease-in-out infinite;
}

.scroll-cue span {
    display: inline-block;
    font-size: 1.1rem;
    transform: translateY(-1px);
}

.hero-visual {
    position: relative;
    min-height: 28rem;
}

.hero-photo-frame {
    position: relative;
    width: min(100%, 28rem);
    margin-left: auto;
    padding: 1.1rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
        rgba(10, 15, 31, 0.88);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.hero-photo-glow {
    position: absolute;
    height: 12rem;
    background: radial-gradient(circle, rgba(255, 170, 124, 0.4), transparent 70%);
    filter: blur(28px);
    z-index: 0;
}

.hero-photo {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 1.5rem;
    mix-blend-mode: screen;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 72%, transparent 100%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 72%, transparent 100%);
}

.hero-float {
    position: absolute;
    padding: 0.9rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(7, 11, 24, 0.74);
    color: #fff6ec;
    font-size: 0.92rem;
    line-height: 1.45;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.24);
    animation: floatCard 6s ease-in-out infinite;
}

.hero-float-top {
    top: 12%;
    left: -8%;
    max-width: 14rem;
}

.hero-float-bottom {
    right: 8%;
    bottom: 8%;
    max-width: 16rem;
    animation-delay: -2.4s;
}

.hero-strata {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.strata {
    position: absolute;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translate3d(0, var(--parallax-shift, 0px), 0);
}

.strata-one {
    width: 16rem;
    height: 16rem;
    top: 10%;
    right: 28%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
}

.strata-two {
    width: 22rem;
    height: 22rem;
    bottom: -6rem;
    right: -4rem;
    background: radial-gradient(circle, rgba(255, 188, 153, 0.12), transparent 75%);
}

.strata-three {
    width: 12rem;
    height: 12rem;
    left: -4rem;
    bottom: 10%;
    background: radial-gradient(circle, rgba(126, 189, 255, 0.14), transparent 70%);
}

.transition,
.about,
.timeline,
.playground,
.note,
.ending {
    padding: 8rem 0;
}

.section-heading {
    max-width: 48rem;
    margin-bottom: 2.8rem;
}

.section-heading h2,
.note-card h2,
.ending-card h2 {
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    margin-bottom: 1rem;
}

.transition-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.floating-panel,
.about-card,
.project-panel,
.timeline-card,
.playground-stage,
.note-card,
.ending-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
        rgba(10, 15, 31, 0.64);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.floating-panel {
    position: relative;
    padding: 1.5rem;
    border-radius: 1.5rem;
    overflow: hidden;
}

.panel-label,
.project-kicker,
.timeline-year,
.card-number {
    display: inline-flex;
    margin-bottom: 0.85rem;
    color: var(--accent);
    font-family: "Consolas", "Cascadia Code", monospace;
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.floating-panel h3,
.about-card h3,
.project-copy h3,
.timeline-card h3 {
    margin-bottom: 0.85rem;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 1.1;
}

.about-stack {
    display: grid;
    gap: 1.6rem;
}

.about-card {
    position: sticky;
    top: calc(6rem + (var(--card-order) * 1.2rem));
    padding: 1.8rem;
    border-radius: 1.6rem;
    transform:
        translate3d(0, calc(var(--reveal-y, 0rem) + (var(--card-order) * 0.2rem)), 0)
        perspective(1200px)
        rotateX(var(--tilt-x, 0deg))
        rotateY(var(--tilt-y, 0deg));
    transition:
        opacity 760ms ease,
        transform 900ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 220ms ease,
        box-shadow 220ms ease;
    transform-style: preserve-3d;
    will-change: transform;
    overflow: hidden;
}

.about-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.about-card-1 {
    --card-order: 0;
}

.about-card-2 {
    --card-order: 1;
}

.about-card-3 {
    --card-order: 2;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.3rem;
}

.chip-list span {
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    font-size: 0.92rem;
}

.projects {
    width: 100%;
    max-width: none;
}

.projects-scroll {
    position: relative;
    width: 100%;
    height: 320vh;
}

.projects-sticky {
    position: sticky;
    top: var(--header-height);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: start;
    gap: 1.4rem;
    padding: 1rem max(1rem, calc((100vw - 1200px) / 2)) 2rem;
    overflow-x: hidden;
    overflow-y: visible;
}

.projects-head {
    display: grid;
    gap: 1rem;
}

.terminal-intro {
    display: inline-grid;
    gap: 0.35rem;
    width: fit-content;
    padding: 1rem 1.15rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(3, 6, 14, 0.78);
    font-family: "Consolas", "Cascadia Code", monospace;
    color: #b1f2c9;
}

.projects-head .section-heading {
    margin-bottom: 0;
}

.projects-viewport {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: hidden;
}

.projects-track {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: 1.5rem;
    padding: 1rem 0 1rem max(1rem, calc((100vw - 1200px) / 2));
    will-change: transform;
}

.project-panel {
    position: relative;
    width: min(78vw, 720px);
    min-width: min(78vw, 720px);
    height: 100%;
    min-height: 0;
    padding: clamp(1.5rem, 2vw, 2rem);
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(260px, 0.85fr);
    gap: 1.6rem;
    align-items: center;
    border-radius: 1.7rem;
    opacity: 0.42;
    transform: scale(0.92);
    transition:
        transform 360ms ease,
        opacity 360ms ease,
        border-color 260ms ease,
        box-shadow 260ms ease;
    overflow: hidden;
}

.project-panel.is-active {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.18);
}

.project-panel:hover {
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.project-preview {
    display: grid;
    gap: 0.9rem;
}

.preview-shell {
    position: relative;
    min-height: 18rem;
    border-radius: 1.3rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
    transform:
        perspective(1200px)
        rotateX(var(--preview-tilt-x, 0deg))
        rotateY(var(--preview-tilt-y, 0deg))
        scale(1);
    transition: transform 240ms ease, border-color 220ms ease;
}

.project-panel:hover .preview-shell {
    border-color: rgba(255, 255, 255, 0.18);
    transform:
        perspective(1200px)
        rotateX(var(--preview-tilt-x, 0deg))
        rotateY(var(--preview-tilt-y, 0deg))
        scale(1.02);
}

.preview-bar {
    position: absolute;
    inset: 0 0 auto;
    height: 2.25rem;
    background:
        radial-gradient(circle at 1rem 50%, #ff8a65 0 0.2rem, transparent 0.22rem),
        radial-gradient(circle at 2rem 50%, #ffd166 0 0.2rem, transparent 0.22rem),
        radial-gradient(circle at 3rem 50%, #7ef7c0 0 0.2rem, transparent 0.22rem),
        rgba(7, 11, 24, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-screen {
    position: absolute;
    inset: 2.25rem 0 0;
    overflow: hidden;
}

.preview-caption {
    color: var(--text-faint);
    font-size: 0.92rem;
}

.preview-pill,
.preview-chart,
.preview-metric,
.preview-card,
.preview-wave,
.preview-dot-grid,
.preview-column,
.preview-scan,
.preview-ring,
.preview-light {
    position: absolute;
    display: block;
}

.preview-ember {
    background:
        radial-gradient(circle at 75% 18%, rgba(255, 154, 115, 0.32), transparent 24%),
        linear-gradient(180deg, rgba(255, 176, 146, 0.08), rgba(255, 255, 255, 0.02)),
        #130f1d;
}

.preview-pill {
    top: 1.2rem;
    left: 1.2rem;
    width: 5.4rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.preview-chart {
    left: 1.2rem;
    bottom: 1.2rem;
    width: 38%;
    height: 48%;
    border-radius: 1.2rem 1.2rem 0.6rem 0.6rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 126, 95, 0.1));
    transform-origin: bottom;
    animation: pulsePanel 3.2s ease-in-out infinite;
}

.preview-chart.delay {
    left: auto;
    right: 1.2rem;
    width: 28%;
    animation-delay: -1.4s;
}

.preview-metric {
    top: 1.4rem;
    right: 1.2rem;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 0.7rem rgba(255, 255, 255, 0.06);
}

.preview-aurora {
    background:
        radial-gradient(circle at 40% 20%, rgba(114, 255, 222, 0.22), transparent 24%),
        linear-gradient(160deg, rgba(10, 19, 32, 0.96), rgba(13, 27, 30, 0.86));
}

.preview-card {
    top: 1.4rem;
    left: 1.3rem;
    right: 1.3rem;
    height: 34%;
    border-radius: 1.2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(116, 242, 206, 0.12));
}

.preview-wave {
    left: 1.3rem;
    right: 1.3rem;
    bottom: 2rem;
    height: 3rem;
    border-radius: 999px;
    border: 1px solid rgba(116, 242, 206, 0.3);
    animation: wave 3.6s ease-in-out infinite;
}

.preview-wave.delay {
    bottom: 6rem;
    animation-delay: -1.2s;
}

.preview-dot-grid {
    top: 44%;
    right: 1.5rem;
    width: 5rem;
    height: 5rem;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.24) 0 1px, transparent 1.2px);
    background-size: 0.9rem 0.9rem;
}

.preview-ocean {
    background:
        radial-gradient(circle at 78% 24%, rgba(120, 183, 255, 0.24), transparent 26%),
        linear-gradient(180deg, rgba(7, 13, 26, 0.98), rgba(8, 20, 40, 0.92));
}

.preview-column {
    bottom: 1.4rem;
    left: 1.3rem;
    width: 18%;
    height: 44%;
    border-radius: 1rem 1rem 0.6rem 0.6rem;
    background: linear-gradient(180deg, rgba(179, 218, 255, 0.9), rgba(72, 134, 255, 0.18));
    animation: growColumn 2.8s ease-in-out infinite;
}

.preview-column.delay {
    left: 28%;
    height: 56%;
    animation-delay: -1.3s;
}

.preview-column.wide {
    left: auto;
    right: 1.3rem;
    width: 34%;
    height: 66%;
    animation-delay: -2s;
}

.preview-scan {
    inset: 3.5rem 1.3rem auto;
    height: 0.35rem;
    border-radius: 999px;
    background: rgba(120, 183, 255, 0.78);
    box-shadow: 0 0 16px rgba(120, 183, 255, 0.68);
    animation: scan 3.8s linear infinite;
}

.preview-violet {
    background:
        radial-gradient(circle at 50% 26%, rgba(210, 167, 255, 0.3), transparent 24%),
        linear-gradient(180deg, rgba(15, 10, 28, 0.98), rgba(21, 11, 39, 0.88));
}

.preview-ring {
    inset: auto auto 50% 50%;
    width: 8rem;
    height: 8rem;
    margin-left: -4rem;
    margin-bottom: -4rem;
    border-radius: 50%;
    border: 1px solid rgba(210, 167, 255, 0.32);
    animation: ringPulse 4s ease-out infinite;
}

.preview-ring.delay {
    animation-delay: -2s;
}

.preview-light {
    top: 50%;
    left: 50%;
    width: 7rem;
    height: 7rem;
    margin-left: -3.5rem;
    margin-top: -3.5rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.34), transparent 70%);
    filter: blur(10px);
}

.project-panel:hover .preview-shell::after {
    opacity: 1;
}

.preview-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.16) 50%, transparent 80%);
    opacity: 0;
    transition: opacity 250ms ease;
}

.projects-progress {
    justify-self: end;
    margin-right: max(1rem, calc((100vw - 1200px) / 2));
    padding: 0.8rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(4, 7, 15, 0.74);
    color: var(--text-soft);
    font-family: "Consolas", "Cascadia Code", monospace;
}

.timeline-shell {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.8rem 4rem;
    padding: 1rem 0;
    --timeline-dash-offset: calc(1000 - (1000 * var(--timeline-progress)));
}

.timeline-svg {
    position: absolute;
    top: 0;
    left: 50%;
    width: 12px;
    height: 100%;
    transform: translateX(-50%);
}

.timeline-track,
.timeline-progress-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.timeline-track {
    stroke: rgba(255, 255, 255, 0.12);
}

.timeline-progress-line {
    stroke: var(--accent);
    stroke-dasharray: 1000;
    stroke-dashoffset: var(--timeline-dash-offset);
    transition: stroke-dashoffset 120ms linear;
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.timeline-item.left {
    justify-self: end;
    padding-right: 2rem;
}

.timeline-item.right {
    grid-column: 2;
    padding-left: 2rem;
}

.timeline-icon {
    position: relative;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 12, 24, 0.92);
    color: var(--accent);
    font-family: "Consolas", "Cascadia Code", monospace;
}

.timeline-card {
    max-width: 26rem;
    padding: 1.4rem;
    border-radius: 1.4rem;
}

.playground-shell {
    width: min(100%, 64rem);
}

.playground-stage {
    position: relative;
    min-height: 28rem;
    border-radius: 2rem;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.04), transparent 38%),
        linear-gradient(180deg, rgba(9, 15, 29, 0.92), rgba(14, 19, 38, 0.82));
    cursor: crosshair;
    transition: transform 220ms ease, border-color 220ms ease;
}

.playground-stage:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.18);
}

.playground-grid,
.playground-light,
.playground-core {
    position: absolute;
    inset: 0;
}

.playground-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 2.5rem 2.5rem;
    -webkit-mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
    mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
    opacity: 0.28;
}

.playground-light {
    background:
        radial-gradient(circle at var(--light-x, 50%) var(--light-y, 50%), rgba(255, 220, 180, 0.28), transparent 18%);
    transition: background 120ms linear;
}

.playground-core {
    inset: 50% auto auto 50%;
    width: 9rem;
    height: 9rem;
    margin-left: -4.5rem;
    margin-top: -4.5rem;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(255, 156, 117, 0.16), transparent 72%);
    filter: blur(6px);
    animation: corePulse 4.2s ease-in-out infinite;
}

.playground-hint {
    position: absolute;
    left: 1.5rem;
    bottom: 1.5rem;
    color: var(--text-soft);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.play-particle {
    position: absolute;
    left: 0;
    top: 0;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: hsl(var(--particle-hue), 90%, 72%);
    box-shadow: 0 0 18px hsla(var(--particle-hue), 100%, 70%, 0.6);
    transform: translate3d(var(--particle-x), var(--particle-y), 0);
    animation: particleBurst 900ms ease-out forwards;
    pointer-events: none;
}

.note {
    display: grid;
    justify-items: center;
}

.note-card,
.ending-card {
    position: relative;
    width: min(100%, 52rem);
    padding: clamp(1.6rem, 4vw, 2.4rem);
    border-radius: 2rem;
    text-align: center;
    overflow: hidden;
}

.typing-line {
    min-height: 1.2em;
}

.typing-line::after {
    content: "";
    display: inline-block;
    width: 0.08em;
    height: 0.9em;
    margin-left: 0.16em;
    background: var(--accent);
    animation: cursorBlink 900ms steps(1) infinite;
    vertical-align: -0.08em;
}

.typing-line.is-typed::after {
    animation-play-state: paused;
    opacity: 0.4;
}

.ending {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
}

.ending-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ending-card {
    position: relative;
    z-index: 1;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

@keyframes cueBlink {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes floatCard {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -0.6rem, 0);
    }
}

@keyframes pulsePanel {
    0%,
    100% {
        transform: scaleY(0.88);
    }
    50% {
        transform: scaleY(1);
    }
}

@keyframes wave {
    0%,
    100% {
        transform: scaleX(0.94);
        opacity: 0.35;
    }
    50% {
        transform: scaleX(1.02);
        opacity: 0.8;
    }
}

@keyframes growColumn {
    0%,
    100% {
        transform: scaleY(0.82);
        transform-origin: bottom;
    }
    50% {
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

@keyframes scan {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(9rem);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes ringPulse {
    0% {
        transform: scale(0.65);
        opacity: 0.65;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@keyframes corePulse {
    0%,
    100% {
        transform: scale(0.94);
    }
    50% {
        transform: scale(1.04);
    }
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate3d(var(--particle-x), var(--particle-y), 0) scale(1);
    }
    100% {
        opacity: 0;
        transform:
            translate3d(
                calc(var(--particle-x) + var(--particle-dx)),
                calc(var(--particle-y) + var(--particle-dy)),
                0
            )
            scale(0.2);
    }
}

@keyframes cursorBlink {
    0%,
    50% {
        opacity: 1;
    }
    50.01%,
    100% {
        opacity: 0;
    }
}

@media (max-width: 1100px) {
    .hero-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .hero-photo-frame {
        margin: 0;
    }

    .transition-grid,
    .project-panel {
        grid-template-columns: 1fr;
    }

    .project-panel {
        width: min(86vw, 640px);
        min-width: min(86vw, 640px);
    }

    .timeline-shell {
        grid-template-columns: 1fr;
        padding-left: 2.6rem;
    }

    .timeline-svg {
        left: 0.35rem;
        transform: none;
    }

    .timeline-item.left,
    .timeline-item.right {
        grid-column: 1;
        justify-self: stretch;
        padding: 0 0 0 1rem;
    }
}

@media (max-width: 780px) {
    .site-nav {
        display: none;
    }

    .header-shell {
        width: min(100%, calc(100% - 1rem));
        gap: 0.65rem;
    }

    .header-tools {
        gap: 0.5rem;
    }

    .header-cta {
        min-height: 2.4rem;
        padding: 0 0.85rem;
        font-size: 0.84rem;
    }

    .lang-switch {
        padding: 0.24rem;
    }

    .lang-button {
        min-width: 2rem;
        min-height: 1.82rem;
        font-size: 0.76rem;
    }

    .section {
        width: min(100%, calc(100% - 1rem));
    }

    .hero,
    .transition,
    .about,
    .timeline,
    .playground,
    .note,
    .ending {
        padding: 5rem 0;
    }

    .hero-card {
        border-radius: 1.6rem;
        padding: 1.25rem;
    }

    .hero-copy h1 {
        font-size: clamp(3rem, 18vw, 5rem);
    }

    .hero-float {
        position: static;
        margin-top: 1rem;
        animation: none;
    }

    .transition-grid {
        grid-template-columns: 1fr;
    }

    .about-card {
        position: relative;
        top: 0;
    }

    .projects-scroll {
        height: auto;
    }

    .projects-sticky {
        position: relative;
        height: auto;
        padding: 5rem 1rem;
    }

    .projects-track {
        padding-left: 0;
        transform: none !important;
        flex-direction: column;
    }

    .project-panel {
        width: 100%;
        min-width: 100%;
        opacity: 1;
        transform: none;
    }

    .projects-progress {
        justify-self: start;
        margin-right: 0;
    }

    .playground-stage {
        min-height: 22rem;
    }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-card,
    .about-card,
    .project-panel,
    .preview-shell,
    .playground-stage {
        transform: none !important;
    }
}
