/* ==========================================================================
   Digital Twins (digitaltwins.be) | Architectural Portfolio Stylesheet
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg: #09090b;
  --bg-elevated: #111115;
  --topbar-scrolled: rgba(9, 9, 11, 0.78);
  --ink: #f4f3ef;
  --ink-soft: rgba(244, 243, 239, 0.68);
  --ink-muted: rgba(244, 243, 239, 0.44);
  --line: rgba(244, 243, 239, 0.12);
  --line-strong: rgba(244, 243, 239, 0.28);
  --pill-active-bg: #f4f3ef;
  --pill-active-ink: #09090b;
  --frame-bg: #131317;
}

[data-theme="light"] {
  --bg: #f4f2ec;
  --bg-elevated: #ebe8df;
  --topbar-scrolled: rgba(244, 242, 236, 0.86);
  --ink: #151517;
  --ink-soft: rgba(21, 21, 23, 0.72);
  --ink-muted: rgba(21, 21, 23, 0.48);
  --line: rgba(21, 21, 23, 0.12);
  --line-strong: rgba(21, 21, 23, 0.28);
  --pill-active-bg: #151517;
  --pill-active-ink: #f4f2ec;
  --frame-bg: #e4e1d8;
}

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

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-locked {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
}

button,
a {
  font: inherit;
  color: inherit;
  text-decoration: none;
}

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

:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 4px;
}

.container {
  width: min(1480px, calc(100% - clamp(2.25rem, 6vw, 6.5rem)));
  margin-inline: auto;
}

.mono-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Brand Twin "ii" Mark */
.twin-mark {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
  height: 13px;
}

.twin-mark i {
  display: block;
  width: 3px;
  height: 13px;
  background: currentColor;
  position: relative;
}

.twin-mark i::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bg);
}

/* Scroll Progress Line */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 120;
  pointer-events: none;
  opacity: 0.85;
}

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

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 1.1rem clamp(1.15rem, 3vw, 3.25rem);
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease, padding 0.35s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

[data-theme="dark"] .topbar:not(.is-scrolled),
[data-theme="light"] .topbar:not(.is-scrolled) {
  color: #f4f3ef;
}

.topbar:not(.is-scrolled) .brand-logo--dark {
  display: block !important;
}

.topbar:not(.is-scrolled) .brand-logo--light {
  display: none !important;
}

.topbar.is-scrolled {
  padding-block: 0.78rem;
  background: var(--topbar-scrolled);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom-color: var(--line);
}

.topbar-inner {
  max-width: 1600px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.25s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand-logo {
  height: clamp(34px, 3.6vw, 44px);
  width: auto;
}

[data-theme="dark"] .brand-logo--light {
  display: none;
}

[data-theme="light"] .brand-logo--dark {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  padding-block: 0.25rem;
  display: inline-flex;
  align-items: baseline;
  opacity: 0.86;
  transition: opacity 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover {
  opacity: 1;
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.25s ease;
}

.theme-toggle:hover {
  border-color: color-mix(in srgb, currentColor 60%, transparent);
}

.theme-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

[data-theme="light"] .topbar.is-scrolled .theme-dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.8px currentColor;
}

/* Mobile Menu Button & Drawer */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s ease;
}

.mobile-menu-btn[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: var(--bg);
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6.5rem 1.75rem 2.5rem;
}

.mobile-drawer.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-block: auto;
}

.mobile-nav-link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.mobile-nav-link span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.mobile-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-email {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 500;
}

/* ==========================================================================
   Full-Viewport Architectural Cinema Hero (100% Viewport)
   ========================================================================== */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  background: #070709;
  color: #f4f3ef;
}

.hero-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.25s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 2;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(6, 6, 8, 0.42) 0%, rgba(6, 6, 8, 0.02) 34%, rgba(6, 6, 8, 0.14) 64%, rgba(6, 6, 8, 0.78) 100%),
    radial-gradient(circle at 18% 85%, rgba(6, 6, 8, 0.4), transparent 55%);
  pointer-events: none;
}

.hero-overlay {
  position: relative;
  z-index: 4;
  height: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: 6.5rem clamp(1.25rem, 3vw, 3.25rem) clamp(1.5rem, 3vh, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.75rem;
}

.hero-copy {
  max-width: 780px;
}

.hero-brand {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(248, 247, 244, 0.92);
  margin-bottom: 0.4rem;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.85rem, 7vw, 6.2rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.04em;
  color: #f8f7f4;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: clamp(0.98rem, 1.4vw, 1.18rem);
  font-weight: 400;
  color: rgba(244, 243, 239, 0.82);
  max-width: 52ch;
  line-height: 1.45;
}

.hero-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(244, 243, 239, 0.18);
}

.hero-scrubber {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.scrub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.15rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: rgba(244, 243, 239, 0.5);
  transition: color 0.3s ease;
}

.scrub-btn:hover,
.scrub-btn.is-active {
  color: #ffffff;
}

.scrub-track {
  width: clamp(28px, 4.5vw, 56px);
  height: 2px;
  background: rgba(244, 243, 239, 0.24);
  overflow: hidden;
  position: relative;
}

.scrub-fill {
  position: absolute;
  inset: 0;
  background: #ffffff;
  transform-origin: left;
  transform: scaleX(0);
}

.scrub-btn.is-active .scrub-fill {
  animation: heroProgress 6.2s linear forwards;
}

@keyframes heroProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(244, 243, 239, 0.85);
  transition: transform 0.3s ease;
}

.scroll-cue .mono-label {
  color: inherit;
}

.scroll-cue:hover {
  transform: translateY(2px);
}

/* ==========================================================================
   Portfolio Exhibition Section (Balanced Scale & Pixel-Aligned Rows)
   ========================================================================== */

.work-section {
  position: relative;
  padding-top: clamp(1.25rem, 2.5vw, 2.25rem);
  padding-bottom: clamp(4rem, 7vw, 7rem);
}

.work-toolbar {
  position: sticky;
  top: 60px;
  z-index: 60;
  padding-block: 0.8rem;
  margin-bottom: clamp(1.5rem, 2.8vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-block: 1px solid var(--line);
  transition: background-color 0.45s ease, border-color 0.45s ease;
}

.work-toolbar-inner {
  width: min(1480px, calc(100% - clamp(2.25rem, 6vw, 6.5rem)));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-group::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 0.46rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-soft);
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: baseline;
}

.filter-pill:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.filter-pill.is-active {
  background: var(--pill-active-bg);
  color: var(--pill-active-ink);
  border-color: var(--pill-active-bg);
}

/* Balanced Editorial Grid: Centered Container + Crisp Row Alignment */
.gallery {
  width: min(1480px, calc(100% - clamp(2.25rem, 6vw, 6.5rem)));
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.95rem, 1.5vw, 1.55rem);
  align-items: stretch;
}

/* Editorial Slot Spans & True-Orientation Proportions */
.gallery .card[data-slot="pano"] {
  grid-column: 1 / -1;
}

.gallery .card[data-slot="pano"] .card-media {
  aspect-ratio: 16 / 9.6;
}

.gallery .card[data-slot="feature-center"] {
  grid-column: 2 / 12;
  margin-block: clamp(0.4rem, 1vw, 1rem);
}

.gallery .card[data-slot="feature-center"] .card-media {
  aspect-ratio: 1.42 / 1;
}

/* Diptych: 8-col Landscape + 4-col Portrait (exact matched row height) */
.gallery .card[data-slot="wide-left"] {
  grid-column: 1 / 9;
}

.gallery .card[data-slot="wide-left"] .card-media {
  aspect-ratio: 1.45 / 1;
}

.gallery .card[data-slot="tall-right"] {
  grid-column: 9 / 13;
}

/* Diptych: 4-col Portrait + 8-col Landscape (exact matched row height) */
.gallery .card[data-slot="tall-left"] {
  grid-column: 1 / 5;
}

.gallery .card[data-slot="wide-right"] {
  grid-column: 5 / 13;
}

.gallery .card[data-slot="wide-right"] .card-media {
  aspect-ratio: 1.45 / 1;
}

/* Diptych: 7-col Square + 5-col Portrait (exact matched row height) */
.gallery .card[data-slot="square-left"] {
  grid-column: 1 / 8;
}

.gallery .card[data-slot="square-left"] .card-media {
  aspect-ratio: 1.02 / 1;
}

.gallery .card[data-slot="tall-right-5"] {
  grid-column: 8 / 13;
}

/* 2-up Landscapes (6 + 6) */
.gallery .card[data-slot="half"],
.gallery .card[data-slot="half-offset"] {
  grid-column: span 6;
}

.gallery .card[data-slot="half"] .card-media,
.gallery .card[data-slot="half-offset"] .card-media {
  aspect-ratio: 1.45 / 1;
}

/* 3-up Portraits (4 + 4 + 4) */
.gallery .card[data-slot="third"],
.gallery .card[data-slot="third-mid"] {
  grid-column: span 4;
}

.gallery .card[data-slot="third"] .card-media,
.gallery .card[data-slot="third-mid"] .card-media {
  aspect-ratio: 0.74 / 1;
}

/* 2-up Portraits (when filtered subset has a pair of portraits) */
.gallery .card[data-slot="portrait-half"] {
  grid-column: span 6;
}

.gallery .card[data-slot="portrait-half"] .card-media {
  aspect-ratio: 0.74 / 1;
}

/* Visual Card & Stretch-Aligned Media */
.card {
  position: relative;
  cursor: pointer;
  display: flex;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.card-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--frame-bg);
}

.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.001);
  transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.card:hover .card-media img {
  transform: scale(1.028);
}

.card-reticle {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(9, 9, 11, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f4f3ef;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.card:hover .card-reticle {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   Ethos / Statement Band
   ========================================================================== */

.statement-band {
  padding-block: clamp(4.5rem, 9vw, 8.5rem);
  border-top: 1px solid var(--line);
}

.statement-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.75rem, 3.8vw, 3.35rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.03em;
  max-width: 26ch;
  color: var(--ink);
}

.statement-text em {
  font-style: normal;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-strong);
}

/* ==========================================================================
   Capabilities Matrix + Kinetic Vector Schematic
   ========================================================================== */

.capabilities-section {
  padding-block: clamp(4.5rem, 9vw, 8.5rem);
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  flex-wrap: wrap;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4.6vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-top: 0.55rem;
}

.section-note {
  max-width: 38ch;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.cap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.cap-list {
  border-top: 1px solid var(--line);
}

.cap-item {
  border-bottom: 1px solid var(--line);
  padding-block: clamp(1.1rem, 2vw, 1.55rem);
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.cap-item:hover,
.cap-item.is-active {
  border-bottom-color: var(--line-strong);
}

.cap-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto 1.25rem;
  align-items: center;
  gap: 1rem;
}

.cap-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-muted);
  transition: color 0.25s ease;
}

.cap-item.is-active .cap-num {
  color: var(--ink);
}

.cap-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.cap-item:hover .cap-name,
.cap-item.is-active .cap-name {
  transform: translateX(6px);
}

.cap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.cap-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.cap-item.is-active .cap-tags span {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.cap-toggle-icon {
  position: relative;
  width: 12px;
  height: 12px;
  justify-self: end;
}

.cap-toggle-icon::before,
.cap-toggle-icon::after {
  content: "";
  position: absolute;
  background: var(--ink-muted);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.cap-toggle-icon::before {
  top: 5.5px;
  left: 0;
  width: 12px;
  height: 1px;
}

.cap-toggle-icon::after {
  top: 0;
  left: 5.5px;
  width: 1px;
  height: 12px;
}

.cap-item.is-active .cap-toggle-icon::after {
  transform: scaleY(0);
}

.cap-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  opacity: 0;
}

.cap-detail > p {
  overflow: hidden;
  padding-left: 3.5rem;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.55;
}

.cap-item.is-active .cap-detail {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0.7rem;
}

/* Sticky Schematic Card */
.cap-viewport {
  position: sticky;
  top: 132px;
}

.cap-viewport-card {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 1;
  transition: background-color 0.45s ease, border-color 0.45s ease;
}

.cap-viewport-top,
.cap-viewport-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cap-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--ink);
}

.cap-canvas svg {
  width: 100%;
  height: 100%;
  max-width: 260px;
  max-height: 260px;
  overflow: visible;
}

.svg-draw {
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: drawLine 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.svg-pulse {
  animation: pulseFade 3.2s ease-in-out infinite;
}

.svg-spin {
  transform-origin: 120px 120px;
  animation: slowSpin 18s linear infinite;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes pulseFade {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Monumental Contact Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--line);
  padding-top: clamp(4.5rem, 9vw, 8.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  background: var(--bg);
}

.footer-hero {
  margin-bottom: clamp(4rem, 8vw, 7.5rem);
}

.email-block {
  margin-top: 1rem;
}

.giant-email {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.75rem, 5.6vw, 5.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  position: relative;
  word-break: break-all;
}

.giant-email::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0.18);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.giant-email:hover::after {
  transform: scaleX(1);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-logo {
  height: 30px;
  width: auto;
}

.footer-domain {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

.back-top {
  margin-left: 0.75rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--ink);
  transition: border-color 0.25s ease;
}

.back-top:hover {
  border-color: var(--ink);
}

/* ==========================================================================
   Scroll Reveal Utility
   ========================================================================== */

.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Fullscreen Architectural Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 6, 8, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #f4f3ef;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

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

.lightbox-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.15rem clamp(1rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  background: linear-gradient(180deg, rgba(6, 6, 8, 0.75), transparent);
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lb-btn,
.lb-nav {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(244, 243, 239, 0.2);
  background: rgba(15, 15, 18, 0.6);
  color: #f4f3ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.lb-btn:hover,
.lb-nav:hover {
  background: rgba(244, 243, 239, 0.14);
  border-color: rgba(244, 243, 239, 0.55);
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
}

.lb-prev { left: clamp(0.75rem, 2vw, 2rem); }
.lb-next { right: clamp(0.75rem, 2vw, 2rem); }

.lightbox-stage {
  width: 100%;
  height: 100%;
  padding: 4.5rem clamp(1rem, 5vw, 4.5rem) 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.lightbox.is-zoomed .lightbox-stage {
  cursor: zoom-out;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65);
}

.lightbox.is-zoomed .lightbox-img {
  transform: scale(1.85);
}

/* ==========================================================================
   Responsive & Mobile Refinements
   ========================================================================== */

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

  .cap-viewport {
    display: none;
  }
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .work-toolbar {
    top: 58px;
  }

  .work-toolbar-inner,
  .gallery {
    width: calc(100% - 2rem);
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .gallery .card[data-slot="pano"],
  .gallery .card[data-slot="wide-left"],
  .gallery .card[data-slot="wide-right"],
  .gallery .card[data-slot="square-left"],
  .gallery .card[data-slot="feature-center"] {
    grid-column: 1 / -1;
    margin-block: 0;
  }

  .gallery .card[data-slot="tall-left"],
  .gallery .card[data-slot="tall-right"],
  .gallery .card[data-slot="tall-right-5"],
  .gallery .card[data-slot="half"],
  .gallery .card[data-slot="half-offset"],
  .gallery .card[data-slot="third"],
  .gallery .card[data-slot="third-mid"],
  .gallery .card[data-slot="portrait-half"] {
    grid-column: span 1;
  }

  /* Explicit portrait aspect ratio when portrait cards sit in 2-col or 1-col mobile flow */
  .gallery .card[data-slot="tall-left"] .card-media,
  .gallery .card[data-slot="tall-right"] .card-media,
  .gallery .card[data-slot="tall-right-5"] .card-media {
    aspect-ratio: 0.72 / 1;
  }

  .cap-row {
    grid-template-columns: 2rem minmax(0, 1fr) 1.25rem;
  }

  .cap-tags {
    grid-column: 2 / 3;
    justify-content: flex-start;
    margin-top: 0.25rem;
  }

  .cap-toggle-icon {
    grid-column: 3;
    grid-row: 1;
  }

  .cap-detail > p {
    padding-left: 2rem;
  }
}

@media (max-width: 580px) {
  .theme-label {
    display: none;
  }

  .theme-toggle {
    padding: 0.5rem;
  }

  .hero-title {
    font-size: clamp(2.4rem, 11vw, 3.3rem);
  }

  .work-toolbar-inner,
  .gallery {
    width: calc(100% - 1.5rem);
  }

  .gallery .card {
    grid-column: 1 / -1 !important;
  }

  .lightbox-stage {
    padding: 4rem 0.5rem 4.5rem;
  }

  .lb-nav {
    top: auto;
    bottom: 1.1rem;
    transform: none;
  }

  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
