:root {
    --primary-blue: #2f7f5f;
    --main-blue: #25664b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #143028;
    background: #f4f8f6;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    background: #0f1419;
    color: #e4e6eb;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Top Controls */
.top-controls {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 1000;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Counter Dropdown */
.counter-dropdown {
    position: relative;
}

.counter-button {
    background: white;
    border: 2px solid #e1e8ed;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-blue);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dark-mode .counter-button {
    background: #1c2938;
    border-color: #2a3f5f;
    color: var(--primary-blue);
}

.counter-button:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.dark-mode .counter-button:hover {
    background: #243447;
}

.counter-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.dark-mode .counter-content {
    background: #1c2938;
    border-color: #2a3f5f;
}

.counter-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.counter-item {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e1e8ed;
}

.dark-mode .counter-item {
    border-bottom-color: #2a3f5f;
}

.counter-item:last-child {
    border-bottom: none;
}

.counter-name {
    font-weight: 600;
    color: var(--primary-blue);
}

.dark-mode .counter-name {
    color: var(--primary-blue);
}

.counter-age {
    font-size: 13px;
    color: #657786;
    font-family: 'Courier New', monospace;
}

.dark-mode .counter-age {
    color: #8899a6;
}

/* Dark Mode Toggle */
.toggle-checkbox {
    display: none;
}

.toggle-label {
    display: block;
    width: 60px;
    height: 32px;
    background: #e1e8ed;
    border-radius: 32px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-checkbox:checked + .toggle-label {
    background: var(--primary-blue);
}

.toggle-switch {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-checkbox:checked + .toggle-label .toggle-switch {
    transform: translateX(28px);
}

/* Header */
header {
    position: sticky;
    top: 0;
    background: rgba(246, 247, 249, 0.85);
    color: #0f1a2a;
    padding: 10px 0;
    border-bottom: 1px solid #e3e8ef;
    backdrop-filter: blur(14px);
    z-index: 100;
}

.dark-mode header {
    background: rgba(20, 27, 38, 0.9);
    border-bottom-color: #2a3f5f;
    color: #e3e9f0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 0;
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid #e3e8ef;
    transition: transform 0.3s;
    box-shadow: 0 10px 30px rgba(15, 26, 42, 0.08);
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.dark-mode .logo {
    border-color: #2a3f5f;
}

.logo:hover {
    transform: scale(1.05);
}

.header-text h1 {
    font-size: 1.5em;
    margin-bottom: 2px;
    font-weight: 700;
}

.tagline {
    font-size: 0.9em;
    color: #5b6b7a;
    font-weight: 500;
}

.dark-mode .tagline {
    color: #93a4b5;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    justify-content: flex-end;
}

nav a {
    color: #5b6b7a;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    font-weight: 600;
    position: relative;
    font-size: 0.95em;
}

header nav {
    margin-left: auto;
}

.dark-mode nav a {
    color: #9fb0c2;
}

nav a:hover {
    color: #0f1a2a;
    transform: translateY(-1px);
}

.dark-mode nav a:hover {
    color: #e3e9f0;
}

nav a.active {
    background: #ffffff;
    color: #0f1a2a;
    box-shadow: 0 10px 30px rgba(15, 26, 42, 0.08);
    border: 1px solid #e3e8ef;
}

.dark-mode nav a.active {
    background: #1f2d3d;
    color: #e3e9f0;
    border-color: #2a3f5f;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.nav-cta {
    background: var(--primary-blue);
    color: #fff;
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 10px 24px rgba(34, 99, 243, 0.25);
}

.nav-cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 12px 28px rgba(34, 99, 243, 0.32);
}

.dark-mode .nav-cta {
    background: var(--primary-blue);
}

.contact-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.contact-modal.show {
    display: flex;
}

.contact-modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    width: min(480px, 90%);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    border: 1px solid #e3e8ef;
}

.dark-mode .contact-modal-content {
    background: #1c2938;
    border-color: #2a3f5f;
}

.contact-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.contact-modal-header h3 {
    margin: 0;
    color: var(--primary-blue);
}

.contact-modal-close {
    background: transparent;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #5b6b7a;
}

.dark-mode .contact-modal-close {
    color: #93a4b5;
}

.contact-modal-links {
    display: grid;
    gap: 12px;
}

.contact-modal-links .contact-link {
    display: inline-block;
    text-align: center;
    background: #f6f8fa;
    border: 1px solid #e3e8ef;
    color: #0f1a2a;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.contact-modal-links .contact-link:hover {
    transform: translateY(-1px);
    border-color: #cdd6e1;
    box-shadow: 0 10px 24px rgba(15, 26, 42, 0.12);
}

.dark-mode .contact-modal-links .contact-link {
    background: #1f2d3d;
    border-color: #2a3f5f;
    color: #e3e9f0;
}

/* Main Content */
main {
    padding: 48px 0;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 48px;
}

.hero-full {
    grid-template-columns: 1fr;
}

.hero-panel-section {
    margin-bottom: 48px;
}

.dark-mode .hero {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.hero h2 {
    font-size: 2.8em;
    margin-bottom: 24px;
    color: var(--primary-blue);
    font-weight: 700;
}

.dark-mode .hero h2 {
    color: var(--primary-blue);
}

.hero h2::after {
    width: 100%;
    left: 0;
}

.hero-subtitle {
    display: block;
    font-size: 0.7em;
    color: #4c6b60;
    font-weight: 600;
    margin-top: 6px;
}

.dark-mode .hero-subtitle {
    color: #93a4b5;
}

.hero p {
    font-size: 1.2em;
    line-height: 1.8;
    color: #657786;
    max-width: 800px;
    margin: 0;
}

.dark-mode .hero p {
    color: #8899a6;
}

.hero-card {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e1e8ed;
}

.dark-mode .hero-card {
    background: #1c2938;
    border-color: #2a3f5f;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef5f1;
    color: #4c6b60;
    font-weight: 600;
    font-size: 0.85em;
    margin-bottom: 16px;
}

.dark-mode .hero-pill {
    background: #243447;
    color: #93a4b5;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.hero-btn {
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid #e1e8ed;
    background: white;
    color: #2c3e50;
    text-decoration: none;
}

.hero-btn.primary {
    background: var(--primary-blue);
    color: white;
    border-color: transparent;
}

.hero-btn.ghost {
    color: var(--main-blue);
    background: transparent;
}

.hero-panel {
    display: grid;
    gap: 16px;
}

.hero-illustration {
    position: relative;
    background: linear-gradient(135deg, rgba(47, 127, 95, 0.08), rgba(183, 225, 161, 0.15));
    border: 1px solid #e1e8ed;
    border-radius: 16px;
    padding: 26px;
    min-height: 260px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(transparent 23px, rgba(0, 0, 0, 0.04) 24px),
        linear-gradient(90deg, transparent 23px, rgba(0, 0, 0, 0.04) 24px);
    background-size: 24px 24px;
    opacity: 0.4;
    pointer-events: none;
}

.hero-scan {
    position: absolute;
    left: -10%;
    top: 15%;
    width: 140%;
    height: 120px;
    background: linear-gradient(90deg, transparent, rgba(47, 127, 95, 0.18), transparent);
    filter: blur(1px);
}

.hero-terminal {
    position: relative;
    background: #0b1118;
    border-radius: 14px;
    border: 1px solid #1f2937;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}

.terminal-header {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: #0f1722;
    align-items: center;
}

.terminal-header span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #cbd5e1;
}

.terminal-header span:nth-child(1) { background: #ef4444; }
.terminal-header span:nth-child(2) { background: #f59e0b; }
.terminal-header span:nth-child(3) { background: #22c55e; }

.terminal-title {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.75em;
    letter-spacing: 0.04em;
    max-width: 40%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-body {
    padding: 16px;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.terminal-body p {
    margin-bottom: 8px;
    color: #d7e2ef;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.95em;
    outline: none;
    padding: 2px 0;
}

.terminal-body .prompt {
    color: #7dd3fc;
    margin-right: 6px;
}

.terminal-body .prompt-line {
    color: #7dd3fc;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.prompt-user {
    color: #a7f3d0;
    font-weight: 600;
}

.prompt-sep {
    color: #94a3b8;
}

.prompt-host {
    color: #7dd3fc;
    font-weight: 600;
}

.prompt-path {
    color: #fbbf24;
    margin-left: 2px;
}

.prompt-char {
    color: #e2e8f0;
    margin-left: 6px;
    margin-right: 6px;
}

.terminal-body .output {
    color: #a7f3d0;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}

.terminal-body .output .html-tag {
    color: #f59e0b;
}

.terminal-body .output .html-text {
    color: #e2e8f0;
}

.terminal-body .output {
    color: #a7f3d0;
}

.terminal-body .cursor {
    color: #e2e8f0;
    animation: blink 1s step-end infinite;
}

.hero-caption {
    color: #5b6b7a;
    margin-top: 14px;
}

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

/* Section Styling */
section {
    margin-bottom: 64px;
}

section h2 {
    font-size: 2.2em;
    margin-bottom: 32px;
    color: var(--primary-blue);
    font-weight: 700;
    position: relative;
    padding-bottom: 16px;
}

.dark-mode section h2 {
    color: var(--primary-blue);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--main-blue));
    border-radius: 2px;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.blog-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 1px solid #e1e8ed;
    display: flex;
    flex-direction: column;
}

.dark-mode .blog-card {
    background: #1c2938;
    border-color: #2a3f5f;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 28px rgba(47, 127, 95, 0.2);
}

.blog-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.blog-date, .blog-category {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.blog-date {
    background: #f0f4f8;
    color: #657786;
}

.dark-mode .blog-date {
    background: #2a3f5f;
    color: #8899a6;
}

.blog-category {
    background: #e8f0f8;
    color: var(--primary-blue);
}

.dark-mode .blog-category {
    background: #2a3f5f;
    color: var(--primary-blue);
}

.blog-card h3 {
    margin-bottom: 12px;
    font-size: 1.4em;
    line-height: 1.4;
}

.blog-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.dark-mode .blog-card h3 a {
    color: #e4e6eb;
}

.blog-card h3 a:hover {
    color: var(--primary-blue);
}

.dark-mode .blog-card h3 a:hover {
    color: var(--primary-blue);
}

.blog-card p {
    color: #657786;
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.7;
}

.dark-mode .blog-card p {
    color: #8899a6;
}

.read-more {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
}

.dark-mode .read-more {
    color: var(--primary-blue);
}

.read-more:hover {
    gap: 8px;
}

/* Resources Section */
.resources-intro {
    font-size: 1.1em;
    color: #657786;
    margin-bottom: 32px;
}

.dark-mode .resources-intro {
    color: #8899a6;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.resource-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 1px solid #e1e8ed;
}

.dark-mode .resource-card {
    background: #1c2938;
    border-color: #2a3f5f;
}

.resource-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(47, 127, 95, 0.15);
}

.featured-resource {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #e8f3ee 0%, #f1f7f3 100%);
    border-left: 4px solid var(--primary-blue);
}

.dark-mode .featured-resource {
    background: linear-gradient(135deg, #1c2938 0%, #243447 100%);
    border-left-color: var(--primary-blue);
}

.resource-card h3 {
    color: var(--primary-blue);
    margin-bottom: 16px;
    font-size: 1.3em;
    font-weight: 600;
}

.dark-mode .resource-card h3 {
    color: var(--primary-blue);
}

.resource-card p {
    color: #657786;
    margin-bottom: 16px;
    line-height: 1.7;
}

.dark-mode .resource-card p {
    color: #8899a6;
}

.resource-card ul {
    list-style: none;
    padding: 0;
}

.resource-card li {
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
}

.resource-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: bold;
}

.dark-mode .resource-card li::before {
    color: var(--primary-blue);
}

.resource-card a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.dark-mode .resource-card a {
    color: var(--primary-blue);
}

.resource-card a:hover {
    color: var(--main-blue);
    text-decoration: underline;
}

.dark-mode .resource-card a:hover {
    color: var(--main-blue);
}

.resource-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-blue);
    color: white !important;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.3s;
    margin: 6px 0;
}

.resource-link:hover {
    background: var(--main-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 127, 95, 0.3);
}

.medmath-page .medmath-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-top: 18px;
}

.medmath-page .medmath-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #657786;
}

.dark-mode .medmath-page .medmath-toggle {
    color: #93a4b5;
}

.medmath-page .medmath-toggle input {
    width: 18px;
    height: 18px;
}

.medmath-page .medmath-timer {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #657786;
}

.dark-mode .medmath-page .medmath-timer {
    color: #93a4b5;
}

@media (max-width: 640px) {
    .medmath-page .medmath-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .medmath-page .medmath-timer {
        flex-wrap: wrap;
        width: 100%;
    }

    .medmath-page #timerDisplay {
        width: 100%;
    }
}

.medmath-page .medmath-input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 8px;
}

.medmath-page .medmath-input-row input {
    padding: 10px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1em;
    width: 140px;
}

.dark-mode .medmath-page .medmath-input-row input {
    background: #1c2938;
    color: #e4e6eb;
    border-color: #2a3f5f;
}

.medmath-page .medmath-btn {
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.medmath-page .medmath-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(47, 127, 95, 0.2);
}

.medmath-page .feedback {
    margin-top: 10px;
    font-weight: 600;
}

.medmath-page .correct { color: #22c55e; }
.medmath-page .incorrect { color: #ef4444; }

.medmath-page .explanation {
    margin-top: 8px;
    font-size: 0.95em;
    color: #657786;
}

.dark-mode .medmath-page .explanation {
    color: #93a4b5;
}

.medmath-page .medmath-dim {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed #d5dee6;
    background: #f7fafc;
    color: #4b5b6a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
}

.dark-mode .medmath-page .medmath-dim {
    background: #1f2d3d;
    border-color: #2a3f5f;
    color: #c9d3df;
}

.medmath-page .medmath-score {
    margin-top: 28px;
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.dark-mode .medmath-page .medmath-score {
    background: #1c2938;
    border-color: #2a3f5f;
}

.medmath-page .medmath-score h2 {
    margin-top: 0;
    color: var(--primary-blue);
}

.medmath-page .medmath-help-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
}

.medmath-page .medmath-help-modal[hidden] {
    display: none;
}

.medmath-page .medmath-help-panel {
    width: min(900px, 100%);
    max-height: 85vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e1e8ed;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.dark-mode .medmath-page .medmath-help-panel {
    background: #1c2938;
    border-color: #2a3f5f;
}

.medmath-page .medmath-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.medmath-page .medmath-help-header h3 {
    margin: 0;
    color: var(--primary-blue);
}

.medmath-page .help-item {
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    margin-bottom: 10px;
    overflow: hidden;
}

.dark-mode .medmath-page .help-item {
    background: #223145;
    border-color: #2a3f5f;
}

.medmath-page .help-item summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.medmath-page .help-item summary::-webkit-details-marker {
    display: none;
}

.medmath-page .help-content {
    margin-top: 8px;
    color: #657786;
    padding-left: 6px;
}

.dark-mode .medmath-page .help-content {
    color: #93a4b5;
}

.medmath-page .help-content pre {
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef3f7;
    overflow-x: auto;
}

.dark-mode .medmath-page .help-content pre {
    background: #1c2938;
}

.medmath-page .help-content ul,
.medmath-page .help-content ol {
    margin: 6px 0 4px 0;
    padding-left: 18px;
    list-style-position: inside;
}

.medmath-page .help-note {
    margin-top: 6px;
    font-size: 0.95em;
    color: #6b7c8f;
}

.dark-mode .medmath-page .help-note {
    color: #93a4b5;
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.resource-links .resource-link {
    margin: 0;
}

/* Contact Section */
.contact-section {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    border: 1px solid #e1e8ed;
}

.dark-mode .contact-section {
    background: #1c2938;
    border-color: #2a3f5f;
}

.contact-section h2::after {
    width: 100%;
    left: 0;
}

.contact-section p {
    font-size: 1.1em;
    color: #657786;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.dark-mode .contact-section p {
    color: #8899a6;
}

.contact-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-link {
    padding: 14px 32px;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(47, 127, 95, 0.2);
}

.contact-link:hover {
    background: var(--main-blue);
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(47, 127, 95, 0.3);
}

/* Footer */
footer {
    background: #1c2938;
    color: white;
    text-align: center;
    padding: 32px 0;
    margin-top: 64px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
}

.dark-mode footer {
    background: #0a0e13;
}

/* Responsive */
@media (max-width: 768px) {
    .top-controls {
        right: 16px;
        top: 16px;
        position: absolute;
        z-index: 1001;
    }

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

    .header-text h1 {
        font-size: 1.8em;
    }

    nav ul {
        justify-content: center;
    }

    header {
        background: rgba(246, 247, 249, 0.92);
        position: static;
    }

    .dark-mode header {
        background: rgba(20, 27, 38, 0.95);
    }

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

    .hero h2 {
        font-size: 2em;
    }

    .hero p {
        font-size: 1.1em;
    }

    .hero-card {
        padding: 32px 24px;
    }

    section h2 {
        font-size: 1.8em;
    }

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

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

    .contact-section {
        padding: 32px 24px;
    }
}

/* Resume Page Styles */
.resume-section {
    max-width: 900px;
    margin: 0 auto;
}

.resume-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin-bottom: 32px;
    border: 1px solid #e1e8ed;
}

.dark-mode .resume-card {
    background: #1c2938;
    border-color: #2a3f5f;
}

.resume-card h3 {
    color: var(--primary-blue);
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-blue);
}

.dark-mode .resume-card h3 {
    color: var(--primary-blue);
}

.resume-card > p {
    color: #2c3e50;
    line-height: 1.8;
    font-size: 1.05em;
}

.dark-mode .resume-card > p {
    color: #e4e6eb;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.skill-category h4 {
    color: var(--primary-blue);
    font-size: 1.1em;
    margin-bottom: 12px;
    font-weight: 600;
}

.dark-mode .skill-category h4 {
    color: var(--primary-blue);
}

.skill-category ul {
    list-style: none;
    padding: 0;
}

.skill-category li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #657786;
    line-height: 1.6;
}

.dark-mode .skill-category li {
    color: #8899a6;
}

.skill-category li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: bold;
}

/* Experience Items */
.experience-item {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px solid #e1e8ed;
}

.dark-mode .experience-item {
    border-bottom-color: #2a3f5f;
}

.experience-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.experience-item h4 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 8px;
    font-weight: 600;
}

.dark-mode .experience-item h4 {
    color: #e4e6eb;
}

.experience-item .company {
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1.05em;
}

.dark-mode .experience-item .company {
    color: var(--primary-blue);
}

.experience-item ul {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}

.experience-item li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #657786;
    line-height: 1.7;
}

.dark-mode .experience-item li {
    color: #8899a6;
}

.experience-item li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1.2em;
}

/* Certifications Grid */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.cert-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s;
    border: 2px solid #e1e8ed;
}

.dark-mode .cert-item {
    background: #243447;
    border-color: #2a3f5f;
}

.cert-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(47, 127, 95, 0.15);
    border-color: var(--primary-blue);
}

.cert-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 12px;
}

.cert-item span {
    font-size: 0.9em;
    color: #2c3e50;
    font-weight: 500;
    line-height: 1.4;
}

.dark-mode .cert-item span {
    color: #e4e6eb;
}

/* Education Items */
.education-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e1e8ed;
}

.dark-mode .education-item {
    border-bottom-color: #2a3f5f;
}

.education-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.education-item h4 {
    color: #2c3e50;
    font-size: 1.2em;
    margin-bottom: 8px;
    font-weight: 600;
}

.dark-mode .education-item h4 {
    color: #e4e6eb;
}

.education-item .company {
    color: var(--primary-blue);
    font-weight: 600;
}

.dark-mode .education-item .company {
    color: var(--primary-blue);
}

/* Responsive Resume */
@media (max-width: 768px) {
    .resume-card {
        padding: 24px;
    }

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

    .certifications-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .cert-logo {
        width: 60px;
        height: 60px;
    }

    .cert-item {
        padding: 16px;
    }

    .cert-item span {
        font-size: 0.85em;
    }
}

/* CySA+ Notes Page Specific Styles */
.notes-header {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin-bottom: 32px;
    border: 1px solid #e1e8ed;
}

.dark-mode .notes-header {
    background: #1c2938;
    border-color: #2a3f5f;
}

.notes-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--primary-blue);
}

.dark-mode .notes-header h1 {
    color: var(--primary-blue);
}

.notes-header .subtitle {
    font-size: 1.2em;
    color: #657786;
    margin-bottom: 30px;
}

.dark-mode .notes-header .subtitle {
    color: #8899a6;
}

/* Search */
.search-container {
    position: relative;
    margin-bottom: 30px;
}

.search-results {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.search-result {
    background: #f6f8fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 0.95em;
    color: #2c3e50;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.search-result:hover {
    background: #eef3f9;
    border-color: #cfd8e3;
    transform: translateY(-1px);
}

.search-result small {
    display: block;
    color: #657786;
    margin-top: 4px;
}

.dark-mode .search-result {
    background: #1f2d3d;
    border-color: #2a3f5f;
    color: #dbe3ec;
}

.dark-mode .search-result:hover {
    background: #243447;
    border-color: #3a5377;
}

.dark-mode .search-result small {
    color: #93a4b5;
}

#searchInput {
    width: 100%;
    padding: 15px 45px 15px 20px;
    font-size: 1em;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.dark-mode #searchInput {
    background: #243447;
    color: #e0e0e0;
    border-color: #2a3f5f;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
}

/* Quick Nav */
.quick-nav {
    background: #f0f4f8;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

.dark-mode .quick-nav {
    background: #243447;
}

.quick-nav h3 {
    margin-bottom: 15px;
    color: var(--primary-blue);
    font-size: 1.2em;
}

.dark-mode .quick-nav h3 {
    color: var(--primary-blue);
}

.nav-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.nav-links .nav-link {
    display: block;
    padding: 10px 15px;
    background: white;
    color: var(--primary-blue);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.dark-mode .nav-links .nav-link {
    background: #1c2938;
    color: var(--primary-blue);
}

.nav-links .nav-link:hover {
    border-color: var(--primary-blue);
    transform: translateX(5px);
}

/* Command Category */
.command-category {
    margin-bottom: 30px;
}

.category-toggle {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--main-blue) 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.5em;
    margin-bottom: 20px;
    transition: transform 0.3s;
    position: relative;
    border: none;
    width: 100%;
    text-align: left;
}

.dark-mode .category-toggle {
    background: linear-gradient(135deg, #2a3f5f 0%, #1c2938 100%);
}

.category-toggle:hover {
    transform: translateY(-2px);
}

.category-toggle::after {
    display: none;
}

.category-toggle.collapsed {
    background: #e5e9ef;
    color: #4b5b6a;
}

.dark-mode .category-toggle.collapsed {
    background: #2a3f5f;
    color: #c0c7d1;
}

.category-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    transition: opacity 0.2s ease-out;
    opacity: 1;
}

.category-content.collapsed {
    display: none;
    opacity: 0;
}

/* Command Cards */
.command-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border-left: 4px solid var(--primary-blue);
    border: 1px solid #e1e8ed;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dark-mode .command-card {
    background: #1c2938;
    border-left: 4px solid var(--primary-blue);
    border-color: #2a3f5f;
}

.command-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(47, 127, 95, 0.2);
}

.command-header h3 {
    color: var(--primary-blue);
    font-size: 1.3em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e8ed;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dark-mode .command-header h3 {
    color: var(--primary-blue);
    border-bottom-color: #2a3f5f;
}

.command-card ul {
    list-style: none;
    padding-left: 0;
}

.command-card p,
.command-description {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.command-card li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.command-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
}

.dark-mode .command-card li::before {
    color: var(--primary-blue);
}

.command-card strong {
    color: var(--main-blue);
    font-weight: 600;
}

.dark-mode .command-card strong {
    color: #7a9fcd;
}

.command-notes {
    line-height: 1.8;
    color: #657786;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dark-mode .command-notes {
    color: #8899a6;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--main-blue) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 100;
}

.back-to-top.show {
    opacity: 1;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* CySA Notes Responsive */
@media (max-width: 768px) {
    .notes-header {
        padding: 24px;
    }

    .notes-header h1 {
        font-size: 2em;
    }

    .category-toggle {
        font-size: 1.2em;
        padding: 15px 20px;
    }

    .category-content {
        grid-template-columns: 1fr;
    }
}

/* Asterisk Commands Page Specific Styles */
.commands-header {
    text-align: center;
}

.command-description {
    color: #657786;
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 0.95em;
}

.dark-mode .command-description {
    color: #8899a6;
}

.command-block {
    position: relative;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 16px 100px 16px 16px;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
}

.dark-mode .command-block {
    background: #0f1419;
    border-color: #2a3f5f;
}

.command-block code {
    color: var(--primary-blue);
    font-size: 0.95em;
    display: block;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.dark-mode .command-block code {
    color: var(--primary-blue);
}

.copy-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: var(--main-blue);
    transform: translateY(-50%) scale(1.05);
}

.copy-btn.copied {
    background: #4caf50;
}

.placeholder {
    background: var(--primary-blue);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.favorites-section {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f0f8 100%);
    padding: 32px;
    border-radius: 12px;
    border: 2px solid var(--primary-blue);
    margin-bottom: 48px;
}

.dark-mode .favorites-section {
    background: linear-gradient(135deg, #1c2938 0%, #243447 100%);
}

.favorites-list {
    display: grid;
    gap: 20px;
}

.empty-favorites {
    text-align: center;
    color: #657786;
    font-style: italic;
    padding: 32px;
}

.dark-mode .empty-favorites {
    color: #8899a6;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #657786;
    transition: all 0.3s;
    padding: 5px;
}

.favorite-btn:hover {
    color: #ffd700;
    transform: scale(1.2);
}

.favorite-btn.active {
    color: #ffd700;
}

@media (max-width: 768px) {
    .command-block {
        padding: 16px 16px 60px 16px;
    }

    .copy-btn {
        right: 12px;
        top: auto;
        bottom: 12px;
        transform: none;
    }

    .copy-btn:hover {
        transform: scale(1.05);
    }
}

/* Input boxes for placeholders */
.placeholder-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.placeholder-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.dark-mode .placeholder-input {
    background: #0f1419;
    color: var(--primary-blue);
    border-color: #2a3f5f;
}

.placeholder-input::placeholder {
    color: #8899a6;
}

.placeholder-label {
    font-size: 0.85em;
    color: #657786;
    margin-bottom: 4px;
    font-weight: 600;
}

.dark-mode .placeholder-label {
    color: #8899a6;
}

.input-group {
    flex: 1;
    min-width: 200px;
}

.command-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Search Modal */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.search-modal.show {
    display: flex;
}

.search-modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dark-mode .search-modal-content {
    background: #1c2938;
}

.search-modal h3 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.search-modal-input {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.dark-mode .search-modal-input {
    background: #0f1419;
    color: var(--primary-blue);
    border-color: #2a3f5f;
}

.search-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.search-modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.search-modal-btn.btn-search {
    background: var(--primary-blue);
    color: white;
}

.search-modal-btn.btn-search:hover {
    background: var(--main-blue);
}

.search-modal-btn.btn-cancel {
    background: #e1e8ed;
    color: #2c3e50;
}

.dark-mode .search-modal-btn.btn-cancel {
    background: #2a3f5f;
    color: #e4e6eb;
}

.search-modal-btn.btn-cancel:hover {
    background: #657786;
    color: white;
}


.site-footer {
    background: #0f1a17;
    color: #c6d2cc;
    padding: 16px 0 10px;
    margin-top: 32px;
}

.dark-mode .site-footer {
    background: #0b1110;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}

.footer-grid h4 {
    margin-bottom: 6px;
    color: #e7efe9;
    font-size: 0.82em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-grid li {
    margin-bottom: 4px;
    font-size: 0.92em;
}

.footer-grid a {
    color: #a9bcb3;
    text-decoration: none;
}

.footer-grid a:hover {
    color: #ffffff;
}

.footer-bar {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 6px;
    text-align: center;
    color: #8fa39a;
    font-size: 0.82em;
}
