/* ============================================================
   TLabs Design System
   Pure CSS — Zero dependencies
   Fonts: Self-hosted (DM Sans + JetBrains Mono)
   ============================================================ */

/* ---- @font-face ------------------------------------------ */

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/dm-sans-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/dm-sans-italic-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/dm-sans-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/dm-sans-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/dm-sans-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/jetbrains-mono-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/jetbrains-mono-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Design Tokens --------------------------------------- */

:root {
    --c-surface: #0F1112;
    --c-surface-alt: #161819;
    --c-border: #2A2D30;
    --c-border-light: #3A3D40;
    --c-text: #FAFAFA;
    --c-text-secondary: #B0B0B6;
    --c-text-muted: #8A8A90;
    --c-amber: #F6A623;
    --c-amber-subtle: rgba(246, 166, 35, 0.1);

    --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --s-container: 1024px;
}

/* ---- Reset & Base ---------------------------------------- */

html {
    scroll-behavior: smooth;
}

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

body {
    background-color: var(--c-surface);
    color: var(--c-text);
    font-family: var(--font-sans);
    font-feature-settings: 'ss01' on, 'cv01' on;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

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

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

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.text-muted {
    color: var(--c-text-muted);
}

.text-secondary {
    color: var(--c-text-secondary);
}

.text-amber {
    color: var(--c-amber);
}

.tracking-tight {
    letter-spacing: -0.025em;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.uppercase {
    text-transform: uppercase;
}

.italic {
    font-style: italic;
}

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

/* ---- Layout Utilities ------------------------------------ */

.container {
    max-width: var(--s-container);
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.hidden {
    display: none;
}

@media (min-width: 640px) {
    .sm-flex-row {
        flex-direction: row;
    }

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

/* ---- Navigation ------------------------------------------ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5rem;
    background-color: rgba(15, 17, 18, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    z-index: 50;
}

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

.nav-link {
    font-size: 0.875rem;
    color: var(--c-text-secondary);
}

.nav-link:hover {
    color: var(--c-text);
}

.nav-logo {
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: -0.025em;
}

/* ---- Hero ------------------------------------------------ */

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 3.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.hero-content {
    max-width: 48rem;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    color: var(--c-text);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

.hero-rule {
    width: 2rem;
    height: 1px;
    background-color: var(--c-border-light);
    border: none;
    margin: 2rem auto;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--c-text);
    color: var(--c-surface);
}

.btn-primary:hover {
    background-color: var(--c-text-secondary);
}

.btn-outline {
    border: 1px solid var(--c-border);
    color: var(--c-text-secondary);
}

.btn-outline:hover {
    border-color: var(--c-border-light);
    color: var(--c-text);
}

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

.section {
    padding: 6rem 1.5rem;
    border-top: 1px solid var(--c-border);
}

.section-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 2rem;
    color: var(--c-text);
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.875rem;
    }
}

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

.grid {
    display: grid;
    gap: 1.5rem;
}

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

@media (min-width: 768px) {
    .grid-projects {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-projects {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

@media (min-width: 640px) {
    .grid-contact {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---- Project Cards --------------------------------------- */

.project-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--c-border);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background-color: transparent;
}

.project-card:hover {
    border-color: var(--c-border-light);
    background-color: var(--c-surface-alt);
}

.project-card .card-arrow {
    width: 1rem;
    height: 1rem;
    color: var(--c-text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.project-card:hover .card-arrow {
    transform: translateX(4px);
    color: var(--c-text);
}

.tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.25rem;
    background-color: var(--c-amber-subtle);
    color: var(--c-amber);
}

/* ---- Animations ------------------------------------------ */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

/* ---- Grain Texture --------------------------------------- */

.grain::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 1000;
}

/* ---- Footer ---------------------------------------------- */

.footer {
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--c-border);
}

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

/* ---- Icons ----------------------------------------------- */

.icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---- Domain Blocks (Research section) -------------------- */

.domain-block {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--c-border);
}

.domain-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.domain-block:first-child {
    padding-top: 0;
}

.domain-id {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--c-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.domain-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--c-text);
    letter-spacing: -0.015em;
    margin-bottom: 0.75rem;
}

.domain-desc {
    font-size: 0.9375rem;
    color: var(--c-text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.domain-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--c-text-muted);
    transition: color 0.2s ease;
}

.domain-link:hover {
    color: var(--c-text-secondary);
}

.domain-link svg {
    width: 0.75rem;
    height: 0.75rem;
    transition: transform 0.2s ease;
}

.domain-link:hover svg {
    transform: translateX(2px);
}

/* ---- Manifesto / Long-form text -------------------------- */

.manifesto-text {
    font-size: 1.0625rem;
    color: var(--c-text-secondary);
    line-height: 1.8;
}

/* ---- Meta Grid (About section) --------------------------- */

.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .meta-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.meta-label {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--c-text-muted);
    margin-bottom: 0.25rem;
}

.meta-value {
    font-size: 0.875rem;
    color: var(--c-text-secondary);
}