/* --- jrnk.cz — minimalistické portfolio --- */

:root {
    --bg: #f6f6f3;
    --bg-soft: #fff;
    --text: #1f2326;
    --text-muted: #5a5f64;
    --section-heading: #454a4e;
    --border: #e2e4e0;
    --accent: #2d8b7e;
    --accent-soft: #cce8e4;
    --accent-glow: rgba(45, 139, 126, 0.15);
    --link-hover: #1e6b61;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --bg: #0f1214;
    --bg-soft: #181c1f;
    --text: #e6e8ea;
    --text-muted: #9ca3a8;
    --section-heading: #b4b9be;
    --border: #2a2e32;
    --accent: #4db8a9;
    --accent-soft: #1e3d3a;
    --accent-glow: rgba(77, 184, 169, 0.2);
    --link-hover: #6dd4c6;
    --glass-bg: rgba(24, 28, 31, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: rgba(0, 0, 0, 0.3);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

.logo-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem 0.4rem 0.6rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.logo-wrap:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.logo-icon svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
}

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

.logo {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: var(--text);
}

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

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav a {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-muted);
}

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

/* --- Theme toggle --- */

.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--glass-bg);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.theme-toggle-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.theme-toggle[data-mode="system"] .auto {
    opacity: 1;
}

.theme-toggle[data-mode="light"] .sun {
    opacity: 1;
}

.theme-toggle[data-mode="dark"] .moon {
    opacity: 1;
}

/* --- Main --- */

main {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.25rem 4rem;
    width: 100%;
}

/* Hero — první segment hned pod hero, menší odsazení */
.hero + .segment .segment-header {
    margin-top: 0.5rem;
}

.hero + .segment .segment-header::before {
    display: none;
}

/* --- Hero --- */

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 20rem;
    padding: 5rem 1.25rem;
    margin: 0 -1.25rem 2.5rem;
    border-radius: 1.75rem;
    overflow: visible;
}

.hero-logo {
    position: absolute;
    top: 0;
    left: 1.25rem;
    transform: translateY(-50%);
    z-index: 3;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

.hero-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--accent-soft) 0%, transparent 45%, transparent 55%, var(--accent-soft) 100%);
    opacity: 0.95;
}

[data-theme="dark"] .hero-bg-gradient {
    opacity: 0.7;
}

.hero-bg-glow {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -30%;
    left: -20%;
    background: radial-gradient(ellipse 60% 45% at 50% -10%, var(--accent-glow) 0%, transparent 50%);
    animation: hero-glow 10s ease-in-out infinite alternate;
}

.hero-bg-mesh {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
    pointer-events: none;
}

[data-theme="dark"] .hero-bg-mesh {
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
}

@keyframes hero-glow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.5; }
    100% { transform: scale(1.08) translate(-2%, -3%); opacity: 1; }
}

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

.hero-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
    animation: hero-title-in 0.6s ease-out;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 3.5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text);
    animation: hero-title-in 0.7s ease-out 0.08s both;
}

.hero .tagline {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 38ch;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    animation: hero-title-in 0.7s ease-out 0.18s both;
}

@keyframes hero-title-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Segments (web / dron / kontakt) --- */

.segment {
    position: relative;
}

.segment-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: 4rem auto 1rem;
    text-align: center;
    animation: hero-title-in 0.6s ease-out both;
}

.segment-header::before {
    content: '';
    display: block;
    width: 6rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin-bottom: 0.5rem;
}

.segment-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    transition: background 0.3s ease, color 0.3s ease;
}

.segment-header-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    stroke: currentColor;
}

.segment-header-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0;
}

/* --- Sections --- */

.section {
    padding: 1.5rem 0 2.5rem;
}

/* Vnitřní h2/h3 — malá verzálková obočnice */
.section h2,
.section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--section-heading);
    margin-bottom: 1.25rem;
    animation: hero-title-in 0.45s ease-out both;
}

/* --- Services --- */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.service-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.6rem 0.85rem;
    align-items: start;
    padding: 1.25rem 1.35rem;
    border-radius: 0.85rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 24px var(--glass-shadow);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.3s ease, opacity 0.3s ease;
    animation: hero-title-in 0.5s ease-out both;
}

.service-card:nth-child(1) { animation-delay: 0.05s; }
.service-card:nth-child(2) { animation-delay: 0.1s; }
.service-card:nth-child(3) { animation-delay: 0.15s; }
.service-card:nth-child(4) { animation-delay: 0.2s; }
.service-card:nth-child(5) { animation-delay: 0.25s; }
.service-card:nth-child(6) { animation-delay: 0.3s; }

.service-card:hover {
    box-shadow: 0 8px 32px var(--glass-shadow);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.service-card.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.service-card-icon {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--accent);
    line-height: 1.3;
}

.service-card-icon svg {
    width: 1.15rem;
    height: 1.15rem;
    stroke: currentColor;
    flex-shrink: 0;
}

.service-card-title {
    grid-column: 2;
    grid-row: 1;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.service-card-desc {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
}

.service-card-desc a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-soft);
    text-underline-offset: 2px;
}

.service-card-desc a:hover {
    color: var(--link-hover);
    text-decoration-color: currentColor;
}

/* --- Project cards (liquid glass) + swiper --- */

.project-swiper {
    position: relative;
}

.project-swiper-viewport {
    overflow: hidden;
    margin: 0 -0.25rem; /* malý výběh pro stíny */
    padding-top: 10px;  /* prostor pro hover (translateY + stín) */
}

.project-swiper-track {
    display: flex;
    gap: 1.25rem;
    transition: transform 0.35s ease-out;
    width: max-content;
}

.project-swiper-track .project-card {
    flex: 0 0 calc((100% - 2.5rem) / 3);
    width: calc((100% - 2.5rem) / 3);
    min-width: 0;
}

.project-swiper-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.project-swiper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--glass-bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.project-swiper-btn:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
}

.project-swiper-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.project-swiper-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.project-swiper-track .project-card {
    animation: hero-title-in 0.5s ease-out both;
}

.project-swiper-track .project-card:nth-child(1) { animation-delay: 0.08s; }
.project-swiper-track .project-card:nth-child(2) { animation-delay: 0.16s; }
.project-swiper-track .project-card:nth-child(3) { animation-delay: 0.24s; }
.project-swiper-track .project-card:nth-child(4) { animation-delay: 0.32s; }
.project-swiper-track .project-card:nth-child(5) { animation-delay: 0.40s; }
.project-swiper-track .project-card:nth-child(6) { animation-delay: 0.48s; }
.project-swiper-track .project-card:nth-child(7) { animation-delay: 0.56s; }
.project-swiper-track .project-card:nth-child(8) { animation-delay: 0.64s; }
.project-swiper-track .project-card:nth-child(9) { animation-delay: 0.72s; }

.project-card {
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 24px var(--glass-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--glass-shadow);
    border-color: var(--accent);
}

.project-card.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.card-preview {
    aspect-ratio: 16 / 10;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--border) 0%, var(--bg-soft) 100%);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .card-preview {
    background: linear-gradient(145deg, var(--border) 0%, var(--bg) 100%);
}

.card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-preview:has(img) .card-preview-placeholder {
    display: none;
}

.card-preview-placeholder {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    opacity: 0.85;
}

.card-meta {
    display: block;
    padding: 0 1.1rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 1.1rem 0.75rem;
    margin-top: auto;
}

.card-labels:empty {
    display: none;
}

.card-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
    background: var(--bg-soft);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

[data-theme="dark"] .card-label {
    background: var(--bg);
    border-color: var(--border);
}

.card-title {
    display: block;
    padding: 1rem 1.1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    transition: color 0.2s ease;
}

.project-card:hover .card-title {
    color: var(--accent);
}

/* --- Contact --- */

.contact-list {
    list-style: none;
}

.contact-item {
    margin-bottom: 0.85rem;
    text-align: center;
    animation: hero-title-in 0.5s ease-out both;
}

.contact-item:nth-child(1) { animation-delay: 0.06s; }
.contact-item:nth-child(2) { animation-delay: 0.12s; }
.contact-item:nth-child(3) { animation-delay: 0.18s; }
.contact-item:nth-child(4) { animation-delay: 0.24s; }
.contact-item:nth-child(5) { animation-delay: 0.30s; }

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
    color: var(--accent);
}

.contact-item a:hover {
    color: var(--link-hover);
}

.contact-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.contact-item a:hover .contact-icon {
    color: var(--accent);
}

/* --- Footer --- */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

.site-footer::before {
    content: '';
    display: block;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
    border-top: 1px solid var(--border);
    order: -1;
    flex-basis: 100%;
}

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

/* --- Responsive --- */

@media (max-width: 768px) {
    main {
        padding: 2.5rem 1rem 3rem;
    }

    .hero {
        min-height: 16rem;
        padding: 4rem 1rem;
        margin: 0 -1rem 2rem;
        border-radius: 1.25rem;
    }

    .hero-logo {
        left: 1rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 2.75rem);
    }

    .hero .tagline {
        font-size: 1rem;
        max-width: 100%;
    }

    .segment-header {
        margin-top: 3rem;
        gap: 0.6rem;
    }

    .segment-header-icon {
        width: 2.25rem;
        height: 2.25rem;
    }

    .segment-header-icon svg {
        width: 1.05rem;
        height: 1.05rem;
    }

    .segment-header-title {
        font-size: 1.35rem;
    }

    .section {
        padding: 1rem 0 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card {
        padding: 1.1rem 1.2rem;
    }

    .project-swiper-track .project-card {
        flex: 0 0 100%;
        width: 100%;
    }

    .site-footer {
        flex-direction: column;
        padding: 1.25rem 1rem;
        gap: 1rem;
    }

    .site-footer::before {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 16px;
    }

    main {
        padding: 1.5rem 0.75rem 2.5rem;
    }

    .hero {
        min-height: 14rem;
        padding: 3rem 0.75rem;
        margin: 0 -0.75rem 1.5rem;
        border-radius: 1rem;
    }

    .hero-logo {
        left: 0.75rem;
    }

    .logo-wrap {
        padding: 0.35rem 0.6rem 0.35rem 0.5rem;
        gap: 0.4rem;
    }

    .logo {
        font-size: 1rem;
    }

    .logo-icon svg {
        width: 0.9rem;
        height: 0.9rem;
    }

    .hero-label {
        font-size: 0.65rem;
        letter-spacing: 0.15em;
    }

    .hero-title {
        font-size: clamp(1.75rem, 9vw, 2.25rem);
        margin-bottom: 0.75rem;
    }

    .hero .tagline {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .segment-header {
        margin-top: 2.5rem;
        gap: 0.5rem;
    }

    .segment-header-title {
        font-size: 1.2rem;
    }

    .section {
        padding: 0.75rem 0 1.5rem;
    }

    .section h2,
    .section h3 {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    .services-grid {
        gap: 0.75rem;
    }

    .service-card {
        padding: 1rem 1.1rem;
    }

    .service-card-icon svg {
        width: 1.05rem;
        height: 1.05rem;
    }

    .service-card-title {
        font-size: 0.95rem;
    }

    .service-card-desc {
        font-size: 0.8rem;
    }

    .contact-list {
        padding: 0;
    }

    .contact-item a {
        font-size: 1rem;
    }

    .contact-icon {
        width: 18px;
        height: 18px;
    }

    .site-footer {
        padding: 1rem 0.75rem;
    }

    .site-footer::before {
        max-width: 100%;
        margin-left: 0.75rem;
        margin-right: 0.75rem;
        margin-bottom: 1rem;
    }

    .footer-copy {
        font-size: 0.8rem;
    }

    .theme-toggle {
        width: 2.5rem;
        height: 2.5rem;
    }

    .theme-toggle-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* cv/ — obnova stylů pro .profile-picture-img (root reset * maže margin) */
.img-wrap .profile-picture-img {
    margin: 15px;
}
