/* ============================
 *  1. VARIABLES & THEME
 *  ============================ */
:root {
    --bg-color: #F5F5F7;
    --text-main: #111111;
    --text-muted: #666666;
    --grid-line: #D4D4D4;
    --accent: #0070F3;

    --panel-bg: #FFFFFF;
    --panel-overlay: rgba(0, 0, 0, 0.06);

    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-logo: 'Space Grotesk', sans-serif;

    --grain-url: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

[data-theme="dark"] {
    --bg-color: #050505;
    --text-main: #EDEDED;
    --text-muted: #888888;
    --grid-line: #333333;

    --panel-bg: #090909;
    --panel-overlay: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--grid-line);
    border: 2px solid var(--panel-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ============================
 *  2. NAVIGATION
 *  ============================ */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    height: 64px;
    border-bottom: 1px solid var(--grid-line);
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(180deg, var(--panel-overlay), transparent);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo-img {
    width: 32px;
    height: 32px;
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: block;
}

[data-theme="light"] .logo-light {
    display: block;
}

.logo-text {
    font-family: var(--font-logo);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.terminal-prompt {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.terminal-prompt::after {
    content: '_';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.terminal-prompt.root-mode {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent);
    font-weight: 700;
}

.terminal-prompt.pulse {
    animation: pulseAccent 700ms ease;
}

@keyframes pulseAccent {
    0% {
        text-shadow: 0 0 0 rgba(0, 0, 0, 0);
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 12px rgba(0, 112, 243, 0.25);
        transform: scale(1.02);
    }

    100% {
        text-shadow: 0 0 0 rgba(0, 0, 0, 0);
        transform: scale(1);
    }
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-sun {
    display: none;
    width: 20px;
}

.icon-moon {
    display: block;
    width: 20px;
}

[data-theme="light"] .icon-sun {
    display: block;
}

[data-theme="light"] .icon-moon {
    display: none;
}


/* ============================
 *  3. HERO SECTION
 *  ============================ */
.hero-container {
    height: 100vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding-top: 64px;
    padding-bottom: 2rem;
    overflow: hidden;
}

.grid-line-v {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--grid-line);
    z-index: 0;
}

.grid-line-v.left {
    left: 15%;
}

.grid-line-v.right {
    right: 15%;
}

.grid-line-h {
    width: 100%;
    height: 1px;
    background-color: var(--grid-line);
    z-index: 0;
}

.hero-content {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    z-index: 1;
    gap: 0;
    margin: auto 0;
}

.title-box {
    width: 100%;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-box {
    align-items: flex-start;
    padding-left: 16%;
}

.bottom-box {
    align-items: flex-end;
    padding-right: 16%;
}

.acad-text,
.hack-text {
    font-size: clamp(5rem, 15vw, 11rem);
    line-height: 0.9;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: -10px;
    position: relative;
}



.hack-text {
    font-family: var(--font-mono);
    font-weight: 400;
    font-style: italic;
    letter-spacing: -0.06em;
    color: var(--text-main);
    margin-top: -10px;
}

.blink-underscore {
    animation: blink 1s infinite;
}

/* Text Grain */
.acad-text::before,
.hack-text::before {
    content: "";
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background-image: var(--grain-url);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
    mask-image: radial-gradient(ellipse, black 40%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse, black 40%, transparent 70%);
}

[data-theme="light"] .acad-text::before,
[data-theme="light"] .hack-text::before {
    filter: invert(1);
    opacity: 0.12;
}

.decorator-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    position: absolute;
    text-transform: uppercase;
}

.top-box .decorator-label {
    top: 0;
    left: 22%;
}

.bottom-box .decorator-label {
    bottom: -1.5rem;
    right: 22%;
}

/* Footer in hero */
.hero-footer {
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    margin-bottom: 2vh;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}


/* ============================
 *  4. ANIMATED BUTTONS
 *  ============================ */
.btn-primary,
.btn-secondary {
    position: relative;
    display: inline-block;
    padding: 0.9rem 2.5rem;
    border: 1px solid var(--text-main);
    font-family: var(--font-mono);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    overflow: hidden;
}

.btn-primary span,
.btn-secondary span {
    display: block;
    position: relative;
    z-index: 10;
    transition: color 0.3s;
}

.btn-primary>span,
.btn-secondary>span {
    overflow: hidden;
}

.btn-primary>span>span,
.btn-secondary>span>span {
    display: block;
    position: relative;
    transition: color 0.3s;
    z-index: 10;
}

@keyframes MoveUpInitial {
    to {
        transform: translate3d(0, -105%, 0);
    }
}

@keyframes MoveUpEnd {
    from {
        transform: translate3d(0, 100%, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}


/* STYLE 1: PROCEED */
.btn-primary {
    background: var(--text-main);
    color: var(--bg-color);
}

.btn-primary:hover>span>span {
    color: var(--text-main);
    animation: MoveUpInitial 0.2s forwards, MoveUpEnd 0.2s forwards 0.2s;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.2, 1);
    transform-origin: 100% 50%;
    z-index: 0;
    transform: scale3d(0, 1, 1);
}

.btn-primary:hover::before {
    transform: scale3d(1, 1, 1);
    transform-origin: 0% 50%;
}


/* STYLE 2: VIEW SOURCE */
.btn-secondary {
    background: transparent;
    color: var(--text-main);
}

.btn-secondary:hover>span>span {
    color: var(--bg-color);
    animation: MoveUpInitial 0.2s forwards, MoveUpEnd 0.2s forwards 0.2s;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--text-main);
    transition: transform 0.3s cubic-bezier(0.7, 0, 0.2, 1);
    transform-origin: 100% 50%;
    z-index: 0;
    transform: scale3d(0, 1, 1);
}

.btn-secondary:hover::before {
    transform: scale3d(1, 1, 1);
    transform-origin: 0% 50%;
}


/* Scroll Indicator */
.scroll-indicator {
    margin-top: 1rem;
    animation: bounce 2s infinite;
}

.scroll-indicator a {
    color: var(--text-muted);
    cursor: pointer;
}

.scroll-indicator:hover a {
    color: var(--text-main);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ============================
 *  5. SECTION SEPARATOR
 *  ============================ */
.section-separator {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    margin-top: 4rem;
    margin-bottom: 0.5rem;
}

.separator-line {
    height: 1px;
    flex-grow: 1;
    background-color: var(--grid-line);
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}


/* ============================
 *  6. WORKFLOW SECTION
 *  ============================ */
.workflow-section {
    padding: 4rem 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

.step-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10rem;
    position: relative;
    width: 100%;
}

.step-row.reverse {
    flex-direction: row-reverse;
}

.step-row::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 1px;
    background: var(--grid-line);
    left: 0;
    width: 50%;
    z-index: 0;
}

.step-row.reverse::before {
    left: auto;
    right: 0;
}

.step-text {
    width: 35%;
    z-index: 2;
}

.step-number {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: block;
}

.step-heading {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.step-desc {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
    font-family: var(--font-mono);
}

.step-visual {
    width: 50%;
    position: relative;
    z-index: 2;
}

.tech-frame {
    position: relative;
    padding: 0;
    display: block;
    width: 100%;
    margin: 10px 0;
}

/* Corner markers */
.corner-tl,
.corner-tr,
.corner-bl,
.corner-br {
    position: absolute;
    width: 15px;
    height: 15px;
    pointer-events: none;
    z-index: 5;
}

.corner-tl::before,
.corner-tr::before,
.corner-bl::before,
.corner-br::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(var(--grid-line) 0 0) center/1px 100% no-repeat,
        linear-gradient(var(--grid-line) 0 0) center/100% 1px no-repeat;
}

.corner-tl {
    top: -7px;
    left: -7px;
}

.corner-tr {
    top: -7px;
    right: -7px;
}

.corner-bl {
    bottom: -7px;
    left: -7px;
}

.corner-br {
    bottom: -7px;
    right: -7px;
}

/* Screenshots */
.screenshot-img {
    width: 100%;
    height: auto;
    display: none;
    opacity: 0.95;
    transition: opacity 0.25s ease;
    border: 1px solid var(--grid-line);
    box-sizing: border-box;
}

html[data-theme="dark"] .screenshot-img--dark {
    display: block;
}

html[data-theme="dark"] .screenshot-img--light {
    display: none;
}

html[data-theme="light"] .screenshot-img--light {
    display: block;
}

html[data-theme="light"] .screenshot-img--dark {
    display: none;
}

.screenshot-img:hover {
    opacity: 1;
}

/* ============================
 *  7. FOOTER
 *  ============================ */
.footer-minimal {
    border-top: 1px solid var(--grid-line);
    padding: 1.25rem 1.5rem;
    text-align: center;
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-muted);
    background: transparent;
}

.footer-minimal .author-link,
.footer-minimal .author-link:link,
.footer-minimal .author-link:visited {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.footer-minimal .author-link::after {
    content: '_';
    display: inline-block;
    margin-left: 4px;
    animation: blink 1s infinite;
}

.footer-minimal .author-link:hover,
.footer-minimal .author-link:focus {
    text-decoration: underline;
    outline: none;
}

/* ============================
 *  8. EASTER EGG UI HELPERS
 *  ============================ */
.typing-cursor {
    display: inline-block;
    width: 8px;
    margin-left: 2px;
    vertical-align: baseline;
    animation: blink 1s steps(1) infinite;
}

.toast.egg-toast {
    border-color: var(--accent);
    color: var(--accent);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.term-line.term-egg-success {
    color: var(--accent);
    font-weight: 700;
}

/* ============================
 *  9. SCROLL REVEAL
 *  ============================ */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================
 *  10. TERMINAL MODAL
 *  ============================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.terminal-window {
    position: relative;
    width: 600px;
    max-width: 90%;
    background: var(--panel-bg);
    border: 1px solid var(--grid-line);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    font-family: var(--font-mono);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.active .terminal-window {
    transform: scale(1);
}

.terminal-header {
    background: var(--panel-overlay);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--grid-line);
}

.term-buttons {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.term-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
    animation: termWave 1.5s infinite ease-in-out;
}

.term-dot:nth-child(1) {
    animation-delay: 0s;
}

.term-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.term-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes termWave {

    0%,
    100% {
        background: var(--text-muted);
        opacity: 0.5;
        box-shadow: none;
    }

    50% {
        background: var(--accent);
        opacity: 1;
        box-shadow: 0 0 8px var(--accent);
    }
}

.term-title {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0 auto;
    transform: translateX(-26px);
    letter-spacing: 0.05em;
}

.terminal-body {
    padding: 25px;
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.6;
    min-height: 250px;
    cursor: text;
    background: var(--panel-bg);
    overflow-y: auto;
}

.term-line {
    margin-bottom: 8px;
}

.term-success {
    color: var(--accent);
    font-weight: 700;
}

.term-error {
    color: var(--text-muted);
    text-decoration: line-through;
}

.input-line {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.prompt-user {
    color: var(--accent);
    margin-right: 12px;
    font-weight: 700;
}

#term-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    flex-grow: 1;
    caret-color: var(--accent);
    text-transform: lowercase;
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
}

.toast {
    background: var(--panel-bg);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideInToast 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), fadeOutToast 0.5s forwards 3s;
    pointer-events: none;
}

@keyframes slideInToast {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOutToast {
    to {
        opacity: 0;
    }
}

/* ============================
 *  11. CUSTOM CURSOR
 *  ============================ */

/* hide native cursor when custom active */
body.custom-cursor-enabled {
    cursor: none;
}

body.custom-cursor-enabled * {
    cursor: none !important;
}

/* base inverting square */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 0;
    /* explicit square */
    pointer-events: none;
    z-index: 3000;
    background: #ffffff;
    border: 1px solid #ffffff;
    mix-blend-mode: difference;
    /* inverts whatever is below */
    transform: translate3d(-50%, -50%, 0);
    opacity: 0;
    transition:
        opacity 0.15s ease-out,
        width 0.12s ease-out,
        height 0.12s ease-out,
        border-radius 0.12s ease-out,
        border-width 0.12s ease-out;
}

/* visible while mouse is inside window */
body.custom-cursor-enabled.cursor-visible .cursor {
    opacity: 1;
}

/* hover over text areas: vertical bar | */
body.custom-cursor-enabled.cursor-hover-text .cursor {
    width: 2px;
    height: 18px;
    border-radius: 1px;
    border-width: 0;
}

/* hover over other clickable things: underscore _ */
body.custom-cursor-enabled.cursor-hover-click .cursor {
    width: 18px;
    height: 2px;
    border-radius: 1px;
    border-width: 0;
}

/* ============================
 *  RESPONSIVE
 *  ============================ */
.footer-minimal p {
    margin: 0.25rem 0;
}

.legal-notice {
    font-size: 0.85em;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .grid-line-v {
        display: none;
    }

    .top-box {
        padding-left: 5%;
    }

    .bottom-box {
        padding-right: 5%;
    }

    .acad-text,
    .hack-text {
        font-size: 4.5rem;
    }

    .decorator-label {
        display: none;
    }

    .step-row,
    .step-row.reverse {
        flex-direction: column;
        gap: 3rem;
        margin-bottom: 6rem;
        text-align: left;
    }

    .step-text,
    .step-visual {
        width: 100%;
    }

    .terminal-prompt {
        display: none;
    }

    .step-row::before {
        display: none;
    }

    footer {
        padding: 1rem 1rem;
        margin-top: 1rem;
    }
}