/* =====================================================================
   DatenDelta – editorial / research-report visual system
   Paper background, ink type, one petrol accent, hairline rules.
   Fonts are self-hosted (no requests to Google, DSGVO-friendly).
   ===================================================================== */

@font-face {
    font-family: 'Newsreader';
    src: url('../fonts/newsreader.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Newsreader';
    src: url('../fonts/newsreader-italic.woff2') format('woff2');
    font-weight: 200 800;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/jetbrains-mono.woff2') format('woff2');
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Palette */
    --paper: #f6f4ef;
    --paper-tint: #efece4;
    --surface: #fffefb;
    --ink: #14171c;
    --ink-soft: #353a44;
    --muted: #666b75;
    --rule: #ddd8cc;
    --rule-strong: #c7c0b0;
    --accent: #0f5e6c;
    --accent-strong: #0a4852;
    --accent-soft: #dbe9e8;
    --signal: #c4532a;
    --success: #1f6b45;
    --error: #a3321c;

    /* Chart ramp (diverging, survey-style) */
    --likert-1: #c4532a;
    --likert-2: #e7a582;
    --likert-3: #d8d2c4;
    --likert-4: #7eafb2;
    --likert-5: #0f5e6c;

    /* Type */
    --font-serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Shape & motion */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 14px;
    --header-h: 72px;
    --gutter: 1.5rem;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --shadow: 0 1px 2px rgba(20, 23, 28, 0.04), 0 8px 24px -12px rgba(20, 23, 28, 0.12);
    --shadow-lg: 0 1px 2px rgba(20, 23, 28, 0.05), 0 24px 48px -20px rgba(20, 23, 28, 0.22);
}

/* ===== BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'ss01', 'cv11';
}

main {
    flex: 1;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

a:hover {
    color: var(--accent-strong);
}

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

::selection {
    background: var(--accent);
    color: var(--paper);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container--narrow > * {
    max-width: 720px;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(246, 244, 239, 0.86);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.header--scrolled {
    border-bottom-color: var(--rule);
}

.header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ink);
}

.logo:hover {
    color: var(--ink);
}

.logo__mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    padding-bottom: 2px;
    transition: background 0.25s var(--ease);
}

.logo:hover .logo__mark {
    background: var(--accent);
}

.logo__text {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav__list {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav__link {
    position: relative;
    color: var(--ink-soft);
    font-size: 0.925rem;
    font-weight: 500;
    padding: 0.25rem 0;
}

.nav__link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1.5px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}

.nav__link:hover,
.nav__link.active {
    color: var(--ink);
}

.nav__link:hover::after,
.nav__link.active::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    margin-right: -8px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}

.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 23px; }

.menu-toggle.active span:nth-child(1) {
    top: 19.5px;
    transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    top: 19.5px;
    transform: rotate(-45deg);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn span[aria-hidden] {
    transition: transform 0.25s var(--ease);
}

.btn:hover span[aria-hidden] {
    transform: translateX(3px);
}

.btn--primary {
    background: var(--ink);
    color: var(--paper);
}

.btn--primary:hover,
.btn--primary.active {
    background: var(--accent);
    color: var(--paper);
}

.btn--outline {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule-strong);
}

.btn--outline:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.btn--light {
    background: var(--paper);
    color: var(--ink);
}

.btn--light:hover {
    background: #fff;
    color: var(--accent-strong);
}

.btn--sm {
    padding: 0.55rem 1.05rem;
    font-size: 0.9rem;
}

.btn--full {
    width: 100%;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--ink);
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: 0.2rem;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.link-arrow span {
    transition: transform 0.25s var(--ease);
}

.link-arrow:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.link-arrow:hover span {
    transform: translateX(4px);
}

/* ===== TYPE HELPERS ===== */
.section__label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.section__index {
    color: var(--accent);
}

.section__index::after {
    content: '';
    display: inline-block;
    width: 28px;
    height: 1px;
    margin-left: 0.75rem;
    vertical-align: middle;
    background: var(--rule-strong);
}

.section__title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.section__subtitle {
    margin-top: 0.9rem;
    font-size: 1.075rem;
    color: var(--muted);
    max-width: 38ch;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    padding: calc(var(--header-h) + 5rem) 0 0;
    overflow: hidden;
}

.hero::before {
    /* faint graph-paper grid */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--rule) 1px, transparent 1px),
        linear-gradient(90deg, var(--rule) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 70% 60% at 75% 35%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 75% 35%, #000 20%, transparent 75%);
    pointer-events: none;
}

.hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 4rem;
    align-items: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.85rem 0.4rem 0.7rem;
    border: 1px solid var(--rule-strong);
    border-radius: 100px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
    margin-bottom: 2rem;
}

.hero__badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2f9e66;
    box-shadow: 0 0 0 3px rgba(47, 158, 102, 0.18);
}

.hero__title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5.4vw, 4.25rem);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-bottom: 1.75rem;
    text-wrap: balance;
    hyphens: manual;
    overflow-wrap: break-word;
}

.hero__title .highlight {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

.hero__description {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--ink-soft);
    max-width: 54ch;
    margin-bottom: 2.5rem;
}

.hero__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Hero figure – decorative survey chart */
.hero-figure {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem 1.75rem 1.5rem;
}

.hero-figure__head {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.85rem;
    row-gap: 0.5rem;
    align-items: center;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.hero-figure__mark {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
}

.skeleton {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: var(--rule);
}

.skeleton--title {
    width: 72%;
    height: 10px;
    background: var(--rule-strong);
}

.skeleton--sub {
    width: 46%;
}

.hero-figure__chart {
    display: grid;
    gap: 0.9rem;
}

.likert-row,
.likert-axis {
    display: grid;
    grid-template-columns: 28% 1fr;
    gap: 1rem;
    align-items: center;
}

.likert-bar {
    display: flex;
    height: 20px;
    border-radius: 3px;
    overflow: hidden;
    gap: 2px;
}

.likert-bar__seg {
    flex-grow: 0;
    flex-shrink: 1;
    transform-origin: left;
    animation: grow 0.9s var(--ease) both;
    animation-delay: calc(0.25s + var(--i, 0) * 0.08s);
}

.likert-bar__seg--1 { background: var(--likert-1); }
.likert-bar__seg--2 { background: var(--likert-2); }
.likert-bar__seg--3 { background: var(--likert-3); }
.likert-bar__seg--4 { background: var(--likert-4); }
.likert-bar__seg--5 { background: var(--likert-5); }

@keyframes grow {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}

.likert-axis {
    margin-top: 0.1rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--rule);
}

.likert-axis__ticks {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
}

.hero-figure__legend {
    display: flex;
    gap: 0.4rem;
    margin-top: 1.25rem;
}

.hero-figure__legend span {
    width: 22px;
    height: 6px;
    border-radius: 3px;
}

/* Stats */
.hero__stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 5.5rem;
    border-top: 1px solid var(--ink);
}

.stat {
    padding: 1.75rem 2rem 2.5rem 0;
}

.stat + .stat {
    padding-left: 2rem;
    border-left: 1px solid var(--rule);
}

.stat__number {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--ink);
    font-variant-numeric: lining-nums;
}

.stat__label {
    display: block;
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ===== PAGE HERO (subpages) ===== */
.page-hero {
    padding: calc(var(--header-h) + 4.5rem) 0 3.5rem;
}

.page-hero .container {
    position: relative;
    padding-bottom: 2.5rem;
}

.page-hero .container::after {
    content: '';
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 0;
    height: 1px;
    background: var(--ink);
}

.page-hero--small {
    padding-bottom: 2.5rem;
}

.page-hero__title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5.5vw, 4.25rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.page-hero__subtitle {
    margin-top: 0.9rem;
    font-size: 1.2rem;
    color: var(--muted);
}

/* ===== SECTIONS ===== */
.section {
    padding: 7rem 0;
}

.section--flush-top {
    padding-top: 0;
}

.section--tinted {
    background: var(--paper-tint);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.section__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 3.5rem;
}

.section__cta {
    margin-top: 3rem;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 4rem;
    align-items: start;
}

.section__header--side {
    margin-bottom: 0;
    position: sticky;
    top: calc(var(--header-h) + 2rem);
}

/* ===== SERVICE CARDS (home) ===== */
.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
}

.service-card {
    position: relative;
    padding: 2rem 1.75rem 2.25rem;
    transition: background 0.25s var(--ease);
}

.service-card + .service-card {
    border-left: 1px solid var(--rule);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}

.service-card:hover {
    background: #fff;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.service-card__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent);
}

.service-card__icon svg {
    width: 22px;
    height: 22px;
}

.service-card__num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.service-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

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

/* ===== TECH ===== */
.tech-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--rule);
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--ink);
    transition: color 0.2s var(--ease), padding 0.25s var(--ease);
}

.tech-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--rule-strong);
    transition: background 0.2s var(--ease);
}

.tech-item:hover {
    color: var(--accent);
    padding-left: 0.35rem;
}

.tech-item:hover::before {
    background: var(--accent);
}

/* ===== CTA ===== */
.cta {
    padding: 0 0 7rem;
}

.section + .cta {
    padding-top: 0;
}

.cta__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    padding: 4rem 4rem;
    border-radius: var(--radius-lg);
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
}

.cta__inner::after {
    /* oversized delta watermark */
    content: '\0394';
    position: absolute;
    right: 18%;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-serif);
    font-size: 22rem;
    line-height: 1;
    color: rgba(246, 244, 239, 0.04);
    pointer-events: none;
}

.cta__inner > * {
    position: relative;
    z-index: 1;
}

.cta__title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.cta__text {
    margin-top: 0.75rem;
    font-size: 1.1rem;
    color: rgba(246, 244, 239, 0.7);
    max-width: 48ch;
}

.cta .btn {
    flex-shrink: 0;
}

/* ===== LEISTUNGEN ===== */
.services-list {
    display: flex;
    flex-direction: column;
}

.service-detail {
    display: grid;
    grid-template-columns: 110px minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 3rem;
    padding: 3.5rem 0;
    border-bottom: 1px solid var(--rule);
}

.service-detail:first-child {
    padding-top: 1rem;
}

.service-detail__number {
    font-family: var(--font-serif);
    font-size: 3.25rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1;
    color: var(--accent);
}

.service-detail__main h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 2.8vw, 2.1rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin-bottom: 1rem;
}

.service-detail__main > p {
    color: var(--ink-soft);
    font-size: 1.05rem;
    max-width: 56ch;
}

.service-detail__tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.75rem;
}

.tag {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ink-soft);
}

.service-detail__list {
    list-style: none;
    align-self: start;
    border-top: 1px solid var(--ink);
    margin-top: 0.4rem;
}

.service-detail__list li {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
    color: var(--ink);
}

.service-detail__list li::before {
    content: '\2192';
    flex-shrink: 0;
    color: var(--accent);
    font-family: var(--font-mono);
}

/* ===== CONTACT ===== */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 5rem;
    align-items: start;
}

.contact-info h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin-bottom: 1rem;
}

.contact-info > p {
    color: var(--ink-soft);
    margin-bottom: 2.5rem;
}

.contact-info__items {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--rule);
}

.contact-info__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--rule);
}

.contact-info__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent);
}

.contact-info__icon svg {
    width: 19px;
    height: 19px;
}

.contact-info__item h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.1rem;
}

.contact-info__item p,
.contact-info__item a {
    color: var(--ink);
    font-weight: 500;
}

/* ===== FORMS ===== */
.contact-form {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem 0.95rem;
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.form-input::placeholder {
    color: #9a9ea6;
}

.form-input:hover {
    border-color: var(--muted);
}

.form-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 94, 108, 0.14);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.radio,
.checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--ink);
}

.radio {
    padding: 0.55rem 1rem 0.55rem 0.8rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.radio:hover {
    border-color: var(--muted);
}

.radio:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.radio input,
.checkbox input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.radio__mark {
    position: relative;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 1.5px solid var(--rule-strong);
    border-radius: 50%;
    background: #fff;
    transition: border-color 0.2s var(--ease);
}

.radio input:checked + .radio__mark {
    border-color: var(--accent);
}

.radio input:checked + .radio__mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--accent);
}

.radio input:focus-visible + .radio__mark,
.checkbox input:focus-visible + .checkbox__mark {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.checkbox {
    align-items: flex-start;
}

.checkbox__mark {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1.5px solid var(--rule-strong);
    border-radius: 3px;
    background: #fff;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.checkbox input:checked + .checkbox__mark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox input:checked + .checkbox__mark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox__text {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--muted);
}

.checkbox__text a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 3px;
}

.checkbox__text a:hover {
    text-decoration-color: var(--accent);
}

.contact-form .btn--full {
    margin-top: 0.5rem;
    padding: 1rem 1.5rem;
}

/* ===== ALERTS ===== */
.flash-messages {
    padding-top: calc(var(--header-h) + 1.5rem);
}

.flash-messages + .hero,
.flash-messages + .page-hero {
    padding-top: 2.5rem;
}

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.alert--success {
    background: #e7f2ea;
    border-color: #b9d8c3;
    border-left-color: var(--success);
    color: #174f33;
}

.alert--error {
    background: #f7e6e0;
    border-color: #e5bfb2;
    border-left-color: var(--error);
    color: #7d2715;
}

.alert__close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
}

.alert__close:hover {
    opacity: 1;
}

/* ===== LEGAL PAGES ===== */
.legal-content {
    font-size: 1.025rem;
    color: var(--ink-soft);
}

.legal-content h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 2.75rem 0 0.85rem;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content p {
    margin-bottom: 1rem;
}

.legal-content ul {
    list-style: none;
    margin: 0 0 1rem;
    border-top: 1px solid var(--rule);
}

.legal-content li {
    padding: 0.6rem 0 0.6rem 1.5rem;
    border-bottom: 1px solid var(--rule);
    position: relative;
}

.legal-content li::before {
    content: '\2014';
    position: absolute;
    left: 0;
    color: var(--muted);
}

.legal-content a {
    text-decoration: underline;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 3px;
}

.legal-content a:hover {
    text-decoration-color: var(--accent);
}

/* ===== FOOTER ===== */
.footer {
    padding: 4.5rem 0 2rem;
    border-top: 1px solid var(--rule);
    background: var(--paper-tint);
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer__tagline {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 28ch;
}

.footer__col h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.footer__col ul {
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.footer__col a {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.footer__col a:hover {
    color: var(--accent);
}

.footer__bottom {
    padding-top: 1.75rem;
    border-top: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1080px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-card:nth-child(3) {
        border-left: none;
    }

    .service-card:nth-child(n + 3) {
        border-top: 1px solid var(--rule);
    }

    .service-detail {
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 1.5rem 2rem;
    }

    .service-detail__list {
        grid-column: 2;
    }
}

@media (max-width: 900px) {
    .hero {
        padding-top: calc(var(--header-h) + 3rem);
    }

    .hero__grid {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .hero-figure-wrap {
        max-width: 520px;
    }

    .hero__stats {
        margin-top: 4rem;
    }

    .split,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .section__header--side {
        position: static;
    }

    .cta__inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 3rem 2.25rem;
    }

    .cta__inner::after {
        right: -2rem;
        font-size: 16rem;
    }

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

    .footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    /* Mobile navigation */
    .menu-toggle {
        display: block;
    }

    .nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        /* explicit height: the header's backdrop-filter makes it the containing
           block for this fixed element, so bottom: 0 would collapse the panel */
        height: calc(100vh - var(--header-h));
        height: calc(100dvh - var(--header-h));
        overflow-y: auto;
        background: var(--paper);
        border-top: 1px solid var(--rule);
        padding: 1.5rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
    }

    .nav.open {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav__link {
        display: block;
        padding: 1.1rem 0;
        border-bottom: 1px solid var(--rule);
        font-family: var(--font-serif);
        font-size: 1.75rem;
        color: var(--ink);
    }

    .nav__link::after {
        display: none;
    }

    .nav__link.active {
        color: var(--accent);
    }

    .nav__cta {
        width: 100%;
        margin-top: 1.75rem;
        padding: 1rem;
        font-size: 1rem;
    }

    body.nav-open {
        overflow: hidden;
    }

    .header:has(.nav.open) {
        background: var(--paper);
        border-bottom-color: var(--rule);
    }

    .section {
        padding: 4.5rem 0;
    }

    .section--flush-top {
        padding-top: 0;
    }

    .cta {
        padding-bottom: 4.5rem;
    }

    .page-hero {
        padding: calc(var(--header-h) + 2.5rem) 0 2.5rem;
    }

    .page-hero .container {
        padding-bottom: 2rem;
    }
}

@media (max-width: 640px) {
    :root {
        --gutter: 1rem;
    }

    .hero__description {
        font-size: 1.05rem;
    }

    .hero__actions .btn {
        flex: 1 1 auto;
    }

    .hero-figure {
        padding: 1.25rem;
    }

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

    .stat,
    .stat + .stat {
        padding: 1.25rem 0;
        border-left: none;
    }

    .stat + .stat {
        border-top: 1px solid var(--rule);
    }

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

    .service-card + .service-card {
        border-left: none;
        border-top: 1px solid var(--rule);
    }

    .service-card__top {
        margin-bottom: 1.5rem;
    }

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

    .service-detail {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 2.5rem 0;
    }

    .service-detail__number {
        font-size: 2.5rem;
    }

    .service-detail__list {
        grid-column: auto;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cta__inner {
        padding: 2.5rem 1.5rem;
    }

    .cta .btn {
        width: 100%;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

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