/* ==========================================================================
   CSS Стилі для навчального сайту: Система контролю версій Git
   ========================================================================== */

:root {
    /* Колірна палітра: Git Dark (за замовчуванням) */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: rgba(22, 27, 34, 0.85);
    --bg-card-hover: rgba(33, 38, 45, 0.95);
    
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --border-color: #30363d;
    --border-hover: #484f58;
    
    --git-orange: #f05032;
    --git-orange-light: #ff7b54;
    --git-orange-glow: rgba(240, 80, 50, 0.25);
    
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-purple: #bc8cff;
    --accent-gold: #d4af37;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-code: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
    --font-cert: 'Playfair Display', Georgia, serif;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Світла тема */
body.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: #ffffff;
    
    --text-primary: #1f2328;
    --text-secondary: #57606a;
    --text-muted: #8c959f;
    
    --border-color: #d0d7de;
    --border-hover: #afb8c1;
    
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
}

/* Базові стилі скидання */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Контейнери та сітки */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Заголовки секцій */
.section {
    padding: 5rem 0;
    position: relative;
}

.section.bg-alt {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 3.5rem;
}

.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--git-orange);
    background: var(--git-orange-glow);
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.85rem;
    border: 1px solid rgba(240, 80, 50, 0.3);
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--git-orange), #d43d22);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--git-orange-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--git-orange-light), var(--git-orange));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 80, 50, 0.4);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
}

/* ==========================================================================
   Header & Навігація
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

body.theme-light .site-header {
    background: rgba(255, 255, 255, 0.85);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
}

.brand-logo .accent-dot {
    color: var(--git-orange);
}

.main-nav .nav-list {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.4rem 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--git-orange);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.mobile-toggle span {
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    padding: 5.5rem 0 4.5rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 650px;
    height: 450px;
    background: radial-gradient(circle, rgba(240, 80, 50, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3.5rem;
    align-items: center;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--git-orange);
    background: var(--git-orange-glow);
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(240, 80, 50, 0.3);
    margin-bottom: 1.25rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--git-orange);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(240, 80, 50, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(240, 80, 50, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(240, 80, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(240, 80, 50, 0); }
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, #f05032 0%, #ff8b60 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Термінал у Hero */
.terminal-card {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    font-family: var(--font-code);
}

body.theme-light .terminal-card {
    background: #1e2228;
    color: #e6edf3;
    border-color: #383f47;
}

.terminal-header {
    background: #161b22;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #30363d;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
    font-size: 0.78rem;
    color: #8b949e;
    margin: 0 auto;
}

.terminal-body {
    padding: 1.25rem;
    font-size: 0.88rem;
    line-height: 1.6;
}

.term-line {
    margin-bottom: 0.4rem;
    color: #f0f6fc;
}

.term-prompt {
    color: #f05032;
    font-weight: 700;
}

.term-cmd {
    color: #79c0ff;
    font-weight: 600;
}

.term-out {
    color: #8b949e;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}

.highlight-text {
    color: #7ee787;
    font-weight: 500;
}

.cursor-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.term-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background-color: #f05032;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ==========================================================================
   Розділ 1: Інфо-картки та схема 3 станів
   ========================================================================== */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.info-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-icon-box {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.card-icon-box.accent {
    color: var(--git-orange);
    background: var(--git-orange-glow);
    border-color: rgba(240, 80, 50, 0.3);
}

.info-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.98rem;
    margin-bottom: 1.25rem;
}

.comparison-block {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
}

.comparison-block h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.compare-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compare-list li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.badge-sub {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    margin-right: 0.35rem;
}

.badge-git {
    background: var(--git-orange-glow);
    color: var(--git-orange);
    border-color: rgba(240, 80, 50, 0.4);
}

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

.feature-bullets li {
    font-size: 0.92rem;
    color: var(--text-secondary);
    padding-left: 1.25rem;
    position: relative;
}

.feature-bullets li::before {
    content: '➔';
    position: absolute;
    left: 0;
    color: var(--git-orange);
    font-size: 0.85rem;
}

/* Діаграма трьох станів */
.workflow-diagram-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.diagram-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.diagram-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.states-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    position: relative;
}

.state-node {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.state-node:hover {
    border-color: var(--git-orange);
    transform: translateY(-2px);
}

.node-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.node-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-code);
}

.node-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.node-arrow-label {
    font-size: 0.85rem;
    color: var(--git-orange);
    font-weight: 600;
    align-self: flex-start;
}

.node-arrow-label code {
    background: var(--bg-primary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-family: var(--font-code);
}

.node-return code {
    color: var(--accent-blue);
}

/* ==========================================================================
   Розділ 2: Переваги Git (Features Grid)
   ========================================================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.feature-box:hover {
    border-color: var(--git-orange);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.f-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--git-orange-glow);
    color: var(--git-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(240, 80, 50, 0.25);
}

.feature-box h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-box p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ==========================================================================
   Розділ 3: 10 Базових команд
   ========================================================================== */
.commands-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1.25rem;
    flex-grow: 1;
    max-width: 500px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--git-orange);
    box-shadow: 0 0 0 3px var(--git-orange-glow);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 100%;
}

.filter-count {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.commands-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.command-card {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.command-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.cmd-num {
    background: var(--bg-tertiary);
    color: var(--git-orange);
    font-family: var(--font-code);
    font-size: 1.35rem;
    font-weight: 800;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    min-width: 80px;
}

.cmd-content {
    padding: 2rem;
    flex-grow: 1;
}

.cmd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cmd-title {
    font-family: var(--font-code);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cmd-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.cmd-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.55;
}

.cmd-description code {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-code);
    font-size: 0.85rem;
}

/* Блок коду з кнопкою копіювання */
.cmd-code-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #090d13;
    border: 1px solid #30363d;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

body.theme-light .cmd-code-block {
    background: #1b1f24;
}

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

.cmd-code-block code {
    font-family: var(--font-code);
    font-size: 0.95rem;
    color: #79c0ff;
    font-weight: 500;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #c9d1d9;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--git-orange);
    color: #ffffff;
    border-color: var(--git-orange);
}

.copy-btn.copied {
    background: var(--accent-green);
    color: #ffffff;
    border-color: var(--accent-green);
}

/* Примітки та прапорці */
.cmd-details {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 0.88rem;
    border-left: 3px solid var(--git-orange);
}

.cmd-note {
    color: var(--text-secondary);
}

.cmd-flags {
    color: var(--text-muted);
}

.cmd-flags code, .cmd-note code {
    background: var(--bg-primary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-code);
    font-size: 0.82rem;
}

/* ==========================================================================
   Розділ 4: Сертифікат курсу
   ========================================================================== */
.cert-controls-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.cert-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
    max-width: 500px;
}

.cert-input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.input-with-btn input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    flex-grow: 1;
    transition: var(--transition);
}

.input-with-btn input:focus {
    border-color: var(--git-orange);
}

.cert-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Стилізація сертифіката */
.certificate-wrapper {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.certificate-frame {
    width: 100%;
    max-width: 950px;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 0, 0, 0.35);
    position: relative;
    padding: 24px;
    transition: var(--transition);
}

.cert-border-outer {
    border: 4px double #d4af37;
    border-radius: 4px;
    padding: 16px;
    position: relative;
}

.cert-border-inner {
    border: 1px solid #e0c878;
    padding: 3rem 3.5rem;
    background: radial-gradient(circle at center, #ffffff 60%, #faf8f0 100%);
    position: relative;
}

/* Декоративні кутики сертифіката */
.cert-border-inner::before,
.cert-border-inner::after {
    content: '❖';
    position: absolute;
    color: #d4af37;
    font-size: 1.2rem;
}

.cert-border-inner::before {
    top: 8px;
    left: 8px;
}

.cert-border-inner::after {
    bottom: 8px;
    right: 8px;
}

.cert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid #eae2c7;
    padding-bottom: 1.5rem;
}

.cert-logo-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cert-org-title {
    display: flex;
    flex-direction: column;
}

.cert-org-title span {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #222222;
}

.cert-org-title small {
    font-size: 0.65rem;
    color: #777777;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.cert-id-badge {
    font-family: var(--font-code);
    font-size: 0.78rem;
    background: #f4eee1;
    color: #8c6e26;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid #dfd3bc;
}

.cert-body {
    text-align: center;
    margin-bottom: 2.5rem;
}

.cert-title-sub {
    font-size: 0.85rem;
    letter-spacing: 3px;
    font-weight: 700;
    color: #888888;
    margin-bottom: 0.5rem;
}

.cert-main-title {
    font-family: var(--font-cert);
    font-size: 2.6rem;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.cert-text-present {
    font-style: italic;
    font-size: 1.05rem;
    color: #555555;
    margin-bottom: 1rem;
}

.cert-student-name {
    font-family: var(--font-cert);
    font-size: 2.5rem;
    font-weight: 700;
    color: #d43d22;
    margin: 0.5rem 0 1rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #d43d22;
    display: inline-block;
    padding: 0 2rem 0.3rem;
}

.cert-line-divider {
    width: 60px;
    height: 3px;
    background-color: #d4af37;
    margin: 0.5rem auto 1.5rem;
}

.cert-text-desc {
    font-size: 1rem;
    color: #444444;
    margin-bottom: 0.75rem;
}

.cert-course-name {
    font-size: 1.35rem;
    color: #111111;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cert-topics-list {
    max-width: 720px;
    margin: 0 auto;
    font-size: 0.86rem;
    color: #666666;
    line-height: 1.6;
}

.cert-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border-top: 1px solid #eae2c7;
    padding-top: 2rem;
}

.cert-signature-block, .cert-date-block {
    text-align: center;
    width: 220px;
}

.cert-sig-line {
    border-bottom: 1px solid #333333;
    padding-bottom: 0.25rem;
    margin-bottom: 0.4rem;
}

.fake-signature {
    font-family: 'Brush Script MT', cursive, sans-serif;
    font-size: 1.8rem;
    color: #1a365d;
    font-weight: normal;
    display: block;
}

.cert-sig-title, .cert-date-title {
    font-size: 0.75rem;
    color: #777777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cert-date-val {
    font-size: 1.05rem;
    font-weight: 600;
    color: #222222;
    border-bottom: 1px solid #333333;
    padding-bottom: 0.25rem;
    margin-bottom: 0.4rem;
}

/* Печатка */
.cert-seal {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px dashed #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px #faf8f0, 0 4px 12px rgba(212, 175, 55, 0.25);
    background: #ffffff;
}

.seal-inner {
    text-align: center;
}

.seal-text {
    font-size: 0.48rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #9a7b1c;
    margin-top: 2px;
}

/* ==========================================================================
   Розділ 5: Джерела інформації (Resources Grid)
   ========================================================================== */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.resource-card:hover {
    border-color: var(--git-orange);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.res-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--git-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

.res-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.resource-card h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.resource-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.res-link-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--git-orange);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.resource-card:hover .res-link-text {
    color: var(--git-orange-light);
    transform: translateX(4px);
}

/* ==========================================================================
   Підвал (Footer)
   ========================================================================== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-logo {
    margin-bottom: 0.75rem;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 420px;
}

.footer-right {
    text-align: right;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.footer-right strong {
    color: var(--git-orange);
}

.footer-credits {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* ==========================================================================
   Модальне вікно для сертифіката
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    position: relative;
    max-width: 1050px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    animation: modalScale 0.3s ease;
}

@keyframes modalScale {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    background: #000000;
    color: #ffffff;
    border: none;
    font-size: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.modal-close:hover {
    background: var(--git-orange);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--accent-green);
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification svg {
    color: var(--accent-green);
}

/* ==========================================================================
   Друк сертифіката (@media print)
   ========================================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    
    #printableCertificate, #printableCertificate * {
        visibility: visible;
    }
    
    #printableCertificate {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }
    
    .cert-border-outer {
        border-width: 3px;
        padding: 10px;
    }

    .cert-border-inner {
        padding: 2rem 2.5rem;
    }
    
    @page {
        size: A4 landscape;
        margin: 1cm;
    }
}

/* ==========================================================================
   Адаптивність (Media Queries)
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .features-grid, .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .states-flow {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-primary);
        padding: 2rem;
        transition: var(--transition);
        border-top: 1px solid var(--border-color);
    }

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

    .main-nav .nav-list {
        flex-direction: column;
        gap: 1.5rem;
    }

    .mobile-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .grid-2col {
        grid-template-columns: 1fr;
    }

    .features-grid, .resources-grid {
        grid-template-columns: 1fr;
    }

    .command-card {
        flex-direction: column;
    }

    .cmd-num {
        padding: 0.75rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        justify-content: flex-start;
    }

    .cmd-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .cert-controls-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .cert-footer {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }

    .cert-border-inner {
        padding: 1.5rem 1rem;
    }

    .cert-main-title {
        font-size: 1.8rem;
    }

    .cert-student-name {
        font-size: 1.8rem;
        padding: 0 0.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-right {
        text-align: center;
    }
}
