/* ============================================
   octal to hexadecimal Premium Design System
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Colors */
    --bg-primary: #0a0a12;
    --bg-secondary: #0f0f1e;
    --bg-tertiary: #141428;
    --bg-card: rgba(20, 20, 45, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    --text-primary: #e8e8f0;
    --text-secondary: #9494b8;
    --text-muted: #5e5e80;

    --accent-cyan: #00d4ff;
    --accent-purple: #7c3aed;
    --accent-violet: #a855f7;
    --accent-amber: #f59e0b;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;

    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7c3aed 50%, #a855f7 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #f43f5e 100%);
    --gradient-cool: linear-gradient(135deg, #00d4ff 0%, #10b981 100%);
    --gradient-bg: linear-gradient(180deg, #0a0a12 0%, #0f0f2e 50%, #0a0a12 100%);

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(0, 212, 255, 0.2);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow-cyan: 0 0 40px rgba(0, 212, 255, 0.15);
    --shadow-glow-purple: 0 0 40px rgba(124, 58, 237, 0.15);

    /* Typography */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --section-padding: 120px;
    --container-max: 1200px;

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Particle Canvas ---------- */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ---------- Container ---------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Navigation ---------- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition-base);
    backdrop-filter: blur(0px);
}

#navbar.scrolled {
    padding: 10px 0;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.18rem;
    font-weight: 700;
}

.logo-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.24);
}

.logo-icon::before,
.logo-icon::after {
    position: absolute;
    font-family: var(--font-mono);
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.logo-icon::before {
    content: '8';
    top: 8px;
    left: 9px;
    font-size: 0.9rem;
}

.logo-icon::after {
    content: '16';
    right: 7px;
    bottom: 8px;
    font-size: 0.78rem;
}

.logo-slash {
    width: 2px;
    height: 28px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.72);
    transform: rotate(32deg);
}

.logo-text {
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.logo-accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-domain {
    color: var(--text-secondary);
    font-weight: 700;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: var(--transition-base);
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-base);
}

/* ---------- Section Common ---------- */
.section {
    position: relative;
    z-index: 1;
    padding: var(--section-padding) 0;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 6px 20px;
    border-radius: 100px;
    margin-bottom: 20px;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Glass Card ---------- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    transition: var(--transition-base);
}

.glass-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow-cyan);
}

/* ---------- Hero Section ---------- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 120px 24px 80px;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 20%, rgba(124, 58, 237, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 30% 80%, rgba(0, 212, 255, 0.06) 0%, transparent 50%);
    z-index: -1;
}

.hero-content {
    text-align: center;
    max-width: 780px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.12);
    padding: 8px 20px;
    border-radius: 100px;
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease forwards;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-cyan);
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0, 212, 255, 0); }
}

.hero-title {
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 24px;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-title .gradient-text {
    font-size: 0.8em;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 64px;
    animation: fadeInUp 0.8s ease 0.3s both;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 24px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-glass {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(8px);
}

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

/* ---------- Hero Stats ---------- */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-subtle);
}

/* ---------- Floating Shapes ---------- */
.hero-visual {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
}

.floating-shape {
    position: absolute;
    opacity: 0.08;
    color: var(--accent-cyan);
    animation: float 20s ease infinite;
}

.floating-shape svg {
    width: 100%;
    height: 100%;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
    color: var(--accent-cyan);
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 20%;
    right: 8%;
    animation-delay: -5s;
    color: var(--accent-purple);
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: 15%;
    right: 15%;
    animation-delay: -10s;
    color: var(--accent-amber);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(5deg); }
    50% { transform: translate(-10px, 20px) rotate(-3deg); }
    75% { transform: translate(15px, 10px) rotate(4deg); }
}

/* ---------- Converter Section ---------- */
.converter-section {
    background: var(--bg-secondary);
    position: relative;
}

.converter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
    opacity: 0.3;
}

.converter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.6;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: start;
}

/* Input/Output Sides */
.input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.base-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 100px;
}

.octal-badge {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.hex-badge {
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.input-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
}

.converter-field {
    width: 100%;
    padding: 20px 24px;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-base);
    letter-spacing: 4px;
}

.converter-field:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), var(--shadow-glow-cyan);
}

.converter-field::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.input-glow {
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

.converter-field:focus ~ .input-glow {
    transform: translateX(-50%) scaleX(1);
}

.input-hint {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: var(--transition-base);
}

.input-hint.error {
    color: var(--accent-rose);
}

.input-hint.success {
    color: var(--accent-emerald);
}

/* Quick Examples */
.quick-examples {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.quick-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.example-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition-base);
}

.example-btn:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.06);
}

/* Converter Flow Arrow */
.converter-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 50px;
}

.flow-line {
    width: 2px;
    height: 30px;
    background: var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.flow-pulse {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--accent-cyan), transparent);
    animation: flowPulse 2s ease infinite;
}

@keyframes flowPulse {
    0% { top: -100%; }
    100% { top: 200%; }
}

.flow-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    animation: flowGlow 3s ease infinite;
}

@keyframes flowGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); }
    50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.4); }
}

/* Output */
.output-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.converter-output {
    width: 100%;
    padding: 20px 24px;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-md);
    letter-spacing: 4px;
    min-height: 68px;
    transition: var(--transition-base);
}

.copy-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.3);
}

.copy-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--accent-emerald);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: var(--transition-spring);
    pointer-events: none;
}

.copy-btn.copied .copy-tooltip {
    transform: translateX(-50%) scale(1);
}

.decimal-preview {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Binary Intermediate */
.binary-intermediate {
    margin-top: 32px;
    padding: 20px 24px;
    background: rgba(124, 58, 237, 0.04);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: var(--radius-md);
    text-align: center;
}

.binary-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--accent-violet);
    font-weight: 500;
    margin-bottom: 8px;
}

.binary-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-violet);
    letter-spacing: 3px;
    word-break: break-all;
}

/* Calculator-Synced Diagram */
.calculator-diagram {
    margin-top: 28px;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(16, 185, 129, 0.05)),
        rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(0, 212, 255, 0.14);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.calculator-diagram-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.calculator-diagram-head h3 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.calculator-diagram-head p,
.calculator-diagram-note {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.calculator-diagram-result {
    flex: 0 0 auto;
    max-width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-emerald);
    font-family: var(--font-mono);
    font-weight: 700;
    word-break: break-word;
}

.calculator-diagram-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.calculator-diagram-stage {
    min-height: 150px;
    padding: 18px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.18);
    position: relative;
}

.calculator-diagram-stage::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -13px;
    width: 12px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
}

.calculator-diagram-stage:last-child::after {
    display: none;
}

.calculator-diagram-stage.result {
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.055);
}

.calc-stage-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.calc-stage-label span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: rgba(0, 212, 255, 0.09);
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
}

.calc-stage-label strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.calc-chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.calculator-diagram-note {
    margin-top: 18px;
}

/* ---------- How It Works ---------- */
.how-section {
    position: relative;
}

.process-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.process-step {
    position: relative;
    width: 100%;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.process-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.step-number {
    font-size: 4rem;
    font-weight: 900;
    color: var(--bg-tertiary);
    position: absolute;
    top: -20px;
    left: -30px;
    z-index: 0;
    font-family: var(--font-mono);
    line-height: 1;
    opacity: 0.4;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-card {
    padding: 36px;
    position: relative;
    z-index: 1;
}

.step-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.7;
}

.step-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.octal-icon { color: var(--accent-cyan); background: rgba(0, 212, 255, 0.06); }
.binary-icon { color: var(--accent-violet); background: rgba(168, 85, 247, 0.06); }
.regroup-icon { color: var(--accent-amber); background: rgba(245, 158, 11, 0.06); }
.hex-icon { color: var(--accent-emerald); background: rgba(16, 185, 129, 0.06); }

.step-example {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.step-example code {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--accent-cyan);
    letter-spacing: 3px;
}

.step-example .result-code {
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.06);
}

.arrow-small {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Process Connector */
.process-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 4px 0;
}

.connector-line {
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, var(--border-subtle), rgba(0, 212, 255, 0.3));
}

.connector-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gradient-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* ---------- Interactive Diagram ---------- */
.diagram-section {
    background: var(--bg-secondary);
    position: relative;
}

.diagram-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), var(--accent-amber), transparent);
    opacity: 0.3;
}

.diagram-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.diagram-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
    justify-content: center;
}

.diagram-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.diagram-input-group {
    display: flex;
    gap: 8px;
}

.diagram-field {
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    outline: none;
    width: 160px;
    letter-spacing: 3px;
    transition: var(--transition-base);
}

.diagram-field:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.diagram-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.2);
}

.diagram-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 212, 255, 0.3);
}

.diagram-btn:active {
    transform: translateY(0);
}

/* Diagram Flow */
.diagram-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.diagram-stage {
    width: 100%;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.diagram-stage.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.stage-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stage-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.digit-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 60px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.digit-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 52px;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 1px solid;
    padding: 0 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.digit-box.show {
    opacity: 1;
    transform: scale(1);
}

.digit-box.octal {
    color: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.25);
    background: rgba(0, 212, 255, 0.06);
}

.digit-box.binary {
    color: var(--accent-violet);
    border-color: rgba(168, 85, 247, 0.25);
    background: rgba(168, 85, 247, 0.06);
    font-size: 1rem;
    letter-spacing: 2px;
}

.digit-box.nibble {
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
    font-size: 1rem;
    letter-spacing: 2px;
}

.digit-box.hex {
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.06);
    font-size: 1.5rem;
}

/* Diagram Arrows */
.diagram-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.diagram-arrow.active {
    opacity: 1;
}

.arrow-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Diagram Result */
.diagram-result {
    margin-top: 24px;
    padding: 24px 40px;
    background: rgba(16, 185, 129, 0.06);
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.diagram-result.active {
    opacity: 1;
    transform: scale(1);
}

.result-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.result-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-emerald);
    letter-spacing: 6px;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* ---------- Reference Section ---------- */
.reference-section {
    position: relative;
}

.reference-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.ref-table-card {
    padding: 32px;
    overflow: hidden;
}

.ref-table-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
}

.ref-table th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.ref-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.ref-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.ref-table code {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-violet);
    letter-spacing: 3px;
    font-size: 0.9rem;
}

.octal-chip, .hex-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
}

.octal-chip {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.hex-chip {
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ---------- Article Guide ---------- */
.article-section {
    background: var(--bg-secondary);
    position: relative;
}

.article-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-emerald), transparent);
    opacity: 0.3;
}

.article-container {
    max-width: 1120px;
}

.article-intro {
    max-width: 820px;
    margin: 0 auto 56px;
    text-align: center;
}

.article-intro p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-top: 16px;
}

.article-intro .article-lead {
    color: var(--text-primary);
    font-size: 1.2rem;
}

.base-visual-strip {
    display: grid;
    grid-template-columns: 1fr auto 1.35fr auto 1fr;
    gap: 14px;
    align-items: stretch;
    margin-top: 32px;
}

.base-visual-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 132px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.base-visual-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.12;
}

.base-visual-card.octal::before {
    background: var(--gradient-cool);
}

.base-visual-card.binary::before {
    background: var(--gradient-primary);
}

.base-visual-card.hex::before {
    background: var(--gradient-warm);
}

.base-visual-card > * {
    position: relative;
}

.base-visual-number {
    font-family: var(--font-mono);
    font-size: 2.7rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.base-visual-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    margin: 10px 0 4px;
}

.base-visual-card strong {
    color: var(--accent-cyan);
    font-size: 0.92rem;
}

.base-visual-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    font-size: 1.6rem;
    font-weight: 700;
}

.article-outline-panel {
    margin-top: 28px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: left;
}

.outline-panel-head,
.visual-lab-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.outline-panel-head strong,
.visual-lab-header h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    line-height: 1.3;
}

.visual-kicker {
    display: block;
    color: var(--accent-cyan);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    margin-bottom: 5px;
}

.outline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.outline-grid a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.outline-grid a:hover {
    color: var(--text-primary);
    border-color: rgba(0, 212, 255, 0.22);
    background: rgba(0, 212, 255, 0.06);
}

.outline-grid span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 800;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.16);
    border-radius: var(--radius-sm);
}

.article-intro code,
.article-body code {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.07);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
}

.article-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.article-toc {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.article-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.article-toc a:hover {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.06);
}

.article-body {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    min-width: 0;
}

.article-body h2 {
    color: var(--text-primary);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
    margin: 72px 0 20px;
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    color: var(--text-primary);
    font-size: 1.35rem;
    line-height: 1.25;
    margin: 42px 0 14px;
}

.article-body h4 {
    color: var(--accent-cyan);
    font-size: 1rem;
    line-height: 1.35;
    margin: 30px 0 12px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body pre,
.article-table-wrap {
    margin-bottom: 18px;
}

.article-body ul,
.article-body ol {
    padding-left: 22px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body strong {
    color: var(--text-primary);
}

.article-body pre {
    overflow-x: auto;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.article-body pre code {
    display: block;
    padding: 0;
    color: var(--accent-violet);
    background: transparent;
    border: 0;
    line-height: 1.7;
    white-space: pre;
}

.article-example {
    padding: 24px;
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: var(--radius-md);
    margin: 28px 0 40px;
}

.article-example h3 {
    margin-top: 0;
}

.concept-diagram,
.base-compare,
.use-case-explorer {
    margin: 32px 0 42px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.concept-controls,
.base-tabs,
.use-case-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.concept-btn,
.base-tab,
.use-case-btn {
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.86rem;
    font-weight: 800;
    padding: 9px 13px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
}

.concept-btn:hover,
.concept-btn.active,
.base-tab:hover,
.base-tab.active,
.use-case-btn:hover,
.use-case-btn.active {
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(0, 212, 255, 0.16);
}

.concept-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.concept-node {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 132px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.concept-node.active {
    border-color: rgba(0, 212, 255, 0.28);
    box-shadow: var(--shadow-glow-cyan);
    transform: translateY(-2px);
}

.concept-node span,
.concept-node small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.concept-node strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: clamp(1.15rem, 2.4vw, 1.55rem);
    line-height: 1.35;
    margin: 8px 0;
    word-break: break-word;
}

.concept-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    color: var(--accent-cyan);
    font-size: 0.76rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.concept-note {
    color: var(--text-secondary);
    margin: 18px 0 0;
}

.base-compare-panel,
.use-case-display {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
    gap: 24px;
    align-items: center;
}

.base-compare-panel h3,
.use-case-display h3 {
    margin-top: 0;
}

.digit-tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.digit-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-weight: 800;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.16);
    border-radius: var(--radius-sm);
    animation: chipIn 0.25s ease forwards;
}

.base-meter {
    height: 8px;
    overflow: hidden;
    margin-top: 22px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
}

.base-meter-fill {
    display: block;
    width: 50%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: inherit;
    transition: width 0.4s ease;
}

.use-case-display {
    grid-template-columns: 112px minmax(0, 1fr);
}

.use-case-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 900;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 30px rgba(0, 212, 255, 0.18);
}

.use-case-display code {
    display: inline-block;
    margin-top: 8px;
}

.article-visual-lab {
    margin: 38px 0 46px;
    padding: 28px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.06), rgba(16, 185, 129, 0.04));
    border: 1px solid rgba(0, 212, 255, 0.14);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.visual-result-pill {
    flex: 0 0 auto;
    color: var(--accent-emerald);
    font-family: var(--font-mono);
    font-size: 0.98rem;
    font-weight: 800;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: var(--radius-sm);
}

.visual-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.visual-sample,
.visual-send-btn {
    font-family: var(--font-primary);
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
}

.visual-sample {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.22);
    padding: 9px 14px;
}

.visual-sample:hover,
.visual-sample.active {
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(0, 212, 255, 0.18);
}

.visual-conversion-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.visual-panel {
    min-height: 132px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.visual-panel-result {
    border-color: rgba(16, 185, 129, 0.18);
    background: rgba(16, 185, 129, 0.04);
}

.visual-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.visual-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    background: var(--gradient-primary);
    border-radius: 50%;
}

.visual-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.visual-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 42px;
    padding: 8px 11px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(4px);
    opacity: 0;
    animation: chipIn 0.32s ease forwards;
}

.visual-chip.octal {
    color: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.06);
}

.visual-chip.binary {
    color: var(--accent-violet);
    border-color: rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.06);
}

.visual-chip.nibble {
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.07);
}

.visual-chip.hex {
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.07);
}

.visual-chip.empty {
    min-width: 96px;
    color: var(--text-muted);
    border-style: dashed;
    background: rgba(255, 255, 255, 0.025);
}

.visual-lab-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
}

.visual-lab-footer p {
    margin: 0;
    color: var(--text-secondary);
}

.visual-sync-pill {
    flex: 0 0 auto;
    color: var(--accent-cyan);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 212, 255, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(0, 212, 255, 0.07);
}

.visual-send-btn {
    color: #fff;
    background: var(--gradient-cool);
    padding: 10px 16px;
}

.visual-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.18);
}

.faq-card {
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-card[open] {
    border-color: rgba(0, 212, 255, 0.18);
}

.faq-card summary {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.faq-card summary::-webkit-details-marker {
    display: none;
}

.faq-card summary::after {
    content: '+';
    float: right;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.faq-card[open] summary::after {
    content: '-';
}

.faq-answer {
    padding: 0 20px 18px;
}

.faq-answer > :last-child {
    margin-bottom: 0;
}

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

.article-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.article-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.18);
}

.article-table th,
.article-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.article-table th {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.article-table td {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.92rem;
}

.article-table tr:last-child td {
    border-bottom: 0;
}

/* ---------- Information Pages ---------- */
.info-main {
    min-height: 100vh;
}

.info-page .nav-links {
    gap: 4px;
}

.info-hero {
    position: relative;
    padding: 150px 0 70px;
}

.info-hero .hero-title {
    max-width: 820px;
    margin: 18px 0 16px;
    font-size: clamp(2.3rem, 6vw, 4.8rem);
}

.info-hero .hero-subtitle {
    max-width: 760px;
    margin: 0;
}

.info-body {
    max-width: 880px;
}

.info-body h2:first-child {
    margin-top: 0;
}

/* ---------- Footer ---------- */
.footer {
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    padding: 48px 0 24px;
}

.footer-content {
    text-align: center;
    margin-bottom: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-base);
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

.footer-language-links {
    max-width: 760px;
    margin: 24px auto 0;
    padding-top: 22px;
    border-top: 1px solid var(--border-subtle);
}

.footer-language-title {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-bottom: 12px;
}

.language-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.language-links a {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.language-links a:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.22);
    background: rgba(0, 212, 255, 0.06);
}

.language-links a.active,
.language-links a[aria-current="page"] {
    color: #fff;
    border-color: transparent;
    background: var(--gradient-primary);
}

.footer-tool-links {
    max-width: 920px;
    margin: 24px auto 0;
    padding-top: 22px;
    border-top: 1px solid var(--border-subtle);
}

.tool-page-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.tool-page-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.tool-page-links a:hover,
.tool-page-links a.active,
.tool-page-links a[aria-current="page"] {
    color: #fff;
    border-color: transparent;
    background: var(--gradient-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    :root {
        --section-padding: 80px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 18, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .nav-links.open {
        display: flex;
    }

    .mobile-toggle {
        display: flex;
    }

    .hero-title {
        letter-spacing: -1px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .converter-card {
        padding: 24px;
    }

    .converter-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .converter-flow {
        flex-direction: row;
        padding: 0;
        justify-content: center;
    }

    .flow-line {
        width: 30px;
        height: 2px;
    }

    .converter-field, .converter-output {
        font-size: 1.3rem;
        padding: 16px 20px;
    }

    .calculator-diagram {
        padding: 20px;
    }

    .calculator-diagram-head {
        flex-direction: column;
        align-items: stretch;
    }

    .calculator-diagram-result {
        width: fit-content;
    }

    .calculator-diagram-grid {
        grid-template-columns: 1fr;
    }

    .calculator-diagram-stage::after {
        top: auto;
        right: 50%;
        bottom: -13px;
        width: 2px;
        height: 12px;
    }

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

    .base-visual-strip {
        grid-template-columns: 1fr;
    }

    .base-visual-arrow {
        min-height: 22px;
        transform: rotate(90deg);
    }

    .outline-grid,
    .visual-conversion-grid,
    .concept-flow,
    .base-compare-panel,
    .use-case-display {
        grid-template-columns: 1fr;
    }

    .concept-link {
        min-height: 24px;
        min-width: 0;
    }

    .digit-tiles {
        justify-content: flex-start;
    }

    .use-case-display {
        gap: 18px;
    }

    .outline-panel-head,
    .visual-lab-header,
    .visual-lab-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .visual-result-pill {
        width: fit-content;
    }

    .article-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .article-toc {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
        scrollbar-width: thin;
    }

    .article-toc a {
        white-space: nowrap;
    }

    .article-body h2 {
        margin-top: 56px;
    }

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

    .process-flow {
        padding: 0 8px;
    }

    .step-number {
        font-size: 2.5rem;
        left: -8px;
    }
}

@media (max-width: 480px) {
    .logo {
        gap: 8px;
        font-size: 0.98rem;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .logo-icon::before {
        top: 7px;
        left: 8px;
        font-size: 0.82rem;
    }

    .logo-icon::after {
        right: 6px;
        bottom: 7px;
        font-size: 0.72rem;
    }

    .logo-slash {
        height: 24px;
    }

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

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

    .diagram-input-group {
        flex-direction: column;
        width: 100%;
    }

    .diagram-field {
        width: 100%;
    }

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

    .article-intro {
        text-align: left;
    }

    .article-intro .article-lead {
        font-size: 1.05rem;
    }

    .article-example {
        padding: 18px;
    }

    .article-outline-panel,
    .article-visual-lab,
    .concept-diagram,
    .base-compare,
    .use-case-explorer {
        padding: 18px;
    }

    .base-visual-card {
        min-height: 112px;
    }

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

    .visual-sample,
    .concept-btn,
    .base-tab,
    .use-case-btn,
    .visual-send-btn {
        width: 100%;
    }

    .tool-page-links {
        grid-template-columns: 1fr;
    }
}
