/* Import monospace font for certain text elements */
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&display=swap');

/* Custom font for headlines */
@font-face {
    font-family: 'Inter Display';
    src: url(font/InterDisplay-SemiBold.woff2);
}

/* Base styles */
:root {
    /* Colors */
    --background-color: #E8E8E6;
    --line-color: #D1CFCF;
    --highlight-color: #CCFF5F;
    --text-color: #1D1D1D;
    --text-gray: #909090;
    
    /* Typography */
    --font-heading: 'Inter Display', sans-serif;
    --font-body: 'Fira Mono', monospace;
    
    /* Font Sizes */
    --font-size-h1: 56px;
    --font-size-p: 20px;
    --font-size-small: 12px;
    
    /* Grid */
    --line-height: 40px;      /* Height between background lines */
    --content-left: 25%;      /* Left margin for content */
    --padding-top: 60px;      /* Top padding for first element */
    --intro-contact-gap-scrollable: 180px; /* Minimum spacing in scrollable mode */
}

/* Reset */
html, body {
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    height: 100vh;
}

body {
    overflow: hidden;
}

body.scrollable {
    overflow-y: auto;
}

/* Layout */
.container {
    width: 100%;
    position: relative;
    min-height: 100vh;
}

/* Background lines - adjust --line-height to modify grid */
.background-lines {
    position: fixed;
    top: var(--line-height);
    left: var(--content-left);
    width: calc(100% - var(--content-left));
    height: 100vh;
    background: repeating-linear-gradient(
        to bottom,
        var(--line-color) 0px,
        var(--line-color) 1px,
        transparent 1px,
        transparent var(--line-height)
    );
    pointer-events: none;
}

body.scrollable .background-lines {
    position: absolute;
    height: 100%;
}

/* Content wrapper */
.content {
    position: relative;
    z-index: 10;
    padding-left: calc(var(--content-left) + 12px);
    padding-right: 40px;
}

/* Heading styles */
h1 {
    font-family: var(--font-heading);
    font-size: var(--font-size-h1);
    line-height: calc(var(--line-height) * 2);
    margin: 0;
    padding: var(--padding-top) 0 0 0;
    font-weight: 500;
}

/* Paragraph styles */
p {
    font-family: var(--font-body);
    font-size: var(--font-size-p);
    line-height: var(--line-height);
    margin: 0;
    padding: 0;
}

/* Intro paragraph */
.intro {
    margin: 33px 0 0 0;
}

/* Contact information styles */
.contact-info {
    position: fixed;
    left: calc(var(--content-left) + 12px);
}

.contact-info p {
    margin: 0;
}

body.scrollable .contact-info {
    position: relative;
    left: 0;
    margin-top: calc(var(--intro-contact-gap-scrollable) + 20px); /* Use the new variable for scrollable mode */
}

/* Legal links styles */
.legal-links {
    position: fixed;
    left: 32px;
    /* Bottom is handled by JS */
    height: var(--line-height);
}

.legal-links a {
    font-family: var(--font-body);
    font-size: var(--font-size-small);
    color: var(--text-gray);
    line-height: var(--line-height);
    margin: 0;
    padding: 0;
    /* Explicitly position the text to align with grid */
    display: block;
    position: relative;
    top: 0;
}

body.scrollable .legal-links {
    position: relative;
    left: 0;
    margin-top: 3px;
    margin-bottom: var(--line-height); /* Add bottom margin to ensure space at the end */
}

/* Link styles */
a {
    color: var(--text-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Text highlight animation */
.highlight {
    position: relative;
    display: inline-block;
}

.highlight::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 80%;
    background-color: var(--highlight-color);
    z-index: -1;
    transform: translateY(-50%) scaleX(0);
    transform-origin: left;
    animation: highlightAnimation 0.6s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
    animation-delay: 0.5s;
    top: 50%;
}

.highlight:nth-of-type(2)::before {
    animation-delay: 1.5s;
}

@keyframes highlightAnimation {
    from { transform: translateY(-50%) scaleX(0); }
    to { transform: translateY(-50%) scaleX(1); }
}

/* Responsive layouts */
@media (min-width: 1921px){
    :root {
        --font-size-h1: 80px;
        --font-size-p: 20px;
    }

    h1 {
        line-height: 120px;
        padding-top: 71px;
        padding-right: 56px;
    }

    .intro {
        margin-top: 63px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --content-left: 0;
    }
    
    .content {
        padding-left: 24px;
        padding-right: 24px;
    }

    .contact-info:not(.scrollable) {
        left: 24px;
    }
    
    .legal-links {
        left: 24px;
    }

    .background-lines {
        left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    :root {
        --content-left: 0;
        --padding-top: 50px;
        --font-size-h1: 28px;
        --font-size-p: 16px;
    }
    
    .content {
        padding-left: 16px;
        padding-right: 16px;
    }

    h1{
        line-height: var(--line-height);
    }

    .intro {
        margin-top: 46px;
    }

    .contact-info:not(.scrollable) {
        left: 16px;
    }
    
    .legal-links {
        left: 16px;
        gap: 8px;
    }

    .background-lines {
        left: 0;
        width: 100%;
    }
}

/* Desktop image positioning */
.desktop-image {
    display: none; /* Hidden by default on all devices */
}

/* Only show on desktop screens (1025px and above) */
@media (min-width: 1025px) {
    .desktop-image {
        display: block;
        position: fixed;
        left: 32px; /* Same as legal-links */
        bottom: calc(var(--line-height) + 56px); /* 56px above legal-links */
        width: 16vw; /* 16% of viewport width */
        height: auto; /* Maintain aspect ratio */
        z-index: 5; /* Below content but above background */
    }
    
    body.scrollable .desktop-image {
        display: none; /* Hide in scrollable mode to avoid conflicts */
    }
}

/* Explicitly hide on tablet and mobile */
@media (max-width: 1024px) {
    .desktop-image {
        display: none !important;
    }
}