/* ============================================================
   harrycaskey.com — Stylesheet
   Dark theme, clean typography, security-conscious design
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-card: #1a2234;
    --bg-card-hover: #1e2a40;
    --border: #1e293b;
    --border-light: #2d3a4f;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-teal: #10b981;
    --accent-gold: #d4aa00;
    --accent-red: #ef4444;
    --code-bg: #1e1e2e;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --nav-height: 70px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Starfield Canvas --- */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Floating Gradient Orbs --- */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #3b82f6, transparent 70%);
    top: -15%;
    left: -10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #10b981, transparent 70%);
    top: 50%;
    right: -12%;
    animation-delay: -8s;
    animation-duration: 22s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -10%;
    left: 25%;
    animation-delay: -15s;
    animation-duration: 28s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 35px) scale(1.02); }
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-blue-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Layout --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.section-alt {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(2px);
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: border-color 0.3s, background 0.3s;
}

.navbar.scrolled {
    border-bottom-color: var(--border);
    background: rgba(10, 15, 26, 0.95);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    transition: color 0.2s, transform 0.2s;
}

.nav-logo:hover {
    color: var(--accent-blue);
    transform: scale(1.08);
}

.nav-logo-icon {
    width: 42px;
    height: 42px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: transform 0.3s, opacity 0.3s;
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
    padding-top: var(--nav-height);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 40%);
    pointer-events: none;
    animation: heroPulse 8s ease-in-out infinite;
}

@keyframes heroPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 40px 24px;
}

.hero-greeting {
    font-size: 1.1rem;
    color: var(--accent-blue);
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.hero-name {
    font-size: clamp(2.8rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #e2e8f0 0%, #3b82f6 50%, #10b981 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: nameShimmer 6s ease-in-out infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.15));
}

@keyframes nameShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 400;
    margin-bottom: 8px;
}

.hero-tagline {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 300;
    margin-bottom: 40px;
    letter-spacing: 0.05em;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 35px rgba(59, 130, 246, 0.5);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-ghost:hover {
    color: #fff;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.08);
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.scroll-arrow {
    width: 2px;
    height: 24px;
    background: var(--text-muted);
    position: relative;
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* --- Section Titles --- */
.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    text-align: center;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-primary);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px;
}

/* --- About --- */
.about-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
}

.about-text p {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-text em {
    color: var(--accent-blue);
    font-style: italic;
}

.about-text a,
.script-desc a,
.pub-desc a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-decoration-color: rgba(59, 130, 246, 0.3);
    transition: text-decoration-color 0.2s;
}

.about-text a:hover,
.script-desc a:hover,
.pub-desc a:hover {
    text-decoration-color: var(--accent-blue);
}

.about-text ul,
.about-text ol,
.script-desc ul,
.script-desc ol,
.pub-desc ul,
.pub-desc ol {
    margin: 8px 0 16px 20px;
    color: var(--text-primary);
}

.about-text blockquote,
.script-desc blockquote,
.pub-desc blockquote {
    border-left: 3px solid var(--accent-blue);
    padding-left: 14px;
    margin: 12px 0;
    color: var(--text-muted);
    font-style: italic;
}

.script-desc p,
.pub-desc p {
    margin-bottom: 8px;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.highlight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: border-color 0.3s;
}

.highlight-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.highlight-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-blue);
    line-height: 1;
    margin-bottom: 4px;
}

.highlight-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Certifications --- */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.cert-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.cert-flip.cert-hidden {
    display: none;
}

.load-more-certs {
    display: block;
    margin: 2rem auto 0;
    padding: 0.75rem 2rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.load-more-certs:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

/* Flip card container */
.cert-flip {
    perspective: 800px;
    height: 200px;
    cursor: pointer;
}

.cert-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.cert-flip.flipped .cert-flip-inner {
    transform: rotateY(180deg);
}

.cert-front,
.cert-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent, var(--accent-blue));
    box-sizing: border-box;
    overflow: hidden;
}

.cert-front {
    background: var(--bg-card);
}

.cert-front:hover {
    border-color: var(--accent, var(--accent-blue));
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.cert-back {
    background: var(--bg-secondary);
    transform: rotateY(180deg);
    border-left-color: var(--accent, var(--accent-blue));
}

.cert-tap-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-top: auto;
    text-align: right;
}

.cert-back-issuer {
    font-size: 0.75rem;
    color: var(--accent, var(--accent-blue));
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.cert-back-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.cert-back-desc {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-y: auto;
}

.cert-credential-id {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.03em;
}

.cert-issuer {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.cert-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
}

.cert-dates {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cert-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cert-expiry {
    font-size: 0.8rem;
    color: #f59e0b;
}

.cert-no-expiry {
    color: #22c55e;
}

/* --- Publications & Press --- */
.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
    gap: 20px;
}

.pub-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.3s, border-color 0.3s;
    position: relative;
}

.pub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-blue);
}

.pub-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.pub-type-publication {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.pub-type-press {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.pub-title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.pub-publisher {
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 500;
    margin-bottom: 10px;
}

.pub-desc {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.pub-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.pub-link-hint {
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 500;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.pub-card:hover .pub-link-hint {
    opacity: 1;
}

/* --- Scripts Archive --- */
.filter-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
    gap: 20px;
}

.script-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.3s;
}

.script-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.script-card.hidden-card,
.script-card.script-hidden {
    display: none;
}

.load-more-scripts {
    display: block;
    margin: 2rem auto 0;
    padding: 0.75rem 2rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.load-more-scripts:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.script-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.script-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.script-lang {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
}

.script-desc {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.script-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.script-date {
    opacity: 0.8;
}

.script-category {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.script-github-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.script-github-link:hover {
    color: var(--accent-blue);
}

.script-code-wrapper {
    margin-top: 12px;
}

.code-toggle {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--accent-blue);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.code-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

.script-code {
    margin-top: 12px;
    border-radius: 8px;
    max-height: 400px;
    overflow: auto;
}

.script-code code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.hidden {
    display: none;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 60px 0;
}

/* --- Connect --- */
.connect-section {
    text-align: center;
}

.connect-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.connect-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.connect-card:hover {
    color: #fff;
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 40px rgba(59, 130, 246, 0.35), 0 0 30px rgba(59, 130, 246, 0.15), inset 0 0 30px rgba(59, 130, 246, 0.06);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.10));
}

.connect-card span {
    font-weight: 500;
}

.connect-footer {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.connect-footer a {
    color: var(--accent-blue);
}

/* --- Footer --- */
.footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    position: relative;
    z-index: 1;
}

/* --- Grid Overlay (subtle tech pattern) --- */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.025) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at 50% 40%, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 0%, transparent 75%);
}

/* --- Scan Line --- */
.grid-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.06), transparent);
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { top: -2px; }
    100% { top: 100%; }
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.secret-login {
    display: inline-block;
    margin-left: 6px;
    opacity: 0.15;
    transition: opacity 0.3s;
    vertical-align: middle;
    line-height: 1;
}

.secret-login:hover {
    opacity: 0.5;
}

.secret-login svg {
    fill: var(--text-muted);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(10, 15, 26, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 24px;
        gap: 0;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s, opacity 0.3s;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-links a {
        display: block;
        padding: 16px 0;
        font-size: 1.1rem;
    }

    .section {
        padding: 64px 0;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-highlights {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .highlight-card {
        flex: 1;
        min-width: 120px;
    }

    .scripts-grid {
        grid-template-columns: 1fr;
    }

    .cert-grid {
        grid-template-columns: 1fr;
    }

    .hero-name {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .connect-card {
        padding: 24px 32px;
    }
}

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .filter-bar {
        gap: 6px;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
}


/* --- Mobile Enhancements --- */
@media (max-width: 768px) {
    .btn {
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 48px;
    }

    .filter-btn {
        min-height: 44px;
        padding: 10px 18px;
    }

    .code-toggle {
        min-height: 44px;
        padding: 10px 20px;
    }

    .nav-links a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .script-code {
        max-height: 300px;
        font-size: 0.78rem;
    }

    .script-code pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    .hero-tagline {
        font-size: 0.88rem;
    }

    .section-title {
        font-size: 1.7rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 32px;
    }

    .connect-links {
        flex-direction: column;
        align-items: stretch;
    }

    .connect-card {
        flex-direction: row;
        padding: 16px 20px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .section {
        padding: 48px 0;
    }

    .hero-content {
        padding: 24px 16px;
    }

    .highlight-card {
        padding: 16px;
    }

    .highlight-number {
        font-size: 1.6rem;
    }

    .cert-card {
        padding: 16px;
    }

    .script-card {
        padding: 16px;
    }

    .script-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* --- Safe areas for notched devices --- */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
}

/* --- Section navigation arrows --- */
.section-nav {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 900;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.section-nav.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.section-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.section-nav-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.section-nav-btn:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 768px) {
    .section-nav {
        bottom: 20px;
        right: 16px;
    }
}

/* --- Blog Section --- */
.blog-search-bar {
    position: relative;
    max-width: 480px;
    margin: 0 auto 24px;
}

.blog-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.blog-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.blog-search-input::placeholder {
    color: var(--text-muted);
}

.blog-filters {
    text-align: center;
    margin-bottom: 32px;
}

.blog-filter-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.blog-filter-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.blog-filter-btn:hover,
.blog-filter-btn.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.blog-tags-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.blog-tag-btn {
    padding: 4px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.blog-tag-btn:hover,
.blog-tag-btn.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.blog-tag-count {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-left: 2px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.blog-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.blog-card.blog-hidden {
    display: none;
}

.blog-card.blog-filtered-out {
    display: none;
}

.blog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.blog-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

.blog-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.blog-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.blog-card-tag {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-read-more {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--accent-blue);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.blog-read-more:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

.blog-card-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.blog-card-content p {
    margin-bottom: 14px;
}

.blog-card-content ul,
.blog-card-content ol {
    margin: 0 0 14px 20px;
}

.blog-card-content li {
    margin-bottom: 6px;
}

.blog-card-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.blog-card-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 14px;
}

.blog-card-content pre code {
    background: none;
    padding: 0;
}

.blog-card-content strong {
    color: var(--text-primary);
}

.blog-no-results {
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
}

.load-more-blog {
    display: block;
    margin: 32px auto 0;
    padding: 12px 32px;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-blog:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-search-bar {
        max-width: 100%;
    }

    .blog-card {
        padding: 18px;
    }

    .blog-filter-group {
        gap: 6px;
    }

    .blog-filter-btn {
        padding: 6px 12px;
        font-size: 0.78rem;
        min-height: 36px;
    }

    .blog-tags-bar {
        gap: 6px;
    }

    .blog-tag-btn {
        padding: 4px 10px;
        font-size: 0.72rem;
        min-height: 32px;
    }

    .blog-card-content pre {
        font-size: 0.78rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
