@font-face {
    font-family: 'ABC Maxi';
    src: url('../fonts/ABCMaxiRound-Regular.woff2') format('woff2'),
         url('../fonts/ABCMaxiRound-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'ABC Diatype';
    src: url('../fonts/ABCDiatype-Light.woff2') format('woff2'),
         url('../fonts/ABCDiatype-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'ABC Diatype';
    src: url('../fonts/ABCDiatype-Regular-Trial.woff2') format('woff2'),
         url('../fonts/ABCDiatype-Regular-Trial.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Default colors (sRGB) */
    --background: #7DCE82;
    --text: #00FFF5;
    --text-secondary: #FFFFFF;
    --accent-orange: #FFFFFF;
    --grid-color: transparent;
    --transition-duration: 2000ms;
}

/* Override for Display P3 wide-gamut displays (Safari on Mac) */
@media (color-gamut: p3) {
    :root {
        /* Using Display P3 color space directly for precise colors */
        /* Target: #7DCE82 (green bg), #00FFF5 (cyan text) */
        --background: color(display-p3 0.49 0.808 0.51);
        --text: color(display-p3 0 1 0.96);
    }
}

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

html {
    font-size: 16px;
    background: var(--background) !important;
}

body {
    font-family: 'ABC Diatype', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background) !important;
    color: var(--text) !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.infrastructure-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 32px,
            var(--grid-color) 32px,
            var(--grid-color) 33px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 32px,
            var(--grid-color) 32px,
            var(--grid-color) 33px
        );
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    background-position: center center;
}

body.show-grid .infrastructure-grid {
    opacity: 1;
}

.calibration {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1.5rem;
    pointer-events: none;
    z-index: 100;
}

.reading {
    font-family: 'ABC Diatype', monospace;
    font-size: 1.75rem;
    color: var(--text);
    opacity: 0;
}

.reading[data-reading="1"] { 
    animation: breatheIn 1800ms ease-in-out 0ms forwards;
}
.reading[data-reading="2"] { 
    animation: breatheIn 1800ms ease-in-out 700ms forwards;
}
.reading[data-reading="3"] { 
    animation: breatheIn 1800ms ease-in-out 1400ms forwards;
}

@keyframes breatheIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    20% {
        opacity: 0.8;
        transform: translateY(3px) scale(0.98);
    }
    40% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    60% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    80% {
        opacity: 0.8;
        transform: translateY(-3px) scale(0.98);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

body.calibrated .calibration {
    display: none !important;
    visibility: hidden;
    opacity: 0;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.identity {
    text-align: center;
    opacity: 0;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Reveal the identity only after calibration completes */
body.calibrated .identity {
    animation: fadeIn 1000ms cubic-bezier(0.4, 0, 0.2, 1) 0ms forwards;
}

.company-name {
    font-family: 'ABC Maxi', 'Georgia', serif;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 0.9;
    margin-bottom: 0;
    cursor: default;
    color: var(--text) !important;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-inline: 1rem;
    max-width: 100%;
    /* Prevent mid-word breaks; only break at our explicit mobile-break */
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
    text-wrap: balance;
}

.company-name .line1 {
    font-size: 7.5rem;
    display: block;
}

.company-name .line2 {
    font-size: 7.5rem;
    display: block;
}

.company-name:hover {
    cursor: crosshair;
}

.tagline {
    font-family: 'ABC Diatype', sans-serif;
    font-size: 1.125rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    position: fixed;
    top: 2rem;
    left: 2rem;
    margin: 0;
    opacity: 0;
    animation: fadeIn 1000ms cubic-bezier(0.4, 0, 0.2, 1) 2500ms forwards;
}

@media (prefers-reduced-motion: reduce) {
    .tagline {
        animation: none;
    }
    .calibration {
        display: none;
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.period-infrastructure {
    display: inline;
}

.geometric-element {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 120px;
    height: 120px;
    color: var(--accent-orange);
    opacity: 0;
    animation: reveal 1000ms cubic-bezier(0.4, 0, 0.2, 1) 800ms forwards;
    pointer-events: none;
}

@keyframes reveal {
    to {
        opacity: 0.5;
    }
}

.geometric-element svg {
    width: 100%;
    height: 100%;
}

.square-outer {
    opacity: 0.6;
    animation: breathe-outer 6s ease-in-out infinite;
}

.square-middle {
    opacity: 0.4;
    animation: breathe-middle 6s ease-in-out infinite;
}

.square-inner {
    opacity: 0.2;
    animation: breathe-inner 6s ease-in-out infinite;
}

@keyframes breathe-outer {
    0%, 100% {
        opacity: 0.1;
    }
    33% {
        opacity: 0.5;
    }
    66% {
        opacity: 0.25;
    }
}

@keyframes breathe-middle {
    0%, 100% {
        opacity: 0.25;
    }
    33% {
        opacity: 0.1;
    }
    66% {
        opacity: 0.5;
    }
}

@keyframes breathe-inner {
    0%, 100% {
        opacity: 0.35;
    }
    33% {
        opacity: 0.15;
    }
    66% {
        opacity: 0.1;
    }
}

.mobile-break {
    display: inline;
}

@media (max-width: 768px) {
    .mobile-break {
        display: block;
        margin-top: 0.1em;
    }
    
    .container {
        padding: 1.5rem;
        justify-content: flex-start;
        padding-top: 30vh;
    }
    
    .company-name {
        line-height: 1.05;
    }
    
    .company-name .line1,
    .company-name .line2 {
        /* Keep the desktop size when there's room (7.5rem).
           Only scale down when the viewport is narrower. */
        font-size: clamp(3rem, 14vw, 7.5rem);
        white-space: nowrap; /* keep words intact on each line */
    }
    
    .company-name .line2 {
        margin-top: 0.08em;
    }
    
    .tagline {
        font-size: 1rem;
        top: 1.5rem;
        left: 1.5rem;
    }
    
    .geometric-element {
        width: 80px;
        height: 80px;
        bottom: 1.5rem;
        left: 1.5rem;
    }
}


.company-name.cursor-crosshair {
    position: relative;
}

.company-name.cursor-crosshair::after {
    content: '';
    position: fixed;
    width: 20px;
    height: 20px;
    pointer-events: none;
    opacity: 0.3;
    background-image: 
        linear-gradient(90deg, transparent 45%, currentColor 45%, currentColor 55%, transparent 55%),
        linear-gradient(0deg, transparent 45%, currentColor 45%, currentColor 55%, transparent 55%);
    transform: translate(-50%, -50%);
    z-index: 1000;
}
