:root {
    --ink: #0f1c1a;
    --ink-soft: #2a3d39;
    --muted: #5c6f6a;
    --paper: #f3f0e8;
    --paper-2: #e8e4d8;
    --accent: #0d7a6f;
    --accent-deep: #095a52;
    --accent-bright: #1aa897;
    --line: rgba(15, 28, 26, 0.12);
    --chat-bg: #faf8f2;
    --font-display: "Instrument Serif", Georgia, serif;
    --font-body: "DM Sans", "Segoe UI", sans-serif;
    --radius: 4px;
    --shadow: 0 18px 50px rgba(9, 40, 36, 0.18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: #0a1614;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-deep);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 90% 55% at 10% -10%, rgba(26, 168, 151, 0.28), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 0%, rgba(232, 196, 120, 0.16), transparent 50%),
        linear-gradient(165deg, #0a1614 0%, #122421 42%, #1a2f2b 100%);
}

.page-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(243, 240, 232, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 240, 232, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
    animation: gridDrift 28s linear infinite;
}

@keyframes gridDrift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 48px 48px, 48px 48px; }
}

.page {
    width: min(920px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.5rem 0 6rem;
}

/* Hero — first viewport composition */
.hero {
    min-height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0 3rem;
    animation: riseIn 0.9s ease both;
}

.hero-layout {
    display: block;
}

.hero-copy {
    min-width: 0;
}

.hero-brand {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
    gap: clamp(1.25rem, 3.5vw, 2.5rem);
    align-items: center;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-kicker {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-bright);
}

.hero-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(3rem, 8.5vw, 5.2rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--paper);
}

.hero-role {
    margin: 1rem 0 0;
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(243, 240, 232, 0.78);
}

.hero-lede {
    margin: 1.5rem 0 0;
    max-width: 40rem;
    font-size: 1.08rem;
    color: rgba(243, 240, 232, 0.68);
}

.hero-photo {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(26, 168, 151, 0.45);
    box-shadow:
        0 0 0 10px rgba(26, 168, 151, 0.08),
        0 24px 60px rgba(0, 0, 0, 0.35);
    animation: riseIn 1.05s ease 0.12s both, photoGlow 5.5s ease-in-out infinite;
}

.hero-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    transform: scale(1.02);
}

@keyframes photoGlow {
    0%, 100% {
        box-shadow:
            0 0 0 10px rgba(26, 168, 151, 0.08),
            0 24px 60px rgba(0, 0, 0, 0.35);
    }
    50% {
        box-shadow:
            0 0 0 14px rgba(26, 168, 151, 0.14),
            0 28px 70px rgba(0, 0, 0, 0.4);
    }
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.75rem;
    animation: riseIn 1.1s ease 0.15s both;
}

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.65rem 1.15rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-bright);
    color: #04221e;
    border-color: transparent;
}

.btn-primary:hover {
    background: #2bc4b0;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--paper);
    border-color: rgba(243, 240, 232, 0.28);
}

.btn-ghost:hover {
    border-color: rgba(243, 240, 232, 0.55);
    background: rgba(243, 240, 232, 0.06);
}

.skills-band {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.25rem 0 2.5rem;
    border-top: 1px solid rgba(243, 240, 232, 0.12);
    animation: riseIn 1.15s ease 0.25s both;
}

.skill-tag {
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(243, 240, 232, 0.16);
    border-radius: 999px;
    font-size: 0.8rem;
    color: rgba(243, 240, 232, 0.72);
    background: rgba(243, 240, 232, 0.04);
}

.section-head {
    margin-bottom: 1.75rem;
}

.section-head h2,
.certs h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 400;
    color: var(--paper);
}

.section-head p {
    margin: 0.4rem 0 0;
    color: rgba(243, 240, 232, 0.55);
    font-size: 0.95rem;
}

.experience {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.job {
    padding: 1.35rem 0 1.5rem;
    border-top: 1px solid rgba(243, 240, 232, 0.1);
}

.job-header {
    margin-bottom: 0.75rem;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.job-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--paper);
}

.company {
    margin: 0.35rem 0 0;
    color: var(--accent-bright);
    font-weight: 500;
}

.duration {
    margin: 0.15rem 0 0;
    color: rgba(243, 240, 232, 0.5);
    font-size: 0.88rem;
}

.accomplishments {
    margin: 0;
    padding-left: 1.15rem;
    color: rgba(243, 240, 232, 0.78);
}

.accomplishments li {
    margin-bottom: 0.45rem;
}

.accomplishments li:last-child {
    margin-bottom: 0;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(243, 240, 232, 0.55);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.info-icon:hover {
    color: var(--accent-bright);
    background: rgba(26, 168, 151, 0.12);
    transform: scale(1.06);
}

.info-icon svg {
    width: 18px;
    height: 18px;
}

.certs {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(243, 240, 232, 0.1);
}

.certs ul {
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
}

.certs li {
    color: rgba(243, 240, 232, 0.75);
    margin-bottom: 0.35rem;
}

.page-footer {
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(243, 240, 232, 0.1);
    color: rgba(243, 240, 232, 0.45);
    font-size: 0.9rem;
}

.page-footer a {
    color: rgba(243, 240, 232, 0.7);
}

/* Chat widget */
.chat-widget {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1000;
}

.chat-toggle {
    width: 3.25rem;
    height: 3.25rem;
    border: none;
    border-radius: 50%;
    background: var(--accent-bright);
    color: #04221e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, opacity 0.25s ease, background 0.2s ease;
}

.chat-toggle:hover {
    background: #2bc4b0;
    transform: translateY(-2px);
}

.chat-toggle.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

.chat-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: min(400px, calc(100vw - 1.5rem));
    height: min(70vh, 620px);
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 999;
}

.chat-container.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
    display: none;
}

.chat-container.visible {
    opacity: 1;
    transform: scale(1);
    display: flex;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, #12332e, #0d7a6f);
    color: var(--paper);
}

.chat-header-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.chat-header-copy strong {
    font-size: 0.98rem;
}

.chat-header-copy span {
    font-size: 0.78rem;
    opacity: 0.75;
}

.chat-minimize {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: rgba(243, 240, 232, 0.12);
    color: var(--paper);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.chat-minimize:hover {
    background: rgba(243, 240, 232, 0.22);
    transform: rotate(180deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--chat-bg);
}

.message {
    max-width: 88%;
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.message.bot {
    align-self: flex-start;
    background: #ebe6da;
    color: var(--ink);
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.error {
    align-self: flex-start;
    background: #f7d9d4;
    color: #8a2f22;
}

.message.thinking,
.message.typing {
    align-self: flex-start;
    background: #ebe6da;
    color: var(--muted);
    font-style: italic;
    animation: pulseSoft 1.4s ease-in-out infinite;
}

@keyframes pulseSoft {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.message.bot p {
    margin: 0.35rem 0;
}

.message.bot p:first-child {
    margin-top: 0;
}

.message.bot p:last-child {
    margin-bottom: 0;
}

.message.bot ul {
    margin: 0.35rem 0;
    padding-left: 1.1rem;
}

.message.bot li {
    margin: 0.25rem 0;
}

.message.bot strong {
    color: var(--ink);
    font-weight: 600;
}

.suggested-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.15rem 0 0.35rem;
}

.suggestion {
    border: 1px solid rgba(13, 122, 111, 0.28);
    background: rgba(13, 122, 111, 0.08);
    color: var(--accent-deep);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.suggestion:hover {
    background: rgba(13, 122, 111, 0.16);
    transform: translateY(-1px);
}

.suggested-questions.hidden {
    display: none;
}

.input-suggestions-wrapper {
    display: flex;
    flex-direction: column;
}

.chat-input-container {
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--line);
    background: #f7f4ec;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.chat-input {
    flex: 1;
    min-height: 2.6rem;
    max-height: 100px;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    resize: none;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.4;
    background: white;
    color: var(--ink);
}

.chat-input:focus {
    outline: 2px solid rgba(13, 122, 111, 0.35);
    border-color: var(--accent);
}

.chat-send {
    width: 2.6rem;
    height: 2.6rem;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.char-counter {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
}

.char-counter.near-limit {
    color: #b86b1a;
}

.char-counter.at-limit {
    color: #b33a2b;
}

.pdf-hide {
    display: block;
}

@media (max-width: 640px) {
    .page {
        width: calc(100% - 1.25rem);
        padding-top: 1.5rem;
        padding-bottom: 7rem;
    }

    .hero {
        min-height: auto;
        padding: 1.25rem 0 2rem;
    }

    .hero-brand {
        grid-template-columns: minmax(0, 1fr) 110px;
        gap: 1rem;
        align-items: center;
    }

    .hero-photo {
        max-width: 110px;
        justify-self: end;
    }

    .hero-name {
        font-size: clamp(2.4rem, 11vw, 3.4rem);
    }

    .hero-role {
        margin-top: 0.55rem;
        font-size: 0.95rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-ghost {
        width: 100%;
    }

    .chat-container {
        width: calc(100% - 1rem);
        height: min(62vh, 560px);
        right: 0.5rem;
        bottom: 0.75rem;
    }

    .chat-widget {
        right: 0.75rem;
        bottom: 0.75rem;
    }
}

@media print {
    .page-bg,
    .chat-widget,
    .info-icon,
    .hero-actions .btn-primary {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero-name,
    .hero-role,
    .hero-lede,
    .section-head h2,
    .certs h2,
    .job-header h3,
    .company,
    .duration,
    .accomplishments,
    .skill-tag,
    .page-footer,
    .certs li {
        color: black !important;
    }

    .skills-band,
    .job,
    .certs,
    .page-footer {
        border-color: #ccc !important;
    }
}
