:root {
    --bg: #071018;
    --text: #edf6f2;
    --muted: #9fb6ab;
    --accent: #8cffd3;
    --accent-strong: #56e6b5;
    --rule: rgba(136, 255, 211, 0.1);
    --max-width: 980px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(86, 230, 181, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #071018 0%, #09121b 50%, #050c13 100%);
    color: var(--text);
    font-family: "Inter", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(140, 255, 211, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 255, 211, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    content: "";
    pointer-events: none;
}

a {
    color: inherit;
}

p, h1, h2, h3, ul {
    margin: 0;
}

.page-shell {
    width: min(var(--max-width), calc(100% - 48px));
    margin: 0 auto;
    padding-bottom: 80px;
}

/* ---- Header ---- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0;
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--rule);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    color: var(--accent);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.brand-text strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.brand-text span {
    color: var(--muted);
    font-size: 0.82rem;
}

.site-nav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 20px;
}

.site-nav a {
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--text);
}

/* ---- Typography ---- */

.eyebrow {
    margin-bottom: 12px;
    color: var(--accent);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1, h2 {
    font-family: "Cormorant Garamond", serif;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    max-width: 18ch;
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    max-width: 22ch;
}

h3 {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 10px;
}

/* ---- Sections ---- */

.section {
    padding: 72px 0;
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 80px 0 72px;
}

.hero-copy {
    min-width: 0;
}

.hero-visual {
    position: relative;
    aspect-ratio: 1 / 1;
    max-height: 480px;
    justify-self: end;
}

.hero-visual canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.divider {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 0;
}

.hero-sub {
    max-width: 58ch;
    margin-top: 20px;
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

/* ---- Buttons ---- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 22px;
    border: 1px solid rgba(136, 255, 211, 0.18);
    border-radius: 0;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.button-primary {
    background: transparent;
    border-color: rgba(136, 255, 211, 0.36);
    color: var(--accent);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: rgba(140, 255, 211, 0.07);
    border-color: rgba(136, 255, 211, 0.52);
}

.button-secondary {
    background: transparent;
    color: var(--muted);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    border-color: rgba(136, 255, 211, 0.3);
    color: var(--text);
}

/* ---- Grids ---- */

.card-grid,
.case-study-grid {
    display: grid;
    gap: 40px 32px;
    margin-top: 36px;
}

.three-up {
    grid-template-columns: repeat(3, 1fr);
}

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

.case-study-grid {
    grid-template-columns: repeat(3, 1fr);
}

.timeline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 36px;
}

/* ---- Cards (borderless) ---- */

.info-card p,
.case-context,
.case-list li,
.quote,
.timeline-step p,
.about-copy p,
.mini-card p,
.contact-block p {
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.7;
}

.case-label {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--accent);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.case-context {
    margin-bottom: 14px;
}

.case-list {
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.step-number {
    display: block;
    margin-bottom: 12px;
    color: var(--accent);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    font-weight: 500;
}

.quote {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.18rem;
    font-style: italic;
    font-weight: 500;
    line-height: 1.55;
    color: var(--text);
}

.quote-author {
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

/* ---- About ---- */

.about-layout {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 40px;
    margin-top: 36px;
}

.about-copy {
    display: grid;
    gap: 18px;
}

.about-points {
    display: grid;
    gap: 32px;
    align-content: start;
}

/* ---- Contact ---- */

.contact-block {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: start;
}

.contact-block h2 {
    margin-bottom: 12px;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 36px;
}

/* ---- Flair (click glow) ---- */

.info-card,
.quote-card,
.timeline-step,
.mini-card,
.case-study {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.info-card::after,
.quote-card::after,
.timeline-step::after,
.mini-card::after,
.case-study::after {
    position: absolute;
    inset: -20% -12%;
    z-index: -1;
    background:
        radial-gradient(
            circle at var(--flair-x, 50%) var(--flair-y, 50%),
            rgba(140, 255, 211, 0.14) 0%,
            rgba(140, 255, 211, 0.06) 22%,
            rgba(140, 255, 211, 0) 56%
        );
    opacity: 0;
    transform: scale(0.86);
    transition: opacity 0.2s ease, transform 0.25s ease;
    content: "";
    pointer-events: none;
}

.info-card:hover::after,
.quote-card:hover::after,
.timeline-step:hover::after,
.mini-card:hover::after,
.case-study:hover::after {
    opacity: 0.22;
    transform: scale(1);
}

.info-card.is-pulsing::after,
.quote-card.is-pulsing::after,
.timeline-step.is-pulsing::after,
.mini-card.is-pulsing::after,
.case-study.is-pulsing::after {
    animation: flairPulse 680ms ease-out;
}

@keyframes flairPulse {
    0% { opacity: 0.08; transform: scale(0.84); }
    28% { opacity: 0.45; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.14); }
}

/* ---- Signal (easter egg) ---- */

.signal-trigger {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 35;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(136, 255, 211, 0.18);
    border-radius: 0;
    background: rgba(6, 14, 21, 0.9);
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.signal-trigger:hover,
.signal-trigger:focus-visible {
    border-color: rgba(136, 255, 211, 0.36);
    color: var(--text);
}

.signal-trigger-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(140, 255, 211, 0.7);
}

.signal-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    width: min(520px, calc(100vw - 20px));
    padding: 18px;
    transform: translateX(calc(100% + 24px));
    transition: transform 0.26s ease;
    pointer-events: none;
}

.signal-drawer.is-open {
    transform: translateX(0);
    pointer-events: auto;
}

.signal-drawer-inner {
    display: grid;
    align-content: start;
    gap: 12px;
    height: 100%;
}

.signal-close {
    justify-self: end;
    padding: 6px 12px;
    border: 1px solid rgba(136, 255, 211, 0.16);
    border-radius: 0;
    background: rgba(6, 14, 21, 0.92);
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
    cursor: pointer;
}

.signal-close:hover {
    color: var(--text);
    border-color: rgba(136, 255, 211, 0.32);
}

.signal-panel {
    padding: 0 0 0 16px;
    border-left: 1px solid var(--rule);
}

.signal-drawer .signal-panel {
    height: min(100%, 720px);
    overflow: hidden;
}

.signal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(3, 8, 13, 0.5);
    backdrop-filter: blur(3px);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
}

.panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(140, 255, 211, 0.7);
}

textarea.tatjsOutput {
    width: 100%;
    height: 320px;
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(136, 255, 211, 0.06);
    border-radius: 0;
    background: rgba(4, 10, 16, 0.94);
    color: var(--accent);
    font-family: "JetBrains Mono", monospace;
    font-size: 5px;
    line-height: 7px;
    resize: none;
    overflow: hidden;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-visual {
        max-height: 320px;
        justify-self: start;
        width: 320px;
    }

    .three-up,
    .case-study-grid,
    .timeline {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-layout,
    .contact-block {
        grid-template-columns: 1fr;
    }

    .contact-actions {
        padding-top: 0;
    }
}

@media (max-width: 600px) {
    .page-shell {
        width: calc(100% - 32px);
    }

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

    h1, h2 {
        max-width: none;
    }

    .hero-visual {
        width: 260px;
        max-height: 260px;
    }

    .three-up,
    .two-up,
    .case-study-grid,
    .timeline {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .section {
        padding: 48px 0;
    }

    textarea.tatjsOutput {
        height: 220px;
        font-size: 4px;
        line-height: 6px;
    }

    .signal-trigger {
        right: 14px;
        bottom: 14px;
    }

    .signal-drawer {
        width: 100vw;
        padding: 10px;
    }
}
