@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,650;9..144,750&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: light;
    --bg: #f3efe6;
    --bg-soft: #fffaf0;
    --surface: rgba(255, 255, 255, 0.74);
    --surface-strong: rgba(255, 255, 255, 0.92);
    --text: #15191c;
    --muted: #5b6268;
    --muted-strong: #30363b;
    --line: rgba(20, 25, 28, 0.14);
    --brand: #245ccc;
    --brand-strong: #17459c;
    --accent: #9b6327;
    --accent-soft: rgba(155, 99, 39, 0.12);
    --danger: #ef8354;
    --shadow: 0 30px 80px rgba(69, 52, 31, 0.16);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --container: 1180px;
    --header-height: 82px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Manrope', sans-serif;
}

body.dark-theme {
    color-scheme: dark;
    --bg: #0c1117;
    --bg-soft: #121a22;
    --surface: rgba(255, 255, 255, 0.08);
    --surface-strong: rgba(255, 255, 255, 0.14);
    --text: #f4efe6;
    --muted: #aeb7be;
    --muted-strong: #d5d9d7;
    --line: rgba(255, 255, 255, 0.15);
    --brand: #74a5ff;
    --brand-strong: #2d6dff;
    --accent: #e5c07b;
    --accent-soft: rgba(229, 192, 123, 0.16);
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 10%, rgba(116, 165, 255, 0.16), transparent 32rem),
        radial-gradient(circle at 90% 2%, rgba(229, 192, 123, 0.12), transparent 34rem),
        linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.7;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    content: '';
    opacity: 0.34;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}

body::after {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    content: '';
    opacity: 0.11;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency=".7" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)" opacity=".65"/%3E%3C/svg%3E');
}

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

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

button {
    border: 0;
    font: inherit;
}

.container {
    width: min(calc(100% - 40px), var(--container));
    margin-inline: auto;
}

.section {
    position: relative;
    padding: 118px 0;
}

.site-orb {
    position: fixed;
    z-index: -4;
    width: 36vw;
    aspect-ratio: 1;
    border-radius: 999px;
    filter: blur(20px);
    opacity: 0.58;
    pointer-events: none;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

.site-orb--one {
    top: 10vh;
    left: -16vw;
    background: radial-gradient(circle, rgba(45, 109, 255, 0.4), transparent 62%);
}

.site-orb--two {
    right: -12vw;
    bottom: 2vh;
    background: radial-gradient(circle, rgba(229, 192, 123, 0.28), transparent 64%);
    animation-delay: -7s;
}

.header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}

.header.is-scrolled {
    border-bottom: 1px solid var(--line);
    background: rgba(243, 239, 230, 0.78);
    backdrop-filter: blur(22px);
}

body.dark-theme .header.is-scrolled {
    background: rgba(12, 17, 23, 0.72);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: 20px;
}

.nav__brand,
.footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav__mark {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
}

.nav__link {
    position: relative;
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    transition: color 0.25s ease, background 0.25s ease;
}

.nav__link:hover,
.nav__link.is-active {
    color: var(--text);
    background: var(--surface);
}

.nav__link--cta {
    color: #10151b;
    background: var(--accent);
}

.nav__link--cta:hover,
.nav__link--cta.is-active {
    color: #10151b;
    background: #f1cf8b;
}

.nav__toggle,
.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(18px);
}

.nav__toggle {
    display: none;
    gap: 4px;
}

.nav__toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    transition: transform 0.25s ease;
}

.nav__toggle.is-open span:first-child {
    transform: translateY(3px) rotate(45deg);
}

.nav__toggle.is-open span:last-child {
    transform: translateY(-3px) rotate(-45deg);
}

.hero {
    display: grid;
    min-height: 100vh;
    padding-top: calc(var(--header-height) + 44px);
    overflow: clip;
    align-items: center;
}

.hero__bg-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(118deg, rgba(255, 255, 255, 0.09), transparent 22%),
        radial-gradient(circle at 70% 46%, rgba(116, 165, 255, 0.14), transparent 26rem);
    clip-path: polygon(54% 0, 100% 0, 100% 82%, 69% 100%, 36% 70%);
}

.hero__container {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
    align-items: center;
    gap: clamp(42px, 6vw, 88px);
}

.hero__content,
.hero__visual {
    min-width: 0;
}

.hero__content {
    position: relative;
    z-index: 2;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow span {
    width: 42px;
    height: 1px;
    background: currentColor;
}

h1,
h2,
h3 {
    color: var(--text);
    line-height: 1;
}

h1,
h2 {
    font-family: var(--font-display);
    font-weight: 750;
    letter-spacing: -0.065em;
}

h1 {
    max-width: 820px;
    font-size: clamp(3.4rem, 7.2vw, 7rem);
    hyphens: auto;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

h2 {
    max-width: 860px;
    font-size: clamp(2.5rem, 5.6vw, 5.4rem);
}

h3 {
    font-size: 1.12rem;
    letter-spacing: -0.02em;
}

.hero__lead {
    max-width: 670px;
    margin: 28px 0 0;
    color: var(--muted-strong);
    font-size: clamp(1.05rem, 1.7vw, 1.34rem);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 14px 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.button:hover {
    transform: translateY(-3px);
}

.button--primary {
    color: #10151b;
    background: linear-gradient(135deg, #f7d995, var(--accent));
    box-shadow: 0 18px 48px rgba(229, 192, 123, 0.2);
}

.button--ghost {
    color: var(--text);
    background: var(--surface);
    backdrop-filter: blur(16px);
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 650px;
    margin-top: 46px;
}

.hero__stats div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    backdrop-filter: blur(18px);
}

.hero__stats strong {
    display: block;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
}

.hero__stats span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.hero__visual {
    position: relative;
    z-index: 1;
    min-height: min(650px, 72vh);
    perspective: 1200px;
}

.hero__image-card,
.hero__logo-card,
.hero__badge {
    position: absolute;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform-style: preserve-3d;
}

.hero__image-card img,
.hero__logo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.hero__image-card--main {
    inset: 6% 4% 10% 15%;
    border-radius: 44px;
    animation: cardFloat 7s ease-in-out infinite;
}

.hero__image-card--small {
    top: 0;
    left: 0;
    width: 44%;
    height: 34%;
    border-radius: 30px;
    animation: cardFloat 8s ease-in-out infinite reverse;
}

.hero__logo-card {
    right: 0;
    bottom: 0;
    width: 38%;
    height: 28%;
    border-radius: 30px;
    background: #fff;
}

.hero__logo-card img {
    object-fit: contain;
    padding: 26px;
}

.hero__badge {
    left: 6%;
    bottom: 12%;
    max-width: 240px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(20px);
}

body.dark-theme .hero__badge {
    background: rgba(12, 17, 23, 0.72);
}

.hero__badge span {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #10151b;
    background: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
}

.hero__badge strong {
    display: block;
    color: var(--text);
    line-height: 1.25;
}

.scroll-cue {
    position: absolute;
    bottom: 30px;
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.scroll-cue span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.6s ease-in-out infinite;
}

.split {
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: clamp(36px, 6vw, 88px);
}

.section__intro {
    position: sticky;
    top: 116px;
    align-self: start;
}

.about__grid {
    display: grid;
    gap: 24px;
}

.portrait-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(229, 192, 123, 0.14), transparent 52%),
        var(--surface);
    box-shadow: var(--shadow);
    padding: clamp(16px, 2.4vw, 28px);
}

.portrait-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    padding: clamp(18px, 3vw, 34px);
    border-radius: 22px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(12, 17, 23, 0.08);
}

.portrait-card figcaption {
    padding: 20px 4px 2px;
    color: var(--muted-strong);
}

.about__copy {
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    backdrop-filter: blur(18px);
}

.about__copy p,
.section__header p,
.contact__panel p {
    color: var(--muted-strong);
    font-size: 1.05rem;
}

.pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.pill-grid span {
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    font-weight: 700;
}

.section__header,
.portfolio__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    align-items: end;
    gap: 32px;
    margin-bottom: 42px;
}

.section__header p {
    align-self: end;
}

.process__rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.process__card,
.service-card,
.contact-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(18px);
    transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.process__card::before,
.service-card::before {
    position: absolute;
    inset: -1px;
    z-index: -1;
    content: '';
    opacity: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 0%), rgba(229, 192, 123, 0.2), transparent 36%);
    transition: opacity 0.25s ease;
}

.process__card:hover,
.service-card:hover,
.contact-card:hover {
    border-color: rgba(229, 192, 123, 0.42);
    transform: translateY(-6px);
}

.process__card:hover::before,
.service-card:hover::before {
    opacity: 1;
}

.process__card {
    min-height: 280px;
    padding: 28px;
    border-radius: var(--radius-xl);
}

.process__card span,
.service-card span {
    display: inline-flex;
    margin-bottom: 60px;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 2.2rem;
    line-height: 1;
}

.process__card h3,
.service-card h3 {
    margin-bottom: 12px;
}

.process__card p,
.service-card p {
    color: var(--muted);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.service-card {
    min-height: 255px;
    padding: 24px;
    border-radius: var(--radius-lg);
}

.service-card span {
    margin-bottom: 46px;
    font-size: 1.7rem;
}

.portfolio__top {
    grid-template-columns: minmax(0, 1fr) auto;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.filter-button {
    padding: 10px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted-strong);
    cursor: pointer;
    font-weight: 800;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.filter-button:hover,
.filter-button.is-active {
    border-color: rgba(229, 192, 123, 0.58);
    background: var(--accent);
    color: #10151b;
    transform: translateY(-2px);
}

.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-flow: dense;
    gap: 18px;
}

.project-card {
    position: relative;
    grid-column: span 4;
    min-height: 380px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.18);
    transition: opacity 0.28s ease, transform 0.28s ease, border-color 0.28s ease;
}

.project-card--wide {
    grid-column: span 8;
}

.project-card--tall {
    grid-row: span 2;
    min-height: 778px;
}

.project-card.is-hidden {
    display: none;
}

.project-card:hover {
    border-color: rgba(229, 192, 123, 0.52);
    transform: translateY(-8px);
}

.project-card img {
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
    filter: saturate(0.9) contrast(1.05);
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.45s ease;
}

.project-card:hover img {
    transform: scale(1.07);
    filter: saturate(1.05) contrast(1.08);
}

.project-card::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: '';
    background:
        linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.08) 58%),
        linear-gradient(135deg, rgba(45, 109, 255, 0.14), transparent 46%);
}

.project-card div {
    position: absolute;
    right: 22px;
    bottom: 22px;
    left: 22px;
    z-index: 2;
    color: #fff;
}

.project-card span {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    backdrop-filter: blur(12px);
}

.project-card h3 {
    color: #fff;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.project-card p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.76);
}

.contact__panel {
    display: grid;
    grid-template-columns: 0.88fr 1.12fr;
    gap: 36px;
    padding: clamp(28px, 6vw, 70px);
    border: 1px solid var(--line);
    border-radius: 42px;
    background:
        radial-gradient(circle at 8% 0, rgba(229, 192, 123, 0.18), transparent 28rem),
        var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.contact__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.contact-card {
    display: grid;
    gap: 9px;
    min-height: 170px;
    padding: 22px;
    border-radius: var(--radius-lg);
}

.contact-card i {
    color: var(--accent);
    font-size: 1.8rem;
}

.contact-card span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.contact-card strong {
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}

.footer {
    padding: 34px 0;
    border-top: 1px solid var(--line);
}

.footer__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
}

.footer__brand {
    color: var(--text);
}

.scroll-top {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    transition: transform 0.25s ease, background 0.25s ease;
}

.scroll-top:hover {
    background: var(--accent);
    color: #10151b;
    transform: translateY(-4px);
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes orbFloat {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(6vw, -4vh, 0) scale(1.12);
    }
}

@keyframes cardFloat {
    0%,
    100% {
        transform: translateY(0) rotate(-1.5deg);
    }
    50% {
        transform: translateY(-16px) rotate(1deg);
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.7);
        opacity: 0.35;
    }
}

@media (max-width: 980px) {
    :root {
        --header-height: 72px;
    }

    .nav__toggle {
        display: inline-grid;
    }

    .nav__menu {
        position: fixed;
        top: calc(var(--header-height) + 12px);
        right: 20px;
        left: 20px;
        display: grid;
        padding: 16px;
        border-radius: 24px;
        background: rgba(255, 250, 240, 0.92);
        box-shadow: var(--shadow);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    body.dark-theme .nav__menu {
        background: rgba(12, 17, 23, 0.9);
    }

    .nav__menu.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav__link {
        justify-content: center;
        padding: 14px;
        text-align: center;
    }

    .hero__container,
    .split,
    .section__header,
    .portfolio__top,
    .contact__panel {
        grid-template-columns: 1fr;
    }

    .section__intro {
        position: static;
    }

    .hero__visual {
        min-height: 560px;
    }

    .process__rail,
    .services__grid {
        grid-template-columns: 1fr;
    }

    .process__card {
        min-height: 230px;
    }

    .portfolio__grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .project-card,
    .project-card--wide {
        grid-column: span 3;
    }

    .project-card--tall {
        grid-row: span 1;
        min-height: 440px;
    }

    .filter-group {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .container {
        width: min(calc(100% - 28px), var(--container));
    }

    .section {
        padding: 82px 0;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--header-height) + 54px);
    }

    h1 {
        font-size: clamp(3rem, 17vw, 5rem);
    }

    h2 {
        font-size: clamp(2.25rem, 13vw, 4rem);
    }

    .nav__brand span {
        display: none;
    }

    .hero__stats,
    .contact__cards {
        grid-template-columns: 1fr;
    }

    .hero__visual {
        min-height: 460px;
    }

    .hero__image-card--main {
        inset: 8% 0 12% 4%;
    }

    .hero__image-card--small {
        width: 48%;
        height: 28%;
    }

    .hero__logo-card {
        width: 48%;
        height: 24%;
    }

    .hero__badge {
        left: 0;
        bottom: 6%;
    }

    .scroll-cue {
        display: none;
    }

    .portfolio__grid {
        grid-template-columns: 1fr;
    }

    .project-card,
    .project-card--wide,
    .project-card--tall {
        grid-column: auto;
        min-height: 360px;
    }

    .footer__container {
        align-items: flex-start;
        flex-direction: column;
    }
}

@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;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
