/*
  File: /home/hackworth/Server/Main/static/css/portfolio.css

  Purpose:
  Main stylesheet for the TrelloTriage Labs portfolio homepage.

  Why this exists:
  The old index.html held all CSS inline inside a <style> block. That made the
  page long and risky to edit. Moving styles here lets index.html focus on page
  structure while this file handles visual design.

  Learning note:
  Flask serves files from /static automatically.

  This file will be loaded from index.html with:

      <link rel="stylesheet" href="/static/css/portfolio.css">

  CSS organization:
    1. Theme variables
    2. Base layout
    3. Top navigation
    4. Hero section
    5. Filters
    6. Project cards
    7. Modal
    8. SEO/crawler text section
    9. Responsive layout
*/


/* ============================================================
   1. THEME VARIABLES
   ============================================================ */

:root {
    --bg0: #030712;
    --bg-card: rgba(15, 23, 42, 0.70);
    --bg-card-hover: rgba(2, 6, 23, 0.82);

    --text: #f8fafc;
    --text-muted: #94a3b8;

    --accent-main: #22d3ee;
    --accent-alt: #a78bfa;
    --accent-green: #4ade80;

    --border-color: rgba(148, 163, 184, 0.18);
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);

    --page-pad: clamp(18px, 2.2vw, 42px);
    --card-min: 360px;
    --radius: 22px;

    --font-stack: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;

    --glass-highlight: rgba(255, 255, 255, 0.10);
    --glass-bg-strong: rgba(15, 23, 42, 0.64);
    --glass-border: rgba(148, 163, 184, 0.18);
}


/* Light theme. Applied by JS with body.theme-light. */
body.theme-light {
    --bg0: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.78);
    --bg-card-hover: rgba(248, 250, 252, 0.90);

    --text: #0f172a;
    --text-muted: #475569;

    --accent-main: #0ea5e9;
    --accent-alt: #8b5cf6;

    --border-color: rgba(15, 23, 42, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.40);
    --glass-bg-strong: rgba(248, 250, 252, 0.80);
    --glass-border: rgba(15, 23, 42, 0.12);

    background:
        radial-gradient(circle at 10% 0%, rgba(34, 211, 238, 0.16), transparent 32%),
        radial-gradient(circle at 85% 12%, rgba(167, 139, 250, 0.18), transparent 34%),
        linear-gradient(135deg, #f8fafc 0%, #e0f2fe 48%, #f5f3ff 100%);
}


/* Terminal theme. Applied by JS with body.theme-terminal. */
body.theme-terminal {
    --bg0: #050505;
    --bg-card: #0a0a0a;
    --bg-card-hover: #111111;

    --text: #4ade80;
    --text-muted: #22c55e;

    --accent-main: #4ade80;
    --accent-alt: #22c55e;

    --border-color: #166534;
    --glass-highlight: rgba(74, 222, 128, 0.05);
    --glass-bg-strong: rgba(0, 0, 0, 0.9);
    --glass-border: #166534;

    --font-stack: "Courier New", Courier, monospace;

    background: #000;
}


/* Cyberpunk theme. Applied by JS with body.theme-cyberpunk. */
body.theme-cyberpunk {
    --bg0: #09021a;
    --bg-card: rgba(30, 0, 50, 0.8);
    --bg-card-hover: rgba(50, 0, 80, 0.9);

    --text: #fdf2f8;
    --text-muted: #f472b6;

    --accent-main: #f0abfc;
    --accent-alt: #22d3ee;

    --border-color: rgba(244, 114, 182, 0.3);
    --glass-highlight: rgba(244, 114, 182, 0.1);
    --glass-bg-strong: rgba(30, 0, 50, 0.9);
    --glass-border: rgba(244, 114, 182, 0.3);

    background: linear-gradient(135deg, #1f0033 0%, #0a001a 100%);
}


/* ============================================================
   2. BASE LAYOUT
   ============================================================ */

* {
    box-sizing: border-box;
    font-family: var(--font-stack);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg0);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
    opacity: 0.3;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

.page {
    width: 100%;
    padding: 34px var(--page-pad) 70px;
}


/* ============================================================
   3. TOP NAVIGATION
   ============================================================ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(18px);
}

body.theme-light .topbar {
    background: rgba(248, 250, 252, 0.6);
}

body.theme-terminal .topbar {
    background: rgba(0, 0, 0, 0.9);
}

body.theme-cyberpunk .topbar {
    background: rgba(10, 0, 26, 0.8);
}

.topbar-inner {
    width: 100%;
    padding: 0 var(--page-pad);
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-main), var(--accent-alt));
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.brand-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title strong {
    font-size: 1rem;
    color: var(--text);
}

.brand-title span {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.controls-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ui-button {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    padding: 9px 12px;
    cursor: pointer;
    transition: 160ms ease;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ui-button:hover {
    border-color: var(--accent-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.nav-button.active {
    border-color: var(--accent-main);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.22),
        0 0 20px color-mix(in srgb, var(--accent-main) 18%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.contact-button {
    background:
        radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent-main) 20%, transparent), transparent 48%),
        linear-gradient(135deg, var(--glass-highlight), transparent 45%),
        var(--glass-bg-strong);
    border-color: color-mix(in srgb, var(--accent-main) 40%, var(--glass-border));
}

.contact-button::before {
    content: "✉";
    margin-right: 7px;
}


/* ============================================================
   4. HERO SECTION
   ============================================================ */

.page-head {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
    margin-bottom: 22px;
    padding: 40px;
    border-radius: 28px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    background: rgba(15, 23, 42, 0.4);
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
}

.page-head-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-main);
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    text-transform: uppercase;
    margin-bottom: 14px;
    backdrop-filter: blur(4px);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 18px var(--accent-green);
}

.page-head h1 {
    margin: 0;
    font-size: clamp(2.25rem, 5vw, 4rem);
    letter-spacing: -0.05em;
    line-height: 1;
}

.page-head p {
    max-width: 800px;
    margin: 16px 0 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.quick-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 10px;
    pointer-events: none;
}

.stat {
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 14px;
}

.stat strong {
    display: block;
    font-size: 1.4rem;
    color: var(--text);
}

.stat span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
}


/* ============================================================
   5. FILTERS
   ============================================================ */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0 10px;
}

.filter-button {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    border-radius: 14px;
    padding: 11px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
    font-size: 0.85rem;
}

.filter-button:hover,
.filter-button.active {
    color: var(--text);
    border-color: var(--accent-main);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.1);
}


/* ============================================================
   6. PROJECT CARDS
   ============================================================ */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-min)), 1fr));
    gap: 18px;
    width: 100%;
    margin-top: 20px;
}

@keyframes cardEnter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tool-card {
    min-height: 330px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-card-hover));
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
    animation: cardEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.tool-card.invite {
    opacity: 0.6;
    border-style: dashed;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-main);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    opacity: 1;
}

.card-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.tool-card:hover .card-video {
    opacity: 0.15;
}

body.theme-light .tool-card:hover .card-video {
    opacity: 0.08;
}

.card-inner {
    position: relative;
    z-index: 1;
    padding: 22px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.project-icon {
    font-size: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.project-badges {
    display: flex;
    gap: 6px;
}

.badge {
    font-size: 0.7rem;
    font-weight: 800;
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 999px;
    height: fit-content;
}

.badge.live {
    color: var(--accent-green);
    border-color: var(--accent-green);
    background: rgba(74, 222, 128, 0.1);
}

.badge.invite {
    color: #facc15;
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.1);
}

.tool-card h3 {
    margin: 0;
    font-size: 1.45rem;
    color: var(--text);
}

.summary {
    margin: 12px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.tag {
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
}

.card-spacer {
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.launch-link,
.detail-button {
    border: 1px solid var(--border-color);
    color: var(--bg0);
    background: var(--text);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    text-align: center;
}

.detail-button {
    background: transparent;
    color: var(--text);
}

.detail-button:hover,
.launch-link:hover {
    transform: translateY(-2px);
    border-color: var(--accent-main);
}


/* ============================================================
   7. MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    width: min(900px, 100%);
    max-height: 85vh;
    overflow: auto;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg0);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

.modal-header {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.modal h2 {
    margin: 0;
    font-size: 2.5rem;
    color: var(--text);
}

.modal-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 0.9rem;
    color: var(--accent-main);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.detail-section p,
.detail-section li {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1rem;
    margin: 0;
}

.detail-section ul {
    padding-left: 20px;
    margin-top: 10px;
}

.detail-section li {
    margin-bottom: 8px;
}

.modal-close {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.5rem;
}

.modal-close:hover {
    border-color: red;
    color: red;
}


/* ============================================================
   8. SEO / CRAWLER TEXT SECTION
   ============================================================ */

/*
  This section holds plain text project descriptions.

  Why:
  The visual cards are generated by JavaScript, but we still want a crawlable,
  accessible, plain-text version of project descriptions in the HTML.
*/

.seo-project-index {
    margin: 36px 0 0;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.14);
    color: var(--text-muted);
}

.seo-project-index summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 800;
    line-height: 1.4;
}

.seo-project-index h2 {
    margin: 18px 0 8px;
    color: var(--text);
    font-size: 1.35rem;
}

.seo-project-index article {
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
}

.seo-project-index h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1.05rem;
}

.seo-project-index p {
    margin: 8px 0;
    line-height: 1.65;
    font-size: 0.9rem;
}


/* ============================================================
   9. RESPONSIVE LAYOUT
   ============================================================ */

@media (max-width: 900px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .page-head {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .card-actions {
        flex-wrap: wrap;
    }
}