:root {
    --nav-height: 6rem;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 1rem);
}

/*subtil glow på project title*/
.project-card:hover .project-title {
    color: #4f8cff;
}

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

body {
    font-family: 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top,#151515,#0a0a0a);
    color: #ffffff;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

a:focus-visible,
button:focus-visible,
main:focus-visible {
    outline: 3px solid #91b8ff;
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 3000;
    padding: 12px 20px;
    background: #111;
    color: #fff;
    border: 2px solid #4f8cff;
    border-radius: 5px;
    transform: translateY(calc(-100% - 20px));
}

.skip-link:focus {
    transform: translateY(0);
}

/* NAVBAR */
.navbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    background-color: #111;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.logo {
    flex-shrink: 0;
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 30px;
    min-width: 0;
}

.nav-links a {
    color: #ccc;
    text-decoration: none;
    padding: 8px 0;
    min-height: 44px;
    transition: 0.3s;
}

.nav-links a:hover {
    color: #4f8cff;
}

#langToggle {
    background-color: #4f8cff;
    border: none;
    padding: 8px 15px;
    color: #111;
    min-height: 44px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
}

/* HERO */
.hero {
    position: relative;
    isolation: isolate;
    min-height: 90vh;
    min-height: min(820px, calc(100svh - var(--nav-height)));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px 8% 72px;
    background: radial-gradient(ellipse at 50% 25%, rgba(79, 140, 255, 0.08), transparent 65%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: linear-gradient(rgba(145, 184, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(145, 184, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 35%, #000, transparent 75%);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    overflow-wrap: anywhere;
    min-width: 0;
    width: 100%;
    max-width: 900px;
    animation: heroIntro 0.8s ease-out;
}

.hero-content > * {
    min-width: 0;
    max-width: 100%;
}

.hero-content:focus-within {
    animation: none;
}

@keyframes heroIntro {
    from { opacity: 0.35; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-content h1 {
    font-size: clamp(2.3rem, 5.2vw, 4.4rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
    font-weight: 700;
    color: #edf3ff;
}

@supports (background-clip: text) {
    .hero-content h1 {
        background: linear-gradient(110deg, #edf3ff 30%, #91b8ff 85%);
        background-clip: text;
        color: transparent;
    }
}

.hero-content h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin: 20px auto 0;
    border-radius: 3px;
    background: #4f8cff;
}

.hero-content .hero-qualification {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #b7bfcd;
    font-weight: 500;
}

.hero-content #heroSubtitle {
    color: #b3b9c4;
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 1.8;
    max-width: 62ch;
}

.hero-brand,
.section-eyebrow {
    color: #91b8ff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.8;
}

.section-eyebrow {
    margin-bottom: 12px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.btn,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn {
    background-color: #4f8cff;
    padding: 12px 24px;
    text-decoration: none;
    color: #111;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #2864ce;
    color: #fff;
    transform: translateY(-3px);
}

.btn-outline {
    border: 1px solid #4f8cff;
    padding: 11px 23px;
    text-decoration: none;
    color: #91b8ff;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-outline:hover {
    background-color: #4f8cff;
    color: #111;
    transform: translateY(-3px);
}

/* SECTIONS */

.section {
    padding: 100px 10%;
    text-align: center;
}

/* Content stays visible unless a supported observer starts this finite animation. */
.section.reveal-in {
    animation: sectionReveal 0.8s ease;
}

.section:focus-within {
    animation: none;
}

@keyframes sectionReveal {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.section h2 {
    margin-bottom: 30px;
    font-size: 2rem;
}

.dark {
    background-color: #161616;
}

/* ABOUT AND TECHNOLOGY STACK */
#about,
#skills {
    padding-top: clamp(64px, 7vw, 96px);
    padding-bottom: clamp(64px, 7vw, 96px);
}

#about h2,
#skills h2 {
    font-size: clamp(1.8rem, 3vw, 2.25rem);
    line-height: 1.25;
    letter-spacing: -0.025em;
}

#aboutText {
    max-width: 74ch;
    margin: 0;
    color: #b8bec9;
    font-size: 1.05rem;
    line-height: 1.9;
    text-align: left;
}

.about-panel {
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid #2b3039;
    border-radius: 18px;
    background: linear-gradient(135deg, #1b2029, #141619 60%);
    text-align: left;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid #2c3544;
    list-style: none;
}

.about-highlights li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dce4f2;
    font-size: 0.9rem;
    font-weight: 500;
}

.line-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.about-highlights .line-icon {
    color: #91b8ff;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 1120px;
    margin: 40px auto 0;
}

.skill-category {
    min-width: 0;
    padding: 24px;
    border: 1px solid #2b2b2b;
    border-radius: 14px;
    background: linear-gradient(145deg, #1d1e21, #18191b);
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.skill-category:hover {
    border-color: rgba(79, 140, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.skill-category h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 2.8rem;
    margin-bottom: 20px;
    color: #e8ecf4;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.skill-category h3::before {
    content: "";
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #4f8cff;
}

.technology-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr));
    gap: 10px;
    list-style: none;
}

.technology-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    min-height: 108px;
    padding: 16px 8px;
    border: 1px solid #303238;
    border-radius: 9px;
    background: #222429;
    color: #dce1eb;
    font-size: 0.82rem;
    line-height: 1.4;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.technology-item:hover {
    border-color: #4f8cff;
    background: #252c38;
}

.technology-icon,
.technology-symbol {
    display: block;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.technology-icon--light {
    filter: brightness(0) invert(1);
}

.technology-icon--invert {
    filter: invert(1);
}

.technology-icon--surface {
    border-radius: 50%;
    background: #f1f4fa;
}

.technology-symbol {
    display: grid;
    place-items: center;
    color: #91b8ff;
    font: 700 17px/1 monospace;
    white-space: nowrap;
}

/* PROJECTS */

.projects-content {
    max-width: 1120px;
    margin: 0 auto;
    text-align: left;
}

.projects-group-heading {
    margin-bottom: 20px;
    color: #edf3ff;
    font-size: clamp(1.25rem, 2.2vw, 1.6rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.client-preview-notice {
    margin-bottom: 24px;
    padding: 12px 16px;
    border-left: 2px solid #4f8cff;
    background: rgba(79, 140, 255, 0.06);
    color: #b8c6df;
    font-size: 0.85rem;
    line-height: 1.6;
}

.featured-projects-grid,
.other-projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.featured-project {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #2e3b52;
    border-radius: 16px;
    background: linear-gradient(145deg, #1b202a, #15171c);
}

.featured-project-media {
    min-width: 0;
    margin: 16px 16px 0;
    border: 1px solid #303b4c;
    border-radius: 9px;
    overflow: hidden;
    background: #0b111a;
}

.featured-project-media img {
    display: block;
    width: 100%;
    height: auto;
}

.project-preview-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: clamp(200px, 18vw, 250px);
    padding: 20px;
    background: radial-gradient(ellipse at center, #1b2b44, #111925);
    text-align: center;
}

.project-preview-placeholder svg {
    flex-shrink: 0;
    color: #91b8ff;
}

.preview-placeholder-title {
    color: #e1eaff;
    font-size: 0.95rem;
    font-weight: 600;
}

.preview-placeholder-text {
    max-width: 32ch;
    color: #b8c6df;
    font-size: 0.8rem;
    line-height: 1.5;
}

.featured-project-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 24px;
}

.project-category {
    align-self: flex-start;
    padding: 5px 10px;
    border: 1px solid #30496c;
    border-radius: 6px;
    background: #18263b;
    color: #abc8ff;
    font-size: 0.75rem;
    line-height: 1.5;
}

.featured-project-body h4 {
    color: #edf3ff;
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    line-height: 1.3;
    letter-spacing: -0.025em;
}

.featured-project-description {
    color: #bdc5d2;
    font-size: 0.95rem;
    line-height: 1.75;
}

.featured-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.featured-tech-stack li {
    min-width: 0;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid #333c4c;
    border-radius: 6px;
    background: #202631;
    color: #dce4f2;
    font-size: 0.78rem;
    line-height: 1.5;
}

.project-contribution {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #303745;
}

.project-contribution h5 {
    margin-bottom: 8px;
    color: #91b8ff;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-contribution p {
    color: #b8c2d2;
    font-size: 0.88rem;
    line-height: 1.75;
}

.other-projects {
    margin-top: 64px;
}

.project-card {
    display: block;
    background: linear-gradient(145deg, #1c1c1c, #151515);
    padding: 30px;
    border-radius: 12px;
    margin: 25px auto;
    max-width: 750px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #222;
    transition: all 0.3s ease;
}

.project-card .project-title {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.project-card p {
    color: #aaa;
    font-size: 0.95rem;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: #4f8cff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.other-projects-grid .project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 24px;
}

.other-projects-grid .project-title {
    font-size: 1.1rem;
    line-height: 1.4;
}

.other-projects-grid .tech-stack {
    margin-top: auto;
    padding-top: 16px;
}

.project-hover-action {
    display: block;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #4f8cff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-hover-action,
.project-card:focus-visible .project-hover-action {
    opacity: 1;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 20px;
    background-color: #111;
    color: #888;
}

/* APPROACH SECTION */
.approach-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 1120px;
    margin: 40px auto 0;
}

.approach-card {
    min-width: 0;
    background: linear-gradient(145deg, #1d1e21, #18191b);
    padding: 28px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    border: 1px solid #2b2b2b;
}

.approach-card:hover {
    transform: translateY(-3px);
    border-color: rgba(79, 140, 255, 0.6);
    box-shadow: 0 8px 24px rgba(79, 140, 255, 0.06);
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #344763;
    background: #1a293f;
    color: #91b8ff;
}

.approach-card h3 {
    margin: 20px 0 8px;
    color: #edf3ff;
    font-size: 1.1rem;
    line-height: 1.4;
}

.approach-card p {
    color: #b8c2d2;
}

/* CONTACT */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    max-width: 1120px;
    margin: 40px auto 0;
}

.contact-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 28px;
    border: 1px solid #2b3039;
    border-radius: 14px;
    background: linear-gradient(145deg, #1d1e21, #18191b);
    color: #edf3ff;
    text-align: left;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.contact-card:hover,
.contact-card:focus-visible {
    border-color: #4f8cff;
    box-shadow: 0 8px 28px rgba(79, 140, 255, 0.1);
}

.contact-card:hover {
    transform: translateY(-3px);
}

.contact-method {
    margin-top: 8px;
    font-size: 1.05rem;
    font-weight: 600;
}

.contact-value {
    max-width: 100%;
    color: #b8c2d2;
    font-size: 0.95rem;
}

.contact-arrow {
    position: absolute;
    top: 28px;
    right: 28px;
    color: #91b8ff;
    font-size: 1.3rem;
}

.contact-github-icon {
    filter: brightness(0) invert(1);
}

/* PROFILE IMAGE */
.portrait-halo {
    position: relative;
    isolation: isolate;
    max-width: 100%;
    margin-bottom: 8px;
}

.portrait-halo::before {
    content: "";
    position: absolute;
    inset: -48px;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.2), transparent 70%);
}

.profile-img {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #4f8cff;
    box-shadow: 0 0 30px rgba(79, 140, 255, 0.12);
    transition: transform 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.02);
}


/* Technology groups use a single column on tablets and phones. */
@media (max-width: 1000px) {
    .skills-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .technology-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .featured-projects-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .other-projects-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 540px) {
    .skill-category {
        padding: 20px;
    }

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

    .featured-project-media {
        margin: 12px 12px 0;
    }

    .featured-project-body,
    .other-projects-grid .project-card {
        padding: 20px;
    }
}

/* ================= MOBILE OPTIMIZATION ================= */

@media (max-width: 768px) {
    :root {
        --nav-height: 12rem;
    }

    /* Navbar cleaner layout */
    .navbar {
        padding: 15px 5%;
        gap: 8px;
    }

    .nav-links {
        order: 2;
        flex-basis: 100%;
        gap: 0 16px;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .nav-links .nav-external{
    color:#4f8cff;
    font-weight:500;
    }

    #langToggle {
        margin-left: auto;
    }

    /* Hero tighter spacing */
    .hero {
        min-height: auto;
        padding: 48px 5%;
    }

    .profile-img {
        width: 180px;
    }

    .about-highlights {
        grid-template-columns: minmax(0, 1fr);
    }

    .approach-grid,
    .contact-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .approach-card,
    .contact-card {
        padding: 24px;
    }

    /* Buttons stacked on mobile */
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .btn,
    .btn-outline {
        width: 100%;
        text-align: center;
    }

    /* Section spacing reduced */
    .section {
        padding: 60px 6%;
    }

    /* Project cards full width */
    .project-card {
        margin: 20px 0;
        padding: 20px;
    }

}

.tech-stack{
margin-top:12px;
display:flex;
flex-wrap:wrap;
gap:8px;
}

.tech-stack span{
min-width:0;
max-width:100%;
background:#222;
padding:5px 10px;
border-radius:6px;
font-size:0.8rem;
border:1px solid #333;
}

.project-footer{
display:flex;
align-items:center;
gap:8px;
margin-top:15px;
font-size:0.9rem;
color:#4f8cff;
}

.project-footer img{
width:20px;
height:20px;
flex-shrink:0;
filter:invert(1);
}

.scroll-bar{
position:fixed;
top:0;
left:0;
height:3px;
background:#4f8cff;
width:0%;
z-index:2000;
}

/* Leave room for content when a sticky header would dominate a short screen. */
@media (max-width: 768px) and (max-height: 450px) {
    .navbar {
        position: static;
    }

    html {
        scroll-padding-top: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .project-card:hover,
    .approach-card:hover,
    .contact-card:hover,
    .profile-img:hover,
    .btn:hover,
    .btn-outline:hover {
        transform: none;
    }
}

