/* ========================================
   MATH LOADING SCREEN
   ======================================== */

.math-loader {
    position: fixed;
    inset: 0;
    background: #f8fafc;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.math-loader.hide {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.loader-content {
    position: relative;
    text-align: center;
}

.loader-content h1 {
    font-size: 48px;
    color: #071225;
    letter-spacing: 2px;
    font-weight: 900;
    margin: 0;
    font-family: 'Times New Roman', serif;
}

.loader-content p {
    margin: 12px 0 0 0;
    color: #64748b;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 500;
}

.orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 220px;
    height: 220px;
    transform: translate(-50%, -50%);
    animation: orbitRotate 4s linear infinite;
}

.orbit span {
    position: absolute;
    color: rgba(7, 18, 37, 0.25);
    font-weight: 700;
    font-size: 22px;
    font-family: 'Times New Roman', serif;
}

.orbit span:nth-child(1) { 
    top: 0; 
    left: 50%; 
    transform: translateX(-50%);
}

.orbit span:nth-child(2) { 
    top: 20%; 
    right: 5%; 
}

.orbit span:nth-child(3) { 
    top: 50%; 
    right: 0; 
    transform: translateY(-50%);
}

.orbit span:nth-child(4) { 
    bottom: 20%; 
    right: 5%; 
}

.orbit span:nth-child(5) { 
    bottom: 0; 
    left: 50%; 
    transform: translateX(-50%);
}

.orbit span:nth-child(6) { 
    bottom: 20%; 
    left: 5%; 
}

.orbit span:nth-child(7) { 
    top: 50%; 
    left: 0; 
    transform: translateY(-50%);
}

.orbit span:nth-child(8) { 
    top: 20%; 
    left: 5%; 
}

@keyframes orbitRotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.loader-bar {
    width: 260px;
    height: 3px;
    background: #e2e8f0;
    margin: 24px auto 0;
    overflow: hidden;
    border-radius: 2px;
}

.loader-progress {
    height: 100%;
    width: 0%;
    background: #071225;
    animation: loadingProgress 1.8s ease forwards;
    border-radius: 2px;
}

@keyframes loadingProgress {
    to {
        width: 100%;
    }
}

/* Loading States */
body.loading main,
body.loading header,
body.loading footer {
    opacity: 0;
}

body.loaded main,
body.loaded header,
body.loaded footer {
    opacity: 1;
    animation: pageFadeUp 0.8s ease forwards;
}

@keyframes pageFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ========================================
   PAGE TRANSITION ANIMATIONS
   ======================================== */

/* Page Transition Overlay */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #071225;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Body States */
body {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.page-loaded {
    opacity: 1;
}

body.page-leaving {
    opacity: 0.8;
}

body.page-leaving .page-transition {
    transform: translateY(0);
}

/* Main Content Animation */
main,
.hero,
.materi-section,
.features-section,
.about-section,
.page-header,
.content-section,
.lab-section {
    transform: translateY(20px);
    filter: blur(6px);
    opacity: 0.7;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.page-loaded main,
body.page-loaded .hero,
body.page-loaded .materi-section,
body.page-loaded .features-section,
body.page-loaded .about-section,
body.page-loaded .page-header,
body.page-loaded .content-section,
body.page-loaded .lab-section {
    transform: translateY(0);
    filter: blur(0);
    opacity: 1;
}

body.page-leaving main,
body.page-leaving .hero,
body.page-leaving .materi-section,
body.page-leaving .features-section,
body.page-leaving .about-section,
body.page-leaving .page-header,
body.page-leaving .content-section,
body.page-leaving .lab-section {
    transform: translateY(20px);
    filter: blur(8px);
    opacity: 0;
}

/* Navbar stays fixed during transition */
.site-header {
    z-index: 10000;
    transition: none;
}

/* Canvas and interactive elements protection */
canvas,
.machine-visual,
.inspect-buttons {
    transition: opacity 0.3s ease;
}

body.page-leaving canvas,
body.page-leaving .machine-visual,
body.page-leaving .inspect-buttons {
    opacity: 0;
}

/* Footer animation */
.footer {
    transform: translateY(30px);
    opacity: 0.5;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

body.page-loaded .footer {
    transform: translateY(0);
    opacity: 1;
}

body.page-leaving .footer {
    transform: translateY(30px);
    opacity: 0;
}

/* Stagger animation for cards */
.card {
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.page-loaded .card:nth-child(1) {
    transition-delay: 0.1s;
}

body.page-loaded .card:nth-child(2) {
    transition-delay: 0.2s;
}

body.page-loaded .card:nth-child(3) {
    transition-delay: 0.3s;
}

body.page-loaded .card {
    transform: translateY(0);
    opacity: 1;
}

/* Feature items stagger */
.feature-item {
    transform: translateY(25px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.page-loaded .feature-item:nth-child(1) {
    transition-delay: 0.15s;
}

body.page-loaded .feature-item:nth-child(2) {
    transition-delay: 0.25s;
}

body.page-loaded .feature-item:nth-child(3) {
    transition-delay: 0.35s;
}

body.page-loaded .feature-item {
    transform: translateY(0);
    opacity: 1;
}

/* Disable transitions during page leave for performance */
body.page-leaving * {
    transition-duration: 0.45s !important;
}

/* Math Background - exclude from page transitions */
.math-bg,
.math-symbol {
    transition: none !important;
}

/* Navbar cursor - exclude from page transitions */
.nav-cursor {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #1a2332;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   MATH BACKGROUND ANIMATION
   ======================================== */

.math-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.math-symbol {
    position: absolute;
    font-family: 'Times New Roman', serif;
    font-weight: 300;
    color: #1a2332;
    user-select: none;
    will-change: transform, opacity;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: var(--symbol-opacity);
    }
    90% {
        opacity: var(--symbol-opacity);
    }
    100% {
        transform: translateY(-100px) rotate(var(--rotate-end));
        opacity: 0;
    }
}

@keyframes floatAlt {
    0% {
        transform: translateY(100vh) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--symbol-opacity);
    }
    50% {
        transform: translateY(50vh) rotate(calc(var(--rotate-end) / 2)) translateX(20px);
    }
    90% {
        opacity: var(--symbol-opacity);
    }
    100% {
        transform: translateY(-100px) rotate(var(--rotate-end)) translateX(0);
        opacity: 0;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   NAVBAR
   ======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.top-line {
    height: 10px;
    background-color: #25283a;
    width: 100%;
}

.nav-wrap {
    height: 72px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 900;
    color: #071225;
    text-decoration: none;
    letter-spacing: 1.5px;
}

.nav-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-cursor {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
    background-color: #071225;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
}

.nav-link {
    position: relative;
    z-index: 2;
    display: block;
    padding: 12px 18px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #071225;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    mix-blend-mode: difference;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-wrap {
        padding: 0 16px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 2px;
    }
    
    .nav-link {
        padding: 10px 12px;
        font-size: 0.7rem;
    }
    
    .nav-cursor {
        height: 32px;
    }
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: 'π';
    position: absolute;
    font-size: 20rem;
    color: rgba(26, 35, 50, 0.03);
    right: -5rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -1px;
}

.hero-description {
    font-size: 1.2rem;
    color: #586069;
    max-width: 700px;
    line-height: 1.8;
}

/* ========================================
   MATERI CARDS
   ======================================== */

.materi-section {
    padding: 4rem 0;
    background-color: #ffffff;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.card-header {
    margin-bottom: 1rem;
}

.card-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #586069;
    letter-spacing: 1px;
    padding: 0.3rem 0.8rem;
    border: 1px solid #e1e4e8;
    background-color: #f8f9fa;
}

.card-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 1rem;
}

.card-description {
    font-size: 1rem;
    color: #586069;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.card-formula {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #1a2332;
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 3px solid #1a2332;
    margin-bottom: 1.5rem;
}

.card-button {
    display: inline-block;
    text-decoration: none;
    color: #1a2332;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease;
}

.card-button:hover {
    transform: translateX(5px);
}

/* ========================================
   FEATURES SECTION
   ======================================== */

.features-section {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 3rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-item {
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    padding: 2rem;
}

.feature-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #e1e4e8;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 1rem;
}

.feature-description {
    font-size: 1rem;
    color: #586069;
    line-height: 1.7;
}

/* ========================================
   ABOUT SECTION
   ======================================== */

.about-section {
    padding: 4rem 0;
    background-color: #ffffff;
}

.about-text {
    font-size: 1.1rem;
    color: #586069;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

/* ========================================
   PAGE HEADER (for content pages)
   ======================================== */

.page-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 3rem 0;
    border-bottom: 1px solid #e1e4e8;
}

.page-title {
    font-size: 2.8rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 1rem;
}

.page-intro {
    font-size: 1.1rem;
    color: #586069;
    line-height: 1.8;
    max-width: 800px;
}

.page-instruction {
    font-size: 1rem;
    color: #586069;
    line-height: 1.7;
    max-width: 800px;
    margin-top: 1rem;
}

/* ========================================
   CONTENT SECTION
   ======================================== */

.content-section {
    padding: 3rem 0;
    background-color: #ffffff;
}

.materi-block {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e1e4e8;
}

.materi-block:last-child {
    border-bottom: none;
}

.materi-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 1rem;
}

.materi-text {
    font-size: 1.05rem;
    color: #586069;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.formula-large {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    color: #1a2332;
    text-align: center;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    margin: 1.5rem 0;
}

.formula-display {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: #1a2332;
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 3px solid #1a2332;
    margin-bottom: 1.5rem;
}

.example-box {
    background-color: #f8f9fa;
    border-left: 4px solid #1a2332;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-size: 1rem;
    color: #586069;
    line-height: 1.7;
}

.steps-list {
    margin-left: 2rem;
    margin-top: 1rem;
    color: #586069;
    line-height: 1.8;
}

.steps-list li {
    margin-bottom: 0.5rem;
}

.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.two-column h4 {
    color: #1a2332;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.two-column ul,
.two-column ol {
    margin-left: 1.5rem;
    color: #586069;
    line-height: 1.8;
}

.two-column li {
    margin-bottom: 1rem;
}

.method-box {
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.method-box h4 {
    color: #1a2332;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.warning-block {
    background-color: #fff8e1;
    border: 1px solid #ffd54f;
    border-left: 4px solid #ffa000;
    padding: 2rem;
    margin-bottom: 2rem;
}

.warning-list {
    margin-left: 2rem;
    margin-top: 1rem;
    color: #586069;
    line-height: 1.8;
}

.warning-list li {
    margin-bottom: 1.5rem;
}

.insight-block {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-left: 4px solid #1976d2;
    padding: 2rem;
    margin-bottom: 2rem;
}

.reference-block {
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    padding: 2rem;
}

.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.formula-item {
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    padding: 1.5rem;
}

.formula-item h4 {
    color: #1a2332;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.formula-item p {
    font-family: 'Courier New', monospace;
    color: #586069;
    font-size: 1rem;
}

/* ========================================
   LAB SECTION
   ======================================== */

.lab-section {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

.tab-navigation {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e1e4e8;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #586069;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #1a2332;
}

.tab-button.active {
    color: #1a2332;
    border-bottom-color: #1a2332;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.lab-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    padding: 2rem;
}

.lab-controls {
    border-right: 1px solid #e1e4e8;
    padding-right: 2rem;
}

.lab-controls h3 {
    font-size: 1.3rem;
    color: #1a2332;
    margin-bottom: 1rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 0.5rem;
}

.control-group input[type="number"],
.control-group input[type="text"],
.control-group select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #e1e4e8;
    background-color: #f8f9fa;
    font-size: 1rem;
    color: #1a2332;
    transition: border-color 0.3s ease;
}

.control-group input[type="number"]:focus,
.control-group input[type="text"]:focus,
.control-group select:focus {
    outline: none;
    border-color: #1a2332;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

.update-button {
    width: 100%;
    padding: 0.9rem;
    background-color: #1a2332;
    color: #ffffff;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.update-button:hover {
    background-color: #2c3e50;
}

.solution-panel,
.info-panel {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
}

.solution-panel h4,
.info-panel h4 {
    font-size: 1.1rem;
    color: #1a2332;
    margin-bottom: 1rem;
}

.solution-panel div,
.info-panel p {
    font-size: 0.95rem;
    color: #586069;
    line-height: 1.7;
}

.lab-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    padding: 1rem;
}

.lab-canvas canvas {
    border: 1px solid #e1e4e8;
    background-color: #ffffff;
}

.inspect-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-top: 1rem;
}

.inspect-btn {
    padding: 0.7rem;
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    color: #1a2332;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inspect-btn:hover,
.inspect-btn.active {
    background-color: #1a2332;
    color: #ffffff;
    border-color: #1a2332;
}

/* Angle Control */
.angle-control {
    border: 1px solid #ddd;
    padding: 16px;
    margin-top: 20px;
    background: #fff;
    border-radius: 4px;
}

.angle-control label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.angle-input-wrap {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.angle-input-wrap input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #9c27b0;
    border-radius: 4px;
    font-size: 1rem;
    color: #1a2332;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.angle-input-wrap input[type="number"]:focus {
    outline: none;
    border-color: #7b1fa2;
}

.angle-input-wrap span {
    margin-left: 8px;
    font-weight: 600;
    color: #9c27b0;
    font-size: 1.1rem;
}

.angle-control input[type="range"] {
    width: 100%;
    accent-color: #9c27b0;
    height: 6px;
    background: #e1e4e8;
    border-radius: 3px;
    outline: none;
}

.angle-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #9c27b0;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e1e4e8;
    background-color: #ffffff;
    color: #1a2332;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.zoom-btn:hover {
    background-color: #f8f9fa;
    border-color: #1a2332;
}

.zoom-btn:active {
    transform: scale(0.95);
}

#reset-view-linear,
#reset-view-kuadrat {
    width: auto;
    padding: 0 12px;
    font-size: 0.85rem;
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e1e4e8;
    background-color: #ffffff;
    color: #1a2332;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.zoom-btn:hover {
    background-color: #f8f9fa;
    border-color: #1a2332;
}

.zoom-btn:active {
    transform: scale(0.95);
}

#reset-view-linear,
#reset-view-kuadrat {
    width: auto;
    padding: 0 12px;
    font-size: 0.85rem;
}

/* Formula Cards for Circle */
.formula-cards {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.formula-card {
    border: 1px solid #d9dee7;
    border-left: 4px solid #7c3aed;
    background: #ffffff;
    padding: 18px;
    border-radius: 4px;
}

.formula-title {
    font-size: 11px;
    letter-spacing: 3px;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 700;
}

.formula-card h3 {
    color: #7c3aed;
    font-size: 22px;
    margin-bottom: 14px;
    font-weight: 700;
}

.formula-card hr {
    border: none;
    border-top: 1px dashed #d9dee7;
    margin: 14px 0;
}

.formula-subtitle {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 1px;
}

.formula-card pre {
    font-family: 'Courier New', monospace;
    color: #334155;
    line-height: 1.7;
    white-space: pre-wrap;
    font-size: 13px;
    margin: 0;
}

/* ========================================
   MACHINE VISUAL (for composition)
   ======================================== */

.machine-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem;
    background-color: #ffffff;
}

.machine-step {
    background-color: #f8f9fa;
    border: 2px solid #e1e4e8;
    padding: 1.5rem;
    min-width: 120px;
    text-align: center;
}

.machine-label {
    font-size: 0.85rem;
    color: #586069;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.machine-value {
    font-size: 1.2rem;
    color: #1a2332;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.machine-arrow {
    font-size: 2rem;
    color: #1a2332;
    font-weight: 700;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background-color: #1a2332;
    color: #ffffff;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-brand h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.footer-tagline {
    font-size: 0.95rem;
    color: #b8bec5;
    line-height: 1.7;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
    color: #b8bec5;
    font-size: 0.95rem;
}

.footer-info {
    font-size: 0.95rem;
    color: #b8bec5;
    margin-bottom: 0.5rem;
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.social-icon svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.social-icon:hover svg {
    transform: scale(1.1);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .lab-container {
        grid-template-columns: 1fr;
    }
    
    .lab-controls {
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
        padding-right: 0;
        padding-bottom: 2rem;
    }
    
    .machine-visual {
        flex-direction: column;
    }
    
    .machine-arrow {
        transform: rotate(90deg);
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
}
