/* ===================================
   RESET & BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --dark: #0f172a;
    --dark-lighter: #1e293b;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --gray-lighter: #f1f5f9;
    --white: #ffffff;
    --bg-light: #f8fafc;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    color: var(--dark);
    line-height: 1.6;
    background: var(--white);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

/* ===================================
   NAVIGATION
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    padding: var(--spacing-sm) 0;
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--dark);
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    cursor: pointer;
}

.nav-brand:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.brand-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 3px;
    background: var(--dark);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===================================
   BUTTONS
   =================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px -5px rgba(255, 255, 255, 0.3);
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

.btn-github {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #24292e;
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-github:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 20px -5px rgba(36, 41, 46, 0.6);
}

.btn-github svg {
    transition: transform 0.3s;
}

.btn-github:hover svg {
    transform: rotate(360deg);
}

/* ===================================
   HERO SECTION
   =================================== */
.hero {
    padding: calc(var(--spacing-xl) + 60px) 0 var(--spacing-xl);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===================================
   SECTIONS
   =================================== */
.section {
    padding: var(--spacing-xl) 0;
    width: 100%;
    overflow-x: hidden;
}

.section-dark {
    background: var(--dark);
    color: var(--white);
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.section-intro {
    text-align: center;
    font-size: 1.25rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
}

.section-dark .section-intro {
    color: var(--gray-light);
}

/* ===================================
   GRID & CARDS
   =================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    width: 100%;
}

.card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    color: var(--dark);
}

.card p {
    color: var(--gray);
    line-height: 1.6;
}

/* ===================================
   SIGNAL CHAIN
   =================================== */
.signal-chain {
    background: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-lg);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.signal-chain h3 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: var(--spacing-lg);
}

.chain-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.chain-step {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    min-width: 150px;
    text-align: center;
    max-width: 100%;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    line-height: 40px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.step-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--dark);
}

.step-content p {
    font-size: 0.875rem;
    color: var(--gray);
}

.chain-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

/* ===================================
   VIDEO CONTAINER
   =================================== */
.video-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===================================
   ARCHITECTURE
   =================================== */
.architecture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.arch-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.arch-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

.spec-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.spec-label {
    font-weight: 600;
    color: var(--gray);
}

.spec-value {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--dark);
}

.memory-map {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.memory-region {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    color: var(--white);
}

.memory-region.flash {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.memory-region.sram {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.memory-region.eeprom {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.region-label {
    font-weight: 600;
}

.region-addr {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.code-structure {
    background: var(--dark);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-md);
}

.code-structure h3 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
}

.code-structure pre {
    margin: 0;
}

.code-structure code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--gray-light);
    line-height: 1.8;
}

/* ===================================
   SETUP STEPS
   =================================== */
.setup-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.setup-step {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.setup-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.setup-content {
    flex: 1;
}

.setup-content h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
    color: var(--white);
}

.setup-content p {
    color: var(--gray-light);
    margin-bottom: var(--spacing-sm);
}

.code-block {
    position: relative;
    background: rgba(15, 23, 42, 0.7);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block pre {
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--gray-lighter);
    line-height: 1.8;
}

.copy-btn {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.warning-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    color: var(--white);
}

.warning-box h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.warning-box ul {
    margin-left: var(--spacing-md);
}

.warning-box li {
    margin-bottom: var(--spacing-xs);
}

/* ===================================
   WORKFLOW
   =================================== */
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.workflow-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.workflow-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

.command-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.command-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.command-item code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
}

.command-item span {
    font-size: 0.875rem;
    color: var(--gray);
}

.convention-list {
    list-style: none;
}

.convention-list li {
    padding-left: 1.5rem;
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.convention-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.workflow-card .code-block {
    background: var(--dark);
    margin-top: var(--spacing-sm);
}

/* ===================================
   HARDWARE SECTION
   =================================== */
.hardware-intro {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
    margin-bottom: var(--spacing-lg);
}

.hardware-intro p {
    font-size: 1.125rem;
    color: var(--gray);
    line-height: 1.8;
    margin: 0;
}

.hardware-section {
    margin-bottom: var(--spacing-xl);
}

.hardware-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Specifications Table */
.specs-table {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--white);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
    transition: all 0.2s;
}

.spec-row:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.spec-key {
    font-weight: 600;
    color: var(--gray);
    min-width: 150px;
}

.spec-val {
    text-align: right;
    color: var(--dark);
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

/* Memory Details */
.memory-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.memory-item {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-top: 3px solid var(--primary);
}

.memory-item h4 {
    color: var(--dark);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.memory-item p {
    color: var(--gray);
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
}

.memory-spec {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.ms-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.ms-row span {
    color: var(--gray);
}

.ms-row strong {
    color: var(--primary);
    font-family: var(--font-mono);
}

.ms-row code {
    font-family: var(--font-mono);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    color: #6366f1;
    font-size: 0.85rem;
}

/* I/O Grid */
.io-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.io-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--secondary);
}

.io-card h4 {
    color: var(--dark);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.io-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.io-list li {
    color: var(--gray);
    font-size: 0.95rem;
    padding-left: 1rem;
    position: relative;
}

.io-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

.io-list strong {
    color: var(--dark);
}

.io-list code {
    font-family: var(--font-mono);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: #6366f1;
    font-size: 0.85rem;
}

/* Clock Grid */
.clock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.clock-item {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.clock-item h4 {
    color: var(--dark);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.clock-item p {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.clock-table {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.clock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.clock-row span {
    color: var(--gray);
    font-size: 0.9rem;
}

.clock-row strong {
    color: var(--primary);
    font-family: var(--font-mono);
}

/* Communication Table */
.comm-table {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
}

.comm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--white);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary);
}

.comm-protocol {
    font-weight: 600;
    color: var(--dark);
    min-width: 160px;
}

.comm-spec {
    color: var(--gray);
    font-size: 0.95rem;
    text-align: right;
}

/* Power Grid */
.power-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.power-card {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-top: 3px solid #f5576c;
}

.power-card h4 {
    color: var(--dark);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
}

.voltage-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.voltage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.voltage-label {
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.voltage-value {
    color: var(--dark);
    font-family: var(--font-mono);
    font-weight: 600;
}

.power-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.power-list li {
    color: var(--gray);
    font-size: 0.95rem;
    padding-left: 1.5rem;
    position: relative;
}

.power-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* Debug Items */
.debug-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.debug-item {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 4px solid #4facfe;
}

.debug-item h4 {
    color: var(--dark);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.debug-item p {
    color: var(--gray);
    font-size: 0.95rem;
    margin: 0;
}

.debug-item code {
    font-family: var(--font-mono);
    background: rgba(79, 172, 254, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: #4facfe;
    font-size: 0.85rem;
}

/* Firmware Layout */
.firmware-layout {
    background: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
}

.firmware-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--white);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    border-left: 4px solid var(--primary);
}

.fw-addr {
    flex-shrink: 0;
    width: 120px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: #6366f1;
    font-size: 0.9rem;
}

.fw-info {
    flex: 1;
}

.fw-info h4 {
    color: var(--dark);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.fw-info p {
    color: var(--gray);
    font-size: 0.9rem;
    margin: 0;
}

/* Performance Section */
.performance-section {
    margin-top: var(--spacing-xl);
}

.perf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
}

.perf-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s, box-shadow 0.3s;
}

.perf-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.perf-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.perf-label {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    opacity: 0.95;
}

.perf-detail {
    font-size: 0.875rem;
    opacity: 0.85;
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    background: var(--dark);
    color: var(--gray-light);
    padding: var(--spacing-lg) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-section a {
    color: var(--gray-light);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--dark-lighter);
    font-size: 0.875rem;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 968px) {
    .workflow-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

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

    .memory-details {
        grid-template-columns: 1fr;
    }

    .io-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

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

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

    .debug-items {
        grid-template-columns: 1fr;
    }

    .perf-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .spec-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .spec-val {
        text-align: left;
    }

    .comm-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .comm-spec {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: var(--spacing-lg) var(--spacing-md);
        transition: left 0.3s ease;
        box-shadow: var(--shadow-xl);
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links a {
        width: 100%;
        padding: var(--spacing-sm) 0;
        font-size: 1.125rem;
        border-bottom: 1px solid var(--gray-lighter);
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-links .btn-github {
        width: 100%;
        justify-content: center;
        margin-top: var(--spacing-sm);
        border-bottom: none;
        min-height: 48px;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
        z-index: 1000;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .hero {
        padding: calc(var(--spacing-lg) + 70px) 0 var(--spacing-lg);
        width: 100%;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
        padding: 0 0.5rem;
    }

    .hero-stats {
        gap: var(--spacing-sm);
        flex-direction: column;
        width: 100%;
    }

    .stat {
        width: 100%;
        max-width: 100%;
        padding: var(--spacing-sm);
        background: rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
    }

    .grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        width: 100%;
    }

    .card {
        padding: 1.25rem;
        width: 100%;
        max-width: 100%;
    }

    .chain-steps {
        flex-direction: column;
        width: 100%;
    }

    .chain-arrow {
        transform: rotate(90deg);
    }

    .chain-step {
        width: 100%;
        min-width: unset;
        max-width: 100%;
    }

    .signal-chain {
        padding: 1rem;
        margin-left: 0;
        margin-right: 0;
    }

    .architecture-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .arch-card {
        width: 100%;
        max-width: 100%;
        padding: var(--spacing-md);
    }

    .memory-details {
        grid-template-columns: 1fr;
    }

    .memory-item {
        width: 100%;
    }

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

    .io-card {
        width: 100%;
    }

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

    .clock-item {
        width: 100%;
    }

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

    .power-card {
        width: 100%;
    }

    .debug-items {
        grid-template-columns: 1fr;
    }

    .debug-item {
        width: 100%;
    }

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

    .perf-card {
        width: 100%;
    }

    .spec-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .spec-val {
        text-align: left;
    }

    .comm-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .comm-spec {
        text-align: left;
    }

    .firmware-item {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .fw-addr {
        width: auto;
    }

    .workflow-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .workflow-card {
        width: 100%;
        max-width: 100%;
    }

    .setup-step {
        flex-direction: column;
        gap: var(--spacing-sm);
        width: 100%;
    }

    .setup-number {
        align-self: flex-start;
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .code-block {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .code-block pre {
        font-size: 0.75rem;
        white-space: pre;
    }

    .code-block code {
        font-size: 0.8125rem;
    }

    .copy-btn {
        padding: 0.625rem 1.125rem;
        font-size: 0.875rem;
        min-height: 44px;
    }

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

    .section {
        padding: var(--spacing-lg) 0;
    }

    .section-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .section-intro {
        font-size: 1.125rem;
        line-height: 1.6;
    }

    .card {
        padding: 1.25rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-large {
        min-height: 48px;
        padding: 0.75rem 1.5rem;
    }

    .video-container {
        margin: 0;
        border-radius: var(--radius-md);
        width: 100%;
        max-width: 100%;
    }

    .hardware-section-title {
        font-size: 1.5rem;
    }

    .hardware-intro {
        padding: 1.5rem;
    }

    .hardware-intro p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }

    .hero {
        padding: calc(var(--spacing-md) + 70px) 0 var(--spacing-md);
        width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
    }

    .btn-large {
        width: 100%;
        justify-content: center;
        min-height: 52px;
        font-size: 1rem;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .brand-icon {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .card-icon {
        font-size: 2rem;
    }

    .card h3 {
        font-size: 1.125rem;
    }

    .card p {
        font-size: 0.9375rem;
        line-height: 1.6;
    }

    .step-number {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 0.875rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .section-intro {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    .code-block {
        margin: 0;
        border-radius: var(--radius-sm);
        padding: 1rem 0.75rem;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    .code-block pre {
        font-size: 0.6875rem;
        overflow-x: auto;
    }

    .copy-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .signal-chain {
        padding: 1rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }

    .chain-step {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .setup-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .setup-content h3 {
        font-size: 1.25rem;
    }

    .arch-card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .arch-card h3 {
        font-size: 1.25rem;
    }

    .workflow-card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }

    .footer-section ul li {
        margin-bottom: 0.75rem;
    }

    .footer-section a {
        display: inline-block;
        padding: 0.25rem 0;
        min-height: 32px;
        line-height: 32px;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.setup-step,
.workflow-card {
    animation: fadeInUp 0.6s ease-out;
}
