body {
    --bg: #0f172a;
    --panel: #111827;
    --panel-2: #1f2937;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --brand: #f97316;
    --brand-2: #fb923c;
    --ok: #22c55e;
    --border: #334155;
    --shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.16), transparent 32rem), var(--bg);
    color: var(--text);
    min-height: 100vh;
}

* {
    box-sizing: border-box;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem clamp(1rem, 4vw, 3rem) clamp(2.25rem, 5vw, 3.5rem);
    position: relative;
}

.header {
    padding: 2rem clamp(1rem, 4vw, 3rem);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    position: relative;
    z-index: 1;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1180px;
    margin: 0 auto;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(249, 115, 22, 0.45);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.profile-info {
    text-align: left;
    flex: 1;
}

.eyebrow {
    color: var(--brand-2);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .78rem;
    font-weight: 800;
    margin: 0 0 0.6rem;
}

.profile-links {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.4rem 0;
}

.profile-links a {
    text-decoration: none;
    color: var(--text);
    padding: 0.75rem 1.1rem;
    border-radius: 0.9rem;
    transition: all 0.2s ease;
    background: var(--panel-2);
    border: 1px solid var(--border);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.profile-links a:hover {
    border-color: var(--brand-2);
    transform: translateY(-2px);
}

.profile-links a:nth-child(1) i { color: #ef4444; }
.profile-links a:nth-child(2) i { color: #9ca3af; }
.profile-links a:nth-child(3) i { color: #0077b5; }
.profile-links a:nth-child(4) i { color: var(--brand-2); }

h1, h2, h3 {
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

h1 {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    color: var(--text);
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    color: var(--text);
}

h3 {
    font-size: 1.15rem;
}

.subtitle {
    color: var(--brand-2);
    margin-bottom: 0.75rem;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 700;
}

.hero-summary {
    color: var(--muted);
    max-width: 760px;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.terminal-info {
    font-family: 'Courier New', monospace;
    font-size: 0.92rem;
    color: var(--text);
    background: #0b1220;
    padding: 10px 16px;
    border-radius: 0.8rem;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    position: relative;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    z-index: 1;
}

.terminal-info::before {
    content: '[robert@platform] $';
    color: var(--brand-2);
    margin-right: 8px;
    white-space: nowrap;
}

.terminal-text {
    position: relative;
    display: inline-block;
    width: 0;
    max-width: 100%;
    font-size: 0.95rem;
    padding-right: 15px;
    color: var(--text);
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    animation: typewriter 1.5s steps(50, end) 0.2s both;
}

.terminal-text::after {
    content: '█';
    position: absolute;
    right: 0;
    top: 0;
    animation: blink 1s step-end infinite;
    color: var(--brand-2);
}

.card, .skill-category, .work-card {
    background: rgba(17, 24, 39, 0.88);
    border: 1px solid var(--border);
    border-radius: 1.4rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.intro-card {
    margin-bottom: 0;
}

/* Match other sections: eyebrow + h2 full width; framed panel only for body copy */
.intro-card-body {
    margin-top: 1rem;
}

.skills-container, .work-grid {
    display: grid;
    gap: 1rem;
    /* bottom spacing comes from .container > section so gaps between blocks match */
    margin: 1rem 0 0;
}

.skills-container {
    grid-template-columns: repeat(3, 1fr);
}

.work-grid {
    grid-template-columns: repeat(4, 1fr);
}

.focus-grid {
    grid-template-columns: repeat(4, 1fr);
}

.skill-category, .work-card {
    transition: all 0.2s ease;
}

.skill-category:hover, .work-card:hover {
    border-color: rgba(249, 115, 22, 0.75);
    transform: translateY(-3px);
}

.skill-category h3, .work-card h3 {
    color: var(--text);
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-weight: 800;
}

.skill-category h3 i {
    margin-right: 0.5rem;
    color: var(--brand-2);
}

.skill-category p, .work-card p, .fade-in-text span {
    color: var(--muted);
}

.skill-category ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.skill-category li {
    color: var(--text);
    border-left: 2px solid rgba(249, 115, 22, 0.45);
    padding-left: 0.85rem;
    margin: 0.65rem 0;
    font-size: 1rem;
}

/* Uniform spacing between content blocks in main (eyebrow → content rhythm) */
.container > section {
    margin: 0;
    padding-top: clamp(2.25rem, 5vw, 3.5rem);
}

.container > section:first-child {
    padding-top: 0;
}

.fade-in-text span {
    display: block;
    margin-bottom: 0.9rem;
    padding-left: 2rem;
    position: relative;
}

.fade-in-text span i {
    position: absolute;
    left: 0;
    top: 0.2rem;
    color: var(--brand-2);
}

.footer {
    text-align: center;
    padding: 2rem clamp(1rem, 4vw, 3rem);
    margin-top: clamp(1.5rem, 4vw, 2.5rem);
    border-top: 1px solid var(--border);
    background: rgba(17, 24, 39, 0.35);
}

.quote {
    font-style: italic;
    color: var(--muted);
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.6;
}

.quote-text {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.quote-author {
    font-size: 0.9rem;
    color: var(--muted);
    font-style: normal;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.terminal-expanded {
    position: fixed;
    width: min(900px, 90%);
    height: 400px;
    top: 12%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: #0b1220;
    overflow-y: auto;
    padding: 20px;
    font-family: 'Courier New', monospace;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-radius: 1rem;
    opacity: 0;
    transition: all 0.3s ease-out;
    z-index: 1000;
}

.terminal-expanded.active {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
}

.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
    z-index: 999;
}

.terminal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.command-history {
    color: var(--text);
    margin: 0;
    padding: 0;
    list-style: none;
}

.command-history li {
    margin-bottom: 8px;
}

.command-history .prompt {
    color: var(--brand-2);
    margin-right: 8px;
}

.command-history .output {
    color: var(--muted);
    margin-left: 24px;
    font-size: 0.9em;
    white-space: pre-line;
}

#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

#matrix.active {
    opacity: 1;
    z-index: 0;
}

.matrix-active .container,
.matrix-active .footer,
.matrix-active .header {
    opacity: 0;
    pointer-events: none;
}

/* Neutral wrapper — the sticker PNG already has a white rim; no extra plate behind it */
.clippy-mascot {
    position: relative;
    flex-shrink: 0;
}

.clippy {
    width: 148px;
    height: 152px;
    display: block;
    object-fit: contain;
    cursor: pointer;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.5));
}

.clippy-bubble {
    background: linear-gradient(
        160deg,
        rgba(71, 85, 105, 0.55) 0%,
        rgba(51, 65, 85, 0.92) 38%,
        rgba(36, 49, 66, 0.97) 100%
    );
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 1.15rem;
    padding: 1rem 1.2rem;
    position: relative;
    max-width: min(300px, calc(100vw - 7.5rem));
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text);
    box-shadow: var(--shadow), 0 0 0 1px rgba(249, 115, 22, 0.07);
}

/* Pointer toward the mascot (same plane as cards) */
.clippy-bubble::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: 1.35rem;
    width: 12px;
    height: 12px;
    background: rgb(36, 49, 66);
    border-right: 1px solid rgba(148, 163, 184, 0.45);
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    transform: rotate(-45deg);
    z-index: 0;
}

.clippy-bubble a {
    color: var(--brand-2);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(249, 115, 22, 0.35);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.clippy-bubble a:hover {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.clippy-container {
    position: fixed;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    right: -300px;
    bottom: 30px;
    z-index: 1000;
    transition: right 0.5s ease;
    opacity: 0;
    visibility: hidden;
}

.clippy-container.active {
    right: 30px;
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1100px) {
    .skills-container, .work-grid, .focus-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-info {
        text-align: center;
    }

    .profile-links {
        justify-content: center;
    }

    .profile-image {
        width: 145px;
        height: 145px;
    }

    .skills-container, .work-grid, .focus-grid {
        grid-template-columns: 1fr;
    }

    .terminal-info {
        width: 100%;
        max-width: 330px;
        font-size: 0.7rem;
        justify-content: flex-start;
    }

    .terminal-info::before {
        display: none;
    }

    .terminal-text {
        text-overflow: ellipsis;
    }
}
