﻿/* ================================================
   dormhi.com - Calm Dark Theme
   Neutral, human-made palette. No neon, no glow.
   ================================================ */

/* ----- Custom Properties (Dark Mode - Default) ----- */
:root {
    /* Colors */
    --bg-primary: #111318;
    --bg-secondary: #15181e;
    --bg-card: rgba(255, 255, 255, 0.025);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(18, 21, 27, 0.82);
    --bg-menu: rgba(17, 19, 24, 0.98);
    --border-glass: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text-primary: #e8e6e1;
    --text-secondary: #a3a29c;
    --text-muted: #74736e;

    --accent: #8aa4b8;
    --accent-strong: #a6bccd;
    --accent-soft: rgba(138, 164, 184, 0.12);

    /* Typography */
    --font-heading: 'Nunito Sans', system-ui, sans-serif;
    --font-body: 'Nunito Sans', system-ui, sans-serif;

    /* Spacing */
    --section-padding: 100px 0;
    --container-width: 1100px;
    --container-padding: 0 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Navbar */
    --navbar-height: 64px;
}

/* ----- Light Mode ----- */
[data-theme="light"] {
    --bg-primary: #f5f4f0;
    --bg-secondary: #ffffff;
    --bg-card: rgba(0, 0, 0, 0.02);
    --bg-card-hover: rgba(0, 0, 0, 0.04);
    --bg-glass: rgba(245, 244, 240, 0.82);
    --bg-menu: rgba(245, 244, 240, 0.98);
    --border-glass: rgba(20, 20, 20, 0.12);
    --border-strong: rgba(20, 20, 20, 0.2);

    --text-primary: #24272d;
    --text-secondary: #565a61;
    --text-muted: #8a8d92;

    --accent: #5f7d95;
    --accent-strong: #4c657a;
    --accent-soft: rgba(95, 125, 149, 0.12);
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--navbar-height) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.8rem); }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a,
button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a:hover {
    color: var(--accent-strong);
}

/* ----- Layout ----- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

.section {
    padding: var(--section-padding);
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 44px;
    height: 2px;
    background: var(--accent);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #111318;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--accent-strong);
    color: #111318;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.btn-outline:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Hero buttons sit on the dark video in every theme, so their colors are fixed
   and taken from the video itself: the cream logo and its warm golden glow */
.hero-buttons .btn {
    border: 1px solid transparent;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease,
        box-shadow 0.25s ease, transform 0.25s ease;
}

.hero-buttons .btn-primary {
    background: rgba(196, 162, 102, 0.22);
    color: #eadfc8;
    border-color: rgba(206, 174, 116, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hero-buttons .btn-primary:hover {
    background: rgba(196, 162, 102, 0.32);
    color: #f3ead7;
    border-color: rgba(214, 184, 128, 0.75);
    box-shadow: 0 6px 22px rgba(196, 162, 102, 0.18);
}

.hero-buttons .btn-outline {
    color: #efe9dd;
    background: rgba(20, 17, 12, 0.4);
    border-color: rgba(239, 233, 221, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hero-buttons .btn-outline:hover {
    color: #f8f3e8;
    background: rgba(20, 17, 12, 0.55);
    border-color: rgba(226, 190, 120, 0.75);
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #3a3f47;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ----- Selection ----- */
::selection {
    background: var(--accent);
    color: #111318;
}

/* ================================================
   Navbar
   ================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
    border-bottom-color: var(--border-strong);
    border-bottom-width: 1px;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color var(--transition-normal);
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    border-radius: 6px;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-btn span {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-body);
}

.nav-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Social icons: just the glyph, no frame */
.nav-social {
    width: auto;
    height: auto;
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 0.8rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-social:hover {
    border-color: transparent;
}

/* Gap between social icons and the theme/language controls */
#theme-toggle {
    margin-left: 16px;
}

/* Hamburger Menu */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    cursor: pointer;
    padding: 10px 8px;
    transition: all var(--transition-normal);
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.nav-hamburger:hover {
    border-color: var(--accent);
}

.nav-hamburger:hover span {
    background: var(--accent);
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        width: 100%;
        max-height: calc(100dvh - var(--navbar-height));
        overflow-y: auto;
        flex-direction: column;
        background: var(--bg-menu);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border-bottom: 1px solid var(--border-glass);
        padding: 16px 24px;
        gap: 4px;
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: transform var(--transition-normal), opacity var(--transition-normal), visibility 0s var(--transition-normal);
        pointer-events: none;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        transition: transform var(--transition-normal), opacity var(--transition-normal), visibility 0s 0s;
        pointer-events: all;
    }

    .nav-links .nav-link {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 12px 16px;
    }

    .nav-hamburger {
        display: flex;
        width: 44px;
        height: 44px;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* ================================================
   Hero Section + Video Background
   ================================================ */

/* Video Background (fixed, behind everything) */
.video-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    /* Size the 16:9 video so the whole logo animation (~1100x1150 of the
       1920x1080 frame) always fits: a slightly pulled-back camera on any screen */
    width: min(165vw, 160dvh);
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -2;
    /* Video edges are pure black, so a black fill around it is seamless */
    background: #000;
    box-shadow: 0 0 0 100vmax #000;
}

.video-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: var(--bg-primary);
    opacity: 0;
    z-index: -1;
    transition: none;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--navbar-height);
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.65) 100%);
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 860px;
    padding: 0 24px;
}

.hero-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    animation: heroFadeIn 0.8s ease forwards;
    animation-delay: 0.3s;
}

.hero-title {
    margin-bottom: 10px;
    /* If the name has to wrap, split it evenly instead of leaving "Cüci" alone */
    text-wrap: balance;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6), 0 2px 14px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 0.8s ease forwards;
    animation-delay: 0.6s;
}

/* Small greeting line above the big name */
.hero-greeting {
    display: block;
    font-size: clamp(1.05rem, 2.6vw, 1.4rem);
    font-weight: 400;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 6px;
}

.hero-name {
    display: block;
}

.hero-alias {
    font-size: clamp(0.95rem, 2.3vw, 1.1rem);
    color: #d9c49b;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 0.8s ease forwards;
    animation-delay: 0.75s;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    margin-bottom: 40px;
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 0.8s ease forwards;
    animation-delay: 0.9s;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: heroFadeIn 0.8s ease forwards;
    animation-delay: 1.2s;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Sections after hero need solid background */
#about,
#skills,
#portfolio,
#contact {
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

.footer {
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border-glass);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Mobile hero adjustments */
@media (max-width: 480px) {
    .hero-avatar {
        width: 110px;
        height: 110px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }
}

/* ================================================
   About Section
   ================================================ */

.about-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 32px;
}

/* Story: one larger lead sentence, a short paragraph and a quiet signature */
.about-lead {
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    line-height: 1.55;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.about-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-sign {
    margin-top: 20px;
    color: var(--accent);
    font-weight: 500;
}

/* At a glance */
.about-facts {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.about-facts-title {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

/* Live GitHub counters */
.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}

.about-stats div {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
}

.about-stats dd {
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.about-stats dt {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.about-facts ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-fact {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.about-fact i {
    width: 20px;
    margin-top: 3px;
    text-align: center;
    color: var(--accent);
    flex-shrink: 0;
}

.about-fact-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.about-fact-value {
    display: block;
    font-size: 0.92rem;
    color: var(--text-primary);
}

/* Interests + currently learning */
.about-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.about-list {
    padding: 22px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.about-list h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    margin-bottom: 14px;
}

.about-list h3 i {
    color: var(--accent);
}

.about-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.about-chip {
    padding: 6px 12px;
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* About responsive */
@media (max-width: 768px) {
    .about-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .about-lists {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   Skills Section
   ================================================ */

.skills-intro {
    text-align: center;
    max-width: 560px;
    margin: -32px auto 40px;
    color: var(--text-secondary);
}

/* Most used: big cards with a soft glow in the tool's own brand color */
.skills-featured {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.skill-feature {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px 18px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color var(--transition-normal), transform var(--transition-normal);
}

.skill-feature::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 65%);
    pointer-events: none;
}

.skill-feature:hover {
    border-color: color-mix(in srgb, var(--brand) 55%, var(--border-glass));
    transform: translateY(-3px);
}

.skill-feature-logo {
    position: relative;
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 14px;
}

/* Logos whose brand color is too dark for the theme use the card's brand tint */
.skill-feature-logo i:not(.colored) {
    color: var(--brand);
}

.skill-feature-name {
    position: relative;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
}

.skill-feature-desc {
    position: relative;
    flex-grow: 1;
    margin-top: 4px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.skill-feature-used {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Everything else, grouped by area */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--transition-normal);
}

/* Last category spans the full row so the grid never leaves a gap */
.skill-category--wide {
    grid-column: 1 / -1;
}

.skill-category:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-glass);
}

.skill-category-header i {
    font-size: 1.2rem;
    color: var(--accent);
}

.skill-category-header h3 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0;
}

.skill-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.skill-tag:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* "Used in" tooltip on tags backed by a public repo (hover, or tap/focus on touch) */
.skill-tag[data-used],
.skill-tag[data-used-all],
.skill-tag[data-team] {
    position: relative;
    cursor: default;
}

.skill-tag[data-used]::after,
.skill-tag[data-used-all],
.skill-tag[data-team]::after {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 5;
    width: max-content;
    max-width: min(240px, 70vw);
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    pointer-events: none;
}

.skill-tag[data-used]::after {
    content: "Used in: " attr(data-used);
}

.skill-tag[data-used-all]::after {
    content: "Used in all my projects";
}

html[lang="tr"] .skill-tag[data-used]::after {
    content: "Kullanıldığı yer: " attr(data-used);
}

html[lang="tr"] .skill-tag[data-used-all]::after {
    content: "Tüm projelerimde";
}

/* Team project contributions (no public repo, project not named) */
.skill-tag[data-team]::after {
    content: "Contributed in team projects";
}

.skill-tag[data-used][data-team]::after {
    content: "Used in: " attr(data-used) " · team projects";
}

html[lang="tr"] .skill-tag[data-team]::after {
    content: "Ekip projelerinde katkı";
}

html[lang="tr"] .skill-tag[data-used][data-team]::after {
    content: "Kullanıldığı yer: " attr(data-used) " · ekip projeleri";
}

.skill-tag[data-used]:hover::after,
.skill-tag[data-used]:focus::after,
.skill-tag[data-used-all]:hover::after,
.skill-tag[data-used-all]:focus::after,
.skill-tag[data-team]:hover::after,
.skill-tag[data-team]:focus::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.skill-tag[data-used]:focus,
.skill-tag[data-used-all],
.skill-tag[data-team]:focus {
    outline: none;
    border-color: var(--accent);
}

.skill-logos {
    display: inline-flex;
    gap: 4px;
    font-size: 1.15rem;
    line-height: 1;
}

/* Monochrome logos (Linux, GitHub) follow the text color */
.skill-logos i:not(.colored) {
    color: var(--text-primary);
}

/* Skills responsive */
@media (max-width: 1000px) {
    .skills-featured {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .skills-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 580px) {
    .skills-featured {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* On phones the tooltip sits across the top of the card so it never runs off-screen */
    .skill-category {
        position: relative;
    }

    .skill-tag[data-used],
    .skill-tag[data-used-all],
    .skill-tag[data-team] {
        position: static;
    }

    .skill-tag[data-used]::after,
    .skill-tag[data-used-all]::after,
    .skill-tag[data-team]::after {
        left: 16px;
        right: 16px;
        top: 16px;
        bottom: auto;
        width: auto;
        max-width: none;
        padding: 10px 12px;
        transform: translateY(4px);
    }

    .skill-tag[data-used]:hover::after,
    .skill-tag[data-used]:focus::after,
    .skill-tag[data-used-all]:hover::after,
    .skill-tag[data-used-all]:focus::after,
    .skill-tag[data-team]:hover::after,
    .skill-tag[data-team]:focus::after {
        transform: translateY(0);
    }

    .skill-feature {
        padding: 18px 14px 14px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   Portfolio Section (GitHub API)
   ================================================ */

.portfolio-intro {
    text-align: center;
    max-width: 560px;
    margin: -32px auto 40px;
    color: var(--text-secondary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.portfolio-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.portfolio-loading i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}

.portfolio-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.portfolio-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 22px 22px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    transition: border-color var(--transition-normal), transform var(--transition-normal), background-color var(--transition-normal);
    cursor: pointer;
}

.portfolio-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    background: var(--bg-card-hover);
}

/* Whole card links to the GitHub repo; the live-site button sits above it */
.stretched-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.portfolio-card > * {
    pointer-events: none;
}

.portfolio-card > .stretched-link {
    pointer-events: auto;
}

.repo-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.repo-name {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.repo-stars {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.repo-stars i {
    color: #e2be78;
    font-size: 0.72rem;
}

.repo-desc {
    margin-top: 8px;
    font-size: 0.87rem;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.repo-topics {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.repo-topics li {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.72rem;
}

/* Pushes the language block + footer to the bottom so cards line up */
.repo-spacer {
    flex-grow: 1;
    min-height: 18px;
}

/* Language breakdown: thin stacked bar + top-3 legend */
.repo-langbar {
    display: flex;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-card-hover);
    gap: 2px;
}

.repo-langbar span {
    display: block;
    height: 100%;
    min-width: 3px;
}

.repo-langs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.repo-langs li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.repo-lang-pct {
    color: var(--text-muted);
}

.lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.repo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.repo-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    /* Same height with or without the live-site button, so cards in a row line up */
    height: 28px;
}

.repo-github-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.portfolio-card:hover .repo-github-icon {
    color: var(--accent);
}

.repo-site-link {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.repo-site-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #111318;
}

.repo-site-link i {
    font-size: 0.68rem;
}

.portfolio-more {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.portfolio-more a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.portfolio-more a:hover {
    color: var(--accent);
}

.portfolio-more .fa-arrow-right {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.portfolio-more a:hover .fa-arrow-right {
    transform: translateX(3px);
}

/* Portfolio responsive */
@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 580px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-card {
        min-height: 0;
    }
}

/* ================================================
   Contact Section + Footer
   ================================================ */

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

.contact-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.contact-card {
    padding: 28px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    transition: all var(--transition-normal);
    min-width: 200px;
}

.contact-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.contact-card i {
    font-size: 1.6rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.contact-card h3 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0;
}

.contact-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

/* Clickable email card */
.contact-email {
    display: block;
    position: relative;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.contact-email:hover {
    border-color: var(--accent);
}

.contact-email:hover p {
    color: var(--accent);
}

.contact-hint,
.contact-copied {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: opacity var(--transition-fast);
}

.contact-copied {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28px;
    color: var(--accent);
    font-weight: 500;
    opacity: 0;
}

.contact-email.copied .contact-hint {
    opacity: 0;
}

.contact-email.copied .contact-copied {
    opacity: 1;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all var(--transition-normal);
}

.social-link i {
    font-size: 1.2rem;
}

.social-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

/* Footer */
.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Resume button under the contact links */
.contact-cv {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* Contact + Footer responsive */
@media (max-width: 580px) {
    .contact-grid {
        flex-direction: column;
        align-items: center;
    }

    .contact-card {
        width: 100%;
        max-width: 300px;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .social-link {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }
}

/* ================================================
   Resume Page (cv/)
   ================================================ */

.cv-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cv-back i {
    font-size: 0.85em;
}

.cv {
    padding: calc(var(--navbar-height) + 56px) 0 80px;
}

.cv .container {
    max-width: 820px;
}

.cv-header {
    padding-bottom: 32px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-glass);
}

.cv-name {
    font-size: clamp(2rem, 5vw, 2.6rem);
}

.cv-alias {
    margin-top: 4px;
    color: var(--accent);
    font-weight: 500;
}

.cv-role {
    margin-top: 8px;
}

.cv-contact {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cv-contact li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cv-contact i {
    color: var(--text-muted);
}

.cv-section {
    margin-bottom: 40px;
}

.cv-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.cv-placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.cv-entry {
    margin-bottom: 24px;
}

.cv-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.cv-entry-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0;
}

.cv-entry-org {
    font-weight: 400;
    color: var(--text-secondary);
}

.cv-entry-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.cv-entry-points,
.cv-list {
    margin-top: 8px;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.cv-list {
    list-style: none;
    padding-left: 0;
}

.cv-entry-points li,
.cv-list li {
    margin-bottom: 4px;
}

@media print {
    .cv-page {
        --text-primary: #111;
        --text-secondary: #333;
        --text-muted: #666;
        --accent: #333;
        --border-glass: #ccc;
    }

    .cv-page .footer {
        display: none;
    }

    .cv {
        padding: 0;
    }

    .cv-section,
    .cv-entry {
        break-inside: avoid;
    }

    .cv a {
        color: inherit;
    }
}

/* ================================================
   Light Mode Adjustments
   ================================================ */

/* Light mode hero text needs darker shadow for readability over video */
[data-theme="light"] .hero-title {
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), 0 2px 14px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .video-overlay {
    background: var(--bg-primary);
}

[data-theme="light"] .navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* While the navbar sits over the dark hero video it uses the dark palette,
   so it matches the white hero text; it turns light once past the hero */
[data-theme="light"] .navbar.over-hero {
    --bg-glass: rgba(18, 21, 27, 0.55);
    --bg-menu: rgba(17, 19, 24, 0.98);
    --border-glass: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text-primary: #e8e6e1;
    --text-secondary: #c4c3bd;
    --accent: #a6bccd;
    --accent-strong: #c0d2df;
    --accent-soft: rgba(138, 164, 184, 0.16);
    box-shadow: none;
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #e8e7e2;
}

/* Smooth transition for theme switch */
body,
.navbar,
.about-facts,
.about-list,
.skill-category,
.portfolio-card,
.contact-card,
.social-link,
.nav-btn,
.footer {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ================================================
   Final Polish + Responsive Fine-tuning
   ================================================ */

/* Scroll reveal animation base */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth anchor offset for fixed navbar */
:target {
    scroll-margin-top: calc(var(--navbar-height) + 20px);
}

/* Hero section full height minus navbar */
.hero-section {
    min-height: 100vh;
    min-height: 100dvh;
}

/* Better focus states for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Mobile performance: lighten expensive backdrop blurs */
@media (max-width: 768px) {
    .skill-category,
    .portfolio-card,
    .contact-card,
    .social-link,
    .nav-btn {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .navbar,
    .navbar.scrolled {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

/* Tablet adjustments */
@media (max-width: 900px) {
    :root {
        --section-padding: 70px 0;
    }

    .section-title {
        margin-bottom: 40px;
    }

    .hero-avatar {
        width: 120px;
        height: 120px;
    }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    :root {
        --section-padding: 60px 0;
        --container-padding: 0 16px;
    }

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

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .nav-actions {
        gap: 3px;
    }

    .nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.82rem;
    }

    .nav-social {
        width: auto;
        height: auto;
        font-size: 0.78rem;
    }

    #theme-toggle {
        margin-left: 12px;
    }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 80px 0 40px;
    }

    .hero-avatar {
        width: 80px;
        height: 80px;
        margin-bottom: 16px;
    }

    .hero-subtitle {
        margin-bottom: 20px;
    }
}

/* Reduce animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .navbar,
    .video-bg,
    .video-overlay,
    .nav-hamburger {
        display: none !important;
    }

    .section {
        padding: 20px 0;
    }

    body {
        background: #fff;
        color: #000;
    }
}
