/* =========================================================
   PROJECTS.CSS - sekcja projektow na palecie z style.css
   Featured (TurboRivals), dwie karty produkcyjne, siatka 3x2,
   rozwijane "engineering notes". Kolory tylko z :root.
   ========================================================= */

/* --- Naglowki grup --- */
.projects-group { margin-top: 3.5rem; }

.projects-lead {
    max-width: 640px;
    margin: -0.75rem auto 1.75rem;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #aabcdf;
}

/* Linia roli pod tytulem karty */
.card-role {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 1.2px;
    color: var(--accent);
    margin: -4px 0 12px;
}

.project-desc strong { color: var(--text); font-weight: 600; }
.project-desc code,
.field-notes code {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.92em;
}

/* =========================================================
   FEATURED - TURBORIVALS
   Rama z .tc-showcase (style.css), w srodku karta | screen
   ========================================================= */
.feature-panel { max-width: 1200px; }

.feature-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
}

/* Opis nie rozpycha karty - stopka i tak siedzi na dole (margin-top:auto) */
.feature-copy .project-desc,
.prod-card .project-desc { flex-grow: 0; font-size: 0.9rem; }

.feature-copy h3 { font-size: 1.35rem; line-height: 1.25; }

.feature-copy .card-footer-dual { flex-direction: row; }
.feature-copy .card-footer-dual .btn-repo { flex: 1; }

.feature-shot {
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 1.75rem 2rem;
    min-width: 0;
    border-left: 1px solid rgba(0, 240, 255, 0.15);
    background: rgba(0, 0, 0, 0.15);
}

.feature-shot .uplink-telemetry { margin-bottom: 0; }

.feature-shot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 240, 255, 0.08);
}

.feature-shot figcaption {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.5;
    color: #8a9bc4;
    text-align: center;
}

@media (max-width: 960px) {
    .feature-body { grid-template-columns: 1fr; }
    .feature-shot {
        border-left: none;
        border-top: 1px dashed rgba(0, 240, 255, 0.2);
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 520px) {
    .feature-copy .card-footer-dual { flex-direction: column; }
    .feature-panel .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* =========================================================
   METRYKI - pasek 4 liczb
   ========================================================= */
.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid rgba(0, 240, 255, 0.15);
    margin-bottom: 15px;
}

.metrics .m {
    background: rgba(11, 16, 38, 0.95);
    padding: 0.6rem 0.4rem;
    text-align: center;
}

.metrics .v {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--primary);
    line-height: 1.2;
}

.metrics .k {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 1px;
    color: #8a9bc4;
    margin-top: 3px;
}

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

/* =========================================================
   KARTY PRODUKCYJNE (LoRaWAN, Ekoslupek)
   ========================================================= */
.prod-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.prod-card { min-height: 0; }

@media (max-width: 900px) {
    .prod-grid { grid-template-columns: 1fr; max-width: 640px; }
}

/* Plakietka "zrodlo zamkniete" - to NIE jest link */
.btn-repo-locked {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: #8a9bc4;
    border: 1px dashed rgba(77, 141, 255, 0.35);
    background: rgba(0, 0, 0, 0.25);
    cursor: default;
    user-select: none;
}
.btn-repo-locked i { color: var(--accent); }

/* Rodzina produktow LoRa */
.product-family {
    border: 1px solid rgba(0, 240, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
}
.pf-title {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 1.2px;
    color: var(--accent);
    margin-bottom: 8px;
}
.pf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 5px;
}
.pf {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text);
    padding: 4px 7px;
    border-left: 2px solid rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.04);
}
.pf i { color: var(--primary); width: 12px; }
.pf b { margin-left: auto; color: var(--secondary); font-weight: 400; }

/* =========================================================
   ENGINEERING NOTES - <details>
   ========================================================= */
.deep-dive {
    margin: 0 0 15px;
    border-top: 1px dashed rgba(0, 240, 255, 0.2);
    padding-top: 12px;
}

.deep-dive > summary {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: var(--primary);
    padding: 8px 14px;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.05);
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.deep-dive > summary::-webkit-details-marker { display: none; }

.deep-dive > summary:hover,
.deep-dive > summary:focus-visible {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--primary);
    outline: none;
}

.dd-mark {
    width: 0; height: 0;
    border-left: 6px solid var(--primary);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.2s ease;
}

.deep-dive[open] > summary .dd-mark { transform: rotate(90deg); }

.dd-body {
    padding-top: 1rem;
    animation: ddIn 0.25s ease-out;
}

@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }

.field-notes {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px dashed rgba(0, 240, 255, 0.15);
}

.field-notes li {
    position: relative;
    padding: 0.6rem 0 0.6rem 1.4rem;
    border-bottom: 1px dashed rgba(0, 240, 255, 0.1);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #aabcdf;
}

.field-notes li::before {
    content: '▸';
    position: absolute;
    left: 0.2rem;
    top: 0.55rem;
    color: var(--primary);
    font-size: 0.8rem;
}

.field-notes b { color: var(--text); font-weight: 600; }

/* =========================================================
   WIECEJ PROJEKTOW - siatka 3x2 (3 -> 2 -> 1 kolumna)
   ========================================================= */
.projects-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1100px) {
    .projects-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }
}

@media (max-width: 680px) {
    .projects-grid.six { grid-template-columns: 1fr; max-width: 440px; }
}

/* Akcenty kart spoza style.css */
.card-thermo { border-color: rgba(255, 107, 74, 0.4); }
.card-thermo .card-icon { background: rgba(255, 107, 74, 0.15); color: #ff6b4a; }
.card-thermo:hover { border-color: #ff6b4a; box-shadow: 0 10px 30px rgba(255, 107, 74, 0.15); }

.card-fsqrt { border-color: rgba(157, 78, 255, 0.4); }
.card-fsqrt .card-icon { background: rgba(157, 78, 255, 0.15); color: #b47aff; }
.card-fsqrt:hover { border-color: #b47aff; box-shadow: 0 10px 30px rgba(157, 78, 255, 0.15); }

/* =========================================================
   ABOUT - LeetCode w jednej linijce + CV
   ========================================================= */
.leet-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0 0 1.5rem;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #aabcdf;
    text-decoration: none;
    border: 1px dashed rgba(77, 141, 255, 0.35);
    background: rgba(0, 0, 0, 0.2);
    transition: 0.2s;
}
.leet-line .k { color: var(--secondary); letter-spacing: 1px; }
.leet-line b { color: var(--primary); }
.leet-line i { margin-left: auto; color: var(--accent); }
.leet-line:hover { border-color: var(--primary); color: var(--text); }

.about-cv { margin-top: 0.5rem; }

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .project-card:hover { transform: none; }
}
