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

:root {
    --bg: #f3efe6;
    --surface: #fffaf2;
    --ink: #1f2723;
    --ink-soft: #4f5e57;
    --line: rgba(31, 39, 35, 0.14);
    --accent: #0f8f6f;
    --accent-strong: #08674f;
    --sun: #f4a462;
    --shadow: 0 24px 68px rgba(26, 45, 36, 0.16);
    --radius-lg: 26px;
    --radius-md: 16px;
    --content-max: 1140px;
    --page-gutter: 20px;
    --content-width: min(var(--content-max), calc(100% - (var(--page-gutter) * 2)));
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 84% 14%, rgba(244, 164, 98, 0.24), transparent 44%),
        radial-gradient(circle at 12% 78%, rgba(15, 143, 111, 0.2), transparent 42%),
        var(--bg);
    color: var(--ink);
    font-family: 'Instrument Sans', sans-serif;
    line-height: 1.55;
    overflow-x: hidden;
    position: relative;
}

.page-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(20, 34, 28, 0.08) 0.4px, transparent 0.4px);
    background-size: 3px 3px;
    opacity: 0.2;
    z-index: -2;
}

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

.container {
    width: var(--content-width);
    margin: 0 auto;
}

header {
    position: fixed;
    top: 12px;
    left: 0;
    right: 0;
    transform: none;
    z-index: 30;
}

.menu {
    width: var(--content-width);
    margin: 0 auto;
    padding: 0.875rem 1.25rem;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    background: rgba(255, 250, 242, 0.76);
    transition: box-shadow 220ms ease, transform 220ms ease, background-color 220ms ease;
}

header.scrolled .menu {
    box-shadow: 0 12px 28px rgba(26, 45, 36, 0.16);
    transform: translateY(-2px);
    background: rgba(255, 250, 242, 0.94);
}

.brand {
    display: inline-flex;
    align-items: center;
    font: 700 1.25rem/1 'Unbounded', sans-serif;
    letter-spacing: 0.01em;
    color: var(--ink);
}

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

.main-nav a {
    position: relative;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(31, 39, 35, 0.76);
}

.main-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
    transform: scaleX(1);
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.mobile-menu-toggle-line {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transform-origin: center;
    transition: transform 220ms ease;
}

main {
    padding-top: 110px;
}

#work,
#cases,
#assurance,
#companies,
#contact {
    scroll-margin-top: 100px;
}

#hero {
    padding: 56px 0 48px;
}

.hero-content {
    padding: 74px 56px 60px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(31, 39, 35, 0.16);
    background:
        linear-gradient(120deg, rgba(255, 250, 242, 0.94), rgba(255, 250, 242, 0.86)),
        radial-gradient(circle at 82% 16%, rgba(244, 164, 98, 0.22), transparent 40%);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-content::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    right: -80px;
    top: -80px;
    border: 1px solid rgba(8, 103, 79, 0.3);
}

.hero-kicker {
    width: fit-content;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 143, 111, 0.28);
    color: var(--accent-strong);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

h1 {
    margin-top: 24px;
    max-width: 900px;
    font: 700 clamp(2.1rem, 5vw, 4.35rem)/1.05 'Unbounded', sans-serif;
    letter-spacing: -0.02em;
}

h1 span {
    color: var(--accent-strong);
    text-shadow: 0 12px 28px rgba(8, 103, 79, 0.2);
}

.subtitle {
    max-width: 760px;
    margin-top: 1.5rem;
    color: var(--ink-soft);
    font-size: clamp(1.03rem, 2vw, 1.18rem);
}

.hero-action {
    margin-top: 2rem;
}

.hero-action small {
    display: inline-block;
    margin-top: 0.875rem;
    color: rgba(31, 39, 35, 0.7);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9375rem 1.5rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 14px 28px rgba(8, 103, 79, 0.25);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 20px 32px rgba(8, 103, 79, 0.33);
}

.hero-metrics {
    margin-top: 2.125rem;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-metrics article {
    padding: 1.125rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(31, 39, 35, 0.12);
    background: rgba(255, 250, 242, 0.72);
}

.metric-value {
    font: 700 1.15rem/1.1 'Unbounded', sans-serif;
}

.metric-label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: rgba(31, 39, 35, 0.76);
}

.section-wrap {
    padding: 1.375rem 0 0.5rem;
}

.section-title {
    margin: 0 0 1.5rem;
    font: 700 clamp(1.55rem, 2.8vw, 2.45rem)/1.1 'Unbounded', sans-serif;
}

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

.case-card,
.contact-panel {
    border-radius: var(--radius-md);
    border: 1px solid rgba(31, 39, 35, 0.13);
    background: rgba(255, 250, 242, 0.86);
    box-shadow: 0 8px 24px rgba(26, 45, 36, 0.07);
}

.case-card h3 {
    margin-top: 0.75rem;
    font: 600 1.2rem/1.2 'Unbounded', sans-serif;
}

.case-card p {
    margin-top: 0.75rem;
    color: var(--ink-soft);
}

#work .container {
    position: relative;
}

.timeline {
    position: relative;
    display: grid;
    gap: 1.625rem;
    padding: 0.375rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(
        to bottom,
        rgba(8, 103, 79, 0.12) 0%,
        rgba(8, 103, 79, 0.48) 18%,
        rgba(8, 103, 79, 0.48) 82%,
        rgba(8, 103, 79, 0.12) 100%
    );
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
}

.timeline-content {
    position: relative;
    width: calc(100% - 38px);
    padding: 1.5rem 1.5rem 1.375rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(31, 39, 35, 0.13);
    background: rgba(255, 250, 242, 0.86);
    box-shadow: 0 8px 24px rgba(26, 45, 36, 0.07);
}

.timeline-content h3 {
    font: 600 1.2rem/1.2 'Unbounded', sans-serif;
}

.timeline-content p {
    margin-top: 0.75rem;
    color: var(--ink-soft);
}

.timeline-item.left .timeline-content {
    grid-column: 1;
    justify-self: end;
}

.timeline-item.right .timeline-content {
    grid-column: 2;
    justify-self: start;
}

.timeline-content::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30px;
    height: 1px;
    background: rgba(8, 103, 79, 0.38);
    transform: translateY(-50%);
}

.timeline-item.left .timeline-content::after {
    right: -30px;
}

.timeline-item.right .timeline-content::after {
    left: -30px;
}

.timeline-node {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 600 0.78rem/1 'Unbounded', sans-serif;
    letter-spacing: 0.08em;
    color: var(--accent-strong);
    background: linear-gradient(145deg, rgba(255, 250, 242, 0.98), rgba(244, 164, 98, 0.34));
    border: 1px solid rgba(8, 103, 79, 0.28);
    box-shadow: 0 10px 22px rgba(8, 103, 79, 0.2);
}

.case-card {
    grid-column: span 4;
    padding: 24px;
}

.case-tag {
    margin: 0;
    width: fit-content;
    padding: 0.375rem 0.6875rem;
    border-radius: 999px;
    border: 1px solid rgba(31, 39, 35, 0.16);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(31, 39, 35, 0.76);
}

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

.logos div {
    border: 1px dashed rgba(31, 39, 35, 0.25);
    border-radius: 14px;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 600 0.96rem/1.1 'Unbounded', sans-serif;
    color: rgba(31, 39, 35, 0.8);
    letter-spacing: 0.03em;
    background: rgba(255, 250, 242, 0.62);
}

.assurance-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.assurance-card {
    min-width: 0;
    border-radius: var(--radius-md);
    border: 1px solid rgba(31, 39, 35, 0.13);
    background: rgba(255, 250, 242, 0.88);
    box-shadow: 0 8px 24px rgba(26, 45, 36, 0.07);
    padding: 1.375rem 1.375rem 1.25rem;
}

.assurance-card h3 {
    font: 600 1.08rem/1.25 'Unbounded', sans-serif;
    overflow-wrap: anywhere;
}

.assurance-card p {
    margin-top: 0.625rem;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

@media (min-width: 961px) {
    .assurance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.contact-panel {
    padding: 2.25rem;
    text-align: center;
    background:
        linear-gradient(110deg, rgba(255, 250, 242, 0.9), rgba(243, 239, 230, 0.82)),
        radial-gradient(circle at 12% 0%, rgba(15, 143, 111, 0.12), transparent 42%);
}

.contact-panel h2 {
    font: 700 clamp(1.45rem, 2.8vw, 2.5rem)/1.15 'Unbounded', sans-serif;
}

.contact-panel p {
    margin: 1.125rem auto 1.5rem;
    max-width: 760px;
    color: var(--ink-soft);
}

footer {
    width: var(--content-width);
    margin: 2.375rem auto 2rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    border-top: 1px solid rgba(31, 39, 35, 0.2);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr) minmax(0, 1.1fr);
    gap: 1.5rem 2rem;
    align-items: start;
    color: rgba(31, 39, 35, 0.74);
    font-size: 0.9rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.footer-brand,
.footer-year,
.footer-requisites p {
    margin: 0;
}

.footer-brand {
    color: var(--ink);
    font-size: 1.05rem;
}

.footer-requisites {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.footer-requisites a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(31, 39, 35, 0.2);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.footer-requisites a:hover,
.footer-requisites a:focus-visible {
    color: var(--ink);
    border-color: rgba(31, 39, 35, 0.5);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
    text-align: right;
}

.footer-year {
    color: rgba(31, 39, 35, 0.54);
    font-size: 0.85rem;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(31, 39, 35, 0.2);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--ink);
    border-color: rgba(31, 39, 35, 0.5);
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 540ms ease, transform 540ms ease;
}

.reveal.reveal-left {
    transform: translateX(-42px) translateY(8px);
    transition: opacity 520ms ease, transform 620ms cubic-bezier(0.2, 0.74, 0.2, 1);
}

.reveal.reveal-right {
    transform: translateX(42px) translateY(8px);
    transition: opacity 520ms ease, transform 620ms cubic-bezier(0.2, 0.74, 0.2, 1);
}

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

.delay-1 {
    transition-delay: 90ms;
}

.delay-2 {
    transition-delay: 180ms;
}

.delay-3 {
    transition-delay: 270ms;
}

.delay-4 {
    transition-delay: 360ms;
}

@media (max-width: 960px) {
    .menu {
        grid-template-columns: 1fr auto;
        gap: 0 1rem;
        border-radius: 34px;
        padding: 1rem 1.125rem;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .main-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
        position: relative;
        flex-direction: column;
        align-items: center;
        gap: 0.875rem;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        transform: translateY(-10px);
        margin-top: 0;
        padding-top: 0;
        transition:
            max-height 260ms ease,
            opacity 220ms ease,
            transform 220ms ease,
            margin-top 220ms ease,
            padding-top 220ms ease;
    }

    .main-nav::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: rgba(15, 143, 111, 0.3);
        opacity: 0;
        transform: scaleX(0);
        transform-origin: center;
        transition: transform 1420ms ease, opacity 1420ms ease;
    }

    .main-nav a {
        font-size: 0.9375rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        font-weight: 700;
        color: rgba(31, 39, 35, 0.76);
    }

    .main-nav a::after {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    body.menu-open .mobile-menu-toggle {
        background: rgba(255, 250, 242, 0.98);
    }

    body.menu-open .mobile-menu-toggle-line:first-child {
        transform: translateY(4px) rotate(45deg);
    }

    body.menu-open .mobile-menu-toggle-line:last-child {
        transform: translateY(-4px) rotate(-45deg);
    }

    body.menu-open .menu {
        box-shadow: 0 16px 36px rgba(26, 45, 36, 0.2);
        background: rgba(255, 250, 242, 0.94);
    }

    body.menu-open .main-nav {
        max-height: 340px;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        margin-top: 0.875rem;
        padding-top: 1.125rem;
    }

    body.menu-open .main-nav::before {
        opacity: 1;
        transform: scaleX(1);
    }

    body.menu-scroll-closing .main-nav,
    body.menu-scroll-closing .main-nav::before {
        transition: none;
    }

    .hero-content {
        padding: 52px 28px 38px;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .case-card {
        grid-column: span 6;
    }

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

    .timeline::before {
        left: 22px;
        transform: none;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        padding-left: 54px;
    }

    .timeline-item.left .timeline-content,
    .timeline-item.right .timeline-content {
        grid-column: 1;
        justify-self: stretch;
        width: 100%;
    }

    .timeline-node {
        left: 22px;
        transform: translate(-50%, -50%);
        width: 40px;
        height: 40px;
    }

    .timeline-content::after {
        left: -32px;
        width: 32px;
    }
}

@media (max-width: 640px) {
    :root {
        --page-gutter: 12px;
    }

    header {
        top: 8px;
    }

    .menu {
        padding: 0.875rem 1rem;
    }

    .mobile-menu-toggle {
        width: 42px;
        height: 38px;
    }

    .brand {
        font-size: 1.125rem;
    }

    .main-nav a {
        font-size: 0.875rem;
    }

    body.menu-open .main-nav {
        max-height: 300px;
    }

    main {
        padding-top: 92px;
    }

    #work,
    #cases,
    #assurance,
    #companies,
    #contact {
        scroll-margin-top: 98px;
    }

    #hero {
        padding-top: 18px;
    }

    .hero-content {
        padding: 2rem 1rem 1.5rem;
        border-radius: 1.25rem;
    }

    .hero-content::before {
        width: 160px;
        height: 160px;
        right: -64px;
        top: -64px;
    }

    h1 {
        margin-top: 1rem;
        font-size: clamp(1.85rem, 10vw, 2.7rem);
    }

    .subtitle {
        margin-top: 1rem;
    }

    .btn {
        width: 100%;
        padding: 0.875rem 1.125rem;
    }

    .section-title {
        margin-bottom: 1rem;
    }

    .case-card {
        grid-column: span 12;
    }

    .contact-panel {
        padding: 1.75rem 1rem;
    }

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

    footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 0.9rem;
    }

    .footer-column {
        width: 100%;
        align-items: flex-start;
    }

    .footer-links {
        align-items: flex-start;
        text-align: left;
    }

}

@media (max-width: 480px) {
    .menu {
        border-radius: 1.75rem;
    }

    .main-nav {
        gap: 0.75rem;
    }

    .hero-content {
        padding: 1.75rem 0.875rem 1.25rem;
    }

    h1 {
        font-size: clamp(1.7rem, 11vw, 2.35rem);
    }

    .hero-metrics article {
        padding: 1rem 0.875rem;
    }

    .timeline-item {
        padding-left: 3rem;
    }

    .timeline-node {
        width: 2.25rem;
        height: 2.25rem;
    }

    .timeline-content {
        width: 100%;
        padding: 1.25rem 1rem 1.125rem;
    }

    .timeline-content::after {
        left: -2rem;
        width: 2rem;
    }

    .contact-panel {
        padding: 1.5rem 0.875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

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

    .reveal.reveal-left,
    .reveal.reveal-right {
        transform: none;
    }
}
