* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --white: #fafafa;
    --black: #0a0a0a;
    --gray: #666;
    --gray-dark: #333;
    --accent: #3ecf8e;
    --error: #ef4444;
    --line-left: clamp(40px, 10vw, 120px);
}

html {
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden;
    background: var(--black);
}

/* Text selection */
::selection {
    background: var(--accent);
    color: var(--black);
}

::-moz-selection {
    background: var(--accent);
    color: var(--black);
}

body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--white);
    /* Custom minimal cursor */
    cursor: crosshair;
}

/* ═══════════════════════════════════════
   FOCUS STATES (Accessibility)
═══════════════════════════════════════ */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ═══════════════════════════════════════
   CUSTOM CURSOR
═══════════════════════════════════════ */
a, button, [role="button"] {
    cursor: pointer;
}

input, textarea {
    cursor: text;
}

/* Keep crosshair on footer content */
.footer, .footer-row, .footer-content, .info, .label {
    cursor: crosshair;
}

/* ═══════════════════════════════════════
   PAGE LOAD ANIMATION
═══════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation: fadeIn 0.4s ease-out;
}

.scroll-container {
    position: relative;
}

.scroll-spacer {
    height: 260vh;
    pointer-events: none;
}

.page-end {
    height: 1px;
    pointer-events: none;
}

/* ═══════════════════════════════════════
   BACKGROUNDS
═══════════════════════════════════════ */
.bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
}
.bg-white { background: var(--white); z-index: 1; }
.bg-black { background: var(--black); z-index: 0; }

/* ═══════════════════════════════════════
   LOGO SCENE
═══════════════════════════════════════ */
.logo-scene {
    position: fixed;
    z-index: 20;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: baseline;
    font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
    font-weight: 900;
    font-size: clamp(28px, 6vw, 56px);
    letter-spacing: -0.03em;
    will-change: transform, opacity;
    perspective: 800px;
}

.logo-slash {
    color: var(--black);
    transform-origin: center center;
    will-change: transform, opacity, color;
}

.logo-text {
    color: var(--black);
    transform-origin: left center;
    will-change: transform, opacity, color;
}

/* ═══════════════════════════════════════
   FOOTER LINE
═══════════════════════════════════════ */
.footer-line {
    position: fixed;
    left: var(--line-left);
    top: 0;
    height: 100vh;
    width: 2px;
    background: var(--white);
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    z-index: 15;
    will-change: transform, opacity;
}

/* ═══════════════════════════════════════
   FOOTER - Compact for single screen
═══════════════════════════════════════ */
.footer {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    padding: clamp(24px, 4vw, 48px);
    padding-left: calc(var(--line-left) + clamp(20px, 4vw, 40px));
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--black);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 28px);
    max-width: 480px;
}

.footer-row {
    display: flex;
    align-items: flex-start;
    gap: clamp(16px, 3vw, 28px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* First row (with title) - always visible for morph target */
.footer-row:first-child {
    opacity: 1;
    transform: none;
}

/* Other rows animate in */
.footer.visible .footer-row {
    opacity: 1;
    transform: none;
}

.footer.visible .footer-row:nth-child(2) { transition-delay: 0ms; }
.footer.visible .footer-row:nth-child(3) { transition-delay: 60ms; }
.footer.visible .footer-row:nth-child(4) { transition-delay: 120ms; }

.label {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: clamp(9px, 1vw, 11px);
    color: var(--gray);
    min-width: 24px;
    padding-top: 4px;
}

.info {
    flex: 1;
}

.info strong,
.footer-title {
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    transition: opacity 0.1s linear;
}

.info span {
    display: block;
    font-size: clamp(12px, 1.3vw, 14px);
    opacity: 0.7;
    line-height: 1.4;
}

.info a {
    color: var(--white);
    text-decoration: none;
    font-size: clamp(14px, 1.6vw, 17px);
    position: relative;
    display: inline-block;
    transition: color 0.2s;
}

.info a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s;
}

.info a:hover {
    color: var(--accent);
}

.info a:hover::after {
    background: var(--accent);
    transform: scaleX(1.05);
}

/* ═══════════════════════════════════════
   TYPING TEXT
═══════════════════════════════════════ */
.typing-text {
    font-size: clamp(12px, 1.3vw, 14px);
    color: var(--gray);
    margin-bottom: 8px;
    min-height: 18px;
    font-style: italic;
}

.typing-text::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ═══════════════════════════════════════
   CONTACT FORM - Compact
═══════════════════════════════════════ */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray);
    font-weight: 500;
}

.contact-form input,
.contact-form textarea {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--white);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255,255,255,0.25);
}

.contact-form input:hover,
.contact-form textarea:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.06);
}

.contact-form textarea {
    min-height: 60px;
    resize: none;
    line-height: 1.4;
}

/* Captcha fill-in-the-blank style */
.captcha-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 0 12px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.captcha-wrapper:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
}

.captcha-wrapper:focus-within {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.06);
}

.captcha-prefix {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    white-space: nowrap;
    padding-right: 0;
}

.captcha-wrapper input {
    background: transparent;
    border: none;
    padding: 10px 4px;
    flex: 0 0 auto;
    width: auto;
    min-width: 80px;
    max-width: 120px;
}

.captcha-wrapper input:focus {
    outline: none;
    background: transparent;
}

.captcha-wrapper input::placeholder {
    color: rgba(255,255,255,0.25);
}

/* Validation states - only on submit */
.contact-form input.error,
.contact-form textarea.error,
.captcha-wrapper.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.contact-form input.valid,
.contact-form textarea.valid,
.captcha-wrapper.valid {
    border-color: var(--accent);
}

.hint {
    font-size: 11px;
    color: var(--error);
    min-height: 14px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s;
}

.hint.show {
    opacity: 1;
    transform: none;
}

/* Submit button */
.contact-form button {
    background: var(--white);
    color: var(--black);
    border: none;
    border-radius: 5px;
    padding: 9px 18px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.contact-form button .btn-arrow {
    transition: transform 0.25s;
}

.contact-form button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,255,255,0.12);
}

.contact-form button:hover .btn-arrow {
    transform: translateX(3px);
}

.contact-form button:active:not(:disabled) {
    transform: translateY(0);
}

.contact-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status {
    font-size: 12px;
    min-height: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status.success { color: var(--accent); }
.status.error { color: var(--error); }

/* ═══════════════════════════════════════
   INTERACTIVE CONSTELLATION
═══════════════════════════════════════ */
.logo-playground {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 60px; /* Don't cover legal footer */
    width: 50%;
    pointer-events: auto;
    overflow: hidden;
    z-index: 1;
}

.logo-playground canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ═══════════════════════════════════════
   LEGAL FOOTER
═══════════════════════════════════════ */
.legal-footer {
    margin-top: 0;
    padding-top: 10px;
}

.legal-line {
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
    margin-bottom: 14px;
}

.legal-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: var(--gray);
}

.legal-links {
    display: flex;
    gap: 20px;
}

.legal-links a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
    z-index: 100;
}

.legal-links a:hover {
    color: var(--white);
}

.legal-footer {
    position: relative;
    z-index: 50;
}

/* ═══════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .bg-white { opacity: 0 !important; }
    .logo-slash, .logo-text { color: var(--white) !important; }
    .logo-scene { opacity: 0 !important; }
    .footer-line { opacity: 0.3 !important; transform: scaleY(1) !important; }
    .footer-row { opacity: 1 !important; transform: none !important; }
    .typing-text::after { animation: none; }
}

/* ═══════════════════════════════════════
   MOBILE RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 768px) {
    :root { 
        --line-left: 24px; 
    }
    
    .logo-playground { display: none; }
    body { cursor: auto; }
    
    .scroll-spacer { height: 160vh; }
    .logo-scene { font-size: clamp(32px, 12vw, 56px); }
    
    .footer {
        padding: 28px 24px 20px;
        padding-left: calc(var(--line-left) + 20px);
        min-height: auto;
    }
    
    .footer-content { gap: 24px; }
    .footer-row { gap: 16px; }
    
    .contact-form {
        max-width: 100%;
        gap: 14px;
    }
    
    .contact-form input,
    .contact-form textarea {
        font-size: 16px;
        padding: 14px;
        border-radius: 8px;
    }
    
    .contact-form button {
        padding: 16px 24px;
        font-size: 15px;
        border-radius: 8px;
    }
    
    .captcha-wrapper {
        border-radius: 8px;
        padding: 0 14px;
    }
    
    .captcha-prefix { font-size: 14px; }
    .captcha-wrapper input { font-size: 16px; min-width: 70px; }
    .typing-text { font-size: 14px; }
    
    .legal-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .legal-links { gap: 20px; }
}

@media (max-width: 480px) {
    :root { 
        --line-left: 20px; 
    }
    
    .logo-scene { font-size: clamp(28px, 14vw, 44px); }
    
    .footer {
        padding: 24px 20px 16px;
        padding-left: calc(var(--line-left) + 16px);
    }
    
    .footer-content { gap: 20px; }
    .label { min-width: 24px; font-size: 9px; }
    
    .info strong, .footer-title { font-size: 18px; }
    .info span { font-size: 12px; }
    .info a { font-size: 14px; }
    
    .contact-form { gap: 12px; }
    
    .contact-form input,
    .contact-form textarea {
        padding: 12px;
        font-size: 16px;
    }
    
    .captcha-prefix { font-size: 13px;
    }
}

/* ═══════════════════════════════════════
   LANDSCAPE MOBILE
═══════════════════════════════════════ */
@media (max-height: 600px) and (orientation: landscape) {
    .footer {
        padding: 16px;
        padding-left: calc(var(--line-left) + 16px);
    }
    
    .footer-content {
        gap: 12px;
    }
    
    .contact-form {
        gap: 8px;
    }
    
    .contact-form textarea {
        min-height: 40px;
    }
    
    .legal-footer {
        margin-top: 20px;
    }
}

/* ═══════════════════════════════════════
   TOUCH TARGETS (min 44px for mobile)
═══════════════════════════════════════ */
@media (pointer: coarse) {
    .contact-form button {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .contact-form input,
    .contact-form textarea {
        min-height: 44px;
        padding: 12px;
    }
    
    .legal-links a {
        padding: 8px 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    .info a {
        padding: 4px 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ═══════════════════════════════════════
   PRINT STYLES
═══════════════════════════════════════ */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .bg, .logo-scene, .footer-line, .scroll-spacer {
        display: none;
    }
    
    .footer {
        padding: 0;
        padding-left: 0;
        min-height: auto;
    }
    
    .footer-row {
        opacity: 1;
        transform: none;
    }
    
    .contact-form {
        display: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    a::after {
        display: none;
    }
}
