/* ============================================================
   Polar Studios — design system
   One accent, hairlines, whitespace. The media carries the color.
   ============================================================ */

@font-face {
    font-family: 'Exo 2';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/exo-v25-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Exo 2';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/exo-v25-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Exo 2';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/exo-v25-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Exo 2';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/exo-v25-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Cinzel Decorative';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/cinzel-decorative-v19-latin-700.woff2') format('woff2');
}

:root {
    --bg: #0b0b0d;
    --bg-raised: #101013;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #ececee;
    --muted: #9b9ba3;
    --accent: #7dd8d0;
    --accent-ink: #06201e;
    --font-display: 'Exo 2', system-ui, sans-serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
    --container: 72rem;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

/* ---------- layout ---------- */

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 7rem 0;
}

.section + .section {
    border-top: 1px solid var(--line);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.section-lead {
    color: var(--muted);
    max-width: 40rem;
    font-size: 1.05rem;
}

/* ---------- navigation ---------- */

.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.nav.scrolled {
    background: rgba(11, 11, 13, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--line);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}

.nav-logo em {
    font-style: normal;
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 1.75rem;
    list-style: none;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--text);
}

.lang-toggle {
    display: flex;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.lang-toggle button {
    appearance: none;
    background: none;
    border: none;
    color: var(--muted);
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.lang-toggle button.active {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}

/* ---------- buttons & chips ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.25s var(--ease-out), background 0.25s, border-color 0.25s, color 0.25s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-ghost {
    border-color: var(--line-strong);
    color: var(--text);
    background: transparent;
}

.btn-ghost:hover {
    border-color: var(--text);
    transform: translateY(-2px);
}

.btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(125, 216, 208, 0.35);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
}

.chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.chip.neutral {
    color: var(--muted);
    border-color: var(--line-strong);
}

.chip.neutral::before {
    background: var(--muted);
}

/* ---------- hero: scroll-driven journey ---------- */

.journey {
    height: 420vh;
    position: relative;
}

.journey-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: var(--bg);
}

.journey-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.journey-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 45% at 50% 52%, rgba(11, 11, 13, 0.72) 0%, rgba(11, 11, 13, 0.45) 45%, rgba(11, 11, 13, 0) 72%),
        linear-gradient(to bottom, rgba(11, 11, 13, 0.55) 0%, rgba(11, 11, 13, 0.12) 30%, rgba(11, 11, 13, 0.12) 70%, rgba(11, 11, 13, 0.85) 100%);
    pointer-events: none;
}

.journey-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--bg);
    transition: opacity 0.6s;
    z-index: 3;
}

.journey-loading.done {
    opacity: 0;
    pointer-events: none;
}

.journey-chapters {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1.5rem;
    z-index: 2;
    pointer-events: none;
}

.chapter {
    grid-area: 1 / 1;
    max-width: 44rem;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.chapter.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chapter .chapter-index {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--accent);
    text-transform: uppercase;
    display: block;
    margin-bottom: 1.1rem;
}

.chapter h1,
.chapter h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.9rem, 5vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin-bottom: 1.1rem;
    text-wrap: balance;
}

.chapter p {
    color: rgba(236, 236, 238, 0.75);
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    max-width: 34rem;
    margin: 0 auto 1.6rem;
}

.chapter .chapter-links {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* progress rail */

.journey-rail {
    position: absolute;
    right: 1.6rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    z-index: 4;
}

.journey-rail::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--line-strong);
    z-index: -1;
}

.rail-dot {
    appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.rail-dot:hover {
    border-color: var(--text);
}

.rail-dot.active {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.25);
}

/* tour button */

.journey-tour {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    appearance: none;
    background: rgba(11, 11, 13, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 0.6rem 1.3rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s;
}

.journey-tour:hover {
    border-color: var(--accent);
}

.journey-tour svg {
    width: 12px;
    height: 12px;
}

.journey-tour.playing svg .icon-play {
    display: none;
}

.journey-tour:not(.playing) svg .icon-stop {
    display: none;
}

/* reduced motion / fallback: hero becomes a static stacked intro */

.journey.static {
    height: auto;
}

.journey.static .journey-stage {
    position: relative;
    height: auto;
    min-height: 70vh;
    display: grid;
    place-items: center;
    padding: 8rem 1.5rem 5rem;
}

.journey.static .journey-video {
    position: absolute;
}

.journey.static .journey-chapters {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding: 0;
}

.journey.static .chapter {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.journey.static .journey-rail,
.journey.static .journey-tour,
.journey.static .journey-loading {
    display: none;
}

/* ---------- project cards ---------- */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 3rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-raised);
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.project-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-4px);
}

.project-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.project-card:hover .project-media img {
    transform: scale(1.03);
}

/* typographic media (KAO) */

.project-media.type {
    display: grid;
    place-items: center;
    background:
        repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255, 255, 255, 0.025) 3px 4px),
        radial-gradient(ellipse at 50% 60%, #12201f 0%, var(--bg-raised) 70%);
}

.project-media.type span {
    font-family: var(--font-mono);
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    letter-spacing: 0.35em;
    color: var(--accent);
    text-shadow: 0 0 24px rgba(125, 216, 208, 0.25);
}

/* teaser media */

.project-media.teaser {
    display: grid;
    place-items: center;
    background: var(--bg-raised);
}

.project-media.teaser span {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--muted);
    opacity: 0.5;
}

.project-body {
    padding: 1.4rem 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    flex: 1;
}

.project-body h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

.project-body p {
    color: var(--muted);
    font-size: 0.92rem;
    flex: 1;
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 0.4rem;
}

.project-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.project-link::after {
    content: '→';
    transition: transform 0.25s var(--ease-out);
}

.project-card:hover .project-link::after {
    transform: translateX(4px);
}

/* ---------- studio ---------- */

.studio-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: start;
}

.studio-facts {
    list-style: none;
    border-top: 1px solid var(--line);
}

.studio-facts li {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

.studio-facts .fact-key {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.15rem;
}

/* ---------- footer ---------- */

.footer {
    border-top: 1px solid var(--line);
    padding: 3.5rem 0 2.5rem;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.footer-socials {
    display: flex;
    gap: 0.6rem;
}

.footer-socials a {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color 0.25s, transform 0.25s var(--ease-out);
}

.footer-socials a:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.footer-socials img {
    width: 17px;
    height: 17px;
    filter: grayscale(1) brightness(1.6);
    opacity: 0.8;
}

.footer-socials a:hover img {
    filter: none;
    opacity: 1;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

/* ---------- reveal on scroll ---------- */

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- legal pages ---------- */

.legal-body {
    max-width: 46rem;
    margin: 0 auto;
    padding: 9rem 1.5rem 6rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.legal-body h1 {
    font-family: var(--font-display);
    color: var(--text);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.legal-body h2, .legal-body h3 {
    font-family: var(--font-display);
    color: var(--text);
    font-size: 1.15rem;
    margin: 2.2rem 0 0.7rem;
}

.legal-body p {
    margin-bottom: 0.9rem;
}

.legal-body a {
    color: var(--accent);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .studio-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
    }
    .section {
        padding: 4.5rem 0;
    }
    .journey {
        height: 380vh;
    }
    .journey-rail {
        right: 0.9rem;
    }
}
