/* ===== Custom Properties ===== */
:root {
  --bg: #000b1f;
  --bg-light: #f5f4f0;
  --bg-card: rgba(255, 255, 255, 0.03);
  --accent: #cba14e;
  --accent-dim: rgba(203, 161, 78, 0.15);
  --text: rgba(255, 255, 255, 0.92);
  --text-mid: rgba(255, 255, 255, 0.55);
  --text-dim: rgba(255, 255, 255, 0.3);
  --text-dark: #1a1a1a;
  --text-dark-mid: #6b6b6b;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(0, 0, 0, 0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* Fluid spacing — scales with viewport */
  --space-section: clamp(64px, 10vw, 120px);
  --space-block: clamp(40px, 6vw, 72px);
  --pad-x: clamp(20px, 5vw, 5%);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

section[id] {
  scroll-margin-top: clamp(140px, 16vh, 224px);
}

body {
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Prevent tap highlight on mobile */
  -webkit-tap-highlight-color: transparent;
}

body.menu-open {
  overflow: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(160px, 18.75vh, 260px);
  padding: 0 var(--pad-x);
}

.logo {
  display: inline-flex;
  align-items: center;
  /* Minimum tap target */
  padding: 8px 0;
}

.logo img {
  display: block;
  height: clamp(100px, 12.5vh, 200px);
  width: auto;
}

.logo-dot {
  color: var(--accent);
  margin: 0 1px;
}

/* Nav — desktop */
.nav-list {
  display: flex;
  gap: clamp(24px, 3vw, 40px);
}

.nav-list a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-mid);
  /transition: color 0.3s var(--ease);
  /* Tap target padding */
  padding: 12px 0;
  display: inline-block;
}

.nav-list a:hover {
  color: #fff;
}

/* Hamburger — hidden on desktop, shown via media query */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  /* Min 44px tap target (Apple HIG) */
  width: 44px;
  height: 44px;
  padding: 10px;
  z-index: 10;
}

.menu-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #fff;
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
  transform-origin: center;
}

.menu-toggle.active .menu-bar:first-child {
  transform: translateY(4.25px) rotate(45deg);
}

.menu-toggle.active .menu-bar:last-child {
  transform: translateY(-4.25px) rotate(-45deg);
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(100px, 16vw, 160px) var(--pad-x) clamp(40px, 6vw, 60px);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Hero entrance animation */
.hero-tag,
.hero-line,
.hero-sub,
.hero-scroll-line {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

body.loaded .hero-tag        { opacity: 1; transform: none; transition-delay: 0.2s; }
body.loaded .hero-line:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.35s; }
body.loaded .hero-line:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.5s; }
body.loaded .hero-line:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.65s; }
body.loaded .hero-sub        { opacity: 1; transform: none; transition-delay: 0.85s; }
body.loaded .hero-scroll-line { opacity: 1; transform: none; transition-delay: 1.1s; }

.hero-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 900px;
}

.hero-tag {
  font-size: clamp(0.65rem, 1vw, 0.72rem);
  font-weight: 500;
  letter-spacing: clamp(2px, 0.4vw, 4px);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 7rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero-line {
  display: block;
}

.hero-bottom {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: clamp(32px, 5vw, 60px);
  gap: 24px;
}

.hero-sub {
  max-width: 420px;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  font-weight: 300;
  line-height: 1.8;
  color: var(--text-mid);
}

.hero-scroll-line {
  flex-shrink: 0;
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.15; }
}

/* ==========================================================
   SECTIONS — SHARED
   ========================================================== */
.section {
  padding: var(--space-section) 0;
}

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

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

/* Split layout — label left, content right (collapses on smaller screens) */
.split {
  display: grid;
  grid-template-columns: clamp(120px, 16vw, 200px) 1fr;
  gap: 24px;
  margin-bottom: var(--space-block);
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 12px;
}

.display-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
}

.display-heading em {
  font-style: italic;
}

.display-heading-dark {
  color: var(--text-dark);
}

.body-text {
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  font-weight: 300;
  line-height: 1.9;
  color: var(--text-mid);
  max-width: 600px;
  margin-top: clamp(16px, 2.5vw, 28px);
}

/* ==========================================================
   STATS
   ========================================================== */
.section-stats {
  background: var(--bg);
  padding: clamp(40px, 6vw, 80px) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}

.stat {
  padding: clamp(24px, 4vw, 40px) 20px;
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  font-weight: 400;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: clamp(0.62rem, 0.9vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: clamp(8px, 1.2vw, 14px);
}

/* ==========================================================
   SERVICES
   ========================================================== */
.services-list {
  display: flex;
  flex-direction: column;
}

.service-item {
  display: grid;
  grid-template-columns: clamp(40px, 6vw, 80px) 1fr;
  gap: clamp(16px, 2.5vw, 32px);
  padding: clamp(24px, 3.5vw, 40px) 0;
  border-top: 1px solid var(--border);
  transition: background 0.4s var(--ease);
}

.service-item:last-child {
  border-bottom: 1px solid var(--border);
}

.service-item:hover {
  background: var(--bg-card);
}

.service-index {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  color: var(--text-dim);
  padding-top: 2px;
}

.service-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: clamp(6px, 1vw, 10px);
  transition: color 0.3s var(--ease);
}

.service-item:hover .service-body h3 {
  color: var(--accent);
}

.service-body p {
  font-size: clamp(0.85rem, 1.1vw, 0.9rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-mid);
  max-width: 540px;
}

.service-body p + p {
  margin-top: clamp(10px, 1.3vw, 16px);
}

.service-body p:first-of-type {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
}

.service-body p:last-of-type {
  font-size: clamp(0.78rem, 1vw, 0.85rem);
  color: var(--text-mid);
  padding-left: clamp(12px, 1.5vw, 18px);
  border-left: 1px solid var(--accent-dim);
  margin-top: clamp(14px, 1.8vw, 22px);
}

.service-body strong {
  font-weight: 500;
  color: var(--text);
}

.service-body p:first-of-type em {
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
}

/* ==========================================================
   PORTFOLIO
   ========================================================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

.portfolio-item {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-light);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease);
}

.portfolio-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.portfolio-image {
  overflow: hidden;
  height: clamp(160px, 22vw, 260px);
}

.portfolio-img-inner {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.6s var(--ease-out);
}

.portfolio-item:hover .portfolio-img-inner {
  transform: scale(1.05);
}

.portfolio-meta {
  padding: clamp(18px, 2.5vw, 28px) clamp(18px, 2.5vw, 28px) clamp(22px, 3vw, 32px);
}

.portfolio-cat {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
}

.portfolio-meta h3 {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 500;
  color: var(--text-dark);
  margin-top: 8px;
  margin-bottom: 6px;
}

.portfolio-meta p {
  font-size: clamp(0.8rem, 1vw, 0.85rem);
  color: var(--text-dark-mid);
}

/* ==========================================================
   CONTACT
   ========================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.contact-details li {
  margin-bottom: clamp(20px, 3vw, 28px);
}

.contact-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.contact-value {
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  font-weight: 300;
  color: var(--text-mid);
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.5vw, 24px);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.5vw, 24px);
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--text-dim);
}

.form-group input,
.form-group textarea {
  padding: 16px 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  font-size: clamp(0.9rem, 1.1vw, 0.95rem);
  font-family: var(--font);
  font-weight: 300;
  color: var(--text);
  transition: border-color 0.3s var(--ease);
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
  /* iOS minimum 16px to prevent zoom */
  min-height: 48px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: 14px;
  min-height: 1.2em;
  color: var(--text-mid);
}

.form-status.is-success {
  color: var(--accent);
}

.form-status.is-error {
  color: #e08a8a;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 40px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.2s;
  align-self: flex-start;
  /* Minimum touch target */
  min-height: 48px;
}

.btn:hover {
  background: #b89448;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: clamp(28px, 4vw, 40px) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
}

.footer-logo img {
  height: clamp(80px, 8.75vh, 140px);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ==========================================================
   FADE-IN ANIMATION
   ========================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings */
.service-item.fade-in:nth-child(2) { transition-delay: 0.08s; }
.service-item.fade-in:nth-child(3) { transition-delay: 0.16s; }
.service-item.fade-in:nth-child(4) { transition-delay: 0.24s; }

.stat.fade-in:nth-child(2) { transition-delay: 0.1s; }
.stat.fade-in:nth-child(3) { transition-delay: 0.2s; }

.portfolio-item.fade-in:nth-child(2) { transition-delay: 0.1s; }
.portfolio-item.fade-in:nth-child(3) { transition-delay: 0.2s; }

/* ==========================================================
   RESPONSIVE — TABLET LANDSCAPE & SMALL DESKTOP
   (iPad Pro landscape, iPad Air landscape, small laptops)
   ========================================================== */
@media (max-width: 1024px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: rgba(0, 11, 31, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 5;
    /* Center the links */
    justify-content: center;
    align-items: center;
  }

  .nav.open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    text-align: center;
  }

  .nav-list a {
    display: block;
    padding: 20px 32px;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    letter-spacing: 3px;
    color: var(--text-mid);
    transition: color 0.3s var(--ease);
  }

  .nav-list a:hover,
  .nav-list a:active {
    color: #fff;
  }

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* ==========================================================
   RESPONSIVE — TABLET PORTRAIT
   (iPad Mini, iPad, iPad Air, iPad Pro portrait: 744–834px)
   ========================================================== */
@media (max-width: 834px) {
  .split {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tag {
    padding-top: 0;
  }

  .portfolio-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

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

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

  .hero-scroll-line {
    display: none;
  }

  .hero-sub {
    max-width: 100%;
  }
}

/* ==========================================================
   RESPONSIVE — LARGE PHONE / SMALL TABLET
   (iPhone Pro Max, Pixel XL, Galaxy Ultra, iPad Mini: 430–743px)
   ========================================================== */
@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: left;
  }

  .stat {
    padding: 20px 0;
    display: flex;
    align-items: baseline;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .stat:last-child {
    border-bottom: none;
  }

  .stat-number {
    min-width: 72px;
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .stat-label {
    margin-top: 0;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .btn {
    width: 100%;
    align-self: stretch;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* ==========================================================
   RESPONSIVE — SMALL PHONE
   (iPhone SE, iPhone Mini, Galaxy S series: 320–389px)
   ========================================================== */
@media (max-width: 389px) {
  :root {
    --pad-x: 16px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .display-heading {
    font-size: 1.4rem;
  }

  .nav-list a {
    padding: 16px 24px;
    font-size: 0.9rem;
  }

  .stat {
    gap: 12px;
  }

  .stat-number {
    min-width: 60px;
    font-size: 1.8rem;
  }
}

/* ==========================================================
   LANDSCAPE PHONES
   (prevents hero from being taller than visible area)
   ========================================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: 80px;
    padding-bottom: 32px;
  }

  .hero-content {
    flex: 0;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5vh, 3rem);
  }

  .hero-tag {
    margin-bottom: 16px;
  }

  .hero-bottom {
    padding-top: 24px;
  }

  .hero-scroll-line {
    display: none;
  }

  .section {
    padding: 48px 0;
  }

  .section-stats {
    padding: 32px 0;
  }

  .nav {
    height: 100dvh;
    overflow-y: auto;
  }

  .nav-list a {
    padding: 14px 32px;
  }
}

/* ==========================================================
   SAFE AREA INSETS (notched devices)
   ========================================================== */
@supports (padding: env(safe-area-inset-top)) {
  .header {
    padding-top: env(safe-area-inset-top);
  }

  .hero {
    padding-left: max(var(--pad-x), env(safe-area-inset-left));
    padding-right: max(var(--pad-x), env(safe-area-inset-right));
  }

  .nav {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .container {
    padding-left: max(var(--pad-x), env(safe-area-inset-left));
    padding-right: max(var(--pad-x), env(safe-area-inset-right));
  }

  .footer {
    padding-bottom: max(clamp(28px, 4vw, 40px), env(safe-area-inset-bottom));
  }
}

/* ==========================================================
   TOUCH DEVICE ADJUSTMENTS
   ========================================================== */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover-only effects on touch devices */
  .portfolio-item:hover {
    transform: none;
    box-shadow: none;
  }

  .portfolio-item:hover .portfolio-img-inner {
    transform: none;
  }

  .service-item:hover {
    background: transparent;
  }

  .service-item:hover .service-body h3 {
    color: var(--text);
  }

  /* Active states instead */
  .portfolio-item:active {
    transform: scale(0.98);
  }

  .btn:hover {
    transform: none;
  }

  .btn:active {
    background: #b89448;
    transform: scale(0.97);
  }

  /* Ensure inputs are at least 16px to prevent iOS zoom */
  .form-group input,
  .form-group textarea {
    font-size: 16px;
  }
}

/* ==========================================================
   ACCESSIBILITY — REDUCED MOTION
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in,
  .hero-tag,
  .hero-line,
  .hero-sub,
  .hero-scroll-line {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================
   HIGH CONTRAST / DARK MODE OVERRIDES
   ========================================================== */
@media (prefers-contrast: high) {
  :root {
    --text-mid: rgba(255, 255, 255, 0.75);
    --text-dim: rgba(255, 255, 255, 0.5);
    --border: rgba(255, 255, 255, 0.2);
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 56px);
  background: rgba(0, 11, 31, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), visibility 0.25s var(--ease-out);
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transform: scale(0.96);
  transition: transform 0.3s var(--ease-out);
}

.lightbox.open .lightbox-figure {
  transform: scale(1);
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: clamp(14px, 2.5vw, 28px);
  right: clamp(14px, 2.5vw, 28px);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
  outline: none;
}

body.lightbox-open {
  overflow: hidden;
}
