:root {
    --bg: #ffffff;
    --text: #111111;
    --text-light: #666666;
    --line: #e0e0e0;
    --line-dark: #111111;
    --accent: #000000;
    --font-main: 'Inter', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --easing: cubic-bezier(0.19, 1, 0.22, 1);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    line-height: 1.5;
    width: 100vw;
    overflow-x: hidden;
}

.mono {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: -0.02em;
    font-size: 0.85rem;
}

/* Background Grid */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    border-bottom: 1px dotted var(--text-light);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(5px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.logo-mark {
    width: 12px;
    height: 12px;
    background: var(--text);
    border-radius: 50%;
}

.nav-ticker-container {
    width: 200px;
    overflow: hidden;
    border-left: 1px solid var(--line-dark);
    padding-left: 1rem;
    margin-left: 1rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
}

.nav-ticker {
    display: flex;
    white-space: nowrap;
    animation: navTicker 15s linear infinite;
    font-family: var(--font-main);
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.05em;
}

.nav-ticker span {
    margin-right: 1rem;
}

@keyframes navTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.nav-right a {
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    margin-left: 2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.nav-right a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width 0.3s ease;
}

.nav-right a:hover::after {
    width: 100%;
}

/* Main Structure */
main {
    padding-top: 80px;
}

/* Hero */
.hero {
    min-height: 90vh;
    display: flex;
    border-bottom: 1px solid var(--line-dark);
    position: relative;
}

.hero-container {
    flex: 1;
    padding: 6rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px dotted var(--text-light);
    background: #fff;
}

.hero-visual {
    flex: 1;
    background: #f9f9f9;
    position: relative;
    overflow: hidden;
}

#data-canvas {
    width: 100%;
    height: 100%;
}

.meta-row {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    color: var(--text-light);
}

.headline {
    font-family: var(--font-display);
    font-size: 5.5rem;
    line-height: 0.9;
    margin-bottom: 3rem;
    letter-spacing: -0.04em;
}

.outline-text {
    color: transparent;
    -webkit-text-stroke: 1px var(--text);
}

.hero-desc {
    max-width: 450px;
}

.hero-desc p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--text);
    color: #fff;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.3s;
}

.btn:hover {
    background: #333;
}

/* Ticker */
.ticker-wrap {
    border-bottom: 1px solid var(--line-dark);
    overflow: hidden;
    background: var(--text);
    color: #fff;
    padding: 0.8rem 0;
}

.ticker {
    display: flex;
    white-space: nowrap;
    animation: ticker 20s linear infinite;
}

.ticker-item {
    padding: 0 2rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-transform: uppercase;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 40vh;
}

.feature-col {
    padding: 4rem;
    background: #fff;
    transition: background 0.3s;
}

.feature-col:hover {
    background: #f5f5f5;
}

.border-l {
    border-left: 1px dotted var(--text-light);
}

.feature-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-header h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
}

.feature-col p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
footer {
    border-top: 1px solid var(--line-dark);
    padding: 2rem 4rem;
    background: #fff;
}

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

.f-right a {
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
}

/* Page Headers (for subpages) */
.page-header {
    padding: 6rem 4rem 2rem; /* Reduced vertical padding */
    border-bottom: 1px solid var(--line-dark);
    background: #fff;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    letter-spacing: -0.03em;
    margin-top: 1rem; /* Reduced margin */
}

/* Content Sections */
.content-section {
    padding: 2rem 4rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    border-bottom: 1px dotted var(--text-light);
    background: #fff;
    transition: all 0.5s var(--easing);
    align-items: start;
    position: relative;
}

.content-section:hover {
    padding: 4rem;
    background: #fafafa;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    text-transform: uppercase;
    transition: transform 0.5s var(--easing);
}

.text-block {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s var(--easing);
    transform: translateY(10px);
}

.content-section:hover .text-block {
    opacity: 1;
    max-height: 1000px; /* Large enough to fit content */
    transform: translateY(0);
}

/* Contact page - disable hover effects */

.contact-page .content-section:hover {
    padding: 2rem 4rem;
    background: #fff;
}

.contact-page .text-block {
    opacity: 1;
    max-height: none;
    transform: none;
}

.contact-page .content-section:hover .text-block {
    opacity: 1;
    max-height: none;
    transform: none;
}

.text-block p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

.service-list {
    list-style: none;
}

.service-list li {
    padding: 1.5rem 0;
    border-bottom: 1px dotted var(--line);
    font-family: var(--font-display);
    font-size: 1.5rem;
    display: flex;
    justify-content: space-between;
}

.service-list li:first-child {
    border-top: 1px dotted var(--line);
}

.service-list li:hover {
    background: #fafafa;
    padding-left: 1rem;
    transition: all 0.2s;
}

/* Form */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--line-dark);
    font-family: var(--font-main);
    font-size: 1rem;
    background: transparent;
    border-radius: 0;
}

.form-input:focus {
    outline: none;
    background: #f9f9f9;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 18px;
    z-index: 1001;
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text);
    transition: all 0.3s var(--easing);
}

.nav-open .mobile-toggle span:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-open .mobile-toggle span:last-child {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
    }
    .hero-container {
        border-right: none;
        border-bottom: 1px dotted var(--text-light);
    }
    .hero-visual {
        height: 40vh;
    }
    .features {
        grid-template-columns: 1fr;
    }
    .feature-col.border-l {
        border-left: none;
        border-top: 1px dotted var(--text-light);
    }
    .headline {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 1.5rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: 80px;
        background: rgba(255,255,255,0.98);
    }

    .nav-left {
        width: auto;
        flex-direction: row;
        gap: 1rem;
        align-items: center;
    }

    .logo {
        width: auto;
        font-size: 1.2rem;
    }

    .nav-ticker-container {
        display: flex; /* Restore ticker */
        width: 120px; /* Smaller width for mobile */
        border-left: 1px solid var(--line-dark);
        padding-left: 0.8rem;
        margin-left: 0.8rem;
        height: 1.2rem;
        background: transparent;
        border-top: none;
        border-bottom: none;
        padding: 0 0 0 0.8rem;
        margin: 0 0 0 0.8rem;
    }

    .nav-ticker {
        font-size: 0.6rem;
    }

    .mobile-toggle {
        display: flex;
    }

    .nav-right {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background: #fff;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transform: translateX(100%);
        transition: transform 0.4s var(--easing);
        border-top: 1px solid var(--line);
        padding: 2rem;
        grid-template-columns: 1fr; /* Reset grid */
    }

    .nav-open .nav-right {
        transform: translateX(0);
    }

    .nav-right a {
        margin: 0;
        font-size: 2.5rem;
        border: none;
        background: transparent;
        padding: 0;
        font-family: var(--font-display);
        font-weight: 300;
    }

    .nav-right a::after {
        display: block; /* Restore underline effect or remove if preferred, keeping generic link style */
        bottom: -5px;
    }

    main {
        padding-top: 80px;
    }

    .page-header {
        padding: 3rem 1.5rem 2rem;
    }

    .page-header .mono {
        font-size: 0.75rem;
        display: block;
        margin-bottom: 0.5rem;
    }

    .page-header h1 {
        font-size: 2.5rem;
        line-height: 1.1;
        margin-top: 0.5rem;
    }

    .hero-container, .content-section, .feature-col {
        padding: 2rem 1.5rem;
    }

    .hero-visual {
        display: none;
    }

    .headline {
        font-size: 3rem;
    }

    /* Mobile content visibility fixes */
    .text-block {
        opacity: 1;
        max-height: none;
        transform: none;
        margin-top: 1rem;
    }

    .content-section {
        padding: 3rem 1.5rem;
        grid-template-columns: 1fr;
        gap: 1rem;
        pointer-events: none; /* Disable hover state logic affecting layout if any */
    }

    .content-section > * {
        pointer-events: auto;
    }

    .content-section:hover {
        padding: 3rem 1.5rem;
        background: #fff;
    }

    .service-list li {
        justify-content: flex-start;
        gap: 1rem;
        font-size: 1.1rem;
    }

    .service-list li span {
        display: inline-block;
        width: 1.5rem;
        flex-shrink: 0;
        font-size: 1.1rem;
    }

    .service-list li:hover {
        padding-left: 0;
        background: transparent;
    }

    .ticker {
        animation-duration: 8s; /* Faster ticker */
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .f-left, .f-right {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .headline {
        font-size: 2.5rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }

    .page-header {
        padding: 2.5rem 1rem 1.5rem;
    }
    
    .nav-ticker-container {
        width: 90px; /* Even smaller on very small screens */
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }
}