/* IDX Cluster — professional business portfolio */

:root {
    --bg: #f3f5f8;
    --bg-soft: #e8eef4;
    --surface: #ffffff;
    --ink: #12181f;
    --ink-soft: #3d4754;
    --ink-muted: #6b7582;
    --accent: #1b5f73;
    --accent-strong: #134a5a;
    --accent-soft: rgba(27, 95, 115, 0.1);
    --accent-line: rgba(27, 95, 115, 0.22);
    --border: #d5dde6;
    --shadow: 0 10px 30px rgba(18, 24, 31, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --container: 1120px;
    --header-h: 72px;
    --font-display: "Space Grotesk", "Be Vietnam Pro", sans-serif;
    --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(27, 95, 115, 0.08), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(19, 74, 90, 0.06), transparent 50%),
        linear-gradient(180deg, #f7f9fb 0%, var(--bg) 40%, #eef2f6 100%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
    min-width: 0;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.container {
    width: min(100% - 2.5rem, var(--container));
    margin-inline: auto;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    background: rgba(247, 249, 251, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(213, 221, 230, 0.9);
    /* contain absolute mobile nav */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.brand-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-menu a:hover {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    min-width: 0;
    flex-shrink: 0;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}

.lang-switch__label {
    display: none;
}

.lang-switch__btns {
    display: flex;
    gap: 0.15rem;
}

.lang-btn {
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.78rem;
}

.lang-btn.is-active {
    background: var(--accent);
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
}

/* Hero */
.hero {
    position: relative;
    min-height: calc(100vh - var(--header-h));
    display: grid;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.hero__atmosphere {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(135deg, rgba(27, 95, 115, 0.12), transparent 42%),
        linear-gradient(180deg, transparent 55%, rgba(243, 245, 248, 0.95)),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 47px,
            rgba(27, 95, 115, 0.045) 47px,
            rgba(27, 95, 115, 0.045) 48px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 47px,
            rgba(27, 95, 115, 0.035) 47px,
            rgba(27, 95, 115, 0.035) 48px
        ),
        radial-gradient(ellipse 80% 60% at 70% 30%, rgba(19, 74, 90, 0.14), transparent 60%);
}

.hero__inner {
    width: min(100% - 2.5rem, var(--container));
    margin: 0 auto;
    padding: 4.5rem 0 5rem;
    max-width: 760px;
}

.hero__brand {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5.5vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: var(--ink);
    margin: 0 0 0.85rem;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.hero__role {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    font-weight: 600;
    color: var(--accent-strong);
    letter-spacing: -0.01em;
}

.hero__subtitle {
    margin: 0 0 2rem;
    max-width: 38rem;
    color: var(--ink-soft);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn--primary:hover {
    background: var(--accent-strong);
}

.btn--secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border);
}

.btn--secondary:hover {
    border-color: var(--accent-line);
    color: var(--accent-strong);
}

.btn--ghost {
    background: transparent;
    color: var(--ink-soft);
    border-color: transparent;
}

.btn--ghost:hover {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

/* Sections */
.sections-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.section {
    padding: 5rem 0;
}

.section:nth-child(even) {
    background: rgba(255, 255, 255, 0.45);
    border-block: 1px solid rgba(213, 221, 230, 0.65);
}

.section > .container,
.section .section-inner,
.cv-container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

.section .section-inner {
    min-width: 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.75rem;
    color: var(--ink);
}

.section-lead {
    margin: 0 0 2.25rem;
    max-width: 40rem;
    color: var(--ink-muted);
    font-size: 1rem;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.about-photo {
    width: 240px;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.about-photo img {
    display: block;
    width: 240px;
    max-width: 100%;
    height: 240px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
}

.about-photo figcaption {
    padding: 0.85rem 1rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    border-top: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.about-role {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--accent-strong);
}

.about-copy p {
    margin: 0 0 1rem;
    color: var(--ink-soft);
    max-width: 42rem;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.25rem;
    box-shadow: var(--shadow);
    position: relative;
    height: 100%;
}

.skill-card--lab {
    border-style: dashed;
    background: linear-gradient(180deg, #fff, #f7fafb);
}

.skill-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-strong);
    margin-bottom: 0.9rem;
}

.skill-card__name {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.skill-card__desc {
    margin: 0 0 1rem;
    color: var(--ink-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.skill-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
}

.skill-tags li {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 6px;
    padding: 0.28rem 0.5rem;
}

.skill-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: #e8f3f5;
    border: 1px solid var(--accent-line);
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
    box-sizing: border-box;
    box-shadow: var(--shadow);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
    min-height: 100%;
    min-width: 0;
}

.project-card:hover {
    border-color: var(--accent-line);
    transform: translateY(-2px);
}

.project-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f7fafb;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 8px;
    flex-shrink: 0;
}

.project-logo {
    width: 100%;
    height: 100%;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    object-position: center;
}

.project-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.project-desc {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.93rem;
    line-height: 1.7;
    font-weight: 400;
    flex: 1;
    overflow-wrap: anywhere;
}

.project-desc [data-font-en] {
    font-family: inherit;
    font-weight: 600;
    letter-spacing: normal;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.tech-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: #eef2f6;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    line-height: 1.3;
}

.project-link-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    color: var(--accent-strong);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.45rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.service-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.service-card__name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.service-card__desc {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.93rem;
    flex: 1;
}

.service-card__meta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-strong);
}

/* CV */
.cv-container {
    width: min(100%, 960px);
}

.cv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.cv-viewer {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    height: min(85vh, 1100px);
    min-height: 680px;
}

.cv-viewer iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.cv-fallback {
    margin-top: 0.85rem;
    color: var(--ink-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Footer */
.site-footer {
    padding: 4.5rem 0 3rem;
    background: #12181f;
    color: #e8eef4;
}

.site-footer__container {
    width: min(100% - 2.5rem, var(--container));
    margin-inline: auto;
}

.site-footer__label {
    margin: 0 0 0.4rem;
    color: #8ea0b0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-footer__title {
    margin: 0 0 0.6rem;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2rem);
    letter-spacing: -0.03em;
}

.site-footer__subtitle {
    margin: 0 0 2rem;
    color: #a7b4c0;
    max-width: 36rem;
}

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

.contact-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: #d7e6ec;
}

.contact-card__platform {
    display: block;
    font-size: 0.8rem;
    color: #8ea0b0;
}

.contact-card__value {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.contact-card__content {
    min-width: 0;
}

.contact-card__arrow {
    margin-left: auto;
    color: #8ea0b0;
}

.site-footer__copy {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #7f8f9d;
    font-size: 0.85rem;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn:hover,
    .project-card:hover { transform: none; }
}

/* Responsive */
@media (max-width: 1100px) {
    .nav-menu a {
        padding: 0.5rem 0.6rem;
        font-size: 0.86rem;
    }

    .brand-wordmark span {
        font-size: 0.95rem;
    }
}

@media (max-width: 980px) {
    .skills-grid,
    .projects-grid,
    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-grid {
        grid-template-columns: 200px minmax(0, 1fr);
        gap: 1.5rem;
    }

    .about-photo,
    .about-photo img {
        width: 200px;
        height: auto;
    }

    .about-photo img {
        height: 200px;
    }

    .hero__inner {
        width: min(100% - 2rem, var(--container));
        padding: 3.25rem 0 3.75rem;
    }
}

@media (max-width: 900px) {
    .header-center {
        position: static;
    }

    .mobile-menu-btn {
        display: inline-grid;
        place-items: center;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0.85rem;
        background: rgba(247, 249, 251, 0.98);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        z-index: 120;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 0.85rem 1rem;
        border-radius: var(--radius-sm);
    }

    .header {
        position: sticky;
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.55rem 0.85rem;
        gap: 0.5rem;
    }

    .brand-wordmark span {
        display: none;
    }

    .theme-toggle {
        order: 0;
    }

    .hero__inner {
        padding: 2.75rem 0 3.25rem;
    }

    .hero__subtitle {
        font-size: 0.98rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: clamp(1.45rem, 6vw, 1.9rem);
    }

    .about-grid,
    .skills-grid,
    .projects-grid,
    .services-grid,
    .site-footer__contacts {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-photo {
        width: min(220px, 70vw);
        max-width: 220px;
        margin-inline: auto;
    }

    .about-photo img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        max-height: none;
    }

    .about-copy {
        text-align: left;
    }

    .cv-viewer {
        min-height: 420px;
        height: min(70vh, 640px);
    }

    .cv-actions,
    .hero__actions,
    .about-actions {
        width: 100%;
    }

    .cv-actions .btn,
    .hero__actions .btn,
    .about-actions .btn {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }
}

@media (max-width: 520px) {
    .lang-switch__label {
        display: none;
    }

    .header-right {
        gap: 0.4rem;
    }

    .hero__actions .btn,
    .about-actions .btn,
    .cv-actions .btn {
        flex: 1 1 100%;
    }

    .skill-card,
    .project-card,
    .service-card {
        padding: 1.15rem 1rem;
    }
}
