/* =====================================================================
   BASE — structure & behaviour shared by every theme.
   Themes (assets/css/themes/*.css) set the tokens below and the look.
   ===================================================================== */
:root {
  --bg: #000;
  --fg: #fff;
  --muted: #8e8e8e;
  --line: rgba(255, 255, 255, 0.1);
  --card: #0c0c0d;
  --accent: #fff;
  --accent-fg: #000;
  --radius: 28px;
  --font-body: system-ui, sans-serif;
  --font-display: system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad-x: clamp(16px, 3vw, 32px);
  --pad-top: clamp(14px, 2.4vh, 24px);
  --header-h: 48px;
  --maxw: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 40px);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html.loading body,
html.switching body {
  opacity: 0;
}

body {
  transition: opacity 0.25s ease;
}

body.menu-open {
  overflow: hidden;
}

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

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

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

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

ul,
ol {
  list-style: none;
}

em {
  font-style: normal;
}

.sr-only,
.hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -60px;
  left: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* clip sideways overflow (tilted bands, stickers) without breaking position: sticky */
main,
.site-footer {
  overflow-x: clip;
}

/* ---------------- header ---------------- */
.site-header {
  position: fixed;
  z-index: 30;
  top: var(--pad-top);
  left: 0;
  right: 0;
  margin: 0 auto;
  width: calc(100% - var(--pad-x) * 2);
  display: flex;
  align-items: center;
  animation: slideDown 0.7s var(--ease) both;
  transition: transform 0.45s var(--ease), background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.hide {
  transform: translateY(calc(-100% - var(--pad-top) - 12px));
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
}

.nav-link,
.m-link {
  position: relative;
  white-space: nowrap;
}

.burger,
.menu-overlay,
.mobile-menu {
  display: none;
}

/* ---------------- hero skeleton ---------------- */
.hero {
  position: relative;
  isolation: isolate;
}

.bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.headline .line {
  display: block;
}

.stat-value {
  font-variant-numeric: tabular-nums;
}

/* ---------------- marquee ---------------- */
.marquee {
  overflow: hidden;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 32px;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.marquee span {
  white-space: nowrap;
}

/* ---------------- sections ---------------- */
.section {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 12vh, 130px) var(--pad-x);
}

.section-head {
  margin-bottom: clamp(36px, 6vh, 60px);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------------- services ---------------- */
.service {
  position: relative;
  display: flex;
  flex-direction: column;
}

.deliverables li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.service-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

.quote-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.quote-link i {
  transition: transform 0.3s var(--ease);
}

.quote-link:hover i {
  transform: translateX(4px);
}

/* ---------------- benefits: sticky intro + stacking cards ---------------- */
.benefits-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.benefits-intro {
  position: sticky;
  top: calc(var(--header-h) + var(--pad-top) + 48px);
}

.benefit-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.bp-bar {
  position: relative;
  flex: 1;
  max-width: 220px;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.bp-bar i {
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.15s linear;
}

.benefits-cta {
  margin-top: 28px;
}

.benefit-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 8vh;
}

.benefit {
  --cover: 0;
  position: sticky;
  top: calc(var(--header-h) + var(--pad-top) + 40px + var(--i) * 18px);
  min-height: 300px;
  transform-origin: center top;
  transform: scale(calc(1 - var(--cover) * 0.05));
  filter: brightness(calc(1 - var(--cover) * 0.35));
  will-change: transform;
}

.benefit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------------- case studies ---------------- */
.case-list {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vw, 48px);
}

.case {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: stretch;
}

.case.reverse .case-media {
  order: 2;
}

.case-media {
  position: relative;
  min-height: 340px;
  overflow: hidden;
}

.case-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  position: absolute;
  inset: 0;
}

.case-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.sample-tag {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #ffcc00;
  color: #000;
}

.case-detail {
  display: grid;
  gap: 14px;
}

.case-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.case-metrics div {
  display: flex;
  flex-direction: column;
}

.case-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------- projects ---------------- */
.filter-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(28px, 4vh, 44px);
}

.filters {
  display: flex;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  position: relative;
  flex-shrink: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 16px;
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.project-link {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.project-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: opacity 0.4s ease, object-position 4s ease, transform 1s var(--ease);
}

.project-media.loading-img > img {
  opacity: 0;
}

.project-media.loading-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(127, 127, 127, 0.15), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}

.project:hover .project-media > img {
  object-position: bottom;
}

.project-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.pill-cat,
.pill-result,
.project-arrow {
  position: absolute;
  z-index: 2;
}

.pill-cat {
  top: 12px;
  left: 12px;
}

.pill-result {
  top: 12px;
  right: 12px;
}

.project-arrow {
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transform: scale(0.6) rotate(-45deg);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.3s ease;
}

.project:hover .project-arrow {
  transform: none;
  opacity: 1;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.project-num {
  display: none;
}

.project-domain {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-domain img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.project-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project .chips {
  margin-top: auto;
}

.hover-preview {
  display: none;
}

/* ---------------- process / tools / faq ---------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.step {
  position: relative;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tools li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.plus {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: transform 0.35s var(--ease);
}

.plus::before,
.plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  margin: -0.75px 0 0 -6px;
  background: currentColor;
}

.plus::after {
  transform: rotate(90deg);
}

details[open] .plus {
  transform: rotate(45deg);
}

/* ---------------- contact ---------------- */
.contact {
  isolation: isolate;
}

.contact-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.contact-direct {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.contact-time {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
}

.contact-time .dot,
.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: ping 2s infinite;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  min-width: 0;
}

.field > span,
.field > legend {
  font-size: 13px;
  font-weight: 500;
  padding: 0;
}

.field em {
  opacity: 0.6;
}

.field input,
.field textarea {
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field.invalid input,
.field.invalid textarea {
  border-color: #ef4444 !important;
}

.choice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  position: relative;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: inline-flex;
  align-items: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.submit-btn {
  align-self: flex-start;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form-status {
  min-height: 1.4em;
  font-size: 14px;
}

.form-status.success {
  color: #22c55e;
}

.form-status.error {
  color: #ef4444;
}

.form-status a {
  text-decoration: underline;
}

/* ---------------- footer ---------------- */
.site-footer {
  overflow: hidden;
}

.footer-big {
  display: block;
  white-space: nowrap;
  text-align: center;
  line-height: 0.9;
  user-select: none;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px var(--pad-x) 36px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------- theme switcher ---------------- */
.theme-switch {
  position: fixed;
  z-index: 40;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ddd;
  font: 500 12px/1 system-ui, sans-serif;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.ts-label {
  margin-right: 4px;
}

.ts-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ts-btn:hover {
  transform: scale(1.1);
}

.ts-btn.active {
  border-color: #fff;
}

.ts-noir {
  background: radial-gradient(circle at 30% 30%, #fff 0 18%, #000 20%);
}

.ts-editorial {
  background: linear-gradient(135deg, #f3eee4 50%, #c2410c 50%);
}

.ts-brutal {
  background: conic-gradient(#d4ff3a 0 33%, #ff5ca8 0 66%, #3b5bff 0);
}

/* ---------------- animations ----------------
   Entrance animations only run until they finish; JS then adds .done so
   each theme's own transforms (tilts, hovers) take over again. */
.anim:not(.done),
.reveal:not(.done) {
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  filter: blur(6px);
}

.anim:not(.done) {
  animation: reveal 0.85s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

.reveal.in:not(.done) {
  animation: reveal 0.85s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

.headline .line:not(.done) {
  opacity: 0;
  transform: translateY(14px);
  animation: headlineFade 0.85s var(--ease) forwards;
}

.headline .l1 {
  animation-delay: 0.12s;
}

.headline .l2 {
  animation-delay: 0.3s;
}

html.no-anim .site-header {
  animation: none;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

@keyframes headlineFade {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes ping {
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.96);
  }
}

@keyframes linkIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- responsive structure ---------------- */
@media (max-width: 960px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .case.reverse .case-media {
    order: 0;
  }

  .case-media {
    min-height: 260px;
  }
}

@media (max-width: 860px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .benefits-intro {
    position: static;
  }
}

@media (max-width: 760px) {
  .nav,
  .header-cta {
    display: none !important;
  }

  .site-header {
    justify-content: space-between;
  }

  .burger {
    position: relative;
    z-index: 3;
    display: grid;
    place-content: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
  }

  .burger span {
    display: block;
    width: 18px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.35s var(--ease), opacity 0.2s ease;
  }

  .burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .menu-overlay:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 28;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: overlayIn 0.28s ease both;
  }

  .mobile-menu:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    z-index: 29;
    top: calc(var(--pad-top) + 48px + 14px);
    left: 50%;
    width: min(calc(100% - 28px), 380px);
    padding: 22px 18px 20px;
    transform: translateX(-50%);
    animation: menuIn 0.38s var(--ease) both;
  }

  .m-link,
  .m-cta {
    opacity: 0;
    animation: linkIn 0.4s var(--ease) forwards;
    animation-delay: calc(0.08s + var(--i) * 0.05s);
  }

  .m-link {
    display: block;
    padding: 12px 0 18px;
    text-align: center;
    font-size: 17px;
  }

  .m-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    margin-top: 12px;
  }

  .steps,
  .form-row {
    grid-template-columns: 1fr;
  }

  .benefit {
    top: calc(var(--header-h) + var(--pad-top) + 20px + var(--i) * 12px);
    min-height: 260px;
  }

  .theme-switch .ts-label {
    display: none;
  }

  .theme-switch {
    padding: 6px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .anim:not(.done),
  .reveal:not(.done),
  .headline .line:not(.done),
  .m-link,
  .m-cta {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .benefit {
    transform: none;
    filter: none;
  }
}
