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

:root {
    --primary-color: #f5f5f5;
    --secondary-color: #a1a1a1;
    --muted-color: #6b6b6b;
    --background-dark: #0a0a0a;
    --background-elevated: #141414;
    --background-secondary: #1a1a1a;
    --border-color: #2a2a2a;
    --border-strong: #3a3a3a;
    --accent: #f5f5f5;
    --accent-soft: rgba(245, 245, 245, 0.08);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-large: 0 30px 80px rgba(0, 0, 0, 0.55);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font-primary);
    color: var(--primary-color);
    background: var(--background-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 800px 600px at 15% -10%, rgba(74, 144, 226, 0.06), transparent 60%),
        radial-gradient(ellipse 700px 500px at 90% 10%, rgba(126, 211, 33, 0.04), transparent 60%),
        radial-gradient(ellipse 1000px 700px at 50% 110%, rgba(245, 245, 245, 0.025), transparent 70%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.cv-nav,
.cv-main,
.cv-footer {
    position: relative;
    z-index: 1;
}

.cv-nav {
    position: sticky;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.cv-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cv-nav-logo {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    transition: var(--transition);
}

.cv-nav-logo:hover {
    opacity: 0.75;
}

.cv-nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cv-nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.cv-nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-nav-link:hover,
.cv-nav-link.is-active {
    color: var(--primary-color);
}

.cv-nav-link:hover::after,
.cv-nav-link.is-active::after {
    transform: scaleX(1);
}

.cv-main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.cv-header-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 760px;
}

.cv-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cv-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7ed321;
    box-shadow: 0 0 8px rgba(126, 211, 33, 0.6);
}

.cv-eyebrow-text {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--secondary-color);
}

.cv-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cv-title-line--accent {
    font-size: 0.55em;
    font-weight: 400;
    color: var(--secondary-color);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.cv-subtitle {
    font-size: 1.05rem;
    color: var(--secondary-color);
    max-width: 60ch;
}

.cv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.4rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.cv-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cv-btn--primary {
    background: var(--primary-color);
    color: #0a0a0a;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

.cv-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: #fff;
}

.cv-btn--primary:active {
    transform: translateY(0);
}

.cv-btn--ghost {
    background: rgba(20, 20, 20, 0.6);
    color: var(--primary-color);
    border-color: var(--border-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cv-btn--ghost:hover {
    border-color: var(--primary-color);
    background: rgba(30, 30, 30, 0.75);
    transform: translateY(-2px);
}

.cv-btn--ghost:active {
    transform: translateY(0);
}

.cv-preview {
    width: 100%;
}

.cv-preview-frame {
    width: 100%;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-large);
    display: flex;
    flex-direction: column;
}

.cv-preview-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(8, 8, 8, 0.7);
    border-bottom: 1px solid var(--border-color);
}

.cv-preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.7;
}

.cv-preview-dot--r { background: #ff5f57; }
.cv-preview-dot--y { background: #ffbd2e; }
.cv-preview-dot--g { background: #28c93f; }

.cv-preview-filename {
    margin-left: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cv-preview-viewer {
    width: 100%;
    /* Match one A4 page height at the current FitH width (210×297mm). */
    height: auto;
    aspect-ratio: 210 / 297;
    background: #1f1f1f;
    position: relative;
}

.cv-preview-object {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.cv-preview-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    padding: 2rem;
}

.cv-preview-fallback-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary-color);
}

.cv-preview-fallback-text {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.cv-preview-fallback a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cv-preview-fallback a:hover {
    opacity: 0.75;
}

.cv-footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 10, 10, 0.6);
    margin-top: auto;
}

.cv-footer-text {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.cv-footer-text a,
.cv-footer-link {
    color: var(--primary-color);
    text-decoration: none;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    font: inherit;
    padding: 0;
    cursor: pointer;
    transition: var(--transition);
}

.cv-footer-text a:hover,
.cv-footer-link:hover {
    border-bottom-color: var(--primary-color);
}

.cv-footer-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 2px;
}

.cv-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-modal[hidden] {
    display: none;
}

.cv-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.cv-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cv-modal-panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--background-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 2rem 1.75rem 1.5rem;
    box-shadow: var(--shadow-large);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-modal.is-open .cv-modal-panel {
    transform: translateY(0) scale(1);
}

.cv-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--secondary-color);
    cursor: pointer;
    transition: var(--transition);
}

.cv-modal-close:hover {
    color: var(--primary-color);
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.04);
}

.cv-modal-header {
    margin-bottom: 1.25rem;
    padding-right: 2rem;
}

.cv-modal-title {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--primary-color);
}

.cv-contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cv-contact-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--primary-color);
    background: rgba(20, 20, 20, 0.6);
    text-decoration: none;
    transition: var(--transition);
}

a.cv-contact-row:hover,
.cv-contact-row--email:hover {
    border-color: var(--primary-color);
    background: rgba(30, 30, 30, 0.85);
    transform: translateY(-1px);
}

.cv-contact-row-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.cv-contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--primary-color);
    flex-shrink: 0;
}

.cv-contact-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.cv-contact-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-color);
}

.cv-contact-value {
    font-size: 0.95rem;
    color: var(--primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cv-contact-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.cv-contact-copy {
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.4rem 0.7rem;
    border-radius: 7px;
    cursor: pointer;
    transition: var(--transition);
}

.cv-contact-copy:hover {
    background: var(--primary-color);
    color: #0a0a0a;
    border-color: var(--primary-color);
}

.cv-contact-copy.is-copied {
    background: #7ed321;
    color: #0a0a0a;
    border-color: #7ed321;
}

@media (max-width: 480px) {
    .cv-modal {
        padding: 1rem;
    }

    .cv-modal-panel {
        padding: 1.75rem 1.25rem 1.25rem;
    }

    .cv-contact-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .cv-nav-inner {
        height: 64px;
        padding: 0 1.25rem;
    }

    .cv-nav-menu {
        gap: 1.25rem;
    }

    .cv-nav-link {
        font-size: 0.85rem;
    }

    .cv-main {
        padding: 2.5rem 1.25rem 2rem;
        gap: 2rem;
    }

    .cv-actions {
        width: 100%;
    }

    .cv-btn {
        flex: 1;
        justify-content: center;
        padding: 0.85rem 1rem;
    }
}

@media (max-width: 480px) {
    .cv-nav-menu {
        gap: 0.85rem;
    }

    .cv-preview-filename {
        display: none;
    }
}
