/* Variables */
:root {
    color-scheme: dark;
    --bg: #081016;
    --bg-soft: #0d171f;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.1);
    --line: rgba(255, 255, 255, 0.13);
    --line-strong: rgba(115, 231, 216, 0.36);
    --text: #f4f7f6;
    --text-soft: #c6cfcd;
    --muted: #8c9896;
    --accent: #67dccf;
    --accent-strong: #43bfb2;
    --warm: #d6a06d;
    --danger-safe: #141f28;
    --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.34);
    --radius: 8px;
    --container: 1160px;
    --header-height: 76px;
    --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(115deg, rgba(103, 220, 207, 0.08), transparent 34rem),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 42%, #070d13 100%);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
}

body.nav-open {
    overflow: hidden;
}

body::selection {
    color: #061014;
    background: var(--accent);
}

a {
    color: inherit;
    text-decoration: none;
}

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

p,
h1,
h2,
h3,
ul,
figure {
    margin-top: 0;
}

p {
    color: var(--text-soft);
}

h1,
h2,
h3 {
    color: var(--text);
    line-height: 1.08;
    letter-spacing: 0;
}

h1 {
    max-width: 11ch;
    margin-bottom: 1.35rem;
    font-size: 3rem;
    font-weight: 780;
}

h2 {
    margin-bottom: 1rem;
    font-size: 2.25rem;
    font-weight: 760;
}

h3 {
    margin-bottom: 0.75rem;
    font-size: 1.16rem;
    font-weight: 730;
}

ul {
    padding-left: 0;
    list-style: none;
}

:focus-visible {
    outline: 3px solid rgba(103, 220, 207, 0.72);
    outline-offset: 4px;
}

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

.section {
    position: relative;
    padding-block: 5rem;
}

.section-anchor {
    scroll-margin-top: calc(var(--header-height) + 22px);
}

.section-kicker,
.eyebrow {
    margin-bottom: 0.9rem;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 780;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0;
}

.lead,
.section-copy > p,
.contact-panel p {
    max-width: 720px;
    color: var(--text-soft);
    font-size: 1.08rem;
}

.section-copy h2 {
    max-width: 12ch;
}

.section-copy.centered {
    max-width: 760px;
    margin-inline: auto;
    margin-bottom: 2.5rem;
    text-align: center;
}

.section-copy.centered h2,
.section-copy.centered p {
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    padding: 0.7rem 0.9rem;
    color: #061014;
    background: var(--accent);
    border-radius: var(--radius);
    font-weight: 760;
    transform: translateY(-150%);
    transition: transform 180ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: 0.85rem max(1rem, calc((100vw - var(--container)) / 2));
    background: rgba(8, 16, 22, 0.82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    transition: background 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
    background: rgba(8, 16, 22, 0.94);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.26);
}

.brand {
    position: relative;
    z-index: 52;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    color: var(--text);
    font-weight: 780;
}

.brand::before {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    margin-right: 0.65rem;
    background: var(--accent);
    border-radius: 2px;
    content: "";
    box-shadow: 0 0 22px rgba(103, 220, 207, 0.5);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
}

.main-nav a {
    min-height: 42px;
    padding: 0.56rem 0.72rem;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.is-active {
    color: var(--text);
    background: rgba(103, 220, 207, 0.12);
}

.main-nav a:hover {
    transform: translateY(-1px);
}

.nav-toggle {
    position: relative;
    z-index: 52;
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 2px;
    transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Hero */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: calc(100svh - var(--header-height));
    padding-block: 5rem;
    border-bottom: 1px solid var(--line);
}

.hero::before {
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        linear-gradient(130deg, rgba(103, 220, 207, 0.14), transparent 32%),
        linear-gradient(315deg, rgba(214, 160, 109, 0.12), transparent 36%),
        linear-gradient(180deg, #081016, #0c151d);
    content: "";
}

.hero-noise {
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: 0.33;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 90%);
    animation: gridMove 22s linear infinite;
}

.shape {
    position: absolute;
    z-index: -1;
    width: 42rem;
    height: 9rem;
    background: linear-gradient(90deg, transparent, rgba(103, 220, 207, 0.11), transparent);
    transform: rotate(-18deg);
    pointer-events: none;
    animation: slowSweep 16s ease-in-out infinite;
}

.shape-one {
    top: 20%;
    right: -12rem;
}

.shape-two {
    bottom: 12%;
    left: -18rem;
    animation-delay: -7s;
}

.hero-grid {
    display: grid;
    align-items: center;
    gap: 3rem;
    min-height: calc(100svh - var(--header-height) - 10rem);
}

.hero-copy {
    max-width: 760px;
}

.hero-copy h1 {
    text-wrap: balance;
}

.button-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-portrait {
    position: relative;
    width: min(100%, 430px);
    margin: 0;
    padding: 0.72rem;
    background:
        radial-gradient(circle at 22% 18%, rgba(103, 220, 207, 0.24), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(103, 220, 207, 0.1), rgba(214, 160, 109, 0.16)),
        rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    animation: heroImageFloat 7s ease-in-out infinite, portraitGlow 4.8s ease-in-out infinite;
}

.hero-portrait::before {
    position: absolute;
    inset: 0.7rem;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(103, 220, 207, 0.54), transparent 34%, rgba(214, 160, 109, 0.48) 68%, transparent),
        linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    border-radius: var(--radius);
    content: "";
    filter: blur(22px);
    opacity: 0.54;
    transform: scale(0.96);
    animation: portraitAura 6.4s ease-in-out infinite;
}

.hero-portrait::after {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(115deg, transparent 8%, rgba(255, 255, 255, 0.22) 26%, transparent 42%),
        radial-gradient(circle at 78% 14%, rgba(214, 160, 109, 0.22), transparent 28%);
    content: "";
    mix-blend-mode: screen;
    opacity: 0.38;
    transform: translateX(-34%);
    animation: portraitShine 5.8s ease-in-out infinite;
    pointer-events: none;
}

.hero-portrait img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    filter: saturate(1.05) contrast(1.03);
    transform-origin: center;
    animation: portraitBreath 6.6s ease-in-out infinite;
}

.portrait-frame {
    position: absolute;
    z-index: 3;
    background: linear-gradient(90deg, transparent, rgba(103, 220, 207, 0.92), rgba(214, 160, 109, 0.82), transparent);
    opacity: 0.82;
    pointer-events: none;
}

.portrait-frame-top,
.portrait-frame-bottom {
    left: 0.72rem;
    width: calc(100% - 1.44rem);
    height: 1px;
    transform: scaleX(0.35);
    animation: portraitLineX 4.8s ease-in-out infinite;
}

.portrait-frame-top {
    top: 0.72rem;
    transform-origin: left;
}

.portrait-frame-bottom {
    bottom: 0.72rem;
    transform-origin: right;
    animation-delay: -2.4s;
}

.portrait-frame-right,
.portrait-frame-left {
    top: 0.72rem;
    width: 1px;
    height: calc(100% - 1.44rem);
    background: linear-gradient(180deg, transparent, rgba(103, 220, 207, 0.86), rgba(214, 160, 109, 0.78), transparent);
    transform: scaleY(0.35);
    animation: portraitLineY 4.8s ease-in-out infinite;
}

.portrait-frame-right {
    right: 0.72rem;
    transform-origin: top;
    animation-delay: -1.2s;
}

.portrait-frame-left {
    left: 0.72rem;
    transform-origin: bottom;
    animation-delay: -3.6s;
}

.hero-portrait figcaption {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 4;
    max-width: calc(100% - 2rem);
    padding: 0.52rem 0.68rem;
    color: var(--text);
    background: rgba(8, 16, 22, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    backdrop-filter: blur(14px);
    font-size: 0.86rem;
    font-weight: 780;
    line-height: 1.2;
}

/* Sections */
.profile-section,
.skills-section {
    background: rgba(255, 255, 255, 0.018);
}

.experience-section,
.projects-section {
    border-block: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.032);
}

.profile-grid,
.experience-grid,
.skills-intro {
    display: grid;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2.5rem;
}

.visual-panel {
    position: relative;
    overflow: hidden;
    padding: 0.65rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.18);
}

.visual-panel img {
    width: 100%;
    border-radius: 6px;
}

.compact-visual {
    margin-top: 1.7rem;
}

.sticky-copy {
    align-self: start;
}

.card-grid,
.skill-grid,
.project-grid {
    display: grid;
    gap: 1rem;
}

.feature-card,
.skill-card,
.project-card,
.timeline-item,
.contact-panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 58px rgba(0, 0, 0, 0.18);
}

.feature-card,
.skill-card,
.project-card,
.timeline-item {
    padding: 1.35rem;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.feature-card::after,
.project-card::after,
.timeline-item::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 0%, rgba(103, 220, 207, 0.08) 42%, transparent 78%);
    content: "";
    opacity: 0;
    transform: translateX(-40%);
    transition: opacity 180ms ease, transform 360ms ease;
    pointer-events: none;
}

.feature-card:hover,
.skill-card:hover,
.project-card:hover,
.timeline-item:hover {
    transform: translateY(-5px);
    background: var(--surface-strong);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.feature-card:hover::after,
.project-card:hover::after,
.timeline-item:hover::after {
    opacity: 1;
    transform: translateX(24%);
}

.card-line {
    display: block;
    width: 2.4rem;
    height: 3px;
    margin-bottom: 1.1rem;
    background: linear-gradient(90deg, var(--accent), var(--warm));
    border-radius: 999px;
}

.feature-card p,
.project-card p,
.timeline-item p,
.skill-card p {
    margin-bottom: 0;
}

/* Timeline */
.timeline {
    position: relative;
    display: grid;
    gap: 1rem;
}

.timeline::before {
    position: absolute;
    top: 1.2rem;
    bottom: 1.2rem;
    left: 1.3rem;
    width: 1px;
    background: linear-gradient(180deg, var(--accent), rgba(103, 220, 207, 0));
    content: "";
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.4rem;
}

.timeline-number {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    color: #061014;
    background: var(--accent);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 820;
    box-shadow: 0 0 0 8px rgba(103, 220, 207, 0.1);
}

.muted-item .timeline-number {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
}

/* Skills */
.skills-intro {
    margin-bottom: 2.25rem;
}

.skill-card h3 {
    margin-bottom: 1rem;
}

.skill-card ul {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.skill-card li {
    padding: 0.42rem 0.58rem;
    color: var(--text-soft);
    background: rgba(8, 16, 22, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 6px;
    font-size: 0.92rem;
    line-height: 1.3;
}

/* Projects */
.project-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 100%;
}

.project-card img {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1.1rem;
    transition: transform 180ms ease;
}

.project-card:hover img {
    transform: translateY(-3px) scale(1.04);
}

.highlight-project {
    background:
        linear-gradient(145deg, rgba(103, 220, 207, 0.12), rgba(214, 160, 109, 0.08)),
        var(--surface);
}

.text-link {
    display: inline-flex;
    margin-top: auto;
    padding-top: 1rem;
    color: var(--accent);
    font-weight: 760;
}

.text-link:hover,
.text-link:focus-visible {
    color: var(--text);
}

/* Contact */
.contact-section {
    padding-top: 4rem;
}

.contact-panel {
    display: grid;
    gap: 1.5rem;
    align-items: center;
    padding: 1.45rem;
    background:
        linear-gradient(135deg, rgba(103, 220, 207, 0.16), rgba(214, 160, 109, 0.1)),
        var(--surface);
}

.contact-panel h2 {
    max-width: 13ch;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.78rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 780;
    line-height: 1.2;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
}

.button-primary {
    color: #061014;
    background: var(--accent);
    box-shadow: 0 14px 32px rgba(103, 220, 207, 0.18);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: #87eee4;
}

.button-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    border-color: var(--line);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    border-color: var(--line-strong);
}

/* Footer */
.site-footer {
    padding-block: 1.5rem;
    background: rgba(5, 10, 14, 0.94);
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-inner p {
    margin-bottom: 0;
    color: var(--muted);
}

.footer-inner a {
    color: var(--accent);
    font-weight: 720;
}

/* Scroll Reveal */
.js-enabled.reveal-ready [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 620ms ease, transform 620ms ease;
    transition-delay: var(--reveal-delay, 0ms);
}

.js-enabled.reveal-ready [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.section-anchor:target [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
}

/* Animations */
@keyframes gridMove {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 72px 72px;
    }
}

@keyframes slowSweep {
    0%,
    100% {
        transform: translateX(0) rotate(-18deg);
    }

    50% {
        transform: translateX(-4rem) rotate(-18deg);
    }
}

@keyframes heroImageFloat {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes portraitGlow {
    0%,
    100% {
        border-color: rgba(255, 255, 255, 0.13);
        box-shadow: var(--shadow-soft);
    }

    50% {
        border-color: rgba(103, 220, 207, 0.44);
        box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38), 0 0 38px rgba(103, 220, 207, 0.15);
    }
}

@keyframes portraitAura {
    0%,
    100% {
        opacity: 0.42;
        transform: scale(0.94);
    }

    50% {
        opacity: 0.74;
        transform: scale(1.03);
    }
}

@keyframes portraitBreath {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.018);
    }
}

@keyframes portraitShine {
    0%,
    40% {
        transform: translateX(-42%);
        opacity: 0;
    }

    55% {
        opacity: 0.38;
    }

    78%,
    100% {
        transform: translateX(42%);
        opacity: 0;
    }
}

@keyframes portraitLineX {
    0%,
    100% {
        transform: scaleX(0.24);
        opacity: 0.48;
    }

    50% {
        transform: scaleX(1);
        opacity: 0.95;
    }
}

@keyframes portraitLineY {
    0%,
    100% {
        transform: scaleY(0.24);
        opacity: 0.42;
    }

    50% {
        transform: scaleY(1);
        opacity: 0.9;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .js-enabled.reveal-ready [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* Responsive */
@media (min-width: 720px) {
    h1 {
        font-size: 4.2rem;
    }

    h2 {
        font-size: 3rem;
    }

    .section {
        padding-block: 6.5rem;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.72fr);
    }

    .profile-grid,
    .skills-intro {
        grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.72fr);
    }

    .experience-grid {
        grid-template-columns: minmax(0, 0.76fr) minmax(0, 1fr);
        align-items: start;
    }

    .sticky-copy {
        position: sticky;
        top: 6.5rem;
    }

    .three-columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .skill-grid,
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-panel {
        grid-template-columns: 1fr auto;
        padding: 2rem;
    }
}

@media (min-width: 1080px) {
    h1 {
        font-size: 5.25rem;
    }

    h2 {
        font-size: 3.75rem;
    }

    .project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 819px) {
    .site-header {
        padding-inline: 1rem;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 51;
        display: grid;
        gap: 0.4rem;
        padding: calc(var(--header-height) + 1rem) 1rem 1rem;
        background: rgba(8, 16, 22, 0.98);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-soft);
        transform: translateY(-105%);
        transition: transform 220ms ease;
    }

    .main-nav.is-open {
        transform: translateY(0);
    }

    .main-nav a {
        justify-content: flex-start;
        width: 100%;
        padding: 0.8rem 0.85rem;
        font-size: 1rem;
    }

    .hero {
        min-height: auto;
        padding-block: 3.5rem 4.5rem;
    }

    .hero-grid {
        min-height: auto;
    }

    .hero-portrait {
        width: min(100%, 360px);
    }

    .button {
        width: 100%;
    }

    .visual-panel {
        padding: 0.35rem;
    }

    .timeline::before {
        left: 1.15rem;
    }

    .timeline-item {
        grid-template-columns: auto 1fr;
        padding: 1.1rem;
    }
}

@media (max-width: 460px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 2.55rem;
    }

    h2 {
        font-size: 2.05rem;
    }

    .container {
        width: min(100% - 1.4rem, var(--container));
    }

    .section {
        padding-block: 4.4rem;
    }

    .section-copy.centered {
        text-align: left;
    }

    .section-copy.centered h2,
    .section-copy.centered p {
        margin-inline: 0;
    }

    .skill-card li {
        width: 100%;
    }
}
