:root {
    --background: #252220;
    --foreground: #f6f1e8;
    --surface: rgba(43, 39, 36, 0.84);
    --surface-elevated: rgba(54, 48, 43, 0.94);
    --muted: #b9afa2;
    --muted-strong: #d8cfbf;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(236, 138, 74, 0.24);
    --ember: #ec8a4a;
    --ember-deep: #cf5f2d;
    --ember-soft: #f4b27d;
    --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.6);
    --shadow-ember: 0 10px 40px -10px rgba(236, 138, 74, 0.35);
    --gradient-ember: linear-gradient(135deg, var(--ember), var(--ember-deep));
    --max-width: 1120px;
    --radius: 24px;
    --nav-height: 72px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--foreground);
    background:
        radial-gradient(ellipse 60% 50% at 50% -10%, rgba(236, 138, 74, 0.14), transparent 70%),
        radial-gradient(ellipse 40% 40% at 90% 20%, rgba(207, 95, 45, 0.08), transparent 70%),
        var(--background);
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    line-height: 1.6;
    min-width: 320px;
}

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

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

button,
input,
textarea {
    font: inherit;
}

.site-shell {
    position: relative;
    overflow: hidden;
}

.background-glow {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    border-radius: 999px;
    filter: blur(96px);
    opacity: 0.42;
}

.background-glow-left {
    width: 36rem;
    height: 36rem;
    top: -12rem;
    left: -10rem;
    background: rgba(236, 138, 74, 0.22);
}

.background-glow-right {
    width: 28rem;
    height: 28rem;
    top: 10rem;
    right: -8rem;
    background: rgba(207, 95, 45, 0.15);
}

.container {
    width: min(var(--max-width), calc(100% - 3rem));
    margin: 0 auto;
}

.site-header {
    padding-top: 1.35rem;
}

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
}

.site-nav.scrolled {
    backdrop-filter: blur(20px);
    background: rgba(37, 34, 32, 0.72);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.brand-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--ember);
    box-shadow: var(--shadow-ember);
}

.brand-name,
h1,
h2,
h3 {
    font-family: "Instrument Serif", ui-serif, Georgia, serif;
    letter-spacing: -0.02em;
    font-weight: 400;
}

.brand-name {
    font-size: 1.125rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-links a,
.nav-cta,
.button {
    transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}

.nav-links a {
    color: var(--muted);
    font-size: 0.92rem;
    padding: 0.7rem 0.95rem;
    border-radius: 999px;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--foreground);
}

.nav-cta,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.nav-cta {
    margin-left: 0.75rem;
    padding: 0.8rem 1.2rem;
    border-radius: 999px;
    background: var(--gradient-ember);
    color: #251f1b;
    box-shadow: var(--shadow-ember);
    font-size: 0.92rem;
    font-weight: 600;
}

.nav-cta:hover,
.button:hover {
    transform: translateY(-2px);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 2.8rem;
    height: 2.8rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(43, 39, 36, 0.82);
    color: var(--foreground);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.28rem;
}

.nav-toggle span {
    width: 1rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.hero {
    padding: 7.5rem 0 1rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.95fr);
    gap: 3.5rem;
    align-items: center;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.hero-pill,
.surface-card,
.hero-image-frame,
.service-card,
.project-card,
.contact-form,
.contact-link {
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    width: fit-content;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.pulse-dot {
    width: 0.52rem;
    height: 0.52rem;
    border-radius: 50%;
    background: var(--ember);
    box-shadow: 0 0 0 0 rgba(236, 138, 74, 0.6);
    animation: pulse 2s infinite;
}

.hero-title {
    margin: 0;
    font-size: clamp(3.2rem, 8vw, 6.4rem);
    line-height: 1.02;
}

.hero-italic {
    font-style: italic;
}

.hero-subtitle {
    margin: 0;
    max-width: 38rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.button {
    padding: 0.95rem 1.55rem;
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 600;
}

.button-primary {
    background: var(--gradient-ember);
    color: #251f1b;
    box-shadow: var(--shadow-ember);
}

.button-secondary {
    color: var(--foreground);
    border: 1px solid var(--border);
    background: rgba(43, 39, 36, 0.76);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--muted);
    font-size: 0.94rem;
}

.hero-meta span {
    position: relative;
    padding-left: 1rem;
}

.hero-meta span::before {
    content: "";
    position: absolute;
    top: 0.58rem;
    left: 0;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: var(--ember);
}

.hero-card {
    position: relative;
    animation: float 6s ease-in-out infinite;
}

.hero-aura {
    position: absolute;
    inset: -1.5rem;
    background: var(--gradient-ember);
    opacity: 0.18;
    filter: blur(48px);
    border-radius: 999px;
}

.hero-image-frame {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    width: min(28rem, 82vw);
    margin: 0 auto;
    background:
        radial-gradient(circle at top, rgba(236, 138, 74, 0.16), transparent 45%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.14));
}

.hero-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center 20%;
    transform: scale(1.14);
    filter: saturate(1.04) contrast(1.03);
    transition: transform 1s ease, filter 0.6s ease;
}

.hero-image-frame:hover .hero-image {
    transform: scale(1.19);
    filter: saturate(1.08) contrast(1.05);
}

.hero-image-frame::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.hero-image-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 22%, transparent 70%, rgba(0, 0, 0, 0.18)),
        radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.14), transparent 22%);
    pointer-events: none;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.3rem;
    background: linear-gradient(to top, rgba(37, 34, 32, 0.96), rgba(37, 34, 32, 0.45), transparent);
    z-index: 2;
}

.hero-overlay-text {
    font-size: 0.95rem;
}

.hero-float-card {
    position: absolute;
    left: -1.5rem;
    bottom: -1.5rem;
    padding: 1rem 1.1rem;
    border-radius: 1.15rem;
    border: 1px solid var(--border);
    background: rgba(54, 48, 43, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
}

.hero-float-value {
    font-family: "Instrument Serif", ui-serif, Georgia, serif;
    font-size: 2rem;
}

.hero-float-label {
    color: var(--muted);
    font-size: 0.76rem;
}

.stats-wrap {
    margin-top: 4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    background: var(--border);
}

.stat-card {
    background: rgba(37, 34, 32, 0.82);
    padding: 1.6rem;
}

.stat-card h2 {
    margin: 0;
    font-size: 2.6rem;
    background: var(--gradient-ember);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-card p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.section {
    padding: 5rem 0 0;
    scroll-margin-top: 6rem;
}

.section-intro {
    max-width: 48rem;
    margin-bottom: 2.4rem;
}

.section-eyebrow,
.mono-label,
.mono-small,
.contact-form label {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.section-eyebrow,
.mono-label {
    color: var(--ember);
    font-size: 0.72rem;
    margin: 0 0 0.95rem;
}

.section-intro h2 {
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4rem);
    line-height: 1.1;
}

.muted-heading {
    color: var(--muted);
}

.section-lede {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.text-gradient,
.shimmer-text {
    background: var(--gradient-ember);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.shimmer-text {
    background-image: linear-gradient(90deg, var(--foreground), var(--ember), var(--foreground));
    background-size: 200% 100%;
    animation: shimmer 6s linear infinite;
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.95fr);
    gap: 2rem;
}

.about-copy {
    display: grid;
    gap: 1.25rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.about-copy p {
    margin: 0;
}

.about-facts {
    display: grid;
    gap: 1rem;
}

.surface-card {
    padding: 1.3rem;
    border-radius: 1.1rem;
}

.surface-card p {
    margin: 0.55rem 0 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.service-card {
    border-radius: 1.5rem;
    padding: 1.4rem;
    transition: transform 0.35s ease, border-color 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}

.service-card:hover,
.project-card:hover,
.contact-link:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    background: var(--surface-elevated);
}

.service-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    color: var(--ember);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    background: rgba(54, 48, 43, 0.9);
}

.service-card h3 {
    margin: 0 0 0.55rem;
    font-size: 1.45rem;
}

.service-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 2.5rem;
}

.skill-row {
    display: grid;
    gap: 0.65rem;
}

.skill-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1.08rem;
}

.mono-small {
    color: var(--muted);
    font-size: 0.66rem;
}

.skill-track {
    height: 0.42rem;
    border-radius: 999px;
    background: rgba(54, 48, 43, 0.95);
    overflow: hidden;
}

.skill-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--gradient-ember);
    transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.projects-list {
    display: grid;
    gap: 1.2rem;
}

.project-card {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.95fr);
    overflow: hidden;
    border-radius: 2rem;
    transition: transform 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
}

.project-card-reverse .project-media {
    order: 2;
}

.project-card-reverse .project-copy {
    order: 1;
}

.project-media img {
    width: 100%;
    height: 100%;
    min-height: 18rem;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.project-card:hover .project-media img {
    transform: scale(1.05);
}

.project-copy {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
}

.project-copy h3 {
    margin: 0.7rem 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.project-copy p {
    margin: 0;
    color: var(--muted);
}

.project-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.tag-list span {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
}

.project-arrow {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.timeline {
    position: relative;
    display: grid;
    gap: 2rem;
    padding-left: 2.1rem;
    border-left: 1px solid var(--border);
}

.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -2.45rem;
    top: 0.4rem;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    background: var(--gradient-ember);
    box-shadow: var(--shadow-ember);
}

.timeline-item h3 {
    margin: 0.55rem 0;
    font-size: 1.7rem;
}

.timeline-item p {
    margin: 0;
    color: var(--muted);
    max-width: 42rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1.5rem;
}

.contact-links {
    display: grid;
    gap: 0.8rem;
}

.contact-label {
    margin-bottom: 0.1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    transition: transform 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
}

.contact-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ember);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.85rem;
}

.contact-form {
    border-radius: 2rem;
    padding: 2rem;
    display: grid;
    gap: 0.9rem;
}

.contact-form label {
    color: var(--muted);
    font-size: 0.68rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.7rem 0 0.8rem;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--foreground);
    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--ember);
}

.contact-form textarea {
    resize: vertical;
    min-height: 8rem;
}

.form-note {
    min-height: 1.25rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer {
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

.footer-inner {
    padding: 2rem 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-inner p {
    margin: 0;
}

.footer-inner a:hover {
    color: var(--foreground);
}

.grain {
    position: relative;
}

.grain::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
}

.reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    filter: blur(6px);
    transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.35s ease;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(236, 138, 74, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(236, 138, 74, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(236, 138, 74, 0);
    }
}

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

    .project-card,
    .hero-grid,
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .project-card-reverse .project-media,
    .project-card-reverse .project-copy {
        order: initial;
    }

    .skills-list {
        grid-template-columns: 1fr;
    }
}

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

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0.75rem;
        right: 0.75rem;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0.75rem;
        border-radius: 1.25rem;
        border: 1px solid var(--border);
        background: rgba(43, 39, 36, 0.96);
        box-shadow: var(--shadow-soft);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
    }

    .nav-cta {
        display: none;
    }

    .hero {
        padding-top: 6.5rem;
    }

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

    .hero-float-card {
        left: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 560px) {
    .hero-title {
        font-size: 2.9rem;
    }

    .section-intro h2 {
        font-size: 2.15rem;
    }

    .services-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .project-copy,
    .contact-form {
        padding: 1.35rem;
    }

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

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