:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --primary-color: #e76f51;
    /* Burnt Orange from image */
    --secondary-color: #38bdf8;
    /* Keep blue as secondary/accent */
    --accent-color: #f472b6;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Playfair Display', serif;
    --primary-rgb: 231, 111, 81;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem 2rem;
    /* Reduced padding for cleaner look */
    background: rgba(15, 23, 42, 0.85);
    /* Slightly darker for legibility */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(231, 111, 81, 0.08) 0%, rgba(15, 23, 42, 0) 50%);
    z-index: -1;
    pointer-events: none;
    animation: pulse-glow 10s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Typography */
h1,
h2,
h3,
.brand,
.logo {
    font-family: var(--font-heading);
}

h1 {
    font-size: 4.5rem;
    /* Slightly larger for serif */
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.text-gradient {
    /* Gradient adapted to new primary orange */
    background: linear-gradient(110deg, var(--primary-color), #f4a261, #f8b37d, var(--primary-color));
    background-size: 220% 220%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease infinite;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Header */
/* Header - Full Width Glass */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .glass-nav {
        padding: 0.8rem 1.5rem;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.glass-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.logo-icon {
    color: var(--primary-color);
    margin-left: 2px;
    display: inline-block;
    animation: semicolon-blink 1.5s infinite step-end;
}

@keyframes semicolon-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.tagline {
    font-family: var(--font-heading);
    /* Serif */
    font-size: 0.9rem;
    font-style: italic;
    color: #cbd5e1;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

/* Navigation for single-link pages like problem detail */
.nav-simple {
    display: flex;
    align-items: center;
}

.nav-simple-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 3px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon i {
    font-size: 1.1em;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 111, 81, 0.4);
    background: #f0886e;
    /* Slightly lighter orange */
    border-color: #f0886e;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--glass-bg);
    border-color: var(--primary-color);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.hero::before {
    width: 420px;
    height: 420px;
    right: -120px;
    top: 80px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(56, 189, 248, 0) 65%);
    animation: orbFloatA 11s ease-in-out infinite;
}

.hero::after {
    width: 360px;
    height: 360px;
    left: -110px;
    bottom: 20px;
    background: radial-gradient(circle, rgba(231, 111, 81, 0.2) 0%, rgba(231, 111, 81, 0) 68%);
    animation: orbFloatB 13s ease-in-out infinite;
}

.hero-content {
    max-width: 980px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.2rem;
    font-family: var(--font-heading);
    font-style: italic;
    color: #cbd5e1;
    margin: 0 auto 1.8rem;
    max-width: 860px;
    line-height: 1.65;
}

.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(231, 111, 81, 0.45);
    background: rgba(231, 111, 81, 0.12);
    color: #f8d8ce;
    font-size: 0.92rem;
    font-weight: 600;
    animation: metricDrift 4s ease-in-out infinite;
}

.metric-pill:nth-child(2) {
    animation-delay: 0.4s;
}

.metric-pill:nth-child(3) {
    animation-delay: 0.8s;
}

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

.pulse {
    animation: ctaPulse 2.8s ease-in-out infinite;
}

/* Shared Sections */
.section-title {
    margin-bottom: 0.7rem;
}

.section-desc {
    max-width: 760px;
    margin: 0 auto 2rem;
    color: #94a3b8;
    font-size: 1.05rem;
}

/* Method Section */
.method-section {
    padding: 5rem 2rem;
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
}

.method-step.glass-card {
    --method-rgb: 56, 189, 248;
    text-align: left;
    position: relative;
    min-height: 290px;
    padding: 1.2rem 1.25rem;
    border: 1px solid rgba(var(--method-rgb), 0.34);
    background:
        linear-gradient(160deg, rgba(var(--method-rgb), 0.18), rgba(15, 23, 42, 0.8) 45%, rgba(2, 6, 23, 0.9));
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.26s ease, border-color 0.26s ease, box-shadow 0.26s ease;
}

.method-step.glass-card::after {
    content: '';
    position: absolute;
    width: 190px;
    height: 190px;
    right: -85px;
    top: -85px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--method-rgb), 0.4), rgba(var(--method-rgb), 0));
    opacity: 0.68;
    z-index: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.method-step.glass-card>* {
    position: relative;
    z-index: 1;
}

.method-step.glass-card:hover {
    transform: translateY(-7px);
    border-color: rgba(var(--method-rgb), 0.65);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.46), 0 0 0 1px rgba(var(--method-rgb), 0.25);
}

.method-step.glass-card:hover::after {
    transform: scale(1.14);
    opacity: 1;
}

.method-step-start {
    --method-rgb: 249, 115, 22;
}

.method-step-map {
    --method-rgb: 56, 189, 248;
}

.method-step-explain {
    --method-rgb: 168, 85, 247;
}

.method-step-measure {
    --method-rgb: 34, 197, 94;
}

.method-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.method-index {
    font-family: 'Fira Code', monospace;
    color: rgba(248, 250, 252, 0.9);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--method-rgb), 0.55);
    background: rgba(var(--method-rgb), 0.23);
}

.method-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    border: 1px solid rgba(var(--method-rgb), 0.48);
    background: rgba(var(--method-rgb), 0.24);
    font-size: 0.88rem;
}

.method-step h3 {
    margin-bottom: 0.75rem;
    font-size: 1.55rem;
    line-height: 1.15;
}

.method-step p {
    color: #d2e2f5;
    font-size: 0.99rem;
    line-height: 1.52;
}

.method-tag {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.24rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #eff6ff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.38);
}

/* Concept Map Section */
.concept-map-section {
    padding: 5rem 2rem;
}

.concept-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.35rem;
    max-width: 1200px;
    margin: 0 auto;
}

.concept-card.glass-card {
    --concept-rgb: 56, 189, 248;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 330px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 1.15rem;
    padding: 1.45rem;
    border: 1px solid rgba(var(--concept-rgb), 0.35);
    background:
        linear-gradient(155deg, rgba(var(--concept-rgb), 0.18), rgba(15, 23, 42, 0.82) 40%, rgba(2, 6, 23, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.concept-card.glass-card::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    right: -90px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--concept-rgb), 0.35), rgba(var(--concept-rgb), 0));
    opacity: 0.7;
    z-index: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.concept-card.glass-card>* {
    position: relative;
    z-index: 1;
}

.concept-card.glass-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--concept-rgb), 0.68);
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.5), 0 0 0 1px rgba(var(--concept-rgb), 0.28);
}

.concept-card.glass-card:hover::before {
    transform: scale(1.18);
    opacity: 1;
}

.concept-os {
    --concept-rgb: 249, 115, 22;
}

.concept-api {
    --concept-rgb: 34, 197, 94;
}

.concept-dist {
    --concept-rgb: 56, 189, 248;
}

.concept-db {
    --concept-rgb: 244, 114, 182;
}

.concept-card-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.concept-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    font-size: 0.9rem;
    border: 1px solid rgba(var(--concept-rgb), 0.5);
    background: rgba(var(--concept-rgb), 0.25);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.concept-domain {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.24rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--concept-rgb), 0.52);
    color: #dff4ff;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.42);
}

.concept-card h3 {
    font-size: 1.65rem;
    margin: 0;
    line-height: 1.18;
}

.concept-text {
    color: #d2e2f4;
    font-size: 1rem;
    line-height: 1.58;
}

.concept-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.concept-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.24rem 0.62rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #dde9f8;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.42);
}

.concept-meta i {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
}

.concept-link {
    margin-top: auto;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    border-radius: 0.7rem;
    padding: 0.62rem 0.85rem;
    border: 1px solid rgba(var(--concept-rgb), 0.55);
    background: rgba(var(--concept-rgb), 0.2);
    transition: background 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.concept-link:hover {
    color: #ffffff;
    border-color: rgba(var(--concept-rgb), 0.85);
    background: rgba(var(--concept-rgb), 0.35);
    transform: translateY(-1px);
}

/* Features Section */
.features {
    padding: 5rem 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card.glass-card {
    text-align: left;
    min-height: 260px;
    border-radius: 0.9rem;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.55);
    transition: transform 0.22s ease, border-color 0.22s ease;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.feature-card.glass-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.45);
}

.feature-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-size: 0.9rem;
}

.feature-card h3 {
    font-size: 1.35rem;
    line-height: 1.2;
    margin: 0.2rem 0 0.1rem;
}

.feature-card p {
    color: #c5d4e8;
    font-size: 0.98rem;
    line-height: 1.55;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.icon-box {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* Demo Section */
.demo-section {
    padding: 5rem 2rem;
    text-align: center;
}

.interactive-demo {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.demo-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.demo-controls input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    width: 60px;
    text-align: center;
}

.visualization-area {
    margin-bottom: 2rem;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.array-street {
    display: flex;
    gap: 1rem;
}

.house {
    width: 80px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.house:hover {
    border-color: var(--primary-color);
    background: rgba(56, 189, 248, 0.1);
}

.house.active {
    border-color: var(--accent-color);
    background: rgba(244, 114, 182, 0.1);
    transform: scale(1.1);
}

.house-roof {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 30px solid var(--glass-border);
    position: absolute;
    top: -30px;
}

.house:hover .house-roof {
    border-bottom-color: var(--primary-color);
}

.house.active .house-roof {
    border-bottom-color: var(--accent-color);
}


.house-number {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: auto;
    margin-bottom: 0.5rem;
}

.house-resident {
    font-size: 1.5rem;
    font-weight: 700;
}

.output-log {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: left;
    font-family: monospace;
    color: var(--primary-color);
}

/* Footer */
.glass-footer {
    margin-top: 3.5rem;
    padding: 3.5rem 0 2rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.86);
    backdrop-filter: blur(10px);
    color: #dce7f5;
}

.glass-footer .container {
    padding: 0 2rem;
}

.footer-top-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.5rem;
}

.footer-column h3 {
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: #f1f6ff;
}

.footer-link-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-link-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #bfcee4;
    font-weight: 500;
}

.footer-link-list a i {
    color: #10b7aa;
    font-size: 0.95rem;
}

.footer-link-list a:hover {
    color: #ffffff;
}

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.footer-social-link {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #c7d8ee;
    font-size: 1.1rem;
}

.footer-social-link:hover {
    color: #ffffff;
    border-color: rgba(16, 183, 170, 0.6);
    background: rgba(16, 183, 170, 0.18);
    transform: translateY(-2px);
}

.footer-newsletter {
    margin-top: 1.7rem;
}

.footer-newsletter h4 {
    margin-bottom: 0.55rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f6ff;
}

.footer-newsletter-form {
    max-width: 360px;
    display: flex;
    align-items: stretch;
    border-radius: 0.65rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.18);
}

.footer-newsletter-form input {
    flex: 1;
    border: 0;
    padding: 0.8rem 0.9rem;
    outline: none;
    font-size: 1rem;
    color: #e5eefc;
    background: transparent;
}

.footer-newsletter-form input::placeholder {
    color: #9fb2cc;
}

.footer-newsletter-form button {
    border: 0;
    width: 3rem;
    background: #12b7ab;
    color: #fff;
    cursor: pointer;
}

.footer-newsletter-form button:hover {
    background: #0c9e93;
}

.footer-bottom {
    margin-top: 2.6rem;
    padding-top: 1.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
}

.footer-meta p {
    color: #9fb2cc;
}

.footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.footer-legal-links a {
    color: #afc1d8;
    font-weight: 500;
}

.footer-legal-links a:hover {
    color: #ffffff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(26px) scale(0.98);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-on-scroll.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

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

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes orbFloatA {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-28px, 20px) scale(1.08);
    }
}

@keyframes orbFloatB {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(24px, -18px) scale(1.06);
    }
}

@keyframes metricDrift {

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

    50% {
        transform: translateY(-4px);
    }
}

@keyframes ctaPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(var(--primary-rgb), 0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 900px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero {
        padding: 110px 1.5rem 3.5rem;
    }

    .subtitle {
        font-size: 1.05rem;
    }

    .cta-group {
        flex-wrap: wrap;
    }

    .method-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .method-step h3 {
        font-size: 1.32rem;
    }

    .feature-card h3 {
        font-size: 1.2rem;
    }

    .concept-card h3 {
        font-size: 1.45rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        max-width: 300px;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        padding: 2rem;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        gap: 2rem;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        font-size: 1.2rem;
    }

    .nav-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .nav-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

@media (max-width: 1100px) {
    .footer-top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 700px) {
    h1 {
        font-size: 2.1rem;
    }

    .hero-metrics {
        flex-direction: column;
        align-items: center;
    }

    .hero::before,
    .hero::after {
        opacity: 0.6;
    }

    .metric-pill {
        width: 100%;
        justify-content: center;
    }

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

    .method-step.glass-card {
        min-height: auto;
        padding: 1.05rem 1rem;
    }

    .feature-card.glass-card {
        min-height: auto;
        padding: 1rem;
    }

    .feature-card p {
        font-size: 0.95rem;
    }

    .concept-map-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .concept-card.glass-card {
        min-height: auto;
        padding: 1.2rem;
    }

    .concept-text {
        font-size: 0.95rem;
    }

    .section-desc {
        font-size: 1rem;
    }

    .glass-footer .container {
        padding: 0 1rem;
    }

    .footer-top-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-column h3 {
        font-size: 1.1rem;
    }

    .footer-social-link {
        width: 2.45rem;
        height: 2.45rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .text-gradient,
    .hero::before,
    .hero::after,
    .metric-pill,
    .pulse,
    .reveal-on-scroll,
    .fade-in-up {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* Engineering Demo Styles */
.challenge-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.challenge-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.challenge-btn:hover,
.challenge-btn.active {
    background: rgba(231, 111, 81, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.status-indicator {
    font-family: monospace;
    font-weight: bold;
}

#rl-status.blocked {
    color: #ef4444;
}

#rl-status.ok {
    color: #22c55e;
}

/* Rate Limiter Visuals */
.visual-bucket {
    height: 150px;
    border: 2px dashed var(--glass-border);
    border-radius: 0.5rem;
    display: flex;
    flex-wrap: wrap-reverse;
    /* Stack from bottom */
    align-content: flex-start;
    padding: 0.5rem;
    gap: 0.2rem;
    margin-bottom: 1rem;
    position: relative;
}

.bucket-item {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Load Balancer Visuals */
.lb-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.load-balancer-icon {
    font-size: 2rem;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 1rem;
    border-radius: 50%;
}

.servers-container {
    display: flex;
    gap: 2rem;
}

.server {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    transition: all 0.3s;
}

.server.active-server {
    border-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.server.overloaded {
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

/* DB Visuals */
.db-visual {
    margin-bottom: 1rem;
}

.db-table {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    max-width: 400px;
    margin: 0 auto;
}

.db-cell {
    width: 100%;
    padding-top: 100%;
    /* Square */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    transition: background 0.2s;
}

.db-cell.scanned {
    background: var(--accent-color);
}

.db-cell.found {
    background: #22c55e;
    box-shadow: 0 0 15px #22c55e;
    z-index: 2;
}

/* --- Disk Defragmentation Visuals --- */
.defrag-theory {
    margin: 1.25rem 0 1.5rem;
    padding: 1.5rem;
    text-align: left;
    border-color: rgba(var(--primary-rgb), 0.45);
    background: linear-gradient(160deg, rgba(231, 111, 81, 0.12), rgba(56, 189, 248, 0.06));
}

.defrag-theory h4 {
    font-size: 1.45rem;
    margin-bottom: 0.8rem;
}

.defrag-theory h5 {
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
}

.defrag-theory p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0.85rem;
    color: rgba(255, 255, 255, 0.93);
}

.defrag-theory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.theory-block {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 0.95rem 1rem;
}

.theory-block ul {
    margin-left: 1.05rem;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.6;
}

.theory-example,
.theory-complexity {
    margin-bottom: 0.4rem;
}

.defrag-theory code {
    color: #ffdca9;
}

.disk-visual {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-height: 60px;
    justify-content: center;
}

.disk-block {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: white;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.disk-block.occupied {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
}

.disk-block.free {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
}

.disk-block.access {
    transform: scale(1.2);
    box-shadow: 0 0 15px white;
    z-index: 10;
    border-color: white;
}

.disk-block.read {
    border-color: #ffd700;
    /* Gold for read */
}

.disk-block.write {
    border-color: #ff4500;
    /* OrangeRed for write */
}

.code-editor-container {
    margin-top: 15px;
    text-align: left;
}

.code-editor-container label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.code-editor {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
}

@media (max-width: 700px) {
    .defrag-theory {
        padding: 1.1rem;
    }

    .defrag-theory h4 {
        font-size: 1.25rem;
    }

    .defrag-theory p,
    .theory-block ul {
        font-size: 0.94rem;
    }

    .defrag-theory-grid {
        grid-template-columns: 1fr;
    }
}


/* About Section */
.about-section {
    padding: 8rem 2rem;
    position: relative;
    overflow: hidden;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: start;
}

/* Timeline Flow */
.about-text {
    position: relative;
    padding-left: 2rem;
}

.about-text::before {
    content: '';
    position: absolute;
    top: 1rem;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), rgba(255, 255, 255, 0.05));
    border-radius: 2px;
}

.step-card {
    position: relative;
    margin-bottom: 4rem;
    padding-left: 2rem;
}

.step-card:last-child {
    margin-bottom: 0;
}

/* Timeline Nodes */
.step-card::before {
    content: '';
    position: absolute;
    top: 5px;
    left: -2.6rem;
    /* Align with vertical line */
    width: 1rem;
    height: 1rem;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-card:hover::before {
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.step-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.step-card:hover h3 {
    color: var(--primary-color);
}

.about-text .highlight {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0.8;
    background: rgba(231, 111, 81, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(231, 111, 81, 0.2);
}

.about-text p {
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* About Visual - Code Card */
.about-visual {
    position: relative;
}

.code-block-card {
    background: #1e293b;
    /* Darker slate for window */
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    /* High border-radius */
    padding: 0;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* macOS Window Header */
.code-block-card::after {
    content: '';
    position: absolute;
    top: 1.2rem;
    left: 1.5rem;
    width: 60px;
    height: 12px;
    background-image:
        radial-gradient(circle, #ff5f56 6px, transparent 7px),
        radial-gradient(circle, #ffbd2e 6px, transparent 7px),
        radial-gradient(circle, #27c93f 6px, transparent 7px);
    background-size: 14px 14px, 14px 14px, 14px 14px;
    background-position: 0 0, 20px 0, 40px 0;
    background-repeat: no-repeat;
}

.code-block-card pre {
    margin-top: 3.5rem;
    /* Space for header */
    padding: 1.5rem 2rem;
    background: transparent;
    border: none;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.6;
}

.code-block-card code {
    display: block;
}

.arrow-down {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
    padding: 1rem 0;
    background: rgba(0, 0, 0, 0.2);
    animation: bounce 2s infinite;
}

@keyframes bounce {

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

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

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

.story-snippet {
    background: #0f172a;
    border-top: 1px solid var(--glass-border);
    padding: 2rem;
    font-family: var(--font-heading);
    font-style: italic;
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.6;
}

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

    .about-text p {
        padding-left: 0;
    }
}
