/* ==========================================================
   Appstruct — Design tokens & globals
   ========================================================== */
:root {
    /* Colors */
    --bg: #F4F2EE;
    --bg-card: #FFFFFF;
    --bg-dark: #0A0A0A;
    --bg-dark-soft: #161616;
    --text: #0A0A0A;
    --text-muted: #4A4A4A;
    --text-dim: #888888;
    --text-on-dark: #F4F2EE;
    --text-on-dark-muted: #999999;
    --accent: #3358FF;
    --accent-text: #3358FF;
    --border: #E5E2DD;
    --border-dark: #2A2A2A;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

    /* Spacing */
    --container: 1200px;
    --container-narrow: 800px;
    --section-pad: 120px;
    --section-pad-tight: 80px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 999px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

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

/* ==========================================================
   Typography helpers
   ========================================================== */
.mono {
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.small {
    font-size: 12px;
}

.dim {
    color: var(--text-dim);
}

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

/* ==========================================================
   Navigation
   ========================================================== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(244, 242, 238, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.logo-mark {
    display: grid;
    grid-template-columns: repeat(2, 7px);
    grid-template-rows: repeat(2, 7px);
    gap: 2px;
}

.logo-mark span {
    background: var(--accent);
    border-radius: 1.5px;
}

.logo-mark span:nth-child(2) {
    background: #6B85FF;
}

.logo-mark span:nth-child(3) {
    background: #6B85FF;
}

.nav-links {
    display: flex;
    gap: 36px;
    font-size: 15px;
    font-weight: 500;
}

.nav-links a {
    color: var(--text);
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.6;
}

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 15px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: #2845D6;
    transform: translateY(-1px);
}

.btn-dark {
    background: var(--bg-dark);
    color: white;
}

.btn-dark:hover {
    background: #222;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--text);
}

.btn-outline:hover {
    background: var(--text);
    color: var(--bg);
}

.btn-outline-light {
    background: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-light:hover {
    background: white;
    color: var(--bg-dark);
    border-color: white;
}

.arrow {
    display: inline-block;
    transition: transform 0.2s;
}

.btn:hover .arrow,
.link-arrow:hover .arrow {
    transform: translateX(3px);
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 500;
    font-size: 14px;
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
    padding: 80px 32px 100px;
    background: var(--bg);
}

.hero-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
}

.hero-tag .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.hero-title {
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}

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

.hero-sub {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 36px;
}

.hero-cta {
    display: flex;
    gap: 12px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.hero-platforms {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: var(--text-dim);
}

.hero-platforms .sep {
    color: var(--border);
}

/* Phone mockup */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.phone-frame {
    position: relative;
    width: 280px;
    height: 560px;
    border: 3px solid var(--text);
    border-radius: 42px;
    padding: 14px;
    background: var(--bg-card);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.phone-notch {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 22px;
    background: var(--text);
    border-radius: 0 0 14px 14px;
    z-index: 3;
}

.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 28px;
    background: white;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.phone-diagonal {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.04) 10px,
        rgba(0, 0, 0, 0.04) 20px
    );
}

.phone-floating-card {
    position: absolute;
    bottom: 60px;
    right: -60px;
    background: white;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    z-index: 3;
    min-width: 160px;
}

.phone-floating-title {
    font-weight: 700;
    font-size: 17px;
    margin: 4px 0;
}

.phone-bg-blocks {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.phone-bg-blocks .block {
    position: absolute;
    background: #B8C5FF;
    border-radius: 8px;
}

.phone-bg-blocks .b1 {
    width: 70px; height: 36px;
    top: 18%; left: -10%;
}
.phone-bg-blocks .b2 {
    width: 70px; height: 36px;
    top: 32%; right: -10%;
}
.phone-bg-blocks .b3 {
    width: 70px; height: 36px;
    top: 62%; left: -8%;
}
.phone-bg-blocks .b4 {
    width: 70px; height: 36px;
    top: 78%; right: -8%;
}

/* ==========================================================
   Sections
   ========================================================== */
.section {
    padding: var(--section-pad) 32px;
}

.section-tight {
    padding: var(--section-pad-tight) 32px;
}

.section-dark {
    background: var(--bg-dark);
    color: var(--text-on-dark);
}

.section-dark .section-label,
.section-dark .mono {
    color: var(--text-on-dark-muted);
}

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

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

.text-center {
    text-align: center;
}

.section-label {
    margin-bottom: 24px;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.section-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    max-width: 720px;
}

.section-lead {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 720px;
    margin-bottom: 60px;
}

.section-dark .section-lead {
    color: var(--text-on-dark-muted);
}

/* ==========================================================
   Services
   ========================================================== */
.services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 80px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.2s;
}

.service-card:hover {
    border-color: var(--text);
    transform: translateY(-2px);
}

.service-num {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 60px;
}

.service-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.service-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* 4th card on its own row, same width as others (grid handles it naturally) */
.services > .service-card:nth-child(4) {
    grid-column: span 1;
}

/* ==========================================================
   Stack evolution
   ========================================================== */
.stack-box {
    background: var(--bg-dark);
    color: var(--text-on-dark);
    border-radius: var(--radius-lg);
    padding: 48px;
}

.stack-text {
    font-size: 20px;
    line-height: 1.5;
    margin: 20px 0 32px;
    color: var(--text-on-dark);
    max-width: 540px;
}

.stack-timeline {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stack-pill {
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--text-on-dark);
}

.stack-timeline .arrow {
    color: var(--text-on-dark-muted);
    font-size: 18px;
}

.accent-pill {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: white !important;
}

/* ==========================================================
   Werk header
   ========================================================== */
.werk-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: end;
    margin-bottom: 60px;
}

.werk-stats {
    display: flex;
    gap: 48px;
    padding-bottom: 12px;
}

.stat-num {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 8px;
    letter-spacing: 0.05em;
}

/* ==========================================================
   Project featured (Vaultly)
   ========================================================== */
.project-featured {
    background: var(--bg-dark);
    color: var(--text-on-dark);
    border-radius: var(--radius-lg);
    padding: 56px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 24px;
}

.project-split {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.project-featured-text {
    grid-template-columns: 1fr;
    max-width: 720px;
}

.project-featured-text .featured-content {
    max-width: 720px;
}

.project-split .featured-meta .project-name {
    color: var(--text);
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.project-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-on-dark);
}

.featured-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    max-width: 480px;
}

.featured-text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-on-dark-muted);
    margin-bottom: 28px;
    max-width: 480px;
}

.project-split .featured-text {
    color: var(--text-muted);
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 11px;
    color: var(--text);
}

.project-featured .tag {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-on-dark);
}

.project-split .tag {
    border-color: var(--border);
    color: var(--text);
}

.tag-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.comment {
    display: inline-block;
    margin-top: 8px;
}

/* Vaultly cards visual */
.featured-visual {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vaultly-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 24px;
    color: var(--text-on-dark);
}

.vc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 11px;
    color: var(--text-on-dark-muted);
}

.vc-header .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.vc-header .dot.green { background: #5BD68C; }
.vc-header .dot.blue { background: var(--accent); }

.vc-amount {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

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

.vc-label {
    color: var(--text-on-dark-muted);
    margin-bottom: 4px;
}

.vc-value {
    font-size: 16px;
    font-weight: 600;
}

.tandem-card {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 32px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tandem-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 12px 0 20px;
}

/* ==========================================================
   Client work
   ========================================================== */
.client-work-header {
    margin: 60px 0 24px;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.client-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.client-num {
    margin-bottom: 20px;
}

.client-meta {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 16px;
}

.client-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.client-tag {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.client-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ==========================================================
   Founder section
   ========================================================== */
.founder-container {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 80px;
    align-items: center;
}

.portrait-placeholder {
    position: relative;
    aspect-ratio: 3/4;
    background: var(--bg-dark-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-dark);
}

.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.portrait-stripes {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 14px,
        rgba(255, 255, 255, 0.03) 14px,
        rgba(255, 255, 255, 0.03) 28px
    );
}

.founder-content .section-label {
    margin-bottom: 12px;
}

.founder-name {
    font-size: clamp(48px, 6vw, 80px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 12px;
    color: white;
}

.founder-role {
    font-size: 17px;
    margin-bottom: 24px;
}

.founder-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-on-dark-muted);
    margin-bottom: 28px;
    max-width: 560px;
}

.section-dark .tag-row .tag-dark {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-on-dark);
}

/* ==========================================================
   Insights
   ========================================================== */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.insight-card {
    padding: 4px 0;
}

.insight-icon {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.insight-card h3 {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.insight-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ==========================================================
   Contact section
   ========================================================== */
.section-cta {
    padding: 120px 32px;
}

.contact-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 24px auto 24px;
    max-width: 760px;
}

.contact-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.email-link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--border);
    font-size: 14px;
    transition: text-decoration-color 0.2s;
}

.email-link:hover {
    text-decoration-color: var(--text);
}

/* ==========================================================
   Footer
   ========================================================== */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 32px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 28px;
    font-size: 14px;
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 900px) {
    :root {
        --section-pad: 80px;
        --section-pad-tight: 60px;
    }

    .nav-links {
        display: none;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .hero-visual {
        order: -1;
    }

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

    .services > .service-card:nth-child(4) {
        max-width: 100%;
    }

    .werk-header {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .project-featured {
        grid-template-columns: 1fr;
        padding: 32px;
    }

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

    .founder-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .insights-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 40px 20px 60px;
    }
    .section, .section-tight, .section-cta {
        padding-left: 20px;
        padding-right: 20px;
    }
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-cta .btn {
        justify-content: center;
    }
    .phone-frame {
        width: 240px;
        height: 480px;
    }
}