/* Critical first-viewport styles for the public homepage. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

:root {
    --color-bg-primary: #fafafa;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #f3f3f3;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #666666;
    --color-text-inverse: #ffffff;
    --color-accent-red: #e74c3c;
    --color-accent-industrial: var(--color-accent-red);
    --color-badge-yellow: #FFEB3B;
    --color-border-light: rgba(0, 0, 0, 0.08);
    --color-border-medium: rgba(0, 0, 0, 0.15);
    --color-shadow-medium: rgba(0, 0, 0, 0.07);
    --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", "Courier New", monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-5xl: 4rem;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-tight: 1.2;
    --line-height-relaxed: 1.8;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --container-xl: 1200px;
    --radius-md: 4px;
    --transition-fast: 150ms ease;
    --transition-smooth: 300ms ease;
    --z-index-fixed: 1000;
    --z-index-overlay: 9999;
}

[data-theme="dark"] {
    --color-bg-primary: #0f0f0f;
    --color-bg-secondary: #1a1a1a;
    --color-bg-tertiary: #242424;
    --color-text-primary: #f5f5f5;
    --color-text-secondary: #b6b6b6;
    --color-border-light: rgba(255, 255, 255, 0.1);
    --color-border-medium: rgba(255, 255, 255, 0.16);
    --color-shadow-medium: rgba(0, 0, 0, 0.3);
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

html.home-page,
html.home-page body {
    height: auto;
}

body {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header {
    position: fixed;
    top: 0.5rem;
    left: 0;
    right: 0;
    z-index: var(--z-index-fixed);
    transition: var(--transition-smooth);
    background: transparent;
}

.header.scrolled {
    top: var(--spacing-md);
}

.header .container {
    display: flex;
    justify-content: center;
    max-width: calc(var(--container-xl) * 0.85);
    overflow: visible;
}

.header-inner {
    background-color: transparent;
    backdrop-filter: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.4rem 0.5rem 0.4rem 1.5rem;
    transition: var(--transition-smooth);
    width: 100%;
    overflow: visible;
    box-sizing: border-box;
}

.header.scrolled .header-inner {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(0, 0, 0, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .header.scrolled .header-inner {
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.header-content,
.logo a,
.nav,
.btn-buy,
.btn-cta {
    display: flex;
    align-items: center;
}

.header-content {
    justify-content: space-between;
    gap: var(--spacing-lg);
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    position: relative;
}

.logo a {
    gap: var(--spacing-xs);
    transition: var(--transition-fast);
    text-decoration: none;
}

.logo-img {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: block;
}

.logo .logo-text {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: calc(2.75rem * 0.9);
    font-weight: 400;
    line-height: 1;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    margin: 0.15rem 0 0 0;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nav {
    gap: var(--spacing-xs);
    white-space: nowrap;
    overflow: visible;
    flex-shrink: 0;
    min-width: 0;
}

.header-content .nav.mobile-mode:not(.active) {
    display: none !important;
    position: fixed !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.nav-link {
    color: var(--color-text-primary);
    font-size: calc(var(--font-size-sm) * 1.3);
    font-weight: var(--font-weight-medium);
    position: relative;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    text-transform: uppercase;
}

.btn-buy,
.btn-cta {
    justify-content: center;
    min-height: 44px;
    color: #fff;
    background: #1a1a1a;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    padding: 0.75rem 1.25rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.header .btn-buy {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
    z-index: 1;
}

.btn-cta {
    min-width: 160px;
    font-size: var(--font-size-base);
    padding: 1rem 2.5rem;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    z-index: 1000;
    flex-shrink: 0;
    position: relative;
}

.mobile-menu-toggle.show {
    display: flex;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.nav.mobile-mode {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(280px, 85vw);
    height: 100vh;
    background: var(--color-bg-secondary);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: 5rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    visibility: hidden;
    z-index: 99999;
}

.nav.mobile-mode.active {
    transform: translateX(0);
    visibility: visible;
}

.nav.mobile-mode .nav-link,
.nav.mobile-mode .btn-buy {
    width: 100%;
    justify-content: flex-start;
    padding: 1rem;
    text-align: left;
}

.theme-toggle {
    position: fixed;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    z-index: calc(var(--z-index-overlay) + 1);
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    pointer-events: auto;
}

.theme-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.theme-toggle .theme-icon-sun {
    fill: none;
    stroke: var(--color-text-primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.theme-toggle .theme-icon-dark {
    display: none;
    fill: none;
    stroke: var(--color-text-primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[data-theme="dark"] .theme-toggle .theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-dark {
    display: block;
}

.home-signin-link {
    position: fixed;
    top: var(--spacing-xs);
    right: calc(var(--spacing-xs) + 24px + var(--spacing-xs));
    z-index: calc(var(--z-index-overlay) + 1);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    text-decoration: none;
    line-height: 24px;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    margin: 0;
    padding-top: calc(var(--spacing-xl) + 6rem);
    padding-bottom: var(--spacing-xl);
    background: var(--color-bg-secondary);
}

.hero-content {
    text-align: center;
    opacity: 1;
    transform: none;
}

.hero-title {
    display: inline-block;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-primary);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: clamp(2.25rem, 5.4vw, 4.05rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.03em;
    line-height: var(--line-height-tight);
    text-transform: uppercase;
}

.hero-title-line {
    display: block;
    width: 100%;
    text-align: center;
}

.industrial-accent-yellow {
    position: relative;
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    background-color: var(--color-badge-yellow);
    padding: 0.15em 0.4em;
    margin-left: 0.2em;
    border-radius: var(--radius-md);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .industrial-accent-yellow {
    color: #000000;
}

.industrial-accent-yellow::after {
    content: '_';
    animation: cursor-blink 1s step-end infinite;
    margin-left: 0.05em;
}

@keyframes cursor-blink {
    0%, 50% {
        opacity: 1;
    }
    50.1%, 100% {
        opacity: 0;
    }
}

.hero-mockup {
    display: flex;
    justify-content: center;
    margin: var(--spacing-lg) 0;
}

.tablet-frame {
    position: relative;
    width: 100%;
    max-width: 780px;
    padding: 0.525rem;
    background: #000;
    border-radius: 2rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 0 0 3px #4a4a4a;
}

.tablet-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: calc(2rem - 0.525rem);
    contain: layout paint;
}

.hero-poster,
.hero-poster-image,
.hero-video {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.hero-poster-image,
.hero-video {
    object-fit: cover;
    background: #000;
}

.tablet-screen #video1 {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 180ms ease;
}

.tablet-screen.hero-video-ready #video1 {
    opacity: 1;
}

.volume-toggle {
    display: none;
}

.tablet-screen > .volume-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tablet-screen > .volume-toggle .volume-icon {
    position: absolute;
    width: 22px;
    height: 22px;
    stroke: #fff;
}

.tablet-screen > .volume-toggle .volume-icon-muted,
.tablet-screen > .volume-toggle.muted .volume-icon-unmuted {
    display: none;
}

.tablet-screen > .volume-toggle.muted .volume-icon-muted {
    display: block;
}

.hero-description {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    line-height: var(--line-height-relaxed);
}

.mono-label {
    letter-spacing: 0.02em;
}

.hero-description .mono-label {
    display: block;
    margin-top: 0.5em;
    font-size: var(--font-size-base);
}

.hero-cta-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0 auto;
    gap: 0.5rem;
    text-align: center;
}

.hero-subtext {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.2;
}

.taaft-featured-badge {
    position: relative;
    top: 44px;
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.taaft-featured-badge img {
    width: 300px;
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .header {
        top: var(--spacing-sm);
    }

    .header-inner {
        padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    }

    .logo-img {
        width: 28px;
        height: 28px;
    }

    .logo .logo-text {
        font-size: 2rem;
    }

    .hero {
        padding-top: calc(var(--spacing-lg) + 5rem);
    }
}

@media (max-width: 1250px) {
    body:has(.home-signin-link) .header {
        top: calc(var(--spacing-xs) + 24px + var(--spacing-xs));
    }

    body:has(.home-signin-link) .header.scrolled {
        top: calc(var(--spacing-xs) + 24px + var(--spacing-xs));
    }
}

@media (max-width: 600px) {
    body:has(.home-signin-link) .header {
        top: calc(var(--spacing-sm) + 24px + var(--spacing-xs));
    }

    body:has(.home-signin-link) .header.scrolled {
        top: calc(var(--spacing-sm) + 24px + var(--spacing-xs));
    }
}

@media (max-width: 850px) {
    .header-content .nav:not(.active) {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding-left: 1rem;
    }

    .logo-img {
        width: 24px;
        height: 24px;
    }

    .logo .logo-text {
        font-size: 1.75rem;
    }

    .hero-mockup {
        margin: var(--spacing-md) 0;
    }

    .btn-cta {
        padding: 0.875rem 2rem;
    }
}
