/* ==========================================================================
   Yann Visuals Portfolio - Premium CSS Design System (Light Mode & Top Nav)
   ========================================================================== */

/* 1. CSS Variables & Reset */
:root {
  --bg-color: #f4f4f4;
  --bg-color-rgb: 244, 244, 244;
  --bg-sidebar: #f4f4f4;
  --bg-card: #f8f8f8;
  --bg-drawer: #ffffff;

  --text-main: #231f20;
  --text-muted: #767676;
  --text-accent: #231f20;

  --border-color: rgba(35, 31, 32, 0.08);
  --border-active: rgba(35, 31, 32, 0.9);
  --border-hover: rgba(35, 31, 32, 0.15);

  --scrollbar-thumb: #cccccc;
  --scrollbar-thumb-hover: #999999;


  --spinner-track: rgba(0, 0, 0, 0.05);
  --cursor-hover-bg: rgba(0, 0, 0, 0.04);

  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --header-h: 56px;
  --footer-h: 40px;
  --footer-line: #d4d4d4; /* light grey */
  --transition-drawer: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-theme: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
}

/* Dark theme palette — same structure, inverted tones */
:root[data-theme="dark"] {
  --footer-line: #3a3a3a;
  --bg-color: #121212;
  --bg-color-rgb: 18, 18, 18;
  --bg-sidebar: #121212;
  --bg-card: #1c1c1c;
  --bg-drawer: #161616;

  --text-main: #f4f4f4;
  --text-muted: #8a8a8a;
  --text-accent: #f4f4f4;

  --border-color: rgba(244, 244, 244, 0.08);
  --border-active: rgba(244, 244, 244, 0.9);
  --border-hover: rgba(244, 244, 244, 0.18);

  --scrollbar-thumb: #3a3a3a;
  --scrollbar-thumb-hover: #555555;


  --spinner-track: rgba(244, 244, 244, 0.08);
  --cursor-hover-bg: rgba(244, 244, 244, 0.08);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: var(--transition-theme);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -ms-content-zooming: none;
  -webkit-text-size-adjust: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.4em;
  overflow-y: scroll;
  overflow-x: hidden;
  background-color: var(--bg-color);
  transition: var(--transition-theme);
}

body.drawer-open {
  overflow: hidden;
}

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

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* ==========================================================================
   2. Layout Structure & Top Header
   ========================================================================== */
.layout-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Site Header Styling */
.site-header {
  height: 140px;
  width: 100%;
  max-width: 1712px;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(var(--bg-color-rgb), 1), rgba(var(--bg-color-rgb), 0));
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 50px 60px 0;
  z-index: 250;
  transition: var(--transition-smooth), background 0.35s ease;
  pointer-events: none;
}

.header-brand,
.header-nav {
  pointer-events: auto;
}

/* Once the page is scrolled, content passing under the header is blurred, strongest at the top and
   fading out toward the bottom edge: a strong layer (::before) and a light layer (::after), each masked */
.site-header::before,
.site-header::after {
  content: '';
  position: absolute;
  inset: 0 0 -24px;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.site-header::before {
  background: rgba(var(--bg-color-rgb), 0.3);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 80%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 80%);
}

.site-header::after {
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 20%, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 20%, #000 60%, transparent 100%);
}

.site-header.is-scrolled {
  background: none;
}

.site-header.is-scrolled::before,
.site-header.is-scrolled::after {
  opacity: 1;
}

.brand-link {
  display: flex;
  align-items: center;
}

.brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.4em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-main);
}

/* Light/Dark Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle:hover {
  color: var(--text-accent);
}

.theme-icon {
  width: 18px;
  height: 18px;
}

.theme-icon.icon-sun {
  display: none;
}

.theme-icon.icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-icon.icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-icon.icon-moon {
  display: none;
}

/* Header Navigation List */
.nav-list {
  list-style: none;
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.4em;
  color: var(--text-muted);
  padding: 8px 0;
  display: inline-block;
  text-transform: uppercase;
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--text-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
  color: var(--text-accent);
}

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

.nav-link.active {
  color: var(--text-accent);
}

/* On hover of nav list, non-active, non-hovered nav links become light grey */
.nav-list:hover .nav-link:not(:hover):not(.active) {
  color: #cccccc;
}

/* Main Content Wrapper */
.main-content {
  flex-grow: 1;
  padding: 180px 40px 60px; /* Clears top header shifted down by 50px */
  min-height: 100vh;
  position: relative;
  max-width: 1712px; /* Aligns with header max-width */
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   3. Navigation Views
   ========================================================================== */
.content-section {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  margin-bottom: 50px;
  max-width: 700px;
}

.view-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 15px;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ==========================================================================
   4. Project Grid & Thumbnails (No Rounded Corners)
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* every card the same width, no gap */
  gap: 0;
  position: relative;
}

.grid-loader {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--text-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@keyframes fadeOpacityAppearance {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Project Card Layout Variants (Strictly Hard Corners) */
.project-card {
  position: relative;
  background-color: var(--bg-card);
  border-radius: 0; /* No curved corners */
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, background-color 0.35s ease;
  height: 406px;
  opacity: 0;
  animation: fadeOpacityAppearance 0.5s ease forwards;
}

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

.card-media-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-card);
  border-radius: 0; /* No curved corners */
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  filter: brightness(0.95);
}

.card-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  border-radius: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Info Overlay: Always Dark/Translucent overlay with white text to keep renders readable */
.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px;
  background: transparent;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(0);
  transition: var(--transition-smooth);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: #b0b0b0; /* Light gray for readability */
  text-transform: uppercase;
}

.card-year {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  color: #b0b0b0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 12px; /* same as the homepage project titles */
  font-weight: 400;
  line-height: 16px;
  color: #ffffff; /* White text */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Hover behaviors */

.project-card:hover .card-video {
  opacity: 1;
}

.project-card:hover .card-info {
  background: transparent;
}

/* ==========================================================================
   5. MVSM-Style Project Drawer (Sliding Panel)
   ========================================================================== */
.project-drawer {
  position: fixed;
  top: 0; /* Covers the full height; the header floats above it */
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  display: flex;
  justify-content: flex-start; /* Slide open from the left side */
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.6s step-end;
}

.project-drawer.active {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s step-start;
}

.drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
}

.project-drawer.active .drawer-backdrop {
  /* No visual overlays to prevent background opacity shifts */
}

.drawer-panel {
  position: relative;
  width: 100vw; /* Cover the entire screen */
  height: 100%;
  background-color: var(--bg-drawer);
  box-shadow: 15px 0 40px rgba(0, 0, 0, 0.05);
  display: flex;
  transform: translateX(-100%); /* Slide from the left */
  transition: var(--transition-drawer);
  z-index: 5;
}

.project-drawer.active .drawer-panel {
  transform: translateX(0);
}

/* Scrollable Content Container */
.drawer-scroll-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: calc(var(--header-h) + 40px) 0 100px;
  position: relative;
  background-color: var(--bg-drawer);
  box-sizing: border-box; /* ensure padding doesn't expand width */
}

#drawer-dynamic-content {
  width: 1300px;
  max-width: calc(100% - 160px); /* Leave 80px space on each side on medium viewports */
  margin: 0 auto;
  padding: 0 40px;
}

/* Drawer Inner Details */
/* "<- All projects" link above the title, same look as the homepage's "View all projects" */
.drawer-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin-bottom: 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.drawer-back-arrow {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-back:hover,
.drawer-back:focus-visible {
  color: var(--text-main);
}

.drawer-back:hover .drawer-back-arrow,
.drawer-back:focus-visible .drawer-back-arrow {
  transform: translateX(-8px);
}

.drawer-header {
  margin-bottom: 24px;
  text-align: left;
}

.drawer-meta-line {
  display: flex;
  gap: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-accent);
}

/* Vimeo Player Component (No Rounded Corners) */
.vimeo-facade-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 0; /* No curved corners */
  overflow: hidden;
  margin-bottom: 50px;
}

/* Portrait embeds (e.g. 9/16 vertical video) - cap the width instead of
   letting a 16:9-sized wrapper stretch to an enormous height */
.vimeo-facade-wrapper.is-portrait {
  width: auto;
  max-width: 480px;
  max-height: 85vh;
  margin: 0 auto 50px;
}

/* Multiple portrait embeds shown side by side (e.g. two 9/16 videos) -
   the row as a whole takes 80% of the page width, split evenly */
.vimeo-facade-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  width: 80%;
  margin: 0 auto 50px;
}

.vimeo-facade-row .vimeo-facade-wrapper.is-portrait {
  margin: 0;
  max-width: none;
  flex: 1 1 0;
}

@media (max-width: 768px) {
  .vimeo-facade-wrapper.is-portrait {
    max-width: 100%;
  }
  .vimeo-facade-row {
    width: 100%;
  }
  .vimeo-facade-row .vimeo-facade-wrapper.is-portrait {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

.vimeo-facade-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 5;
}

/* Narrative Grid */
.drawer-info-grid {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 50px;
  margin-bottom: 60px;
}

.drawer-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-main);
}

.drawer-description p {
  margin-bottom: 1.2em;
}

.drawer-description p:last-child {
  margin-bottom: 0;
}

.drawer-specs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 1px solid var(--border-color);
  padding-left: 30px;
}

.spec-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.9rem;
  line-height: 1.6;
}

.spec-label {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-muted);
}

.spec-value {
  color: var(--text-accent);
  font-weight: 500;
}

.drawer-making-of {
  max-width: 800px;
  margin-bottom: 60px;
}

.drawer-making-of-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-accent);
  margin-bottom: 20px;
}

.drawer-making-of-video {
  margin-top: 30px;
  margin-bottom: 0;
}


.filter-status {
  display: none;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
}

.clear-filter-btn {
  font-weight: 700;
  color: var(--text-accent);
  text-decoration: underline;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.clear-filter-btn:hover {
  opacity: 0.7;
}

/* Gallery Stills (No Rounded Corners) */
.drawer-gallery {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Before / After Image Comparison Sliders */
.drawer-comparisons {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 30px;
}

.compare-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  cursor: ew-resize;
  user-select: none;
  touch-action: pan-y;
}

.compare-sizer {
  width: 100%;
  height: auto;
  display: block;
  visibility: hidden;
  pointer-events: none;
}

.compare-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #ffffff;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.compare-handle-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #131313;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.compare-handle-circle svg {
  width: 20px;
  height: 20px;
}

.gallery-img {
  width: 100%;
  border-radius: 0; /* No curved corners */
  object-fit: cover;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

/* ==========================================================================
   6. About View
   ========================================================================== */

/* About Section */
.about-container {
  width: 100%;
  padding-top: 30px;
}

@media (min-width: 769px) {
  .about-container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

.about-avatar-wrapper {
  display: flex;
  justify-content: flex-start;
}

.about-avatar {
  width: 141px;
  height: 141px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  display: block;
}

.about-hero-description {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-location-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #404040;
}

:root[data-theme="dark"] .about-location-time {
  color: #a3a3a3;
}

.location-country {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.location-clock-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.location-time {
  font-variant-numeric: tabular-nums;
}

.about-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  color: var(--text-accent);
}

.about-tagline {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  text-transform: none;
  margin-left: 8px;
  display: inline-block;
}

.about-content-grid {
  display: grid;
  grid-template-columns: 7fr 4fr;
  gap: 60px;
}

.about-main-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-main);
}

.skills-container-row {
  display: flex;
  gap: 40px;
  margin-top: 40px;
}

.skills-container-row .skills-section {
  flex: 1;
  margin-top: 0;
}

.skills-section {
  margin-top: 40px;
}

.skills-section h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skills-tags span {
  font-size: 0.8rem;
  font-weight: 500;
  background-color: var(--bg-card);
  padding: 8px 16px;
  border-radius: 0;
  border: 1px solid var(--border-color);
  color: var(--text-accent);
}

.about-sidebar-info {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.info-block h4 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.info-block p {
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 500;
}

.about-sidebar-link {
  color: var(--text-main);
  position: relative;
  display: inline-block;
  padding-bottom: 4px;
  transition: var(--transition-smooth);
}

.about-sidebar-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--text-accent);
  transform: scaleX(0.2);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-sidebar-link:hover {
  transform: translateX(4px);
}

.about-sidebar-link:hover::after {
  transform: scaleX(1);
}

.about-sidebar-socials {
  display: flex;
  gap: 8px;
  align-items: center;
}

.about-sidebar-socials .separator {
  color: var(--border-color);
}


.availability-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 0.95rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #2edb56;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(46, 219, 86, 0.4);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 219, 86, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(46, 219, 86, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 219, 86, 0);
  }
}

/* Useless View (Personal Series Manifesto) */
/* Same distance under the header as the Work project pages (first element 98px from the top on desktop) */
@media (min-width: 769px) {
  #useless-view,
  #archviz-view {
    margin-top: calc(var(--header-h) + 42px - 210px); /* 210px = main-content padding (180) + container inset (30) */
  }
}

/* 2x2 film grid: equal tiles; the gap matches the Archviz grid's 10px */
.useless-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 40px;
}

.useless-tile {
  position: relative;
  display: block;
  padding: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-card);
  border: none;
  cursor: pointer;
  text-align: left;
  color: #fff;
}

.useless-tile-img,
.useless-tile-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

.useless-tile-img {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.useless-tile-img.is-loaded {
  opacity: 1;
}

.useless-tile:hover .useless-tile-img {
  transform: scale(1.03);
}

.useless-tile-preview {
  pointer-events: none;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.5s ease;
}

.useless-tile-preview.is-playing {
  opacity: 1;
}

.useless-tile-title {
  position: absolute;
  left: 20px;
  bottom: 18px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.useless-tile:focus-visible {
  outline: 1px solid var(--text-main);
  outline-offset: -4px;
}

/* Film player */
.useless-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.useless-modal.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

.useless-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.92);
}

.useless-modal-box {
  position: relative;
  width: min(1200px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
}

.useless-modal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}

.useless-modal-close {
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: rgba(255, 255, 255, 0.7);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.useless-modal-close:hover,
.useless-modal-close:focus-visible {
  color: #fff;
}

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

.useless-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  overflow: hidden;
}

.useless-video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Archviz View (Grid + Lightbox) - full main-content width, matching the Work grid */
.archviz-intro {
  margin-top: 30px;
  max-width: 720px;
}

/* Masonry: CSS multi-column layout, each item's height follows its own image's natural aspect ratio */
.archviz-grid {
  column-count: 3;
  column-gap: 10px;
  margin-top: 60px;
}

.archviz-item {
  position: relative;
  display: block;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  cursor: pointer;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}

/* Added by JS via IntersectionObserver as each item scrolls into view - reveals top to bottom instead of all at once */
.archviz-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.archviz-item:hover {
  border-color: var(--border-hover);
}

.archviz-image {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.97);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.archviz-item:hover .archviz-image {
  transform: scale(1.04);
}

@media (max-width: 1024px) {
  .archviz-grid {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .archviz-grid {
    column-count: 1;
  }
}

/* Archviz Lightbox */
.archviz-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.archviz-lightbox.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

.archviz-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.92);
}

.archviz-lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
  pointer-events: none;
  box-sizing: border-box;
}

.archviz-lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.archviz-lightbox-close,
.archviz-lightbox-nav {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0.8;
}

.archviz-lightbox-close:hover,
.archviz-lightbox-nav:hover {
  opacity: 1;
}

.archviz-lightbox-close {
  top: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
}

.archviz-lightbox-close svg {
  width: 24px;
  height: 24px;
}

.archviz-lightbox-close:hover {
  transform: scale(1.15) rotate(90deg);
}

.archviz-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
}

.archviz-lightbox-nav:hover {
  transform: translateY(-50%) scale(1.15);
}

.archviz-lightbox-nav svg {
  width: 28px;
  height: 28px;
}

.archviz-lightbox-prev {
  left: 20px;
}

.archviz-lightbox-next {
  right: 20px;
}

@media (max-width: 768px) {
  .archviz-lightbox-content {
    padding: 24px;
  }
  .archviz-lightbox-close {
    top: 20px;
    right: 20px;
  }
  .archviz-lightbox-nav {
    width: 44px;
    height: 44px;
  }
  .archviz-lightbox-prev {
    left: 8px;
  }
  .archviz-lightbox-next {
    right: 8px;
  }
}

/* ==========================================================================
   7. Custom Cursor Dot
   ========================================================================== */
/* Minimal Mouse Follower Cursor Dot */
.custom-cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background-color: var(--text-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease, width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border 0.25s ease;
}

.custom-cursor.hover {
  width: 24px;
  height: 24px;
  background-color: var(--cursor-hover-bg);
  border: 1.5px solid var(--text-accent);
}

/* Text label on the cursor (e.g. "Open" over a Useless film) */
.custom-cursor.has-label {
  transform: translate(14px, 14px); /* sits beside the pointer instead of on it */
  width: auto;
  height: 30px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  border: none;
  border-radius: 15px;
  background-color: #fff;
  color: #0c0c0c;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Responsive Breakpoints */

/* Tablet / Laptop Breakpoint */
@media (max-width: 1024px) {
  .site-header {
    padding: 50px 60px 0;
  }
  .main-content {
    padding: 120px 40px 40px;
  }
  .drawer-panel {
    width: 100vw;
  }
  .drawer-scroll-container {
    padding: calc(var(--header-h) + 40px) 50px 50px;
  }
  .about-content-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-sidebar-info {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .info-block {
    flex: 1 1 200px;
  }
}

/* Tablet Portrait & Mobile Breakpoint */
@media (max-width: 768px) {
  .custom-cursor {
    display: none !important;
  }
  .card-video {
    display: none !important;
  }
  .main-content {
    margin-top: 70px;
    padding: 30px 24px;
  }
  .view-title {
    font-size: 2rem;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .project-card {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .card-info {
    padding: 20px;
  }
  .drawer-panel {
    width: 100%;
    flex-direction: column;
  }
  .drawer-scroll-container {
    padding: calc(var(--header-h) + 50px) 24px 60px;
  }
  #drawer-dynamic-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  .drawer-info-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .drawer-specs {
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-left: 0;
    padding-top: 20px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .skills-container-row {
    flex-direction: column;
    gap: 30px;
  }
  .about-avatar {
    width: 94px;
    height: 94px;
  }
  .about-title {
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   9. Homepage (full-screen video + hand-picked project list) & full-bleed Work grid
   ========================================================================== */

/* --- Home layer: covers the whole viewport; header floats on top of it --- */
.content-section.home-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  color: #fff;
  transform: none;
  overflow: hidden;
}

body.is-home {
  overflow: hidden;
}

.home-videos {
  position: absolute;
  inset: 0;
}

.home-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.home-video.active {
  opacity: 1;
}

/* Vimeo background: the still shows first, the iframe (sized to cover the screen at the film's
   own aspect ratio) fades in once its first frame plays */
.home-vimeo {
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.home-vimeo iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, calc(100vh * var(--ar, 1.7778)));
  height: max(100vh, calc(100vw / var(--ar, 1.7778)));
  transform: translate(-50%, -50%);
  border: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.home-vimeo.is-ready iframe {
  opacity: 1;
}

/* Dims the footage so the list stays readable on any clip, with a soft vignette */
.home-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%),
    rgba(0, 0, 0, 0.18);
}

.home-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1100px, calc(100% - 80px));
}

.home-list {
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.home-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  opacity: 0;
  transform: translateY(12px);
  animation: homeRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.08s + 0.15s);
}

@keyframes homeRise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-link {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 48px;
  align-items: center;
  gap: 16px;
  padding: 8px 4px;
  color: #fff;
}

.home-num,
.home-cat,
.home-year {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.home-year {
  text-align: right;
}

.home-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.35s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* The row whose video is on screen (last hovered) is lit; hover/focus lights it immediately */
.home-item.is-active .home-title,
.home-link:hover .home-title,
.home-link:focus-visible .home-title {
  color: #fff;
}

.home-item.is-active .home-num,
.home-item.is-active .home-cat,
.home-item.is-active .home-year {
  color: rgba(255, 255, 255, 0.8);
}

.home-link:hover .home-title,
.home-link:focus-visible .home-title {
  transform: translateX(10px);
}

.home-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: -1px;
}

.home-view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.3s ease;
}

.home-view-all .home-arrow {
  font-size: 12px;
  line-height: 16px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-view-all:hover,
.home-view-all:focus-visible {
  color: #fff;
}

.home-view-all:hover .home-arrow,
.home-view-all:focus-visible .home-arrow {
  transform: translateX(8px);
}

/* --- Header floats over the video on the homepage: transparent, always light text --- */
body.is-home .site-header,
body.is-work .site-header {
  max-width: none;
  height: 56px;
  padding: 0 28px;
}

body.is-home .site-header,
body.drawer-open .site-header {
  background: none;
}

body.is-home:not(.drawer-open) .brand-title,
body.is-home:not(.drawer-open) .nav-link.active,
body.is-home:not(.drawer-open) .theme-toggle:hover {
  color: #fff;
}

body.is-home:not(.drawer-open) .nav-link,
body.is-home:not(.drawer-open) .theme-toggle {
  color: rgba(255, 255, 255, 0.7);
}

body.is-home:not(.drawer-open) .nav-link::after {
  background-color: #fff;
}

body.is-home .nav-list:hover .nav-link:not(:hover):not(.active) {
  color: rgba(255, 255, 255, 0.4);
}

body.is-home .custom-cursor {
  background-color: #fff;
}

body.is-home .custom-cursor.hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

/* --- Work page: all projects, full-bleed and sized to the screen (2 rows per screen) --- */
@media (min-width: 769px) {
  body.is-work .main-content {
    max-width: none;
    padding: var(--header-h) 0 0; /* only clears the header; cards run to the window edges */
  }

  body.is-work .project-card {
    border: none; /* cards touch, no lines between them */
    height: max(300px, calc((100vh - var(--header-h)) / 2));
  }
}

/* --- Homepage on phones: drop the category column, tighten spacing --- */
@media (max-width: 768px) {
  .home-content {
    width: calc(100% - 48px);
  }

  .home-link {
    grid-template-columns: 28px minmax(0, 1fr) 40px;
    gap: 12px;
    padding: 14px 0;
  }

  .home-cat {
    display: none;
  }

  .home-title {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-item {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .home-video {
    transition: none;
  }
}

/* ==========================================================================
   10. Header: site name + menu, collapsing into a MENU button when they do not fit
   ========================================================================== */
.site-header {
  height: 56px;
  padding: 0 40px;
}

.header-brand,
.header-nav {
  flex: none;
}

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

/* States set by fitHeader() in main.js */
.site-header.is-short .brand-tagline {
  display: none;
}

.site-header.is-compact .nav-list {
  display: none;
}

.site-header.is-compact .menu-button {
  display: inline-flex;
}

/* --- MENU button: outlined, fills up from the bottom on hover, label rolls MENU -> CLOSE,
       two bars morph into a cross --- */
.menu-button {
  --fg: var(--text-main);
  --bg: var(--bg-color);
  position: relative;
  display: none;
  align-items: center;
  gap: 14px;
  height: 32px;
  padding: 0 12px 0 14px;
  overflow: hidden;
  isolation: isolate;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  border: 1px solid var(--fg);
  cursor: pointer;
  transition: color 0.35s ease;
}

body.is-home:not(.drawer-open) .menu-button {
  --fg: #ffffff;
  --bg: #0c0c0c;
}

.menu-button::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fg);
  transform: translateY(101%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-button:hover,
.menu-button[aria-expanded="true"] {
  color: var(--bg);
}

.menu-button:hover::before,
.menu-button[aria-expanded="true"]::before {
  transform: translateY(0);
}

.menu-button:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.menu-button-label {
  display: block;
  height: 16px;
  overflow: hidden;
}

.menu-label {
  display: block;
  height: 16px;
  line-height: 16px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-button[aria-expanded="true"] .menu-label {
  transform: translateY(-100%);
}

.menu-button-icon {
  position: relative;
  width: 14px;
  height: 9px;
}

.menu-button-icon i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), top 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-button-icon i:nth-child(1) {
  top: 0;
}

.menu-button-icon i:nth-child(2) {
  top: 7.5px;
}

.menu-button[aria-expanded="true"] .menu-button-icon i:nth-child(1) {
  top: 3.75px;
  transform: rotate(45deg);
}

.menu-button[aria-expanded="true"] .menu-button-icon i:nth-child(2) {
  top: 3.75px;
  transform: rotate(-45deg);
}

/* --- Dropdown list: frosted panel that wipes open, numbered rows that rise in one by one --- */
.menu-panel {
  --m-fg: var(--text-main);
  --m-muted: var(--text-muted);
  --m-line: var(--border-color);
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 5;
  width: min(340px, calc(100vw - 40px));
  color: var(--m-fg);
  background: rgba(var(--bg-color-rgb), 0.88);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--m-line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(0 0 100% 0);
  transform: translateY(-8px);
  transition:
    clip-path 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease,
    visibility 0s linear 0.55s;
}

body.is-home:not(.drawer-open) .menu-panel {
  --m-fg: #ffffff;
  --m-muted: rgba(255, 255, 255, 0.55);
  --m-line: rgba(255, 255, 255, 0.2);
  background: rgba(8, 8, 8, 0.58);
}

.menu-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  clip-path: inset(0 0 0 0);
  transform: none;
  transition-delay: 0s;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-list li {
  border-bottom: 1px solid var(--m-line);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.menu-panel.is-open .menu-list li {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 0.06s + 0.12s);
}

.menu-link {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--m-fg);
  transition: opacity 0.3s ease;
}

.menu-list:hover .menu-link:not(:hover) {
  opacity: 0.45;
}

.menu-link:focus-visible {
  outline: 1px solid var(--m-fg);
  outline-offset: -1px;
}

.menu-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--m-muted);
}

.menu-link.active .menu-num {
  color: var(--m-fg);
}

.menu-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-arrow {
  font-size: 14px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-link:hover .menu-text,
.menu-link:focus-visible .menu-text {
  transform: translateX(8px);
}

.menu-link:hover .menu-arrow,
.menu-link:focus-visible .menu-arrow,
.menu-link.active .menu-arrow {
  opacity: 1;
  transform: none;
}

.menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
}

.menu-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.menu-socials a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--m-muted);
  transition: color 0.3s ease;
}

.menu-socials a:hover {
  color: var(--m-fg);
}

.menu-footer .theme-toggle {
  flex: none;
  color: var(--m-muted);
}

.menu-footer .theme-toggle:hover {
  color: var(--m-fg);
}

/* Phones: slimmer header */
@media (max-width: 768px) {
  .site-header,
  body.is-home .site-header,
  body.is-work .site-header {
    height: 52px;
    padding: 0 20px;
  }
  :root {
    --header-h: 52px;
  }
}


/* ==========================================================================
   11. Fixed footer: 40px, solid colour, 1px light grey line above, centred links (hidden on Work)
   ========================================================================== */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-h);
  padding: 0 40px;
  z-index: 240; /* above the project page, below the header */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color); /* solid: no blur, no gradient */
  border-top: 1px solid var(--footer-line);
}

body.drawer-open .site-footer {
  background-color: var(--bg-drawer);
}

/* Not shown on the Work grid */
body.is-work:not(.drawer-open) .site-footer {
  display: none;
}

body.is-home:not(.drawer-open) .site-footer {
  background: none;
  border-top: none;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.footer-links a {
  position: relative;
  padding: 6px 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Thin line that draws in from the left on hover */
.footer-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text-main);
}

.footer-links a:hover::after,
.footer-links a:focus-visible::after {
  transform: scaleX(1);
}

/* Homepage: transparent, centred, light text over the video */
body.is-home:not(.drawer-open) .footer-links a {
  color: rgba(255, 255, 255, 0.7);
}

body.is-home:not(.drawer-open) .footer-links a:hover,
body.is-home:not(.drawer-open) .footer-links a:focus-visible {
  color: #fff;
}

@media (max-width: 768px) {
  .site-footer {
    padding: 0 20px;
  }

  .footer-links {
    gap: 20px;
  }
}
