/* ===== Hero ===== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    min-height: 90svh;
    padding-block: calc(var(--nav-height) + 3rem) 4rem;
    overflow: hidden;
    text-align: center;
    background-color: var(--bg);
    background-image:
        linear-gradient(135deg, rgba(9, 9, 11, 0.85) 0%, rgba(9, 9, 11, 0.97) 100%),
        url('../images/hero-bg.webp');
    background-size: cover;
    background-position: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(800px, 150vw);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.hero .container {
    position: relative;
}

.avatar {
    position: relative;
    width: 8rem;
    height: 8rem;
    margin: 0 auto 1.5rem;
}

.avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(to top right, var(--brand-500), var(--brand-accent));
    filter: blur(12px);
    opacity: 0.7;
}

.avatar img {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.hero-title {
    margin-bottom: 1rem;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.gradient-text {
    background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-600) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    max-width: 42rem;
    margin: 0 auto 2rem;
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .hero-actions {
        flex-direction: row;
    }
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 48rem;
    margin: 3.5rem auto 0;
}

.stat {
    display: flex;
    flex-direction: column-reverse;
    padding: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(4px);
}

.stat dd {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat dt {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== About ===== */
.about {
    display: grid;
    gap: 4rem;
    align-items: center;
}

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

.about-title {
    margin-bottom: 1.5rem;
    font-size: clamp(1.875rem, 4vw, 2.25rem);
    font-weight: 700;
}

.about-title span {
    color: var(--brand-400);
}

.about-copy {
    display: grid;
    gap: 1.25rem;
    font-size: 1.125rem;
    line-height: 1.75;
}

.skills-card {
    padding: 2rem;
    background: rgba(9, 9, 11, 0.8);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.skills-card::before {
    content: '';
    position: absolute;
    top: -2rem;
    right: -2rem;
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, transparent 70%);
    filter: blur(2rem);
    pointer-events: none;
    z-index: -1;
}

.skills-card h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.skills-card h3 i {
    color: var(--brand-accent);
}

.skill-groups {
    display: grid;
    gap: 1.5rem;
}

.skill-group h4 {
    margin-bottom: 0.625rem;
    color: var(--brand-400);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.skill-group .tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.skill-group .tag i {
    width: 1em;
    color: var(--brand-accent);
    font-size: 0.875rem;
    text-align: center;
}

/* Brand logos not in Font Awesome (Simple Icons SVGs), tinted to match */
.tag-logo {
    flex-shrink: 0;
    width: 0.875rem;
    height: 0.875rem;
    background-color: var(--brand-accent);
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}

.tag-logo--paloalto {
    -webkit-mask-image: url('../icons/brands/paloaltonetworks.svg');
    mask-image: url('../icons/brands/paloaltonetworks.svg');
}

/* Cisco's mark sits in a thin band of a square canvas, so it needs a bigger box */
.tag-logo--cisco {
    width: 1.75rem;
    height: 1.75rem;
    margin-block: -0.5rem;
    -webkit-mask-image: url('../icons/brands/cisco.svg');
    mask-image: url('../icons/brands/cisco.svg');
}

.tag-logo--ubiquiti {
    -webkit-mask-image: url('../icons/brands/ubiquiti.svg');
    mask-image: url('../icons/brands/ubiquiti.svg');
}

.tag-logo--proxmox {
    -webkit-mask-image: url('../icons/brands/proxmox.svg');
    mask-image: url('../icons/brands/proxmox.svg');
}

.tag-logo--truenas {
    -webkit-mask-image: url('../icons/brands/truenas.svg');
    mask-image: url('../icons/brands/truenas.svg');
}

/* ===== Projects ===== */
.project-benefit {
    margin-bottom: 1.5rem !important;
    padding-left: 0.75rem;
    border-left: 2px solid var(--brand-500);
    color: var(--text-soft);
}

/* ===== Experience layout ===== */
.experience-layout {
    display: grid;
    gap: 3rem;
    max-width: 64rem;
    margin-inline: auto;
}

.credentials {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 768px) {
    .credentials {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.credential-block {
    display: grid;
    gap: 1.5rem;
}

.credential-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
}

.credential-heading i {
    color: var(--brand-accent);
}

.credential + .credential {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.credential h4 {
    color: var(--text-strong);
    font-size: 1rem;
    line-height: 1.3;
}

.credential-meta {
    margin: 0.25rem 0 0.5rem;
    color: var(--brand-400);
    font-size: 0.8125rem;
    font-weight: 600;
}

.credential p:last-child {
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ===== Certifications ===== */
.cert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.cert h4 {
    color: var(--text-strong);
    font-size: 1rem;
    line-height: 1.3;
}

.cert-issuer {
    font-size: 0.875rem;
}

.cert-status {
    margin-top: 0.25rem;
    color: var(--brand-400);
    font-size: 0.8125rem;
    font-weight: 600;
}

.cert-note {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.cert-date {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    display: grid;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 19px;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(239, 68, 68, 0.3), transparent);
}

.timeline-item {
    position: relative;
    padding-left: 3.5rem;
}

.timeline-marker {
    position: absolute;
    top: 0.25rem;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-soft);
    font-size: 0.875rem;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.timeline-item:hover .timeline-marker {
    border-color: var(--brand-500);
    color: var(--brand-accent);
}

.timeline-card {
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.timeline-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.timeline-item--highlight .timeline-card {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.timeline-item--highlight .timeline-card:hover {
    border-color: rgba(239, 68, 68, 0.3);
}

.timeline-head {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .timeline-head {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1.5rem;
    }
}

.timeline-head h3 {
    font-size: 1.25rem;
}

.timeline-org {
    font-weight: 500;
}

.timeline-date {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.timeline-item--highlight .timeline-date {
    color: var(--brand-400);
}

.timeline-points {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-left: 1rem;
    font-size: 0.875rem;
}

.timeline-points li::marker {
    color: var(--text-muted);
}

.timeline-item--highlight .timeline-points {
    color: var(--text-soft);
}

.timeline-item--highlight .timeline-points li::marker {
    color: var(--brand-500);
}

/* ===== Projects page ===== */
.page-hero {
    position: relative;
    padding-block: calc(var(--nav-height) + 4rem) 3rem;
    overflow: hidden;
    text-align: center;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: min(700px, 150vw);
    aspect-ratio: 1;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.page-hero .container {
    position: relative;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text-strong);
}

.page-title {
    margin-bottom: 1rem;
    font-size: clamp(2.5rem, 7vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.project-index {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.project-index a {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.project-index a:hover {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    color: var(--text-strong);
}

.case-list {
    display: grid;
    gap: 1.5rem;
}

.case-study {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 640px) {
    .case-study {
        padding: 2rem;
    }
}

@media (min-width: 768px) {
    .case-study {
        grid-template-columns: 15rem minmax(0, 1fr);
        gap: 2rem;
    }
}

.case-media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .case-media {
        grid-template-columns: minmax(0, 1fr);
    }
}

.case-media figure {
    margin: 0;
}

.case-media img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

/* Icon tile for projects without a screenshot */
.case-tile {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.75rem;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 50% 45%, rgba(239, 68, 68, 0.18) 0%, transparent 65%),
        var(--bg);
}

.case-tile-icons {
    display: flex;
    gap: 1rem;
    color: var(--brand-accent);
    font-size: 1.5rem;
}

.case-tile span {
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.case-zoom {
    display: block;
    border-radius: var(--radius);
    transition: opacity 0.2s ease;
}

.case-zoom:hover {
    opacity: 0.8;
}

.case-media figcaption {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.case-kicker {
    margin-bottom: 0.375rem;
    color: var(--brand-400);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.case-body h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.case-body h3 {
    margin: 1.25rem 0 0.5rem;
    color: var(--text-soft);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.case-body > p {
    font-size: 0.9375rem;
    line-height: 1.7;
}

.case-body .project-benefit {
    margin: 1.25rem 0 !important;
}

.case-body a {
    color: var(--brand-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.case-points {
    display: grid;
    gap: 0.375rem;
    padding-left: 1.125rem;
    color: var(--text-soft);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.case-points li::marker {
    color: var(--brand-500);
}

/* ===== Contact ===== */
.contact {
    overflow: hidden;
    text-align: center;
    background: linear-gradient(to bottom, transparent, rgba(127, 29, 29, 0.12));
}

.contact-title {
    margin-bottom: 1.5rem;
    font-size: clamp(2.25rem, 6vw, 3rem);
    font-weight: 800;
}

.contact-lead {
    max-width: 42rem;
    margin: 0 auto 2.5rem;
    font-size: 1.25rem;
}

.contact-card {
    max-width: 42rem;
    margin-inline: auto;
    padding: 2rem;
    background: rgba(24, 24, 27, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -6rem;
    right: -6rem;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    filter: blur(64px);
    pointer-events: none;
    z-index: -1;
}

.contact-card .btn {
    width: 100%;
}

.contact-card .btn:hover i {
    transform: translateY(-2px);
}

.contact-card .btn i {
    transition: transform 0.3s ease;
}

.contact-note {
    margin-top: 1.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .contact-card {
        padding: 3rem;
    }

    .contact-card .btn {
        width: auto;
    }
}

/* ===== Contact page ===== */
.contact-layout {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 900px) {
    .contact-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    }
}

.contact-info,
.contact-form {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .contact-info,
    .contact-form {
        padding: 2rem;
    }
}

.contact-list {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.contact-list a,
.contact-list p:not(.contact-label) {
    color: var(--text-strong);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.contact-list a:hover {
    color: var(--brand-accent);
}

.contact-info .contact-note {
    margin-top: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.form-row {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.field {
    display: grid;
    gap: 0.5rem;
}

.field label {
    color: var(--text-soft);
    font-size: 0.875rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-strong);
    font: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 9rem;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.contact-form .btn {
    justify-self: start;
}

.form-status {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.6;
}

.form-status a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-status.is-success {
    border: 1px solid rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
    color: #86efac;
}

.form-status.is-error {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: var(--brand-accent);
}

/* ===== Footer ===== */
.site-footer {
    padding-block: 3rem;
    background: var(--bg);
    border-top: 1px solid var(--border-subtle);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    font-size: 1.5rem;
}

.social-links a {
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
    color: var(--text-strong);
    transform: scale(1.1);
}

.social-links a.linkedin:hover {
    color: #0a66c2;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
    }
}
