/* Import a tech-style font */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

/* Ensure article-body lists match main text style */
.article-body ul,
.article-body ol,
.article-body li {
    font-size: .9rem;
    line-height: 1.6;
    color: #94a3b8;
}

:root {
    --bg-color: #0a0b10;
    --card-bg: #14181f;
    --accent-cyan: #00f2ff;
    --text-main: #e0e0e0;
    --text-dim: #94a3b8;
    --border-color: rgba(0, 242, 255, 0.15);
    --glow: 0 0 15px rgba(0, 242, 255, 0.1);
}

body {
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(rgba(0, 242, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
    padding: 0;
}

/* Header & Nav */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    color: var(--accent-cyan);
    font-weight: bold;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 30px;
    font-size: 0.9rem;
    transition: 0.3s;
}

nav a:hover, nav a.active {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan);
}

/* Common Card Style */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    box-shadow: var(--glow);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        rgba(0, 242, 255, 0.03) 0px,
        rgba(0, 242, 255, 0.03) 1px,
        transparent 1px,
        transparent 4px
    );
    pointer-events: none;
    opacity: 0.45;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 242, 255, 0.35);
    box-shadow: 0 0 18px rgba(0, 242, 255, 0.2);
}

.card-title {
    color: var(--accent-cyan);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
}

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

h1.page-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    letter-spacing: 4px;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 8px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hero-card {
    grid-column: span 3;
    height: 350px;
    background: url('images/miso_ciso_web.png') center/cover;
    display: flex;
    align-items: flex-end;
    padding: 0 40px 40px;
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-left: 4px solid var(--accent-cyan);
}

.hero-title {
    margin: 0;
}

.hero-subtitle {
    color: var(--accent-cyan);
    margin: 5px 0 0;
}

.sidebar-stack {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 20px;
    height: 100%;
}

.panel-card {
    display: flex;
    flex-direction: column;
}

.sidebar-stack .panel-card {
    min-height: 0;
    padding-bottom: 26px;
}

.compact-body {
    font-size: 0.8rem;
}

.health-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.health-bar {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.health-bar-square,
.health-bar-circle {
    width: 15px;
    height: 15px;
    background-color: #4c4f66;
}

.health-bar-square {
    border: 1px solid #555;
}

.health-bar-circle {
    border-radius: 50%;
}

.health-bar-square.red,
.health-bar-circle.red {
    background-color: #ff4d4d;
}

.health-bar-square.orange,
.health-bar-circle.orange {
    background-color: #ff9900;
}

.health-bar-square.yellow,
.health-bar-circle.yellow {
    background-color: #facc15;
}

.health-bar-square.lightgreen,
.health-bar-circle.lightgreen {
    background-color: #a7f3d0;
}

.health-bar-square.green,
.health-bar-circle.green {
    background-color: #4ade80;
}

.health-bar-square.darkgreen,
.health-bar-circle.darkgreen {
    background-color: #15803d;
}

.health-bar-square.off {
    background-color: #4c4f66;
}

.health-bar-square.red.flashing { animation: flash-red 1s infinite; }
.health-bar-square.orange.flashing { animation: flash-orange 1s infinite; }
.health-bar-square.yellow.flashing { animation: flash-yellow 1s infinite; }
.health-bar-square.lightgreen.flashing { animation: flash-lightgreen 1s infinite; }
.health-bar-square.green.flashing,
.health-bar-circle.flashing { animation: flash-green 1s infinite; }
.health-bar-square.darkgreen.flashing { animation: flash-darkgreen 1s infinite; }

.health-bar > :last-child.flashing {
    animation: none;
}

@keyframes flash-red {
    0%, 100% { background-color: #ff4d4d; }
    50% { background-color: #fff; }
}

@keyframes flash-orange {
    0%, 100% { background-color: #ff9900; }
    50% { background-color: #fff; }
}

@keyframes flash-yellow {
    0%, 100% { background-color: #facc15; }
    50% { background-color: #fff; }
}

@keyframes flash-lightgreen {
    0%, 100% { background-color: #81f1bd; }
    50% { background-color: #fff; }
}

@keyframes flash-green {
    0%, 100% { background-color: #4ade80; }
    50% { background-color: #fff; }
}

@keyframes flash-darkgreen {
    0%, 100% { background-color: #15803d; }
    50% { background-color: #fff; }
}

.soc-gauge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    align-content: start;
}

.soc-gauge {
    width: 112px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.soc-gauge-svg {
    width: 112px;
    height: 112px;
    transform: rotate(135deg);
}

.soc-gauge-track,
.soc-gauge-arc {
    fill: none;
    stroke-width: 14;
    stroke-linecap: butt;
    transform-origin: 50% 50%;
}

.soc-gauge-track {
    stroke: rgba(148, 163, 184, 0.25);
    stroke-dasharray: 216.8 289;
}

.soc-gauge-arc {
    stroke: url(#socGaugeGradientSystem);
    stroke-dasharray: 216.8 289;
    stroke-dashoffset: 216.8;
    transition: stroke-dashoffset 0.6s ease;
}

.active-threats-card .soc-gauge-arc {
    stroke: url(#socGaugeGradientThreat);
}

.soc-gauge-value {
    position: absolute;
    top: 47px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    min-width: 64px;
    text-align: center;
}

.soc-gauge-label {
    margin-top: 2px;
    font-size: 0.85rem;
    color: var(--text-main);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-line {
    font-size: 1rem;
    color: #4ade80;
    text-align: left;
    margin-top: 8px;
    margin-bottom: 0;
    padding-top: 2px;
}

.page-hero {
    margin-bottom: 20px;
}

.page-hero h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.page-hero p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.92rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.project-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 12px;
}

.project-title {
    margin: 0 0 8px;
    color: #fff;
    font-size: 1rem;
}

.project-copy {
    margin: 0 0 14px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-dim);
}

.button-link {
    display: inline-block;
    color: var(--accent-cyan);
    text-decoration: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

.button-link:hover {
    border-color: rgba(0, 242, 255, 0.5);
    text-shadow: 0 0 8px var(--accent-cyan);
}

.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

.profile-photo {
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    object-fit: cover;
}

.profile-copy {
    color: var(--text-dim);
    line-height: 1.65;
    font-size: 0.9rem;
}

.stack-list {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--text-main);
    font-size: 0.88rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chip {
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
    padding: 4px 8px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-template-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.project-detail-block h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: #fff;
}

.project-detail-block p {
    margin: 0 0 10px;
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 0.9rem;
}

.project-meta-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-meta-list li {
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 0.86rem;
}

.project-meta-list strong {
    color: var(--accent-cyan);
    font-weight: 700;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    color: var(--text-main);
    font-size: 0.86rem;
}

.timeline li:last-child {
    border-bottom: 0;
}

.site-footer {
    margin: 18px 20px 20px;
    border: 1px solid var(--border-color);
    background: rgba(10, 11, 16, 0.84);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.footer-note {
    margin: 0;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 0.78rem;
}

.social-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.social-link:hover {
    text-shadow: 0 0 8px var(--accent-cyan);
}

.ctf-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(10, 11, 16, 0.92);
    color: var(--accent-cyan);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 120;
}

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

.ctf-hint-overlay {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: rgba(10, 11, 16, 0.94);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 255, 0.35);
    box-shadow: 0 0 16px rgba(0, 242, 255, 0.2);
    padding: 10px 14px;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 121;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.ctf-hint-overlay.show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ctf-hint-overlay.hide {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        grid-column: span 1;
        height: 280px;
    }

    .sidebar-stack {
        height: auto;
    }

    .panel-card {
        min-height: auto;
    }

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

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .project-template-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    nav a {
        margin-left: 0;
        margin-right: 18px;
        display: inline-block;
    }

    .hero-card {
        height: 220px;
        padding: 0 20px 20px;
    }

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

    .container {
        margin: 20px auto;
    }

    .ctf-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }

    .ctf-hint-overlay {
        right: 12px;
        bottom: 60px;
    }
}

@media (max-width: 520px) {
    .soc-gauge-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .soc-gauge {
        width: 92px;
    }

    .soc-gauge-svg {
        width: 92px;
        height: 92px;
    }

    .soc-gauge-value {
        top: 37px;
        font-size: 1rem;
        min-width: 56px;
    }

    .soc-gauge-label {
        font-size: 0.78rem;
    }

    .site-footer {
        margin: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
}

