/**
 * Fev - Security Research Portfolio
 * Main stylesheet: dark theme, responsive layout, tool cards, modal.
 * Scrollbar styled per Dieter Rams: unobtrusive, thorough to the last detail, as little design as possible.
 */

/* Reset and base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Scrollbar: dark theme, minimal, functional. Recedes until needed (Rams: Unobtrusive; Thorough to the last detail; As little design as possible). */
html {
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #0f0f0f;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-track {
    background: #0f0f0f;
}
*::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
    background: #404040;
}
*::-webkit-scrollbar-thumb:active {
    background: #505050;
}
*::-webkit-scrollbar-corner {
    background: #0f0f0f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0a0a;
    color: #a8a8a8;
    line-height: 1.6;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 50px;
}

header {
    margin-bottom: 60px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.name-wrapper {
    cursor: pointer;
    line-height: 1;
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    padding-top: 4px;
}

.contact-links-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

.contact-link-header {
    font-size: 11px;
    color: #606060;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid #1a1a1a;
    transition: all 0.2s ease;
    text-transform: lowercase;
}

.contact-link-header:hover {
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.3);
}

.resume-link {
    font-size: 11px;
    color: #00ff88;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.05);
    transition: all 0.2s ease;
    text-transform: lowercase;
}

.resume-link:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.5);
}

h1 {
    font-size: 64px;
    font-weight: 300;
    color: #00ff88;
    letter-spacing: -1.5px;
    line-height: 1;
    transition: letter-spacing 0.3s ease;
}

.name-wrapper:hover h1 {
    letter-spacing: 2px;
}

.char {
    display: inline-block;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    font-size: 11px;
    color: #00ff88;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Desktop: strict two-column grid. Left = content (bio); right = summary (stats). Dieter: thorough, one axis per column. */
.intro {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: center;
}

.intro > div:last-child {
    justify-self: end;
}

.tagline {
    font-size: 15px;
    color: #787878;
    line-height: 1.8;
    max-width: 42em;
}

.stats-compact {
    display: flex;
    gap: 40px;
    padding: 20px 0;
    border-top: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 300;
    color: #e8e8e8;
}

.stat-label {
    font-size: 11px;
    color: #505050;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.focus-areas {
    margin-top: 50px;
    margin-bottom: 50px;
    padding: 32px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-left: 2px solid #00ff88;
}

.focus-title {
    font-size: 12px;
    color: #606060;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.focus-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.focus-item {
    font-size: 13px;
    color: #858585;
    padding-left: 16px;
    position: relative;
}

.focus-item::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #00ff88;
}

.approach-section {
    margin-bottom: 50px;
    padding: 32px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
}

.approach-title {
    font-size: 12px;
    color: #606060;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.approach-text {
    font-size: 14px;
    color: #a8a8a8;
    line-height: 1.8;
    max-width: 900px;
}

.credentials-section {
    display: flex;
    gap: 48px;
    margin-bottom: 50px;
    padding: 24px 0;
    border-top: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
}

.credential-group {
    flex: 1;
}

.credential-label {
    font-size: 11px;
    color: #505050;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.credential-item {
    font-size: 13px;
    color: #858585;
    line-height: 1.6;
}

.featured-project {
    margin-bottom: 50px;
    padding: 40px;
    background: #0f0f0f;
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-left: 3px solid #00ff88;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.featured-project:hover {
    border-color: rgba(0, 255, 136, 0.4);
    background: #121212;
}

.featured-badge {
    font-size: 10px;
    color: #00ff88;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.featured-title {
    font-size: 26px;
    font-weight: 300;
    color: #e8e8e8;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.featured-project:hover .featured-title {
    color: #00ff88;
}

.featured-desc {
    font-size: 14px;
    color: #a8a8a8;
    line-height: 1.8;
    margin-bottom: 20px;
}

.featured-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.featured-highlight {
    font-size: 12px;
    color: #858585;
    padding-left: 16px;
    position: relative;
}

.featured-highlight::before {
    content: '●';
    position: absolute;
    left: 0;
    color: #00ff88;
}

.featured-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.featured-tech-item {
    font-size: 10px;
    color: #00ff88;
    padding: 5px 10px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    background: rgba(0, 255, 136, 0.05);
}

.recent-highlights {
    margin-bottom: 50px;
    padding: 24px 32px;
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    border-left: 2px solid #00ff88;
}

.highlights-title {
    font-size: 12px;
    color: #606060;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.highlights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.highlight-item {
    font-size: 13px;
    color: #858585;
    padding-left: 16px;
    position: relative;
    line-height: 1.6;
}

.highlight-item::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #00ff88;
}

.screenshot-container {
    margin: 24px 0;
    padding: 20px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
}

.screenshot-label {
    font-size: 11px;
    color: #505050;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.screenshot-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #404040;
}

/* Tools grid and cards */
.tools-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.tool-card {
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
    padding: 32px;
    transition: border-color 0.3s ease;
    position: relative;
    cursor: pointer;
}

.tool-card:active {
    transform: scale(0.99);
}

.tool-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: #00ff88;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card:hover {
    border-color: rgba(0, 255, 136, 0.25);
}

.tool-card:hover::before {
    transform: scaleY(1);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.tool-name {
    font-size: 20px;
    color: #e8e8e8;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
}

.tool-card:hover .tool-name {
    color: #00ff88;
}

.tool-number {
    font-size: 10px;
    color: #404040;
    font-family: 'Courier New', monospace;
}

.tool-desc {
    font-size: 13px;
    color: #858585;
    line-height: 1.7;
    margin-bottom: 20px;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.tag {
    font-size: 10px;
    color: #606060;
    padding: 4px 8px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag:hover {
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.3);
}

.tool-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #505050;
    padding-top: 16px;
    border-top: 1px solid #1a1a1a;
}

.lang {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-dot {
    width: 5px;
    height: 5px;
    background: #00ff88;
    border-radius: 50%;
}

/* Footer */
footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #505050;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: #707070;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #00ff88;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal {
    background: #0f0f0f;
    border: 1px solid rgba(0, 255, 136, 0.2);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #0f0f0f;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 32px;
    border-bottom: 1px solid #1a1a1a;
    position: sticky;
    top: 0;
    background: #0f0f0f;
    z-index: 10;
}

.modal-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 28px;
    font-weight: 300;
    color: #00ff88;
}

.modal-close {
    background: none;
    border: 1px solid #1a1a1a;
    color: #606060;
    font-size: 24px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    border-color: rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.modal-subtitle {
    font-size: 13px;
    color: #606060;
}

.modal-content {
    padding: 32px;
}

.modal-section {
    margin-bottom: 32px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-title {
    font-size: 12px;
    color: #606060;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.modal-description {
    font-size: 14px;
    color: #a8a8a8;
    line-height: 1.8;
    margin-bottom: 24px;
}

.modal-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tech-item {
    font-size: 11px;
    color: #00ff88;
    padding: 6px 12px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    background: rgba(0, 255, 136, 0.05);
}

.modal-features {
    list-style: none;
}

.modal-features li {
    font-size: 13px;
    color: #858585;
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
    line-height: 1.6;
}

.modal-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #00ff88;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
}

.modal-stat {
    text-align: center;
}

.modal-stat-value {
    font-size: 24px;
    font-weight: 300;
    color: #e8e8e8;
    margin-bottom: 4px;
}

.modal-stat-label {
    font-size: 10px;
    color: #505050;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding-top: 24px;
}

.modal-button {
    flex: 1;
    padding: 12px 24px;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.modal-button-primary {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.modal-button-primary:hover {
    background: rgba(0, 255, 136, 0.15);
}

.modal-button-secondary {
    background: transparent;
    border: 1px solid #1a1a1a;
    color: #858585;
}

.modal-button-secondary:hover {
    border-color: rgba(0, 255, 136, 0.2);
    color: #a8a8a8;
}

.modal-copy-button {
    padding: 8px 16px;
    font-size: 11px;
    background: transparent;
    border: 1px solid #1a1a1a;
    color: #858585;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-copy-button:hover {
    border-color: rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.modal-copy-button.copied {
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.3);
}

/* Print */
@media print {
    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 20px;
    }

    h1 {
        color: #000;
        font-size: 48px;
    }

    .status-badge,
    .status-dot,
    .modal-overlay,
    .focus-item::before,
    .featured-highlight::before {
        display: none;
    }

    .contact-links-header {
        display: block;
    }

    .contact-link-header {
        color: #000;
        border: 1px solid #ccc;
        display: inline-block;
        margin-right: 8px;
    }

    .contact-link-header::after {
        content: " (" attr(href) ")";
        font-size: 9px;
    }

    .tool-card,
    .approach-section,
    .featured-project,
    .focus-areas {
        background: white;
        border: 1px solid #ccc;
        page-break-inside: avoid;
        margin-bottom: 16px;
    }

    .tool-card::before,
    .featured-project {
        border-left-color: #000;
    }

    .tagline,
    .tool-desc,
    .approach-text,
    .featured-desc {
        color: #333;
    }

    .tool-name,
    .featured-title {
        color: #000;
    }

    .tag,
    .tech-item,
    .featured-tech-item {
        border: 1px solid #ccc;
        color: #000;
        background: #f5f5f5;
    }

    .lang-dot {
        background: #000;
    }

    .stat-value,
    .modal-stat-value {
        color: #000;
    }

    .tools-section {
        grid-template-columns: 1fr;
    }

    footer {
        page-break-before: always;
        border-top: 1px solid #ccc;
    }
}

/* Responsive: tablet */
@media (max-width: 1100px) {
    .tools-section {
        grid-template-columns: 1fr;
    }

    .intro {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .stats-compact {
        flex-wrap: wrap;
    }

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

/* Responsive: mobile – tighter spacing and single column */
@media (max-width: 768px) {
    h1 {
        font-size: 48px;
    }

    .container {
        padding: 40px 24px;
    }

    .tool-card {
        padding: 24px;
    }

    .stats-compact {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .header-top {
        flex-direction: column;
        gap: 24px;
        align-items: stretch;
    }

    .header-right {
        align-items: flex-end;
    }

    .contact-links-header {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .modal {
        width: 95%;
    }

    .modal-header,
    .modal-content {
        padding: 24px;
    }

    .modal-title {
        font-size: 24px;
    }

    .focus-areas {
        margin-top: 40px;
        margin-bottom: 40px;
        padding: 24px;
    }

    .credentials-section {
        flex-direction: column;
        gap: 20px;
    }

    .recent-highlights {
        padding: 20px 24px;
    }

    .screenshot-container {
        padding: 16px;
    }

    .featured-highlights {
        grid-template-columns: 1fr;
    }

    .approach-section,
    .featured-project {
        padding: 24px;
    }

    .focus-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
