/* ======================================================
   Apple Glassmorphic Theme + Ambient Gradient Animation
   Blue (Light) × Emerald (Dark)
   ====================================================== */

/* --- Dark Mode --- */
:root {
    --bg: #0d1117;
    --surface: rgba(20, 25, 34, 0.75);
    --text: #e9f3eb;
    --muted: #a0aba3;
    --border: rgba(255, 255, 255, 0.08);
    --accent: #10b981;
    --glow: rgba(16, 185, 129, 0.25);
    --ease: cubic-bezier(.25, 1, .5, 1);
}

/* --- Light Mode --- */
body.light {
    --bg: #f9fafb;
    --surface: rgba(255, 255, 255, 0.75);
    --text: #0f172a;
    --muted: #475569;
    --border: rgba(15, 23, 42, 0.1);
    --accent: #0ea5e9;
    --glow: rgba(14, 165, 233, 0.25);
}

/* Ambient Animated Background */
.ambient-bg {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, var(--accent) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--accent) 70%, #ffffff) 0%, transparent 70%);
    filter: blur(120px) saturate(120%);
    animation: ambientMove 12s ease-in-out infinite alternate;
    z-index: -2;
}
@keyframes ambientMove {
    0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    50% { transform: translate(-40px, 40px) scale(1.1); opacity: 0.8; }
    100% { transform: translate(40px, -40px) scale(1); opacity: 0.7; }
}

/* Base Styling */
body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background 0.6s var(--ease), color 0.4s var(--ease);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-title {
    text-align: center;
    font-weight: 800;
    font-size: clamp(24px, 2vw + 10px, 36px);
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--text)));
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
}

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(12px) saturate(150%);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}
.nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; }
.brand { font-weight: 800; color: var(--text); text-decoration: none; transition: color .4s var(--ease); }
.brand:hover { color: var(--accent); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transition: all .4s var(--ease);
    backdrop-filter: blur(10px);
    text-decoration: none;
}
.btn:hover {
    transform: translateY(-3px);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 40px var(--glow);
}
.btn-primary { background: var(--accent); color: #fff; border: none; }
.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 16px 50px var(--glow);
}
.btn-toggle { width: 36px; height: 36px; border-radius: 10px; }

/* Hero */
.hero {
    text-align: center;
    padding: 100px 0 80px;
    backdrop-filter: blur(8px);
}
.hero-content { max-width: 720px; margin: 0 auto; }
.hero h1 {
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 900;
    margin-bottom: 16px;
}
.hero p { color: var(--muted); margin-bottom: 24px; }
.cta-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    transition: all .4s var(--ease);
    backdrop-filter: blur(10px);
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 45px var(--glow);
    background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--accent) 10%, var(--surface)));
}
.card h3 { color: var(--accent); margin-top: 0; }

/* Architecture Cards */
.arch { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.arch-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    transition: all .45s var(--ease);
}
.arch-card:hover {
    transform: translateY(-6px);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 14px 40px var(--glow);
}

/* Code */
.code-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    overflow: auto;
}
pre { margin: 0; font-family: monospace; color: var(--text); }

/* Footer */
.site-footer {
    padding: 48px 0 32px;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

/* Grid Utility */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }
.clean { margin: 0; padding-left: 18px; }
.clean li { margin: .3rem 0; }

/* ===========================
   Back Button Styling
   =========================== */

.center-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -40px; /* lift it slightly above footer */
}

.btn-back {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transition: all 0.45s var(--ease);
    backdrop-filter: blur(10px);
}

.btn-back:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #fff));
    color: #fff;
    box-shadow: 0 16px 45px var(--glow);
}
