:root {
    --bg: #0c0c0c;
    --bg-2: #161616;
    --ink: #f4f1ea;
    --ink-dim: #a8a39a;
    --line: #2a2a2a;
    --accent: #c6ff3d;
    /* electric lime */
    --accent-2: #ff5c2a;
    /* hot orange */
    --cream: #f4f1ea;
    --shadow: 0 0 0 1px var(--line);
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --sans: 'Geist', -apple-system, system-ui, sans-serif;
    --serif: 'Instrument Serif', Georgia, serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ====== Grain texture overlay ====== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.5;
    pointer-events: none;
    z-index: 999;
    mix-blend-mode: overlay;
}

/* ====== Layout helpers ====== */
.wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

.mono {
    font-family: var(--mono);
}

.label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

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

/* ====== Nav ====== */
nav {
    position: sticky;
    top: 0;
    background: rgba(12, 12, 12, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--accent);
    z-index: 100;
    padding: 18px 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
}

.logo-mark {
    width: 42px;
    height: 30px;
    overflow: visible;
}

.logo-mark .logo-c {
    color: var(--accent);
    transition: color 0.25s ease;
}

.logo-mark .logo-t-stem,
.logo-mark .logo-t-cross {
    color: var(--ink);
    transition: color 0.25s ease;
}

.logo:hover .logo-mark .logo-c {
    color: var(--accent-2);
}

.logo:hover .logo-mark .logo-t-stem,
.logo:hover .logo-mark .logo-t-cross {
    color: var(--accent);
}

.logo-word {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 21px;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.logo-c-word {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.nav-links a:not(.nav-cta)::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.nav-links a:not(.nav-cta):hover::before {
    width: 100%;
}

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

.nav-cta {
    background: var(--accent);
    color: var(--bg) !important;
    padding: 10px 18px;
    font-weight: 700;
    border: 1px solid var(--accent);
    transition: all 0.2s;
}

.nav-cta:hover {
    background: transparent;
    color: var(--accent) !important;
}

@media (max-width: 720px) {
    .nav-links a:not(.nav-cta) {
        display: none;
    }
}

/* ====== Hero ====== */
.hero {
    padding: 120px 0 100px;
    position: relative;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    right: -200px;
    top: 50%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(198, 255, 61, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.hero-brandmark {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.hero-mark {
    width: 64px;
    height: 46px;
    overflow: visible;
}

.brand-wordmark {
    font-family: var(--sans);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.brand-wordmark .c-up {
    color: var(--accent);
}

.hero h1 {
    font-family: var(--sans);
    font-size: clamp(48px, 8vw, 112px);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: 32px;
    max-width: 1000px;
}

.hero h1 .stroke {
    -webkit-text-stroke: 2px var(--ink);
    color: transparent;
    font-style: italic;
    font-family: var(--serif);
    font-weight: 400;
}

.hero h1 .accent {
    color: var(--accent);
}

.hero h1 .mono-inline {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.7em;
    background: var(--ink);
    color: var(--bg);
    padding: 0 12px;
    display: inline-block;
    transform: rotate(-1deg);
    margin: 0 4px;
}

.hero p {
    font-size: 20px;
    color: var(--ink-dim);
    max-width: 620px;
    margin-bottom: 40px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border: 1px solid var(--accent);
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

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

.btn .arrow {
    transition: transform 0.2s;
}

.btn:hover .arrow {
    transform: translateX(4px);
}

/* ====== Section base ====== */
section {
    padding: 100px 0;
    border-bottom: 1px solid var(--line);
}

.section-header {
    margin-bottom: 64px;
}

.section-header .label {
    margin-bottom: 16px;
    display: inline-block;
}

.section-header h2 {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    max-width: 800px;
}

.section-header h2 .italic {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    color: var(--accent);
}

.section-header p {
    color: var(--ink-dim);
    font-size: 18px;
    max-width: 600px;
    margin-top: 24px;
}

/* ====== Services ====== */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--line);
    background: var(--bg-2);
}

.service {
    padding: 48px;
    border-bottom: 1px solid var(--line);
    position: relative;
    transition: background 0.3s;
    display: grid;
    grid-template-columns: 80px 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.service:last-child {
    border-bottom: none;
}

.service:hover {
    background: var(--bg);
}

.service:hover .service-num {
    color: var(--accent);
}

.service-num {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--ink-dim);
    font-weight: 500;
    transition: color 0.3s;
}

.service h3 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.service h3 .code {
    font-family: var(--mono);
    font-size: 0.75em;
    color: var(--accent);
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
}

.service p {
    color: var(--ink-dim);
    font-size: 16px;
    line-height: 1.6;
}

.service ul {
    list-style: none;
    margin-top: 20px;
}

.service ul li {
    font-family: var(--mono);
    font-size: 13px;
    padding: 8px 0;
    color: var(--ink);
    border-bottom: 1px dashed var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
}

.service ul li::before {
    content: '→';
    color: var(--accent);
    font-weight: 700;
}

@media (max-width: 880px) {
    .service {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 32px 24px;
    }
}

/* ====== AI Foundation Section ====== */
.ai-foundation {
    background: var(--cream);
    color: var(--bg);
    position: relative;
    overflow: hidden;
}

.ai-foundation .label {
    color: #555;
}

.ai-foundation .label-accent {
    color: var(--accent-2);
}

.ai-foundation h2 {
    color: var(--bg);
}

.ai-foundation h2 .italic {
    color: var(--accent-2);
}

.ai-foundation .lead {
    font-size: 24px;
    line-height: 1.4;
    color: #2a2a2a;
    max-width: 780px;
    margin-top: 32px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.ai-foundation .lead .highlight {
    background: var(--bg);
    color: var(--accent);
    padding: 0 8px;
    font-family: var(--mono);
    font-size: 0.85em;
    font-weight: 500;
}

.foundation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 64px;
}

.foundation-card {
    background: var(--bg);
    color: var(--ink);
    padding: 40px;
    position: relative;
}

.foundation-card .tag {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.foundation-card h4 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.foundation-card p {
    color: var(--ink-dim);
    font-size: 15px;
    line-height: 1.6;
}

.foundation-card.dark-accent {
    background: var(--bg);
    border: 2px solid var(--accent-2);
}

.foundation-card.dark-accent .tag {
    color: var(--accent-2);
}

@media (max-width: 720px) {
    .foundation-grid {
        grid-template-columns: 1fr;
    }
}

/* Terminal mock */
.terminal {
    background: var(--bg);
    border: 1px solid var(--line);
    margin-top: 48px;
    font-family: var(--mono);
    font-size: 13px;
    overflow: hidden;
}

.terminal-header {
    background: var(--bg-2);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}

.terminal-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-header .dot.r {
    background: #ff5c5c;
}

.terminal-header .dot.y {
    background: #ffbd44;
}

.terminal-header .dot.g {
    background: #00ca56;
}

.terminal-header .title {
    color: var(--ink-dim);
    font-size: 12px;
    margin-left: 12px;
}

.terminal-body {
    padding: 24px;
    color: var(--ink);
}

.terminal-line {
    padding: 4px 0;
}

.terminal-line .prompt {
    color: var(--accent);
}

.terminal-line .cmd {
    color: var(--ink);
}

.terminal-line .output {
    color: var(--ink-dim);
    padding-left: 20px;
}

.terminal-line .ok {
    color: var(--accent);
}

.terminal-line .err {
    color: var(--accent-2);
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: var(--accent);
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ====== Process ====== */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
}

.process-step {
    padding: 40px 24px;
    border-right: 1px solid var(--line);
    position: relative;
}

.process-step:last-child {
    border-right: none;
}

.process-step .num {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 24px;
    display: block;
}

.process-step h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.process-step p {
    color: var(--ink-dim);
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 880px) {
    .process-steps {
        grid-template-columns: 1fr 1fr;
    }

    .process-step:nth-child(2) {
        border-right: none;
    }

    .process-step:nth-child(1),
    .process-step:nth-child(2) {
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 540px) {
    .process-steps {
        grid-template-columns: 1fr;
    }

    .process-step {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .process-step:last-child {
        border-bottom: none;
    }
}

/* ====== Stack ====== */
.stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 40px;
}

.stack-item {
    font-family: var(--mono);
    font-size: 13px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    color: var(--ink-dim);
    transition: all 0.2s;
}

.stack-item:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ====== CTA ====== */
.cta {
    text-align: center;
    padding: 140px 0;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: 'tC';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--sans);
    font-size: clamp(280px, 40vw, 640px);
    font-weight: 900;
    color: var(--bg-2);
    z-index: 0;
    letter-spacing: -0.06em;
    line-height: 1;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta h2 {
    font-size: clamp(40px, 7vw, 88px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.cta h2 .italic {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

.cta p {
    font-size: 20px;
    color: var(--ink-dim);
    max-width: 540px;
    margin: 0 auto 40px;
}

/* ====== Footer ====== */
footer {
    padding: 60px 0 40px;
    background: var(--bg-2);
    border-top: 1px solid var(--line);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .logo {
    font-size: 24px;
    margin-bottom: 16px;
}

.footer-brand p {
    color: var(--ink-dim);
    font-size: 14px;
    max-width: 300px;
}

.footer-col h5 {
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    letter-spacing: 0.08em;
}

.footer-col a {
    display: block;
    color: var(--ink-dim);
    text-decoration: none;
    padding: 6px 0;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--ink);
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-dim);
}

@media (max-width: 720px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
    }
}

/* ====== Reveal animation ====== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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