* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0f172a;
    color: #e5e7eb;
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

.navbar {
    padding: 20px 0;
    border-bottom: 1px solid #1e293b;
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #e5e7eb;
    text-decoration: none;
}

.logo span {
    color: #38bdf8;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #e5e7eb;
    transition: 0.3s;
}

.nav-links a:hover {
    color: #38bdf8;
}

/* HERO SECTION */

.hero {
    padding: 120px 0;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    color: #38bdf8;
    margin-bottom: 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
}

.hero h1 {
    font-size: 64px;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero-description {
    color: #94a3b8;
    margin-bottom: 35px;
    font-size: 18px;
    max-width: 650px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* PROFILE IMAGE */

.hero-image {
    display: flex;
    justify-content: center;
}

.profile-card {
    position: relative;
    width: 380px;
    height: 380px;
    border-radius: 30px;
    overflow: hidden;
    background: #111827;
    border: 1px solid #1f2937;
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.15);
}

.profile-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* BUTTONS */

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    transition: 0.3s;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    text-align: center;
}

.btn-primary {
    background: #38bdf8;
    color: #0f172a;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.3);
}

.btn-secondary {
    border: 1px solid #38bdf8;
    color: #38bdf8;
}

.btn-secondary:hover {
    background: #38bdf8;
    color: #0f172a;
}

/* CONTACT SECTION FIX */

.contact {
    text-align: center;
    padding: 120px 0;
}

.contact-text {
    max-width: 800px;
    margin: 0 auto 35px auto;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1.8;
}

.skills,
.projects,
.contact {
    padding: 100px 0;
}

.section-title {
    font-size: 40px;
    margin-bottom: 50px;
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-card,
.project-card {
    background: #111827;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #1f2937;
    transition: 0.3s;
}

.skill-card:hover,
.project-card:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
}

.skill-card h3,
.project-card h3 {
    margin-bottom: 15px;
}

.project-card p,
.skill-card p,
.contact-text {
    color: #94a3b8;
}

.project-card a {
    display: inline-block;
    margin-top: 20px;
    color: #38bdf8;
    text-decoration: none;
}

.project-media {
    height: 170px;
    margin: -10px -10px 24px;
    overflow: hidden;
    border: 1px solid #1f2937;
    border-radius: 10px;
    background: #020617;
}

.project-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.contact {
    text-align: center;
}

.footer {
    padding: 30px 0;
    border-top: 1px solid #1e293b;
    text-align: center;
    color: #94a3b8;
}

/* CONTACT PAGE */

.contact-page {
    min-height: calc(100vh - 163px);
    padding: 110px 0;
}

.contact-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 520px;
    gap: 70px;
    align-items: start;
}

.contact-intro h1 {
    font-size: 54px;
    line-height: 1.1;
    margin-bottom: 25px;
}

.contact-intro p:last-child {
    max-width: 620px;
    color: #94a3b8;
    font-size: 18px;
}

.contact-panel {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 32px;
}

.contact-form {
    display: grid;
    gap: 22px;
}

.hidden-field {
    display: none;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    color: #e5e7eb;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0f172a;
    color: #e5e7eb;
    font: inherit;
    padding: 14px 16px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group textarea {
    resize: vertical;
    min-height: 170px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #64748b;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.contact-form .btn-primary {
    border: 0;
    cursor: pointer;
    font: inherit;
}

/* CASE STUDY PAGE */

.case-hero {
    min-height: 76vh;
    display: grid;
    align-items: end;
    padding: 120px 0 70px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.95)),
        url("../assets/images/custom-openwrt-board.png") center / cover no-repeat;
}

.jetson-hero {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.96)),
        url("../assets/images/tegrastats_encryption.png") center / cover no-repeat;
}

.iio-hero {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.96)),
        url("../assets/images/custom-board-for-iio-oscilloscope.png") center / cover no-repeat;
}

.oct-hero {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.14), rgba(15, 23, 42, 0.96)),
        url("../assets/images/oct_gui_image.png") top center / cover no-repeat;
}

.antsdr-hero {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.96)),
        url("../assets/images/antsdr_uhd_adrv9364.png") center / cover no-repeat;
}

.case-hero-content {
    max-width: 920px;
}

.case-hero h1 {
    max-width: 900px;
    margin-bottom: 25px;
    font-size: 58px;
    line-height: 1.08;
}

.case-hero-content > p:not(.hero-subtitle) {
    max-width: 760px;
    color: #cbd5e1;
    font-size: 18px;
}

.case-section,
.case-outcome {
    padding: 96px 0;
    border-top: 1px solid #1e293b;
}

.case-outcome {
    background: #111827;
}

.case-kicker {
    margin-bottom: 12px;
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.case-title {
    max-width: 900px;
    margin-bottom: 22px;
    font-size: 40px;
    line-height: 1.16;
}

.case-lead {
    max-width: 900px;
    color: #94a3b8;
    font-size: 18px;
}

.case-grid {
    display: grid;
    gap: 24px;
}

.case-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.case-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 34px;
}

.case-learning-grid {
    margin-top: 34px;
}

.case-card,
.case-phase,
.case-image-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
}

.case-card {
    padding: 26px;
}

.case-card h3,
.case-phase h3 {
    margin-bottom: 10px;
}

.case-card p,
.case-phase p,
.case-image-card p {
    color: #94a3b8;
}

.case-metric {
    display: block;
    margin-bottom: 12px;
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
}

.phase-list {
    display: grid;
    gap: 16px;
    margin-top: 32px;
}

.case-phase {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 18px;
    padding: 22px;
}

.case-phase span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #38bdf8;
    color: #0f172a;
    font-weight: 700;
}

.case-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 28px;
    margin-top: 34px;
    align-items: stretch;
}

.case-media,
.case-image-card {
    overflow: hidden;
}

.case-media {
    height: 430px;
    min-height: 360px;
    border: 1px solid #1f2937;
    border-radius: 12px;
    background: #020617;
}

.case-media img,
.case-image-card img,
.case-image-card video,
.case-image-card iframe {
    width: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: #020617;
}

.case-media img {
    height: 100%;
    min-height: 360px;
}

.case-code {
    overflow: auto;
    margin-top: 30px;
    padding: 24px;
    border: 1px solid #1f2937;
    border-radius: 12px;
    background: #020617;
    color: #cbd5e1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    line-height: 1.7;
}

.case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.case-tags span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 600;
}

.case-tags-solid span {
    background: #111827;
}

.case-image-card {
    margin: 0;
}

.case-image-card img,
.case-image-card video,
.case-image-card iframe {
    height: 280px;
    padding: 10px;
}

.case-image-card iframe {
    border: 0;
}

.case-image-card figcaption {
    padding: 20px;
}

.case-image-card strong {
    display: block;
    margin-bottom: 8px;
}

.case-outcome .btn-primary {
    margin-top: 32px;
}

.case-gallery {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;
    margin-top: 34px;
}

.case-gallery .case-image-card {
    grid-column: span 3;
}

.case-gallery .case-image-card-wide {
    grid-column: span 6;
}

.case-gallery .case-image-card-large {
    grid-column: span 6;
}

.case-image-card-wide img {
    height: 210px;
}

.case-image-card-large img {
    height: 520px;
}

.case-video-card video,
.case-video-card iframe {
    height: 340px;
}

.case-image-card-large video,
.case-image-card-large iframe {
    height: 520px;
}

/* RESPONSIVE */

@media(max-width: 950px) {

    .container {
        width: min(92%, 760px);
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 52px;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero h1 {
        font-size: 48px;
    }

    .profile-card {
        width: min(320px, 78vw);
        height: min(320px, 78vw);
    }

    .contact-page {
        padding: 80px 0;
    }

    .contact-page-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-intro {
        text-align: center;
    }

    .contact-intro h1 {
        font-size: 42px;
    }

    .contact-intro p:last-child {
        margin: auto;
    }

    .case-hero {
        min-height: 68vh;
        padding: 90px 0 60px;
        background-position: center;
    }

    .case-hero h1 {
        font-size: 44px;
    }

    .case-grid-two,
    .case-grid-three,
    .case-feature {
        grid-template-columns: 1fr;
    }

    .case-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-gallery .case-image-card,
    .case-gallery .case-image-card-wide,
    .case-gallery .case-image-card-large {
        grid-column: span 2;
    }

    .case-image-card img,
    .case-image-card video,
    .case-image-card iframe {
        height: 360px;
    }

    .case-image-card-wide img {
        height: 180px;
    }

    .case-image-card-large img,
    .case-image-card-large video,
    .case-image-card-large iframe {
        height: 430px;
    }

}

@media(max-width: 640px) {

    body {
        font-size: 15px;
    }

    .container {
        width: min(92%, 520px);
    }

    .navbar {
        padding: 16px 0;
        position: relative;
    }

    .nav-container {
        align-items: center;
        gap: 14px;
        flex-direction: column;
    }

    .logo {
        font-size: 26px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        column-gap: 18px;
        row-gap: 8px;
    }

    .nav-links a {
        font-size: 14px;
    }

    .hero {
        padding: 64px 0 70px;
    }

    .hero-content {
        gap: 38px;
    }

    .hero h1,
    .contact-intro h1 {
        font-size: 36px;
    }

    .hero-description,
    .contact-text,
    .case-lead,
    .case-hero-content > p:not(.hero-subtitle),
    .contact-intro p:last-child {
        font-size: 16px;
    }

    .hero-buttons {
        width: 100%;
        gap: 14px;
    }

    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary,
    .contact .btn-primary {
        width: 100%;
    }

    .skills,
    .projects,
    .contact {
        padding: 72px 0;
    }

    .section-title {
        font-size: 32px;
        margin-bottom: 32px;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .skill-card,
    .project-card {
        padding: 24px;
    }

    .contact-page {
        padding: 62px 0 74px;
    }

    .contact-panel {
        padding: 24px;
    }

    .contact-form .btn-primary {
        width: 100%;
    }

    .case-section,
    .case-outcome {
        padding: 72px 0;
    }

    .case-hero {
        min-height: auto;
        padding: 74px 0 58px;
    }

    .case-hero h1 {
        font-size: 36px;
    }

    .case-title {
        font-size: 30px;
    }

    .case-phase {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .case-card {
        padding: 22px;
    }

    .case-code {
        padding: 18px;
        font-size: 13px;
    }

    .case-tags {
        gap: 8px;
    }

    .case-tags span {
        font-size: 13px;
    }

    .case-media,
    .case-media img {
        height: 280px;
        min-height: 250px;
    }

    .case-gallery {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .case-gallery .case-image-card,
    .case-gallery .case-image-card-wide,
    .case-gallery .case-image-card-large {
        grid-column: auto;
    }

    .case-image-card img,
    .case-image-card video,
    .case-image-card iframe,
    .case-image-card-large img,
    .case-image-card-large video,
    .case-image-card-large iframe {
        height: 260px;
        padding: 8px;
    }

    .case-image-card-wide img {
        height: 150px;
        padding: 8px;
    }

}

@media(max-width: 420px) {

    .container {
        width: 90%;
    }

    .hero h1,
    .contact-intro h1,
    .case-hero h1 {
        font-size: 32px;
    }

    .section-title,
    .case-title {
        font-size: 28px;
    }

    .profile-card {
        width: min(260px, 82vw);
        height: min(260px, 82vw);
        border-radius: 22px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 13px 18px;
    }

    .case-image-card img,
    .case-image-card video,
    .case-image-card iframe,
    .case-image-card-large img,
    .case-image-card-large video,
    .case-image-card-large iframe {
        height: 230px;
    }

    .case-image-card-wide img {
        height: 126px;
    }

}
