/* ============================================
   Ana Machuca — Humanizing Brands
   Portfolio Styles
   ============================================ */

:root {
  --color-bg: #f8f8f6;
  --color-accent: #00167a;
  --color-accent-light: #3d5a9e;
  --color-dark: #1a1a1a;
  --color-dark-bg: #181218;
  --color-text: #2d2d2d;
  --color-text-muted: #6b6b6b;
  --color-text-light: #dce0eb;
  --color-border: #dfe2ea;
  --font-title: 'Anton', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-pop: cubic-bezier(0.34, 1.45, 0.64, 1);
  --radius: 12px;
  --radius-lg: 20px;
  /* Fixed nav clearance for in-page anchors (mobile + desktop) */
  --nav-offset: clamp(4rem, 12vw, 5.5rem);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  scroll-padding-top: var(--nav-offset);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: max(clamp(1.5rem, 4vw, 3rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(1.5rem, 4vw, 3rem), env(safe-area-inset-right, 0px));
}

.section {
  padding: clamp(1.75rem, 4vw, 3rem) 0;
}

.section--dark {
  background: var(--color-dark-bg);
  color: var(--color-text-light);
}

/* ---- Section Labels & Titles ---- */

.section__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--font-title);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 3rem;
}

.section__title--light {
  color: var(--color-bg);
}

.highlight {
  color: var(--color-accent);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  transition: all 0.4s var(--ease-out);
  cursor: pointer;
  border: 2px solid transparent;
  touch-action: manipulation;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background: transparent;
  color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 22, 122, 0.25);
}

.btn--outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn--outline:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 22, 122, 0.25);
}

.btn--large {
  padding: 1.1rem 2.5rem;
  font-size: 1.05rem;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  --nav-bg-opacity: 1;
  --nav-border-opacity: 1;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0;
  padding-top: env(safe-area-inset-top, 0px);
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 12px rgba(26, 26, 26, 0.06);
}

.nav__inner {
  pointer-events: auto;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.55rem clamp(1rem, 3vw, 2.5rem);
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transition: box-shadow 0.3s var(--ease-out);
}

.nav--scrolled .nav__inner {
  box-shadow:
    0 10px 40px rgba(26, 26, 26, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
}

.nav__logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.65rem;
  min-height: 2.65rem;
  padding: 0 0.2rem;
  border-radius: 50%;
  border: 2px solid rgba(210, 214, 222, calc(var(--nav-border-opacity, 0.55) + 0.25));
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, calc(var(--nav-bg-opacity, 0.78) + 0.12)) 0%,
    rgba(248, 248, 246, calc(var(--nav-bg-opacity, 0.78) * 0.85)) 100%
  );
  font-family: var(--font-title);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--color-dark);
  transition:
    border-color 0.35s var(--ease-out),
    color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.nav__logo:hover .nav__logo-mark {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 4px 18px rgba(0, 22, 122, 0.2);
  transform: translateY(-1px);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.65rem);
  list-style: none;
}

.nav__links a {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-dark);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: color 0.3s var(--ease-out);
  position: relative;
  white-space: nowrap;
}

.nav__links a:not(.nav__cta)::after {
  content: '';
  position: absolute;
  bottom: -0.28rem;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}

.nav__links a:not(.nav__cta):hover::after,
.nav__links a:not(.nav__cta):focus-visible::after {
  width: 100%;
}

.nav__links a:not(.nav__cta):hover,
.nav__links a:not(.nav__cta):focus-visible {
  color: var(--color-accent);
}

.nav__cta {
  background: var(--color-accent);
  color: #fff !important;
  padding: 0.52rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: none;
  box-shadow: 0 2px 12px rgba(0, 22, 122, 0.32);
}

.nav__cta::after {
  display: none !important;
}

.nav__cta:hover,
.nav__cta:focus-visible {
  background: var(--color-dark);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26, 26, 26, 0.12);
}

.nav__toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  z-index: 1003;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.nav__toggle:hover {
  border-color: rgba(0, 22, 122, 0.35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

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

.nav__toggle-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nav__toggle-box span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-dark);
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
  border-radius: 2px;
}

@media (max-width: 1080px) and (min-width: 769px) {
  .nav__links {
    gap: 0.55rem;
  }

  .nav__links a {
    font-size: 0.68rem;
    letter-spacing: 0.07em;
  }
}

/* Mobile menu: dims content behind drawer; injected by main.js */
.nav__backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(26, 26, 26, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease-out), visibility 0.35s;
  pointer-events: none;
}

.nav__backdrop.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

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

.hero {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  /* Safe area: avoid content under notch / home indicator on small viewports */
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.hero__content {
  text-align: center;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(100vw, 1200px);
  padding: 0 clamp(1rem, 5vw, 2rem);
}

.hero__audience {
  font-size: clamp(0.72rem, 1.25vw, 0.85rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-text-muted);
  margin-bottom: 0.85rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.hero__intro {
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-family: var(--font-title);
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero__title-line {
  display: block;
}

.hero__title-line--accent {
  color: var(--color-accent);
}

.hero__tagline {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero__tagline em {
  color: var(--color-accent);
  font-style: italic;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero--has-video {
  background: #0a0a12;
}

.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__html {
  border: 0;
  display: block;
  pointer-events: none;
}

.hero__video--mobile {
  display: none;
}

@media (max-width: 768px) {
  .hero__video--desktop {
    display: none;
  }

  .hero__video--mobile {
    display: block;
  }
}

.hero--has-video .hero__content {
  color: #fff;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
}

.hero--has-video .hero__intro,
.hero--has-video .hero__title,
.hero--has-video .hero__title-line,
.hero--has-video .hero__title-inner,
.hero--has-video .hero__title-line--accent,
.hero--has-video .hero__tagline,
.hero--has-video .hero__tagline em {
  color: #fff;
}

.hero--has-video .btn--primary {
  background: #fff;
  color: var(--color-accent);
  border-color: #fff;
}

.hero--has-video .btn--primary:hover,
.hero--has-video .btn--primary:focus-visible {
  background: transparent;
  color: #fff;
  border-color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.hero--has-video .btn--outline {
  color: #fff;
  border-color: #fff;
}

.hero--has-video .btn--outline:hover,
.hero--has-video .btn--outline:focus-visible {
  background: #fff;
  color: var(--color-accent);
  border-color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .hero__video {
    display: none;
  }
}

/* ============================================
   About
   ============================================ */

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
}

.about .section__label {
  font-family: var(--font-title);
  font-size: 4.125rem;
  letter-spacing: 0.08em;
  margin-bottom: 2.5rem;
}

.about__visual {
  position: relative;
}

.about__image-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--color-accent) 0%, #3d5a9e 100%);
}

.about__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.about__accent-shape {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border: 3px solid var(--color-accent);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.4;
}

.about__description {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  max-width: 540px;
}

.about__details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.about__detail {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
}

.about__detail-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  min-width: 90px;
}

.about__detail-value {
  font-size: 0.95rem;
  color: var(--color-text);
}

/* ============================================
   Brands (logo tiles)
   ============================================ */

.brands__intro {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.brands__groups {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

/* Slightly tighter section padding for logo strip */
#brands.section,
#client-projects.section,
#personal-projects.section,
#projects.section {
  padding: clamp(0.1125rem, 0.25vw, 0.1875rem) 0;
}

#brands .brands__focus-main,
#client-projects .brands__focus-main,
#personal-projects .brands__focus-main,
#projects .brands__focus-main {
  max-width: min(1320px, 100%);
  padding-left: clamp(0.35rem, 1.25vw, 0.65rem);
  padding-right: clamp(0.35rem, 1.25vw, 0.65rem);
}

.brands__group-title {
  font-family: var(--font-title);
  font-size: clamp(1.125rem, 3vw, 1.8rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
  max-width: none;
}

.brands__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.35rem, 1.5vw, 0.75rem);
  align-items: stretch;
  width: 100%;
  margin-top: 0.65rem;
  margin-bottom: 0.65rem;
}

.brands__grid > .brand-tile {
  width: 100%;
  max-width: none;
}

.brand-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 0.075rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}

/* Logo slot: square frame reduces side letterboxing; logos scale to full column width */
.brand-tile__logo {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  object-position: center;
}

.brand-tile__logo-wrap {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
}

.brand-tile__logo-wrap .brand-tile__logo {
  width: 100%;
  height: 100%;
}

.brand-tile__logo--hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.brand-tile__logo--default {
  opacity: 1;
  transition: opacity 220ms ease;
}

.brand-tile--has-hover:hover .brand-tile__logo--default,
.brand-tile--has-hover:focus-visible .brand-tile__logo--default {
  opacity: 0;
}

.brand-tile--has-hover:hover .brand-tile__logo--hover,
.brand-tile--has-hover:focus-visible .brand-tile__logo--hover {
  opacity: 1;
}

.brand-tile__name {
  flex-shrink: 0;
  font-family: var(--font-title);
  font-size: 0.95rem;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--color-text);
}

.brand-tile__cta {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-top: 0.015rem;
}

.brand-tile__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
}

.brand-tile__tag {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid currentColor;
  border-radius: 0;
  line-height: 1.35;
}

#brands .brand-tile:focus-visible,
#client-projects .brand-tile:focus-visible,
#personal-projects .brand-tile:focus-visible,
#projects .brand-tile:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

[id^="work-"],
[id^="project-"] {
  scroll-margin-top: 6rem;
}

/* ============================================
   Marquee (skills strip in About section)
   ============================================ */

.marquee-strip {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(26, 26, 26, 0.06);
}

.about .marquee-strip {
  margin-bottom: clamp(1.75rem, 4.5vw, 3.5rem);
}

.marquee {
  --marquee-pad-y: clamp(0.75rem, 2vw, 1rem);
  background: var(--color-accent);
  padding: var(--marquee-pad-y) 0;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.marquee__track {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(1.25rem, 3vw, 2rem);
  width: max-content;
  animation: marqueeScroll 32s linear infinite;
  will-change: transform;
  backface-visibility: hidden;
}

.marquee__track > span {
  flex-shrink: 0;
  font-family: var(--font-title);
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.marquee__dot {
  font-size: 0.55rem !important;
  opacity: 0.5;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  align-self: center;
}

@keyframes marqueeScroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
  }
}

/* Homepage presentation: hero + skills strip only (admin + localStorage on this device) */
body.portfolio-hero-marquee-focus .nav,
body.portfolio-hero-marquee-focus #scrollProgress,
body.portfolio-hero-marquee-focus .nav__backdrop,
body.portfolio-hero-marquee-focus .hero__actions,
body.portfolio-hero-marquee-focus #brands .brands__focus-main,
body.portfolio-hero-marquee-focus #client-projects,
body.portfolio-hero-marquee-focus #personal-projects,
body.portfolio-hero-marquee-focus #projects,
body.portfolio-hero-marquee-focus #about .container,
body.portfolio-hero-marquee-focus #contact,
body.portfolio-hero-marquee-focus .footer {
  display: none !important;
}

body.portfolio-hero-marquee-focus #brands.section {
  padding: clamp(0.325rem, 1vw, 0.5rem) 0;
}

/* ============================================
   Contact
   ============================================ */

.contact__content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.contact__desc {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.contact__links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

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

.footer {
  background: var(--color-dark-bg);
  color: var(--color-text-light);
  padding: 3rem 0;
  padding-bottom: max(3rem, calc(2rem + env(safe-area-inset-bottom, 0px)));
  text-align: center;
}

.footer__brand {
  font-family: var(--font-title);
  font-size: 1.4rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.footer__tagline {
  font-size: 0.85rem;
  color: rgba(200, 208, 218, 0.5);
  margin-bottom: 1rem;
}

.footer__copy {
  font-size: 0.75rem;
  color: rgba(200, 208, 218, 0.3);
}

/* ============================================
   Reveal Animations
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out), filter 0.9s var(--ease-out);
  will-change: opacity, transform;
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
  filter: blur(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  will-change: opacity, transform;
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  will-change: opacity, transform;
}

.reveal-left.reveal--visible,
.reveal-right.reveal--visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  will-change: opacity, transform;
}

.reveal-scale.reveal--visible {
  opacity: 1;
  transform: scale(1);
}

/* Work Experiences: slower pop-in on scroll */
#brands .reveal-scale {
  transform: scale(0.88);
  transition:
    opacity 1.5s var(--ease-out),
    transform 1.5s var(--ease-pop);
}

#brands .reveal-scale.reveal--visible {
  transform: scale(1);
}

.reveal-blur {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(20px);
  transition: opacity 1s var(--ease-out), filter 1s var(--ease-out), transform 1s var(--ease-out);
  will-change: opacity, filter, transform;
}

.reveal-blur.reveal--visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.reveal-clip {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1s var(--ease-out);
  will-change: clip-path;
}

.reveal-clip.reveal--visible {
  clip-path: inset(0 0 0 0);
}

/* ---- Hero Split Text Animation ---- */

.hero__title-line {
  display: block;
  overflow: hidden;
}

.hero__title-inner {
  display: block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease-out);
}

.hero__title-inner.is-visible {
  transform: translateY(0);
}

.hero__title-inner:nth-child(1) { transition-delay: 0.2s; }

.hero__title-line:nth-child(2) .hero__title-inner { transition-delay: 0.35s; }

/* ---- Floating Accent Shapes ---- */

.about__accent-shape {
  transition: transform 0.1s linear;
}

/* ---- Contact Glow ---- */

.contact__content::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0,22,122,0.12) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 1.2s var(--ease-out);
  pointer-events: none;
  z-index: -1;
}

.contact__content {
  position: relative;
}

.contact__content.glow-active::after {
  transform: translate(-50%, -50%) scale(1);
}

/* ---- Scroll Progress Bar ---- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  z-index: 1001;
  transform-origin: left;
  transform: scaleX(0);
  transition: none;
}

/* ---- Hero Scroll Fade ---- */

.hero {
  transition: none;
}

.hero__content {
  transition: opacity 0.05s linear, transform 0.05s linear;
}

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


@media (max-width: 1024px) {
  .section {
    padding: clamp(1.5rem, 3.5vw, 2.5rem) 0;
  }

  .brands__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {

  .section {
    padding: clamp(1.25rem, 3.5vw, 2rem) 0;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__inner {
    flex-wrap: wrap;
    background: #fff;
    border-color: rgba(210, 214, 222, 0.95);
    box-shadow: 0 8px 28px rgba(26, 26, 26, 0.07);
  }

  .nav__logo {
    order: 1;
  }

  .nav__toggle {
    order: 2;
    margin-left: auto;
  }

  .nav__links {
    order: 3;
    position: fixed;
    top: 0;
    right: 0;
    width: min(85vw, 300px);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    background: linear-gradient(180deg, #f8f8f6 0%, #eceef2 100%);
    padding: max(5rem, calc(3.5rem + env(safe-area-inset-top, 0px))) 1.75rem max(2rem, env(safe-area-inset-bottom, 0px));
    gap: 0.5rem;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out);
    box-shadow: -12px 0 48px rgba(0, 0, 0, 0.12);
    z-index: 1002;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-left: 1px solid var(--color-border);
  }

  .nav__links a {
    white-space: normal;
    padding: 0.55rem 0;
  }

  .nav__links .nav__cta {
    text-align: center;
    justify-content: center;
    margin-top: 0.25rem;
  }

  .nav__links--open {
    transform: translateX(0);
  }

  .nav__toggle--active .nav__toggle-box span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav__toggle--active .nav__toggle-box span:nth-child(2) {
    opacity: 0;
  }
  .nav__toggle--active .nav__toggle-box span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about__visual {
    max-width: 320px;
    margin: 0 auto;
  }

  .brands__grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .brands__grid > .brand-tile {
    max-width: 100%;
  }

  .brand-tile__logo,
  .brand-tile__logo-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .hero__title {
    font-size: clamp(3rem, 14vw, 6rem);
  }

  /* Video hero: full-bleed background on mobile (same as desktop) */
  .hero--has-video .hero__content {
    padding: 0 clamp(0.25rem, 2vw, 0.5rem);
  }

  .hero--has-video .hero__intro {
    font-size: clamp(0.72rem, 2.8vw, 0.85rem);
    letter-spacing: 0.18em;
    margin-bottom: 1rem;
  }

  .hero--has-video .hero__title {
    font-size: clamp(2.5rem, 12vw, 4.25rem);
    margin-bottom: 1rem;
  }

  .hero--has-video .hero__tagline {
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    margin-bottom: 1.5rem;
  }

  .hero--has-video .hero__actions {
    gap: 0.75rem;
  }

  .hero--has-video .hero__actions .btn {
    font-size: 0.88rem;
    padding: 0.75rem 1.5rem;
  }

  #brands.section,
  #client-projects.section,
  #personal-projects.section,
  #projects.section {
    padding: clamp(0.0875rem, 0.25vw, 0.15rem) 0;
  }
}

@media (max-width: 480px) {

  .section {
    padding: 1.125rem 0;
  }

  .about__detail {
    flex-direction: column;
    gap: 0.3rem;
  }

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

  .contact__links {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .hero--has-video .hero__title {
    font-size: clamp(2.15rem, 13vw, 3.5rem);
  }

  .hero__tagline br {
    display: none;
  }
}

/* ============================================
   Detail / case study pages
   ============================================ */

.page-detail {
  padding-top: max(3.5rem, calc(2.75rem + env(safe-area-inset-top, 0px)));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
  background: #fff;
  color: #000;
}

.detail {
  padding-bottom: clamp(4rem, 10vw, 8rem);
}

.detail__header {
  padding: clamp(1.25rem, 3.5vw, 2rem) 0 clamp(0.75rem, 2vw, 1.25rem);
  margin-bottom: 0;
  text-align: left;
}

.detail__header-info {
  max-width: 100%;
  text-align: left;
}

.brand-tile__logo--img {
  padding: 0;
  overflow: hidden;
  border: none;
  background: transparent;
}

.brand-tile__logo--img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand-tile__logo--img.brand-tile__logo--wide {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 2.5 / 1;
}

.brand-tile__logo--img.brand-tile__logo--wide img {
  object-fit: contain;
}

.detail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.detail__title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: #000;
}

.detail__subtitle-line {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 400;
  color: #000;
  margin: 0 0 clamp(0.5rem, 2vw, 1rem);
  line-height: 1.5;
  max-width: 65ch;
}

.detail__subtitle {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.detail__meta {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.detail__body {
  max-width: 720px;
}

.detail__body--wide {
  max-width: none;
}

.detail__deliverable {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--color-border);
}

.detail__deliverable-heading {
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
}

.detail__deliverable-heading--has-about {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.detail__deliverable-heading-text {
  flex: 1 1 12rem;
  min-width: 0;
}

.detail__deliverable-heading--has-about .detail__about-toggle {
  flex-shrink: 0;
  align-self: flex-start;
}

.detail__deliverable-title {
  font-family: var(--font-title);
  font-size: clamp(1.35rem, 2.8vw, 1.65rem);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
  color: var(--color-dark);
}

.detail__deliverable-subtitle {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.45;
  max-width: 65ch;
}

.detail__deliverable-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: start;
}

/* Collapsible about panel: side-by-side only when About is open */
.detail__deliverable-layout--has-about {
  row-gap: clamp(1.25rem, 3vw, 2.25rem);
  transition:
    grid-template-columns 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    column-gap 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail__deliverable-layout--has-about.detail__deliverable-layout--about-open {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  column-gap: clamp(1.25rem, 3vw, 2.25rem);
}

.detail__deliverable-about {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.detail__deliverable-layout--has-about.detail__deliverable-layout--about-open .detail__deliverable-about {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.detail__about-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.5rem 0.9rem;
  border: none;
  background: #e8e8e8;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.detail__about-toggle:hover,
.detail__about-toggle:focus-visible {
  background: #dcdcdc;
  outline: none;
}

.detail__about-toggle-icon {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1;
}

.detail__deliverable-layout--has-about .detail__deliverable-copy {
  width: 100%;
  min-height: clamp(10rem, 28vw, 16rem);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  background: #fff;
  border: 1px solid var(--color-border);
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  .detail__deliverable-layout--has-about,
  .detail__deliverable-about {
    transition: none;
  }
}

@media (max-width: 900px) {
  .detail__deliverable-layout {
    grid-template-columns: 1fr;
  }

  .detail__deliverable-layout--has-about {
    grid-template-columns: 1fr;
    grid-template-rows: auto 0fr;
    column-gap: 0;
    transition:
      grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1),
      row-gap 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .detail__deliverable-layout--has-about.detail__deliverable-layout--about-open {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    row-gap: clamp(1.25rem, 3vw, 2.25rem);
  }
}

.detail__deliverable-copy {
  min-width: 0;
}

.detail__deliverable-media {
  min-width: 0;
  width: 100%;
}

.detail__deliverable-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.7;
  max-width: 52ch;
}

.detail__gallery {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 1rem;
}

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

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

.detail__gallery--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail__gallery--cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 700px) {
  .detail__gallery--cols-2,
  .detail__gallery--cols-3,
  .detail__gallery--cols-4 {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  }
}

.detail__gallery img,
.detail__gallery .detail__slide-still,
.detail__gallery .detail__video-hover .detail__video-hover__media,
.detail__gallery .detail__video-click .detail__video-click__media {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  vertical-align: middle;
  display: block;
}

.detail__gallery .detail__pdf {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 720px);
  margin-inline: auto;
}

.detail__pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.detail__pdf__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  text-align: center;
  font: inherit;
  color: inherit;
}

.detail__pdf__trigger:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.detail__pdf__preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 8.5 / 11;
  max-height: min(78vh, 860px);
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.1);
}

.detail__pdf__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.detail__pdf__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  transition: background 180ms ease;
  pointer-events: none;
}

.detail__pdf__overlay-icon {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-accent, #c45c26);
}

.detail__pdf__overlay-text {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.detail__pdf__trigger:hover .detail__pdf__overlay,
.detail__pdf__trigger:focus-visible .detail__pdf__overlay {
  background: rgba(0, 0, 0, 0.06);
}

.detail__pdf__link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-accent, #c45c26);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail__pdf__link:hover {
  text-decoration-thickness: 2px;
}

/* Fullscreen PDF viewer modal */
.detail-pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.detail-pdf-modal[hidden] {
  display: none !important;
}

.detail-pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.92);
}

.detail-pdf-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.detail-pdf-modal__close:hover,
.detail-pdf-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.detail-pdf-modal__toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 4rem 0.75rem 1.25rem;
  font-size: 0.85rem;
}

.detail-pdf-modal__title {
  font-weight: 600;
  opacity: 0.92;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-pdf-modal__page {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.detail-pdf-modal__scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.detail-pdf-modal__page-wrap {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  box-sizing: border-box;
}

.detail-pdf-modal__page-wrap canvas {
  display: block;
  max-width: min(100%, 920px);
  width: auto;
  height: auto;
  background: #fff;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.45);
  border-radius: 2px;
}

body.detail-pdf-modal-open {
  overflow: hidden;
}

.detail__gallery .detail__html {
  grid-column: 1 / -1;
}

.detail__gallery .detail__audio {
  grid-column: 1 / -1;
  width: min(100%, 640px);
  margin-inline: auto;
}

.detail__audio__media {
  display: none;
}

.detail__audio__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.detail__audio__play {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.detail__audio__play::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  margin: 0.55rem auto 0 0.95rem;
  border-style: solid;
  border-width: 0.45rem 0 0.45rem 0.75rem;
  border-color: transparent transparent transparent currentColor;
}

.detail__audio[data-state='playing'] .detail__audio__play::before {
  width: 0.55rem;
  height: 0.75rem;
  margin: 0.45rem auto 0;
  border: none;
  background: currentColor;
  box-shadow: 0.65rem 0 0 currentColor;
}

.detail__audio__play:hover,
.detail__audio__play:focus-visible {
  transform: scale(1.04);
  outline: none;
}

.detail__audio__play:focus-visible {
  box-shadow: 0 0 0 3px rgba(45, 74, 140, 0.35);
}

.detail__audio__seek {
  flex: 1 1 auto;
  min-width: 0;
  height: 4px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.detail__audio__time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.detail__audio__label {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  text-align: center;
}

.detail__html {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}

.detail__html__frame {
  width: 100%;
  min-height: min(72vh, 640px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.detail__html__iframe {
  width: 100%;
  height: 100%;
  min-height: min(72vh, 640px);
  border: 0;
  display: block;
}

.detail__embed .detail__html__frame {
  aspect-ratio: 16 / 9;
  min-height: 0;
  background: #0a0a0a;
}

.detail__embed .detail__html__iframe {
  min-height: 0;
  height: 100%;
}

.detail__html__link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-accent, #c45c26);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail__html__link:hover {
  text-decoration-thickness: 2px;
}

.detail__video-click {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: #0a0a0a;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.detail__gallery .detail__video-click .detail__video-click__media {
  border: none;
  box-shadow: none;
  object-fit: cover;
}

.detail__video-click__btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

.detail__video-click__btn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #fff;
}

.detail__video-click[data-state="playing"] .detail__video-click__btn {
  opacity: 0;
}

.detail__video-click:hover .detail__video-click__btn,
.detail__video-click:focus-within .detail__video-click__btn {
  opacity: 1;
  background: rgba(0, 0, 0, 0.6);
}

.detail__video-hover {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: #0a0a0a;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.detail__gallery .detail__video-hover .detail__video-hover__media {
  border: none;
  box-shadow: none;
}

.detail__video-hover .detail__video-hover__media {
  position: relative;
  object-fit: cover;
}

.detail__slide-still {
  pointer-events: auto;
  cursor: pointer;
}

.detail__gallery img,
.detail__gallery .detail__video-hover {
  cursor: pointer;
}

.detail__body p {
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.detail__body ul {
  margin: 0 0 1.5rem 1.25rem;
  padding: 0;
  list-style: disc;
}

.detail__body li {
  margin-bottom: 0.65rem;
  padding-left: 0.25rem;
}

.detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.detail__tags span {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(0, 22, 122, 0.1);
  color: var(--color-accent);
}

.page-detail .footer {
  margin-top: 0;
}

/* Fullscreen lightbox: gallery images & videos (detail pages) */
.detail-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(0.75rem, env(safe-area-inset-right, 0px))
    max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.detail-lightbox[hidden] {
  display: none !important;
}

.detail-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.detail-lightbox__close {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  z-index: 10;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease-out);
}

.detail-lightbox__close:hover,
.detail-lightbox__close:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  outline: none;
}

.detail-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s var(--ease-out);
}

.detail-lightbox__nav[hidden] {
  display: none !important;
}

.detail-lightbox__nav--prev {
  left: max(0.75rem, env(safe-area-inset-left, 0px));
}

.detail-lightbox__nav--next {
  right: max(0.75rem, env(safe-area-inset-right, 0px));
}

.detail-lightbox__nav:hover,
.detail-lightbox__nav:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  outline: none;
}

.detail-lightbox__stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.detail-lightbox__frame {
  pointer-events: auto;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-lightbox__frame img,
.detail-lightbox__frame video {
  max-width: min(100vw - 2rem, 100%);
  max-height: min(100dvh - 4rem, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.detail-lightbox__frame video {
  width: min(100vw - 2rem, 1200px);
  max-height: min(100dvh - 4rem, 85vh);
  background: #000;
}

body.detail-lightbox-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .detail__title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .page-detail .detail__body .btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  .detail__body ul {
    padding-left: 0.25rem;
  }
}

/* CMS empty states (homepage when collections are empty) */
.portfolio-empty {
  margin: 0;
  max-width: 36rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(45, 45, 45, 0.72);
}

/* Ensure portfolio sections stay readable without JS or with reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-blur {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .reveal-clip {
    clip-path: inset(0 0 0 0) !important;
  }
}

@media (scripting: none) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-blur {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .reveal-clip {
    clip-path: inset(0 0 0 0) !important;
  }
}

/* ============ Ask AI search popout ============ */
.nav__ask {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
  transition: transform 0.2s var(--ease-pop), color 0.2s ease;
}
.nav__ask svg { width: 1.15rem; height: 1.15rem; }
.nav__ask:hover,
.nav__ask:focus-visible { color: var(--color-accent-light); transform: scale(1.12); }

.ask-search {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(4.5rem, 14vh, 8rem) 1rem 2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ask-search--visible { opacity: 1; }
body.ask-search-open { overflow: hidden; }

.ask-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 24, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ask-search__panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(-12px) scale(0.98);
  transition: transform 0.25s var(--ease-pop);
  overflow: hidden;
}
.ask-search--visible .ask-search__panel { transform: translateY(0) scale(1); }

.ask-search__form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--color-border);
}
.ask-search__icon { width: 1.2rem; height: 1.2rem; color: var(--color-text-muted); flex-shrink: 0; }
.ask-search__form input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--color-text);
}
.ask-search__form input::placeholder { color: var(--color-text-muted); }
.ask-search__submit {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ask-search__submit:hover { background: var(--color-accent-light); }
.ask-search__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
}
.ask-search__close:hover { color: var(--color-dark); }

.ask-search__status {
  padding: 0.85rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.ask-search__results {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1.15rem 1.15rem;
}
.ask-search__results:empty { padding: 0; }
.ask-search__item {
  display: block;
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: #fff;
  transition: border-color 0.2s ease, transform 0.2s var(--ease-out);
}
.ask-search__item:hover {
  border-color: var(--color-accent-light);
  transform: translateY(-1px);
}
.ask-search__item strong {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-accent);
  margin-bottom: 0.3rem;
}
.ask-search__item p {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
}
