/* Catppuccin Frappe Color Palette */
:root {
    /* Base colors */
    --ctp-base: #303446;
    --ctp-mantle: #292c3c;
    --ctp-crust: #232634;

    /* Surface colors */
    --ctp-surface0: #414559;
    --ctp-surface1: #51576d;
    --ctp-surface2: #626880;

    /* Overlay colors */
    --ctp-overlay0: #737994;
    --ctp-overlay1: #838ba7;
    --ctp-overlay2: #949cbb;

    /* Text colors */
    --ctp-text: #c6d0f5;
    --ctp-subtext1: #b5bfe2;
    --ctp-subtext0: #a5adce;

    /* Accent colors */
    --ctp-lavender: #babbf1;
    --ctp-blue: #8caaee;
    --ctp-sapphire: #85c1dc;
    --ctp-sky: #99d1db;
    --ctp-teal: #81c8be;
    --ctp-green: #a6d189;
    --ctp-yellow: #e5c890;
    --ctp-peach: #ef9f76;
    --ctp-maroon: #ea999c;
    --ctp-red: #e78284;
    --ctp-mauve: #ca9ee6;
    --ctp-pink: #f4b8e4;
    --ctp-flamingo: #eebebe;
    --ctp-rosewater: #f2d5cf;

    /* Layout */
    --max-terminal-width: 1200px;
    --max-terminal-height: 65vh;
}

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

html,
body {
    height: 100%;
    font-family:
        "Inter",
        "SF Pro Display",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    background-color: var(--ctp-base);
    background-image: url("/static/bg.png");
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    background-size: cover;
    color: var(--ctp-text);
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 2rem 2rem 1.5rem 2rem;
    max-width: 920px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(
        135deg,
        var(--ctp-mauve) 0%,
        var(--ctp-blue) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(202, 158, 230, 0.3);
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--ctp-subtext1);
    margin-bottom: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Links Section */
.links-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(65, 69, 89, 0.6);
    border: 1px solid rgba(186, 187, 241, 0.2);
    border-radius: 12px;
    color: var(--ctp-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.link-button:hover {
    background: rgba(81, 87, 109, 0.8);
    border-color: var(--ctp-mauve);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(202, 158, 230, 0.2);
}

.link-button i {
    font-size: 1.2rem;
}

.link-button.github {
    border-color: rgba(186, 187, 241, 0.3);
}

.link-button.github:hover {
    border-color: var(--ctp-lavender);
    box-shadow: 0 8px 24px rgba(186, 187, 241, 0.25);
}

.link-button.crate {
    border-color: rgba(239, 159, 118, 0.3);
}

.link-button.crate:hover {
    border-color: var(--ctp-peach);
    box-shadow: 0 8px 24px rgba(239, 159, 118, 0.25);
}

.link-button.docs {
    border-color: rgba(245, 194, 231, 0.3);
}

.link-button.docs:hover {
    border-color: var(--ctp-pink);
    box-shadow: 0 8px 24px rgba(245, 194, 231, 0.25);
}

.link-button.apt {
    border-color: rgba(166, 209, 137, 0.3);
}

.link-button.apt:hover {
    border-color: var(--ctp-green);
    box-shadow: 0 8px 24px rgba(166, 209, 137, 0.25);
}

/* Terminal Wrapper */
.terminal-wrapper {
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 2rem 1.5rem 2rem;
}

/* Terminal Window Frame */
.terminal-window {
    width: 100%;
    max-width: var(--max-terminal-width);
    max-height: var(--max-terminal-height);
    min-height: var(--max-terminal-height);
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 12px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(186, 187, 241, 0.1);
    background: transparent;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(186, 187, 241, 0.15);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* Terminal Title Bar */
.terminal-titlebar {
    height: 44px;
    background: rgba(41, 44, 60, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    padding: 0 16px;
    user-select: none;
    backdrop-filter: blur(10px);
}

/* Traffic Light Buttons */
.terminal-controls {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 0.5px solid rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.terminal-button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.terminal-button:hover::before {
    opacity: 1;
}

.terminal-button.close {
    background: var(--ctp-red);
}

.terminal-button.close:hover::before {
    background: rgba(35, 38, 52, 0.8);
    content: "×";
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    width: 8px;
    height: 8px;
}

.terminal-button.minimize {
    background: var(--ctp-yellow);
}

.terminal-button.minimize:hover::before {
    background: rgba(35, 38, 52, 0.8);
}

.terminal-button.maximize {
    background: var(--ctp-green);
}

.terminal-button.maximize:hover::before {
    background: rgba(35, 38, 52, 0.8);
}

/* Terminal Title */
.terminal-title {
    flex: 1;
    text-align: center;
    color: var(--ctp-subtext1);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Terminal Content */
#terminal {
    flex: 1;
    overflow: hidden;
    background: rgba(48, 52, 70, 0.85);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 8px 12px 8px 12px;
}

/* Ensure xterm fills container and respects rounded corners */
.xterm {
    height: 100% !important;
    background: rgba(48, 52, 70, 0.85) !important;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.xterm-viewport {
    height: 100% !important;
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

.xterm-screen {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Force canvas to clip at rounded corners */
.xterm canvas {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Hide scrollbars */
#terminal,
.xterm,
.xterm-viewport {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#terminal::-webkit-scrollbar,
.xterm::-webkit-scrollbar,
.xterm-viewport::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Footer */
.site-footer {
    padding: 2rem;
    text-align: center;
    color: var(--ctp-overlay1);
    font-size: 0.875rem;
    background: rgba(35, 38, 52, 0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(186, 187, 241, 0.1);
}

.site-footer a {
    color: var(--ctp-mauve);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--ctp-lavender);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .links-section {
        flex-direction: column;
        align-items: center;
    }

    .link-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .terminal-window {
        border-radius: 8px;
    }

    .terminal-wrapper {
        padding: 0 1rem 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 1rem 1.5rem 1rem;
    }

    .terminal-titlebar {
        height: 40px;
    }

    .terminal-button {
        width: 10px;
        height: 10px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection colors */
::selection {
    background: var(--ctp-mauve);
    color: var(--ctp-base);
}

::-moz-selection {
    background: var(--ctp-mauve);
    color: var(--ctp-base);
}
