:root {
    --bg-body: #10100f;
    --bg-surface: #171715;
    --bg-surface-soft: #20201d;
    --bg-header: rgba(16, 16, 15, 0.84);
    --text-main: #f4f1ea;
    --text-secondary: #c8c1b8;
    --text-muted: #8f887f;
    --border-color: #34312d;
    --accent: #dc4f45;
    --accent-strong: #ef7568;
    --accent-green: #36a585;
    --accent-amber: #d59b35;
    --card-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

[data-theme="light"] {
    --bg-body: #f7f7f3;
    --bg-surface: #ffffff;
    --bg-surface-soft: #eeeeea;
    --bg-header: rgba(247, 247, 243, 0.9);
    --text-main: #181817;
    --text-secondary: #4d4b47;
    --text-muted: #77736d;
    --border-color: #d8d5cf;
    --accent: #c93931;
    --accent-strong: #9f2d27;
    --accent-green: #217c65;
    --accent-amber: #a9741e;
    --card-shadow: 0 18px 44px rgba(37, 34, 29, 0.11);
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 26rem),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.026) 0, rgba(255,255,255,0.026) 1px, transparent 1px, transparent 72px),
        var(--bg-body);
    font-family: "Inter", Arial, sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

[data-language].is-active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.language-button {
    position: relative;
}

.language-button::after {
    position: absolute;
    right: 0.72rem;
    bottom: 0.34rem;
    left: 0.72rem;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    content: "";
    opacity: 0;
    transform: scaleX(0.5);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.language-button.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

.language-flag {
    width: 2rem;
    height: 1.35rem;
    border-radius: 0.18rem;
    object-fit: cover;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--border-color) 80%, transparent);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.language-button:hover .language-flag,
.language-button.is-active .language-flag {
    transform: scale(1.04);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 75%, var(--border-color));
}

.site-header {
    box-shadow: 0 1px 0 color-mix(in srgb, var(--border-color) 70%, transparent);
}

.site-header-inner {
    min-height: 68px;
}

.hero-section {
    padding-bottom: clamp(3.25rem, 7vw, 5.5rem);
}

.hero-shell {
    position: relative;
    padding-block: clamp(2rem, 5vw, 4.8rem);
    border-top: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent);
}

.hero-rule {
    display: block;
    width: min(11rem, 45vw);
    height: 3px;
    margin-bottom: clamp(1.4rem, 3vw, 2.4rem);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 12%, transparent));
}

.hero-title {
    text-wrap: balance;
}

.hero-intro {
    text-wrap: pretty;
}

.origin-badge {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--accent-amber) 52%, var(--border-color));
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-amber) 10%, transparent);
    padding: 0.38rem 0.75rem;
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.25;
}

.origin-badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--accent);
}

.section-shell {
    position: relative;
}

.section-heading {
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.section-eyebrow {
    letter-spacing: 0;
}

.section-title {
    max-width: 780px;
    text-wrap: balance;
}

.timeline-section {
    padding-top: clamp(2rem, 4vw, 3.5rem);
}

.timeline-scroll {
    margin-inline: 0;
    overflow: visible;
    padding: 0;
}

.timeline-list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    width: auto;
    min-width: 0;
    padding-top: 0;
}

.timeline-list::before {
    display: none;
}

.timeline-event {
    position: relative;
    width: auto;
    min-width: 0;
}

.timeline-dot {
    position: absolute;
    top: 1.25rem;
    left: 1.2rem;
    z-index: 2;
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid var(--bg-surface);
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 1px var(--border-color);
}

.timeline-dot-muted {
    background: var(--accent-amber);
}

.timeline-dot-active {
    background: var(--accent-green);
}

.timeline-dot-featured {
    background: var(--accent);
}

.timeline-card {
    position: relative;
    display: flex;
    min-height: 280px;
    height: 100%;
    flex-direction: column;
    overflow: visible;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 96%, transparent), color-mix(in srgb, var(--bg-surface-soft) 28%, var(--bg-surface))),
        var(--bg-surface);
    padding: 1.18rem;
    box-shadow: var(--card-shadow);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.timeline-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 16%, transparent));
}

.timeline-card:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color));
    transform: translateY(-2px);
}

.timeline-card time,
.mystery-card span {
    display: block;
    margin-bottom: 0.8rem;
    padding-left: 1.45rem;
    color: var(--accent-amber);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.timeline-card h3,
.mystery-card strong {
    margin-bottom: 0.75rem;
    color: var(--text-main);
    font-size: 1.03rem;
    font-weight: 800;
    line-height: 1.25;
    text-wrap: pretty;
}

.timeline-card p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.55;
}

.timeline-action,
.timeline-status {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    margin-top: auto;
    font-size: 0.88rem;
    font-weight: 800;
}

.timeline-action {
    color: var(--accent-strong);
}

.timeline-action:hover {
    color: var(--accent-green);
}

.timeline-status {
    border: 1px solid color-mix(in srgb, var(--accent-green) 55%, var(--border-color));
    border-radius: 999px;
    padding: 0.28rem 0.62rem;
    color: var(--accent-green);
    font-size: 0.78rem;
}

.mystery-card {
    cursor: help;
}

.mystery-card::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 4;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-surface) 96%, black);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.3rem);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.mystery-card:hover::after,
.mystery-card:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.products-section {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-soft) 58%, transparent), transparent),
        color-mix(in srgb, var(--bg-surface-soft) 50%, transparent);
}

.project-grid {
    align-items: stretch;
}

.project-card {
    min-height: 132px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 95%, transparent), color-mix(in srgb, var(--bg-surface-soft) 22%, var(--bg-surface))),
        var(--bg-surface);
    box-shadow: var(--card-shadow);
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.project-card:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color));
    transform: translateY(-2px);
}

.project-logo {
    background: transparent;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
}

.project-link {
    background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
}

.contact-section {
    padding-top: clamp(4rem, 8vw, 6rem);
    padding-bottom: clamp(4rem, 8vw, 6rem);
}

.contact-shell {
    padding-top: clamp(1.5rem, 3vw, 2.5rem);
    border-top: 1px solid var(--border-color);
}

.not-found-main {
    min-height: calc(100vh - 145px);
}

.not-found-shell {
    min-height: calc(100vh - 240px);
}

.not-found-panel {
    border-top: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent);
    padding-block: clamp(2.75rem, 8vw, 7rem);
}

.not-found-code {
    color: color-mix(in srgb, var(--accent) 18%, transparent);
    font-size: clamp(5.5rem, 22vw, 16rem);
    font-weight: 800;
    line-height: 0.78;
    text-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 42%, transparent);
}

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

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

@media (max-width: 640px) {
    body {
        background:
            linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 20rem),
            var(--bg-body);
    }

    .site-header-inner {
        min-height: 64px;
    }

    .hero-shell {
        padding-block: 2.2rem;
    }

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

    .timeline-card {
        min-height: 0;
    }

    .mystery-card::after {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        top: auto;
    }
}
