/* Fonts — font-display: swap prevents FOIT, improves LCP */
@font-face {
    font-family: "Signifier";
    src: url("Document fonts/Signifier-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Signifier";
    src: url("Document fonts/Signifier-RegularItalic.otf") format("opentype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Oceanic Grotesk";
    src: url("Document fonts/OceanicGrotesk-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Oceanic Grotesk";
    src: url("Document fonts/OceanicGrotesk-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    /* ─── Brand Color Tokens ───────────────────────────────────────
       Source: PARTAQ Visual Identity Guidelines v1.0
       Light Gray (#f7f7f6) dominates 70–90% of any composition.
       Black Ink (#000000) is reserved for type and graphic elements,
       limited to 10–30%. No other colours are permitted.
    ─────────────────────────────────────────────────────────────── */
    --color-bg:          #f7f7f6;   /* PMS Cool Grey 1 C  — Light Gray */
    --color-ink:         #000000;   /* PMS Black C        — Black Ink  */
    --color-mid:         #7f7f7f;   /* 50% gray — captions, dividers   */
    --color-muted:       #bababa;   /* 73% gray — disabled, footnotes  */
    --color-dark:        #2c2c2c;   /* 17% gray — secondary text       */

    /* Legacy aliases kept for compatibility */
    --bg-color:          var(--color-bg);
    --text-color:        var(--color-ink);
    --accent-color:      var(--color-ink);

    --font-serif: "Signifier", "Playfair Display", serif;
    --font-sans:  "Oceanic Grotesk", "Inter", sans-serif;

    --spacing-section: 15vh;
    --spacing-element: 2rem;
}

/* Preloader — full-screen fill hides all website elements until loading is done */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-video {
    width: 80px;
    height: 80px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Cursor effect — tattoo machine trail (desktop only) */
.cursor-effect {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    display: none;
}

.cursor-effect.active {
    display: block;
}

body.cursor-effect-active {
    cursor: none;
}

#cursor-trail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#cursor-needle {
    position: fixed;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: var(--color-ink);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    will-change: transform;
}

.cursor-effect.active #cursor-needle {
    opacity: 1;
}

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

html {
    -webkit-text-size-adjust: 100%;
    background-color: var(--bg-color);
}

html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: var(--bg-color);
    scroll-behavior: auto; /* Lenis handles smooth scroll on desktop; native on mobile avoids lag */
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Canvas-based Film Grain Overlay */
canvas.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: normal;
    opacity: 1;
}

/* Three.js Canvas — sits between logo layer (z:1) and text layer (z:3) */
#canvas-webgl {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: normal;
    contain: paint; /* Isolate for scroll performance */
    transform: translateZ(0); /* Promote to own compositor layer */
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    /* Regular */
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

/* Logo styling */
.hero-logo {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin-bottom: 2rem;
    display: block;
}

.hero-logo-wrap {
    display: inline-flex;
    align-items: flex-end;
}

.hero-tm {
    font-size: 0.35em;
    margin-left: 0.15em;
    margin-bottom: 0.5em;
}

/* Sticky Symbol */
#sticky-symbol-container {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 1001;
    pointer-events: none;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
}

#sticky-symbol {
    width: 40px;
    height: 40px;
    display: block;
    will-change: transform;
}

.footer-logo {
    height: 30px;
    width: auto;
    filter: brightness(0.2);
    /* Subtle look for footer */
}

/* Inline naming logo in titles (replaces "Partaq" text) */
.naming-logo-inline {
    display: inline-block;
    height: 1em;
    width: auto;
    vertical-align: middle;
    margin: 0 0.05em;
}

.tm {
    font-size: 0.5em;
    vertical-align: super;
    margin-left: 0.05em;
}

.footer-brand {
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(2rem, 5vw, 4rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-family: var(--font-sans);
    /* Subheadlines often sans in modern layouts, checking requirements... user said Serif headings, Sans body. Keeping h3 simple or serif. Let's stick to Serif for hierarchy */
    font-family: var(--font-serif);
    font-style: italic;
}

p {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    margin-bottom: 1rem;
    max-width: 60ch;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 500;
}

.hero-cta {
    display: inline-block;
    margin-top: 2.5rem;
    padding: 1rem 2rem;
    border: 1px solid var(--color-ink);
    border-radius: 0;
    text-decoration: none;
    color: var(--color-ink);
    background: transparent;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background 0.18s ease, color 0.18s ease;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    box-shadow: none;
}

.hero-cta:focus {
    outline: none;
}

.hero-cta:hover {
    background: var(--color-ink);
    color: #ffffff;
}

.hero-cta,
.btn,
a[href^="#"] {
    touch-action: manipulation;
}

small,
.small,
.footnote {
    font-size: 0.85rem;
    opacity: 0.7;
    display: block;
    margin-top: 0.5rem;
}

/* Global Layout */
main {
    position: relative;
    /* No z-index — lets hero child layers participate in the root stacking context */
}

section.panel {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10vw;
    position: relative;
}

/* Liquid canvas – full-bleed section background */
#liquid-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 12%,
        black 88%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 12%,
        black 88%,
        transparent 100%
    );
}

#permanent-yet-removable {
    overflow: hidden;
}

#permanent-yet-removable .content {
    position: relative;
    z-index: 1;
    color: #ffffff;
}

#permanent-yet-removable .content h2,
#permanent-yet-removable .content h3,
#permanent-yet-removable .content p {
    color: #ffffff;
}

/* Hero z-index layers ------------------------------------------------- */
#hero {
    align-items: stretch;
    text-align: center;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* .content stretches full height and pushes logo to top, text to bottom */
#hero > .content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 10vh 10vw;
    box-sizing: border-box;
}

/* Logo pinned to the top — above the canvas */
.hero-logo-layer {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Subtitle / small / CTA pinned to the bottom — above the canvas */
.hero-text-layer {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* All non-hero sections paint a solid background so they cover the
   fixed canvas as the user scrolls past the hero */
section.panel:not(#hero) {
    position: relative;
    z-index: 4;
    background: var(--bg-color);
}

/* Bottle sections: hero + what-is-partaq + rnd share one zone so the
   fixed canvas bottles are never cut by section boundaries */
#bottle-sections {
    position: relative;
    z-index: 3;
}

#bottle-sections section.panel {
    z-index: 3;
    background: transparent;
}

#bottle-sections #rnd .content {
    background: unset;
    padding: 1.5rem 0;
}

/* "What is Partaq" sits just above the canvas (z:3) with a transparent
   background so the spinning bottle is visible on the right side.
   Text still renders in front of the bottle (it is inside z:3 context).
   The canvas fade-out trigger handles the clean exit into section 3.
   Selector is maximally specific to override the rule above. */
section#what-is-partaq.panel {
    z-index: 3;
    background: transparent;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    overflow: hidden;
}

#hero p {
    max-width: 50ch;
}

#what-is-partaq {
    align-items: flex-start;
    /* Left */
}

#rnd {
    align-items: flex-end;
    text-align: right;
    opacity: 1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

/* Inside bottle-sections: transparent so bottles show through, no cutting */
#bottle-sections #rnd {
    background: transparent;
    z-index: 3;
    isolation: auto;
    contain: none;
}

/* R&D photo stack — documentary-style, chaotic placement to the left of content */
.rnd-photo-stack {
    flex: 0 0 auto;
    position: relative;
    width: min(52%, 420px);
    min-height: 320px;
}

.rnd-photo-stack-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.rnd-photo {
    position: absolute;
    width: 85%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    transition: z-index 0.5s ease;
}

/* Chaotic documentary-style offsets: larger shift between photos */
.rnd-photo:nth-child(1) { left: 0; top: 0; z-index: 1; }
.rnd-photo:nth-child(2) { left: 48px; top: 56px; z-index: 2; }
.rnd-photo:nth-child(3) { left: 24px; top: 112px; z-index: 3; }

#rnd .content {
    opacity: 1;
    flex: 1 1 50%;
    min-width: 280px;
}

#permanent-yet-removable {
    align-items: flex-start;
    /* Left, but maybe indented */
    padding-left: 15vw;
}

#visual-documentation {
    align-items: center;
    text-align: center;
    /* One rhythm: video↔row spacing = gap between removal thumbnails */
    --visual-doc-removal-gap: clamp(0.5rem, 1.5vw, 1.25rem);
}

/* Full width of padded section so breakout video + removal row share one track */
#visual-documentation .content {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

#visual-documentation .video-zoom-wrap {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    overflow-x: hidden;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* stretch so inner column is full bleed width (center was shrinking children) */
    align-items: stretch;
    margin-bottom: 1rem;
}

/* Same width as video: full track inside 100vw breakout */
#visual-documentation .visual-doc-media-column {
    width: 100%;
    max-width: none;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--visual-doc-removal-gap);
    box-sizing: border-box;
}

#visual-documentation .visual-doc-media-column .gallery-video-wrap {
    width: 100%;
    max-width: none;
}

#visual-documentation .footnote {
    text-align: left;
}

/* Tighter gap between the two description lines under the gallery */
#visual-documentation .content > p.footnote {
    margin-bottom: 0.35rem;
    max-width: none;
}

#visual-documentation .content > p.footnote.footnote-disclaimer {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

/* Removal row: same outer width as video — equal columns, gap between (no max-width % cap) */
.removal-stages {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: var(--visual-doc-removal-gap);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    align-self: stretch;
}

/* Space before footnote copy — overridden on ≤900px to match grid rhythm */
#visual-documentation .removal-stages {
    margin-bottom: clamp(1.75rem, 4.5vw, 3.25rem);
}

.removal-stage {
    margin: 0;
    padding: 0;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
}

.removal-stage-media {
    position: relative;
    width: 100%;
    min-width: 0;
}

.removal-stage-media--static {
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
}

.removal-stage-img {
    width: 100%;
    max-width: none;
    max-height: min(42vh, 320px);
    height: auto;
    aspect-ratio: 16 / 10;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    transform-origin: center center;
    /* Match .gallery-video edge crop */
    clip-path: inset(0 1% 0 1%);
}

.removal-stage-caption {
    margin: 0.75rem 0 0;
    padding: 0 0.35rem;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 400;
    font-style: normal;
    color: var(--color-mid);
    line-height: 1.4;
}

.footnote-disclaimer {
    margin-top: 1.5rem;
}

#for-artists {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 12vh;
}

/* Artists grid — 4 photos with name + studio */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    width: 100%;
    max-width: 1100px;
}

.artist-card {
    display: flex;
    flex-direction: column;
}

/* Shared wrapper: avatar photos and camera placeholder use identical dimensions */
.artist-photo-wrap,
.artist-card--camera .artist-camera-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    margin-bottom: 1rem;
    overflow: hidden;
}

.artist-photo-wrap .artist-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.artist-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.artist-name {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 400;
}

.artist-studio {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-mid);
}

/* 4th card: camera with blur + Join Partaq CTA */

.artist-photo--camera {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(4px) grayscale(1);
    transform: scale(1.05);
}

.artist-camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-muted);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    cursor: pointer;
}

.artist-card--camera .artist-camera-placeholder.hidden {
    display: none;
}

.artist-cta {
    margin-top: 0;
}

#access {
    min-height: 88vh;
    padding: clamp(4rem, 12vh, 7rem) 5vw;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

#access .access-bottles-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    contain: layout;
    pointer-events: none;
}

#access .access-bottles-bg canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#access .content {
    width: 100%;
    max-width: 60ch;
    position: relative;
    z-index: 1;  /* above the 3D canvas */
}

#access .content h2 {
    text-align: right;
}

#access .content p:first-of-type {
    text-align: left;
}

#access .content p:nth-of-type(2) {
    text-align: left;
}

#access .content p:nth-of-type(3) {
    text-align: left;
}

#access .cta-group {
    justify-content: center;
}

#dots-integration {
    flex-direction: column;
    align-items: stretch;
}

#dots-integration .content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 60ch;
}

#dots-integration .content h2 {
    width: 100%;
    text-align: left;
}

#dots-integration .content p {
    width: 100%;
    text-align: left;
}

.dots-platform-wrap {
    position: relative;
    margin-top: 2rem;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.dots-platform-mobile {
    position: absolute;
    left: 50%;
    width: 29%;
    max-width: 238px;
    height: auto;
    z-index: 1;
    transform: translateX(-50%) rotate(-8deg);
    animation: mobile-float 4s ease-in-out infinite;
}

@keyframes mobile-float {
    0%, 100% { transform: translateX(-50%) rotate(-8deg) translateY(0); }
    50% { transform: translateX(-50%) rotate(-8deg) translateY(-12px); }
}

.dots-platform-img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0 auto;
}

.dots-platform-badges {
    position: absolute;
    bottom: -15px;
    right: 20px;
}

.dots-seal-complete {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    animation: seal-rotate 20s linear infinite;
}

.dots-seal {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dots-symbol {
    position: relative;
    z-index: 1;
    width: 48px;
    height: auto;
    opacity: 1;
    animation: seal-rotate-counter 20s linear infinite;
}

@keyframes seal-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes seal-rotate-counter {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

#contact {
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    min-height: auto;
    padding: 10vh 0 0;  /* no horizontal or bottom padding — image goes edge-to-edge, no gap before footer */
    position: relative;
}

#contact .content {
    position: relative;
    z-index: 1;
    padding-left: 10vw;
    padding-right: 10vw;
    width: 100%;
    box-sizing: border-box;
}

.contact-model-wrap {
    width: 100vw;
    height: 85vh;
    min-height: 85vh;
    margin-top: 3rem;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

/* Soft blend from section bg (#f7f7f6) into the product photo — matches global light gray */
.contact-model-wrap::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: clamp(100px, 22vh, 280px);
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        var(--color-bg) 0%,
        color-mix(in srgb, var(--color-bg) 88%, transparent) 28%,
        color-mix(in srgb, var(--color-bg) 35%, transparent) 58%,
        transparent 100%
    );
}

/* Fallback when color-mix is unsupported */
@supports not (background: color-mix(in srgb, white 50%, black)) {
    .contact-model-wrap::before {
        background: linear-gradient(
            to bottom,
            #f7f7f6 0%,
            rgba(247, 247, 246, 0.82) 30%,
            rgba(247, 247, 246, 0.35) 60%,
            rgba(247, 247, 246, 0) 100%
        );
    }
}

.contact-model-wrap canvas,
.contact-model-wrap .contact-composition-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    position: relative;
    z-index: 0;
}

#contact .content p {
    text-align: left;
}

/* Lists */
ul.stats-list {
    list-style: none;
    margin-bottom: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

ul.stats-list li {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-family: var(--font-serif);
    font-size: 1.5rem;
}

/* Buttons */
.cta-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    align-items: stretch;
}

#waitlist-form[hidden],
#waitlist-success[hidden] {
    display: none !important;
}

.waitlist-input {
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-ink);
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    min-width: 360px;
    background: var(--color-bg);
    color: var(--color-ink);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    box-shadow: none;
}

.waitlist-input::placeholder {
    color: var(--color-muted);
}

.waitlist-input:focus {
    outline: none;
    border-color: var(--color-ink);
    box-shadow: none;
}

.waitlist-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

#waitlist-error[hidden] {
    display: none !important;
}

.waitlist-error {
    margin: 0.75rem 0 0;
    max-width: 640px;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #8a1c1c;
    text-align: left;
}

.btn.primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.waitlist-success {
    margin-top: 2rem;
    max-width: 640px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.5);
    text-align: left;
}

.waitlist-success-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.2;
}

.waitlist-success-copy {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
}

.waitlist-success-copy a {
    color: inherit;
    text-underline-offset: 3px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 0;
    text-decoration: none;
    text-transform: uppercase;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    box-shadow: none;
}

.btn:focus {
    outline: none;
}

.btn.primary {
    background-color: var(--color-ink);
    color: #ffffff;
    border: 1px solid var(--color-ink);
}

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

.btn.secondary {
    background-color: transparent;
    color: var(--color-ink);
    border: 1px solid var(--color-ink);
}

.btn.secondary:hover {
    background-color: var(--color-ink);
    color: #ffffff;
}

/* Gallery Video */
.gallery-video-wrap {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
}

.gallery-video {
    width: 100%;
    max-width: 100vw;
    max-height: 60vh;
    display: block;
    object-fit: cover;
    border-radius: 4px;
    transform-origin: center center;
    /* Crop thin black lines at left/right edges */
    clip-path: inset(0 1% 0 1%);
}

.gallery-play-btn {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid currentColor;
    background: transparent;
    color: #fff;
    cursor: pointer;
    opacity: 0.9;
    mix-blend-mode: difference;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.gallery-play-btn:hover {
    transform: scale(1.08);
    opacity: 1;
}

.gallery-play-btn:focus {
    outline: 2px solid var(--color-ink);
    outline-offset: 4px;
}

.gallery-play-btn .gallery-play-icon {
    width: 52px;
    height: 52px;
    display: block;
}

/* Video popup modal */
.video-popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-popup.is-open {
    opacity: 1;
    visibility: visible;
}

.video-popup[hidden] {
    display: none !important;
}

.video-popup:not([hidden]).is-open {
    display: flex !important;
}

.video-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.video-popup-inner {
    position: relative;
    width: 100%;
    max-width: 900px;
    z-index: 1;
}

.video-popup-video {
    width: 100%;
    max-height: 85vh;
    display: block;
    border-radius: 0;
    background: #000;
}

.video-popup-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.video-popup-close:hover {
    opacity: 1;
}

.video-popup-close:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* Footer */
footer {
    padding: 5vw;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

footer nav,
footer .social {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

footer .footer-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

footer .footer-link:hover {
    opacity: 0.7;
}

footer .social-icon {
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

footer .social-icon:hover {
    opacity: 0.7;
}

/* Tablet and below */
@media (max-width: 900px) {
    section.panel {
        padding: 8vw 6vw;
    }

    #contact {
        padding-left: 0;
        padding-right: 0;
    }

    #hero > .content {
        padding: 8vh 6vw;
    }

    .hero-logo {
        max-width: 420px;
    }

    .artists-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    #rnd {
        align-items: flex-start;
        text-align: left;
        flex-direction: column;
    }

    .rnd-photo-stack {
        width: 100%;
        max-width: 340px;
        min-height: 320px;
        order: -1;
    }

    .rnd-photo {
        max-height: 200px;
    }

    #permanent-yet-removable {
        padding-left: 6vw;
    }

    #access .content h2 {
        text-align: left;
    }

    .dots-platform-mobile {
        width: 35%;
        max-width: 180px;
    }

    .dots-platform-badges {
        bottom: -8px;
        right: 10px;
    }

    .dots-seal-complete {
        width: 100px;
        height: 100px;
    }

    .dots-symbol {
        width: 32px;
    }

    /*
     * Single rhythm (px-bounded so row/column/sides read the same):
     * video↔grid | grid gutters | image↔caption | horizontal inset | space before footnotes
     */
    #visual-documentation {
        --visual-doc-removal-gap: clamp(10px, 2.75vw, 14px);
    }

    #visual-documentation .visual-doc-media-column {
        gap: var(--visual-doc-removal-gap);
    }

    /* No extra margin under the block — spacing to footnotes comes from .removal-stages only */
    #visual-documentation .video-zoom-wrap {
        margin-bottom: 0;
    }

    /* Removal timeline: 2×2 grid */
    #visual-documentation .removal-stages {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: var(--visual-doc-removal-gap);
        overflow: visible;
        /* Side inset = same as internal gutter (safe-area wins when larger) */
        padding-left: max(var(--visual-doc-removal-gap), env(safe-area-inset-left, 0px));
        padding-right: max(var(--visual-doc-removal-gap), env(safe-area-inset-right, 0px));
        padding-bottom: 0;
        box-sizing: border-box;
        align-items: start;
        margin-top: 0;
        margin-bottom: calc(var(--visual-doc-removal-gap) * 2);
    }

    /* Block layout avoids flex strut under the video */
    #visual-documentation .gallery-video-wrap {
        display: block;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    #visual-documentation .removal-stage {
        min-width: 0;
        width: 100%;
        max-width: none;
    }

    #visual-documentation .removal-stage-caption {
        margin-top: var(--visual-doc-removal-gap);
        margin-bottom: 0;
    }

    /* Don’t stack .footnote margin-top with .removal-stages margin-bottom */
    #visual-documentation .video-zoom-wrap + p.footnote {
        margin-top: 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --spacing-section: 10vh;
        --spacing-element: 1.5rem;
    }

    #sticky-symbol-container {
        top: max(20px, env(safe-area-inset-top));
        left: max(20px, env(safe-area-inset-left));
    }

    #sticky-symbol {
        width: 56px;
        height: 56px;
    }

    section.panel {
        padding: 6vh 5vw;
        min-height: auto;
    }

    #contact {
        padding-left: 0;
        padding-right: 0;
    }

    #hero {
        min-height: 100vh;
    }

    #hero > .content {
        padding: 6vh 5vw 8vh;
        min-height: 100vh;
        position: relative;
        justify-content: flex-end;
    }

    .hero-logo-layer {
        position: absolute;
        top: calc(50% - 42px);
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .hero-logo {
        max-width: 380px;
        margin-bottom: 1.5rem;
    }

    .hero-text-layer .subtitle {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .hero-text-layer .small {
        font-size: 1rem;
    }

    .hero-cta {
        padding: 1rem 2rem;
        font-size: 0.9rem;
        margin-top: 1.5rem;
    }

    #hero p {
        max-width: none;
    }

    h2 {
        font-size: clamp(2.75rem, 11vw, 3.5rem);
        margin-bottom: 1rem;
    }

    h3 {
        font-size: clamp(1.875rem, 6.5vw, 2.375rem);
    }

    p {
        font-size: 1rem;
        margin-bottom: 0.875rem;
    }

    #what-is-partaq {
        align-items: flex-start;
    }

    #rnd {
        align-items: flex-start;
        text-align: left;
        flex-direction: column;
    }

    .rnd-photo-stack {
        min-height: 320px;
        margin-bottom: 1rem;
    }

    ul.stats-list {
        max-width: none;
    }

    ul.stats-list li {
        font-size: 1.25rem;
        padding: 0.875rem 0;
    }

    #permanent-yet-removable {
        padding-left: 5vw;
        padding-right: 5vw;
    }

    #visual-documentation .video-zoom-wrap {
        margin-bottom: 0;
    }

    /* Inherits grid + gap token from 900px; safe-area padding uses same --visual-doc-removal-gap */
    #visual-documentation .removal-stages {
        padding-left: max(var(--visual-doc-removal-gap), env(safe-area-inset-left, 0px));
        padding-right: max(var(--visual-doc-removal-gap), env(safe-area-inset-right, 0px));
        margin-bottom: calc(var(--visual-doc-removal-gap) * 2);
    }

    #visual-documentation .removal-stage-img {
        max-height: min(22vh, 200px);
        aspect-ratio: 16 / 10;
    }

    #visual-documentation .removal-stage-caption {
        font-size: 0.85rem;
        line-height: 1.35;
    }

    #visual-documentation .content > p.footnote {
        padding-left: 0;
        padding-right: 0;
        word-break: break-word;
    }

    .gallery-video {
        max-height: 70vh;
    }

    .gallery-play-btn {
        width: 64px;
        height: 64px;
    }

    .gallery-play-btn .gallery-play-icon {
        width: 44px;
        height: 44px;
    }

    .video-popup {
        padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    }

    /* Close was negative top — keep in safe area, min 44px touch target */
    .video-popup-close {
        position: fixed;
        top: max(0.75rem, env(safe-area-inset-top, 0px));
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        left: auto;
        width: 44px;
        height: 44px;
        z-index: 10001;
    }

    .video-popup-video {
        max-height: min(82vh, 100dvh - 2.5rem);
    }

    #for-artists {
        padding-top: 8vh;
    }

    .artists-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-top: 2rem;
    }

    .artist-photo-wrap,
    .artist-card--camera .artist-camera-wrap {
        aspect-ratio: 3 / 4;
    }

    #access {
        min-height: 72vh;
        padding: 5rem 5vw 4rem;
    }

    #access .content h2 {
        text-align: center;
    }

    #access .content h2 .naming-logo-block {
        display: block;
        margin-top: 0.25em;
    }

    #dots-integration {
        flex-direction: column;
        gap: 1.5rem;
    }

    .dots-platform-wrap {
        min-height: 40vh;
        margin-top: 1.5rem;
    }

    .dots-platform-img {
        width: 100%;
        max-width: none;
    }

    .dots-platform-mobile {
        width: 45%;
        max-width: 140px;
    }

    .dots-platform-badges {
        bottom: -10px;
        right: 8px;
    }

    .dots-seal-complete {
        width: 120px;
        height: 120px;
    }

    .dots-symbol {
        width: 44px;
    }

    #contact {
        padding-top: 8vh;
    }

    .cta-group {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
        align-items: stretch;
    }

    .waitlist-input {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .waitlist-success {
        max-width: none;
        margin-top: 1.5rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn.primary {
        width: 100%;
    }

    footer {
        flex-direction: column;
        gap: 1.5rem;
        padding: 6vw 5vw;
        text-align: center;
    }

    footer nav,
    footer .social {
        justify-content: center;
    }

    .footer-logo {
        height: 24px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    #sticky-symbol-container {
        top: 16px;
        left: 16px;
    }

    #sticky-symbol {
        width: 48px;
        height: 48px;
    }

    .hero-logo {
        max-width: 320px;
    }

    section.panel {
        padding: 5vh 4vw;
    }

    #contact {
        padding-left: 0;
        padding-right: 0;
    }

    #hero > .content {
        padding: 5vh 4vw 6vh;
    }

    h2 {
        font-size: 2.125rem;
    }

    .dots-platform-mobile {
        width: 50%;
        max-width: 120px;
    }

    .dots-seal-complete {
        width: 96px;
        height: 96px;
    }

    .dots-symbol {
        width: 34px;
    }

    #visual-documentation .removal-stage-caption {
        font-size: 0.8rem;
    }

    #visual-documentation .removal-stage-img {
        max-height: min(20vh, 180px);
    }

    #visual-documentation .removal-stages {
        margin-bottom: calc(var(--visual-doc-removal-gap) * 2);
    }
}