/* ============================================================================
   DZIEDZIC-BUD — style.css
   Direction: "Konstrukcja" — industrial-modern
   Palette: ink graphite / warm concrete / safety amber
   Type:  Big Shoulders Display (display) · Manrope (body) · IBM Plex Mono (labels)
   ========================================================================== */

:root {
    /* Palette */
    --ink-900: #0E1116;
    --ink-800: #151A22;
    --ink-700: #1D2430;
    --ink-600: #2A3342;
    --paper: #F3F1EC;
    --white: #FFFFFF;
    --amber: #FFB020;
    /* Darker amber for use on light backgrounds (4.5:1+ against --paper) */
    --amber-deep: #8A5200;

    /* Text */
    --text-light: #1A202A;
    --text-muted-light: #5B6472;
    --text-on-dark: #F3F1EC;
    --text-muted-dark: #9AA3B2;

    /* Hairlines */
    --line-light: rgba(20, 25, 34, 0.14);
    --line-dark: rgba(243, 241, 236, 0.14);

    /* Typography */
    --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
    --font-body: 'Manrope', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

    /* Layout */
    --navbar-height: 72px;
    --transition-speed: 0.3s;
}

/* ============================================================================
   Reset & base
   ========================================================================== */

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

html {
    /* offset for anchor jumps below the fixed navbar */
    scroll-padding-top: calc(var(--navbar-height) + 16px);
    scroll-behavior: smooth;
    /* Must clip on <html> too (not only on <body>): on mobile the layout
       viewport would otherwise grow to the document width whenever content
       overflows, stretching the fixed navbar/lightbox and enabling panning. */
    overflow-x: clip;
    /* Firefox scrollbar theming */
    scrollbar-color: var(--ink-600) var(--ink-900);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-light);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    /* decorative offsets (about frame etc.) must never create a horizontal scroll */
    overflow-x: clip;
}

/* Film grain over the whole page for a tactile, printed feel */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img {
    max-width: 100%;
    display: block;
}

ul,
ol {
    list-style: none;
}

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

button {
    font-family: inherit;
}

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

/* Chrome scrollbar (WebKit) */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--ink-900);
}

::-webkit-scrollbar-thumb {
    background: var(--ink-600);
    border: 2px solid var(--ink-900);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--amber);
}

/* Consistent, high-visibility focus ring */
:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

/* ============================================================================
   Utilities
   ========================================================================== */

.container {
    width: min(1280px, 100% - 48px);
    margin-inline: auto;
}

.hidden {
    display: none;
}

/* Technical micro-labels (indices, counters, meta) */
.mono {
    font-family: var(--font-mono);
}

/* Inline SVG icons (self-hosted replacement for the Font Awesome web font).
   Sized in em so they follow the surrounding font-size. */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

/* ============================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
    padding: 18px 30px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.btn .icon {
    transition: transform 0.25s ease;
}

.btn:hover .icon {
    transform: translateX(4px);
}

.btn-primary {
    background: var(--amber);
    border-color: var(--amber);
    color: var(--ink-900);
}

.btn-primary:hover {
    background: var(--white);
    border-color: var(--white);
    color: var(--ink-900);
}

.btn-ghost {
    background: transparent;
    border-color: rgba(243, 241, 236, 0.45);
    color: var(--white);
}

.btn-ghost:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.btn-dark {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: var(--amber);
}

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

.btn-dark:focus-visible {
    outline-color: var(--ink-900);
}

/* ============================================================================
   Scroll progress bar
   ========================================================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--amber);
    z-index: 1100;
    pointer-events: none;
}

/* ============================================================================
   Navbar
   ========================================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    /* solid fallback (no-JS); JS switches to transparent over the hero */
    background: var(--ink-900);
    border-bottom: 1px solid transparent;
    transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.js .navbar {
    background: transparent;
}

.js .navbar.scrolled {
    background: rgba(14, 17, 22, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--line-dark);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-size: 0;
}

.brand a {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.75rem;
    line-height: 1;
    letter-spacing: 0.04em;
    color: var(--white);
    display: inline-flex;
    align-items: baseline;
    transition: color var(--transition-speed) ease;
}

.brand a:hover {
    color: var(--amber);
}

.brand-accent {
    color: var(--amber);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    position: relative;
    display: inline-block;
    font-weight: 600;
    font-size: 0.84rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(243, 241, 236, 0.72);
    padding: 10px 14px;
    transition: color 0.25s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    background: var(--amber);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-links a.nav-cta {
    margin-left: 12px;
    background: var(--amber);
    color: var(--ink-900);
    padding: 13px 22px;
}

.nav-links a.nav-cta::after {
    display: none;
}

.nav-links a.nav-cta:hover,
.nav-links a.nav-cta.active {
    background: var(--white);
    color: var(--ink-900);
}

#hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--white);
    padding: 8px;
    transition: color var(--transition-speed) ease;
}

#hamburger:hover {
    color: var(--amber);
}

#hamburger .icon {
    width: 1.4rem;
    height: 1.4rem;
}

/* Mobile dropdown panel */
#dropdown-nav {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    z-index: 999;
    background: var(--ink-900);
    border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

#dropdown-nav-items {
    padding: 8px 24px 28px;
}

#dropdown-nav-items ul {
    display: flex;
    flex-direction: column;
}

#dropdown-nav-items a {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.7rem;
    line-height: 1;
    letter-spacing: 0.05em;
    color: var(--text-on-dark);
    padding: 18px 4px;
    border-bottom: 1px solid var(--line-dark);
    transition: color var(--transition-speed) ease, padding-left var(--transition-speed) ease;
}

#dropdown-nav-items a:last-child {
    border-bottom: 0;
}

#dropdown-nav-items a:hover {
    color: var(--amber);
    padding-left: 12px;
}

/* ============================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: flex-end;
    background: var(--ink-900);
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.9) contrast(1.02);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(14, 17, 22, 0.9) 0%, rgba(14, 17, 22, 0.55) 45%, rgba(14, 17, 22, 0.15) 100%),
        linear-gradient(0deg, rgba(14, 17, 22, 0.85) 0%, rgba(14, 17, 22, 0) 45%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1280px, 100% - 48px);
    margin-inline: auto;
    padding-top: calc(var(--navbar-height) + 48px);
    padding-bottom: clamp(32px, 5vh, 56px);
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.76rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted-dark);
    margin-bottom: 24px;
}

.hero-eyebrow::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--amber);
    flex-shrink: 0;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    font-size: clamp(3.8rem, 12.5vw, 10rem);
    line-height: 0.88;
    letter-spacing: 0.005em;
    color: var(--white);
    margin-bottom: 20px;
}

.hero-title-line {
    display: block;
}

.hero-title-accent {
    color: var(--amber);
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 500;
    color: #D6DBE3;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: clamp(40px, 7vh, 72px);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: clamp(28px, 6vw, 72px);
    border-top: 1px solid var(--line-dark);
    padding-top: 24px;
    max-width: 100%;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1;
    color: var(--white);
}

.hero-stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted-dark);
}

/* Staggered entrance on page load (JS-gated like other scroll states) */
@keyframes hero-rise {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.js .hero-content > * {
    animation: hero-rise 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.js .hero-content > *:nth-child(1) { animation-delay: 0.15s; }
.js .hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.js .hero-content > *:nth-child(3) { animation-delay: 0.35s; }
.js .hero-content > *:nth-child(4) { animation-delay: 0.45s; }
.js .hero-content > *:nth-child(5) { animation-delay: 0.6s; }

/* ============================================================================
   Services ticker (decorative marquee)
   ========================================================================== */

.ticker {
    background: var(--amber);
    color: var(--ink-900);
    overflow: hidden;
    border-top: 2px solid var(--ink-900);
    border-bottom: 2px solid var(--ink-900);
    position: relative;
    z-index: 3;
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: ticker-scroll 32s linear infinite;
}

.ticker:hover .ticker-track {
    animation-play-state: paused;
}

.ticker-group {
    display: flex;
    align-items: center;
    gap: 44px;
    padding: 12px 44px 12px 0;
}

.ticker-item {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(1.2rem, 2.2vw, 1.7rem);
    letter-spacing: 0.05em;
    white-space: nowrap;
    line-height: 1.3;
}

.ticker-sep {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: rgba(14, 17, 22, 0.5);
    white-space: nowrap;
}

@keyframes ticker-scroll {
    to {
        transform: translateX(-50%);
    }
}

/* ============================================================================
   Sections — shared
   ========================================================================== */

.section {
    position: relative;
    padding-block: clamp(72px, 10vw, 132px);
}

.section-header {
    margin-bottom: clamp(36px, 5vw, 60px);
}

.section-header--split {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 64px;
    flex-wrap: wrap;
}

/* Blueprint-style section index: "01 ─────" */
.section-index {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    color: var(--amber);
    margin-bottom: 18px;
}

.section-index::after {
    content: "";
    width: 44px;
    height: 1px;
    background: currentColor;
    opacity: 0.5;
}

/* On light backgrounds the bright amber fails WCAG AA contrast (1.62:1),
   so the index labels switch to the darker amber there. */
.section-about .section-index,
.section-gallery .section-index {
    color: var(--amber-deep);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    font-size: clamp(2.7rem, 5.5vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: 0.01em;
    color: var(--ink-900);
}

.section-lead {
    max-width: 52ch;
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--text-muted-light);
}

/* ============================================================================
   01 · About
   ========================================================================== */

.section-about {
    background: var(--paper);
}

.about-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(40px, 6vw, 88px);
    align-items: center;
}

.about-lead {
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: var(--text-light);
    margin-bottom: 20px;
}

.about-text p + p {
    margin-top: 14px;
}

.about-text p {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--text-light);
}

.about-media {
    position: relative;
}

/* Offset amber frame behind the photo */
.about-media::before {
    content: "";
    position: absolute;
    top: -24px;
    left: -24px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--amber);
}

.about-media img {
    position: relative;
    z-index: 1;
    width: 100%;
    box-shadow: 0 24px 60px rgba(14, 17, 22, 0.18);
}

/* ============================================================================
   02 · Services (dark hairline grid)
   ========================================================================== */

.section-services {
    background: var(--ink-900);
}

.section-services .section-title {
    color: var(--white);
}

.section-services .section-lead {
    color: var(--text-muted-dark);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--line-dark);
    border-left: 1px solid var(--line-dark);
}

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: clamp(28px, 3.5vw, 44px);
    min-height: 300px;
    border-right: 1px solid var(--line-dark);
    border-bottom: 1px solid var(--line-dark);
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

.service-card:hover,
.service-card:focus-visible {
    background: var(--ink-800);
}

.service-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.service-card-index {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--amber);
}

.service-icon {
    font-size: 2.3rem;
    color: var(--text-muted-dark);
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.service-card:hover .service-icon {
    color: var(--amber);
    transform: translateY(-4px);
}

.service-title {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--white);
}

.service-description {
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--text-muted-dark);
    max-width: 48ch;
}

.service-card-cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--amber);
    opacity: 0.65;
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.service-card:hover .service-card-cta,
.service-card:focus-visible .service-card-cta {
    opacity: 1;
    transform: translateX(8px);
}

/* ============================================================================
   03 · Gallery
   ========================================================================== */

.section-gallery {
    background: var(--paper);
}

.gallery-toolbar {
    margin-bottom: clamp(24px, 4vw, 40px);
}

.gallery-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--line-light);
    background: var(--white);
    padding: 5px;
}

.gallery-tab {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted-light);
    background: transparent;
    padding: 12px 22px;
    transition: color 0.25s ease, background-color 0.25s ease;
}

.gallery-tab:hover {
    color: var(--ink-900);
}

.gallery-tab.active {
    background: var(--ink-900);
    color: var(--white);
}

/* No opacity fade here: --text-muted-light at 55% opacity on white
   fails WCAG AA contrast (2.34:1); the muted color alone is subtle enough. */
.gallery-tab-count {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: inherit;
}

.gallery-tab.active .gallery-tab-count {
    color: var(--amber);
    opacity: 1;
}

.project-cards {
    display: grid;
    /* minmax(0, 1fr) — a plain 1fr keeps an "auto" lower bound, so a track
       would grow to the card's min-content (nowrap title + photo count) and
       push the whole document wider than the viewport on narrow screens. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 22px);
}

.project-card {
    /* Reset native button styling (cards are <button> elements for keyboard access) */
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    background: var(--white);
    border: 1px solid var(--line-light);
    /* Second half of the minmax(0, 1fr) guard: never force the track wider */
    min-width: 0;
    transition: border-color var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.project-card.hidden {
    display: none;
}

/* No-JS fallback: without scripts the tabs are inert, so hide the toolbar
   and unhide every project card — all 14 projects stay visible, not 6. */
html:not(.js) .gallery-toolbar {
    display: none;
}

html:not(.js) .project-card.hidden {
    display: block;
}

.project-card:hover,
.project-card:focus-visible {
    border-color: var(--ink-900);
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(14, 17, 22, 0.12);
}

.project-card-image {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(190px, 22vw, 260px);
    overflow: hidden;
    background: var(--ink-700);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-card-image img {
    transform: scale(1.06);
}

/* "Zobacz" chip that slides in over the image on hover */
.project-card-image::after {
    content: "Zobacz \2192";
    position: absolute;
    right: 14px;
    bottom: 14px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--ink-900);
    color: var(--amber);
    padding: 8px 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.project-card:hover .project-card-image::after,
.project-card:focus-visible .project-card-image::after {
    opacity: 1;
    transform: none;
}

.project-card-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--line-light);
}

.project-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.25rem;
    line-height: 1.05;
    letter-spacing: 0.03em;
    color: var(--ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-count {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--text-muted-light);
    border: 1px solid var(--line-light);
    padding: 5px 10px;
    white-space: nowrap;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.project-card:hover .project-card-count {
    color: var(--ink-900);
    border-color: var(--ink-900);
}

/* ============================================================================
   Lightbox
   ========================================================================== */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 14, 0.94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: min(1200px, 90vw);
    max-height: 82vh;
    object-fit: contain;
    border: 1px solid var(--line-dark);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.96);
    transition: transform 0.35s ease;
}

.lightbox-overlay.active .lightbox-image {
    transform: none;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    /* Reset native button styling */
    font-family: inherit;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 17, 22, 0.7);
    border: 1px solid var(--line-dark);
    color: var(--white);
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.lightbox-close {
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
    line-height: 1;
}

.lightbox-close:hover {
    background: var(--amber);
    color: var(--ink-900);
    border-color: var(--amber);
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 1.1rem;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--amber);
    color: var(--ink-900);
    border-color: var(--amber);
}

/* Thumbnails strip */
.lightbox-thumbs {
    position: absolute;
    bottom: 88px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    max-width: min(90vw, 720px);
    overflow-x: auto;
    padding: 8px;
    background: rgba(14, 17, 22, 0.8);
    border: 1px solid var(--line-dark);
    scrollbar-width: none;
}

.lightbox-thumbs::-webkit-scrollbar {
    display: none;
}

/* Lightbox thumbnails are <button> elements wrapping a small <img> */
.lightbox-thumb-btn {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 0;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.45;
    line-height: 0;
    transition: opacity 0.25s ease, border-color 0.25s ease;
}

.lightbox-thumb {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: cover;
}

.lightbox-thumb-btn:hover {
    opacity: 0.8;
}

.lightbox-thumb-btn.active {
    opacity: 1;
    border-color: var(--amber);
}

.lightbox-counter {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--text-on-dark);
    background: rgba(14, 17, 22, 0.8);
    border: 1px solid var(--line-dark);
    padding: 8px 16px;
}

/* ============================================================================
   04 · Cooperation (amber band)
   ========================================================================== */

.section-cooperation {
    background: var(--amber);
    color: var(--ink-900);
    padding-block: 0;
}

.cooperation-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px clamp(32px, 6vw, 72px);
    flex-wrap: wrap;
    padding-block: clamp(56px, 8vw, 104px);
}

.section-cooperation .section-index {
    color: var(--ink-900);
}

.cooperation-title {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 0.9;
    letter-spacing: 0.01em;
    margin: 12px 0 20px;
}

.cooperation-paragraph {
    max-width: 52ch;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.65;
}

/* ============================================================================
   05 · Contact
   ========================================================================== */

.section-contact {
    background: var(--ink-900);
}

.section-contact .section-title {
    color: var(--white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: start;
}

.contact-lead {
    font-size: clamp(1.25rem, 2.2vw, 1.6rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--white);
    margin-bottom: 18px;
}

.contact-intro p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted-dark);
}

.contact-intro p + p {
    margin-top: 12px;
}

.social {
    display: flex;
    gap: 14px;
    margin-top: 28px;
}

.social a {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-dark);
    border-radius: 50%;
    color: var(--text-muted-dark);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.social a .icon {
    width: 1.35rem;
    height: 1.35rem;
}

.social a:hover {
    color: var(--amber);
    border-color: var(--amber);
    transform: translateY(-4px);
}

.contact-card {
    background: var(--ink-800);
    border: 1px solid var(--line-dark);
    padding: clamp(28px, 4vw, 48px);
}

.contact-card-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    color: var(--white);
    margin-bottom: 24px;
}

.contact-card-name::before {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--amber);
    flex-shrink: 0;
}

.contact-phone {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 3.6vw, 2.9rem);
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--amber);
    transition: color 0.25s ease;
}

.contact-phone:hover {
    color: var(--white);
}

.contact-phone .icon {
    width: 0.85em;
    height: 0.85em;
}

.contact-email {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-on-dark);
    transition: color 0.25s ease;
    word-break: break-word;
}

.contact-email:hover {
    color: var(--amber);
}

.contact-email .icon {
    width: 1.1em;
    height: 1.1em;
}

.contact-meta {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line-dark);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
}

.contact-meta dt {
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted-dark);
    margin-bottom: 6px;
}

.contact-meta dd {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-on-dark);
}

/* ============================================================================
   Footer
   ========================================================================== */

.footer {
    background: #0A0D12;
    color: var(--text-muted-dark);
    border-top: 2px solid var(--amber);
    padding-block: clamp(36px, 5vw, 56px);
}

/* Giant outlined wordmark as the closing statement */
.footer-wordmark {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    font-size: clamp(3rem, 11vw, 9rem);
    line-height: 0.85;
    letter-spacing: 0.01em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(243, 241, 236, 0.28);
    user-select: none;
    margin-bottom: clamp(24px, 4vw, 44px);
    white-space: nowrap;
}

@supports not (-webkit-text-stroke: 1px black) {
    .footer-wordmark {
        color: rgba(243, 241, 236, 0.2);
    }
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 32px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.author-href {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted-dark);
    transition: color 0.25s ease;
}

.author-href:hover {
    color: var(--amber);
}

/* ============================================================================
   Back to top
   ========================================================================== */

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--amber);
    color: var(--ink-900);
    border: none;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background-color 0.25s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-to-top:hover {
    background: var(--white);
    transform: translateY(-4px);
}

.back-to-top .icon {
    width: 1.1rem;
    height: 1.1rem;
}

/* ============================================================================
   Scroll animations
   (hidden states only apply with JS available, so the page stays
   readable with scripts disabled)
   ========================================================================== */

.js .animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js .animate-on-scroll.animated {
    opacity: 1;
    transform: none;
}

/* Grid children reveal one after another (the container itself stays put) */
.js .stagger {
    opacity: 1;
    transform: none;
    transition: none;
}

.js .stagger > * {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js .stagger.animated > * {
    opacity: 1;
    transform: none;
}

.js .stagger.animated > *:nth-child(1) { transition-delay: 0s; }
.js .stagger.animated > *:nth-child(2) { transition-delay: 0.07s; }
.js .stagger.animated > *:nth-child(3) { transition-delay: 0.14s; }
.js .stagger.animated > *:nth-child(4) { transition-delay: 0.21s; }
.js .stagger.animated > *:nth-child(5) { transition-delay: 0.28s; }
.js .stagger.animated > *:nth-child(6),
.js .stagger.animated > *:nth-child(n + 7) { transition-delay: 0.35s; }

/* ============================================================================
   Responsive
   ========================================================================== */

/* Tablets and under */
@media (max-width: 1100px) {
    .container {
        width: min(1280px, 100% - 40px);
    }

    /* Mobile navigation: links collapse into the dropdown.
       The .js gate keeps the full nav usable when scripts are off. */
    .js .nav-links {
        display: none;
    }

    .js #hamburger {
        display: inline-flex;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 56px;
    }

    .section-header--split {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .cooperation-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile phones */
@media (max-width: 700px) {
    .section {
        padding-block: clamp(60px, 9vw, 96px);
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .project-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
    }

    .hero-stats {
        gap: 16px;
    }

    .hero-stat-label {
        font-size: 0.62rem;
        letter-spacing: 0.1em;
    }

    .about-media::before {
        top: -14px;
        left: -14px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .gallery-tab {
        padding: 12px 16px;
        font-size: 0.8rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .lightbox-thumbs {
        bottom: 76px;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }

    /* The hamburger is hidden, so keep the full nav usable
       by letting it wrap compactly instead of overflowing the viewport. */
    html:not(.js) .nav-links {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0;
    }

    html:not(.js) .nav-links a {
        font-size: 0.7rem;
        padding: 8px 6px;
    }

    html:not(.js) .nav-links a.nav-cta {
        margin-left: 0;
        padding: 8px 10px;
    }
}

/* ============================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .js .animate-on-scroll,
    .js .stagger > * {
        opacity: 1 !important;
        transform: none !important;
    }

    .ticker-track {
        animation: none;
    }
}
