@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS custom properties — Dark Navy + Fluorescent Green ── */
:root {
    --color-primary:    #00ff88;
    --color-primary-dk: #00cc6a;
    --color-accent:     #39ffb0;
    --color-text:       #e8fff5;
    --color-text-light: #a0c8b0;
    --color-bg:         #04111e;
    --color-white:      #ffffff;
    --color-border:     rgba(0,255,136,.18);
    --color-navy:       #050e1a;
    --color-navy-mid:   #081828;
    --color-shine:      #00ff88;
    --color-card-bg:    rgba(255,255,255,0.10);
    --color-card-border:rgba(0,255,136,0.22);
    --radius:           8px;
    --shadow:           0 2px 18px rgba(0,255,136,.08);
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 42px;
    font-family: 'Inter', sans-serif;
    margin: 0;
    color: var(--color-text);
    line-height: 1.7;
    position: relative;
    /* SVG line-art background — white canvas + light blue tint */
    background-image: url('/img/tm-bg.svg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center center;
    background-color: #e8f4ff;
}

/* Semi-transparent dark overlay — keeps text readable over the light bg */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    /* Dark navy at 72% — enough to read green text, light enough to see art */
    background: rgba(4, 12, 30, 0.72);
}

/* All direct children except header and footer expand to fill space */
body > *:not(.header):not(.footer) { flex: 1 0 auto; position: relative; z-index: 1; }

a { color: var(--color-primary); }
a:hover { color: var(--color-accent); }

/* ── Header ──────────────────────────────────────────────── */
.header {
    background: linear-gradient(90deg, var(--color-navy) 0%, var(--color-navy-mid) 60%, #0a1f35 100%);
    border-bottom: 1px solid rgba(0,255,136,.2);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 18px rgba(0,255,136,.12);
    height: 42px;
    flex-shrink: 0;
}

/* ── Logo ─────────────────────────────────────────────────── */
.logo-link { text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-img {
    height: 28px;
    width: 28px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(0,255,136,.6));
}
.logo-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -.02em;
    cursor: pointer;
    text-shadow: 0 0 18px rgba(0,255,136,.6), 0 0 40px rgba(0,255,136,.3);
}

/* ── Desktop nav ─────────────────────────────────────────── */
.nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 4px;
}
.nav a {
    color: var(--color-primary);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    transition: background .18s, color .18s;
    white-space: nowrap;
}
.nav a:hover { background: rgba(0,255,136,.12); color: var(--color-primary); }
.nav a.active { color: var(--color-primary); background: rgba(0,255,136,.15); }

.nav-parent-link {
    border-right: 1px solid rgba(0,255,136,.2) !important;
    padding-right: 12px !important;
    margin-right: 6px !important;
    color: var(--color-primary) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}
.nav-parent-link:hover { color: var(--color-primary) !important; background: none !important; }

/* ── Nav dropdown ────────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: background .18s, color .18s;
    display: flex;
    align-items: center;
    gap: 3px;
}
.nav-dropdown-toggle::after { content: ' ▾'; font-size: 10px; }
.nav-dropdown-toggle:hover, .nav-dropdown-toggle.active {
    background: rgba(0,255,136,.12); color: var(--color-primary);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #081828;
    border: 1px solid rgba(0,255,136,.25);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,255,136,.12);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
}
.nav-dropdown-menu a {
    display: block;
    padding: 11px 18px;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 0;
    transition: background .15s;
    text-decoration: none;
}
.nav-dropdown-menu a:hover { background: rgba(0,255,136,.1); color: var(--color-primary); }
.nav-dropdown-menu a.active { color: var(--color-primary); font-weight: 700; }

/* ── Hero section ────────────────────────────────────────── */
.hero-section {
    width: 100%;
    padding: 80px 5% 70px;
    text-align: center;
    color: var(--color-white);
    background-color: transparent;
    background-size: cover;
    background-position: center;
    position: relative;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(4, 10, 22, 0.62);
}
.hero-section > * { position: relative; z-index: 1; }
.hero-section h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--color-primary);
    text-shadow:
        0 0 20px rgba(0,255,136,.8),
        0 0 60px rgba(0,255,136,.4),
        2px 3px 12px rgba(0,0,0,.8);
}

/* Topic badge */
.hero-topic-badge {
    display: inline-block;
    background: rgba(0,255,136,.18);
    border: 1px solid rgba(0,255,136,.4);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(0,255,136,.5);
    box-shadow: 0 2px 14px rgba(0,255,136,.2);
}

/* Subtitle */
.hero-subtitle-text {
    margin-top: 14px;
    font-size: 1.1em;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    opacity: .88;
    line-height: 1.5;
    color: var(--color-text-light);
    text-shadow: 0 1px 6px rgba(0,0,0,.6);
}

.hero-section--plain {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
    background-image: none;
}
.hero-section--plain::before { display: none; }

/* ── Content sections ────────────────────────────────────── */
.content-section {
    padding: 56px 5%;
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 28px;
    padding-left: 16px;
    border-left: 4px solid var(--color-primary);
    text-shadow: 0 0 16px rgba(0,255,136,.4);
}

/* ── Cards ───────────────────────────────────────────────── */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover {
    box-shadow: 0 6px 28px rgba(0,255,136,.18);
    border-color: rgba(0,255,136,.45);
    transform: translateY(-2px);
}
.card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 10px;
}

/* ── Blog listing ────────────────────────────────────────── */
.blog-month-group  { margin-bottom: 48px; }
.blog-month-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,255,136,.2);
}
.blog-year  { font-size: 0.8rem; font-weight: 700; color: rgba(0,255,136,.45); letter-spacing: .08em; }
.blog-month { font-size: 1.1rem; font-weight: 800; color: var(--color-primary); }

.blog-card { margin-bottom: 18px; }
.blog-card-body {
    /* Transparent white — shows background through card */
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(0,255,136,.2);
    border-radius: var(--radius);
    padding: 22px 26px;
    box-shadow: 0 2px 18px rgba(0,0,0,.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: box-shadow .18s, border-color .18s, transform .18s;
}
.blog-card-body:hover {
    box-shadow: 0 6px 28px rgba(0,255,136,.15);
    border-color: rgba(0,255,136,.45);
    transform: translateY(-1px);
}
.blog-card-topic {
    display: inline-block;
    background: rgba(0,255,136,.15);
    border: 1px solid rgba(0,255,136,.3);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}
.blog-card-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--color-text);
    text-decoration: none;
}
.blog-card-title:hover { color: var(--color-primary); }
.blog-card-summary { font-size: 0.9rem; color: var(--color-text-light); line-height: 1.6; margin-bottom: 14px; }
.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,255,136,.12);
}
.blog-meta-left { display: flex; gap: 14px; font-size: 12px; color: rgba(0,255,136,.55); }
.blog-meta-left span { white-space: nowrap; }
.blog-read-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(0,255,136,.4);
}
.blog-read-more:hover { color: var(--color-accent); }

/* ── Spinner ─────────────────────────────────────────────── */
.blog-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(0,255,136,.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Contact form ────────────────────────────────────────── */
.contact-form label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--color-text-light); margin-bottom: 5px; margin-top: 16px;
}
.contact-form input[type=text],
.contact-form input[type=email],
.contact-form input[type=number],
.contact-form textarea {
    width: 100%; padding: 10px 14px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(0,255,136,.2);
    border-radius: 6px; font-size: 14px;
    color: var(--color-text); outline: none;
    transition: border .15s; font-family: inherit;
}
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0,255,136,.15);
    background: rgba(255,255,255,.1);
}
.contact-form textarea { height: 130px; resize: vertical; }
.contact-form button[type=submit] {
    margin-top: 22px;
    background: var(--color-primary);
    color: #041020; border: none;
    padding: 12px 32px;
    border-radius: 6px; font-size: 14px;
    font-weight: 700; cursor: pointer;
    transition: background .15s, box-shadow .15s;
    font-family: inherit;
    box-shadow: 0 0 18px rgba(0,255,136,.35);
}
.contact-form button[type=submit]:hover {
    background: var(--color-accent);
    box-shadow: 0 0 28px rgba(0,255,136,.55);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    background: linear-gradient(90deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
    border-top: 1px solid rgba(0,255,136,.15);
    color: var(--color-primary);
    text-align: center;
    padding: 12px 20px;
    font-size: 12px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}
.footer a { color: var(--color-primary); text-decoration: none; }
.footer a:hover { color: var(--color-primary); }

/* ── Mobile sticky nav ───────────────────────────────────── */
#mobile-nav-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(90deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
    border-top: 1px solid rgba(0,255,136,.15);
    z-index: 900;
    box-shadow: 0 -2px 14px rgba(0,0,0,.4);
}
#mobile-nav-bar nav {
    display: flex;
    justify-content: space-around;
    padding: 0;
}
#mobile-nav-bar .nav-item {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    border-right: 1px solid rgba(0,255,136,.15);
}
#mobile-nav-bar .nav-item:last-child { border-right: none; }
#mobile-nav-bar .nav-item.active,
#mobile-nav-bar .nav-item:hover { color: var(--color-primary); background: rgba(0,255,136,.08); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
    .nav { display: none; }
    #mobile-nav-bar { display: block; }
    body { padding-bottom: 50px; }
    .content-section { padding: 36px 5%; }
    .hero-section { padding: 56px 5% 48px; }
}

/* ── Post body typography ────────────────────────────────── */
.content-section h2 { color: var(--color-primary); font-size: 1.4rem; margin-top: 2rem; }
.content-section h3 { color: var(--color-accent); font-size: 1.15rem; margin-top: 1.5rem; }
.content-section p  { margin-bottom: 1rem; }
.content-section ul, .content-section ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.content-section li { margin-bottom: .4rem; }
.content-section blockquote {
    border-left: 4px solid var(--color-primary);
    margin: 1.5rem 0; padding: .8rem 1.2rem;
    background: rgba(0,255,136,.07);
    border-radius: 0 6px 6px 0;
    color: var(--color-text-light);
    font-style: italic;
}

/* ── Post topic tag pill ─────────────────────────────────── */
.post-topic-tag { /* kept for backward compatibility */ }

/* ── Prev/Next link override ─────────────────────────────── */
.post-nav-link {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(0,255,136,.2);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-decoration: none;
    color: var(--color-text);
    display: block;
    backdrop-filter: blur(8px);
    transition: border-color .15s, box-shadow .15s;
}
.post-nav-link:hover {
    border-color: rgba(0,255,136,.45);
    box-shadow: 0 4px 18px rgba(0,255,136,.12);
}
