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

:root {
  --gap: 44px;
  --cols: 3;
  --bg: #F9F9F9;
  --tile-radius: 0px;
  --overlay-bg: rgba(0, 0, 0, 0.50);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #fff;
  user-select: none;
}

/* Enforce the all-lowercase voice across visible UI copy. */
#header-name,
#header-social,
#view-toggle,
#toggle-filter-panel,
#canvas,
#project-view,
#zoom-info,
#modal-backdrop,
#about-overlay,
#dvd-screen {
  text-transform: lowercase;
}

/* ── Header ─────────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 28px;
  pointer-events: none;
}

/* Progressive blur — 5 layers, each masking a vertical slice */
.hb {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#hb1 {
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 20%, transparent 50%);
  mask-image:         linear-gradient(to bottom, black 0%, black 20%, transparent 50%);
}
#hb2 {
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 10%, black 30%, black 45%, transparent 70%);
  mask-image:         linear-gradient(to bottom, transparent 10%, black 30%, black 45%, transparent 70%);
}
#hb3 {
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 35%, black 50%, black 65%, transparent 85%);
  mask-image:         linear-gradient(to bottom, transparent 35%, black 50%, black 65%, transparent 85%);
}
#hb4 {
  backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 60%, black 75%, transparent 100%);
  mask-image:         linear-gradient(to bottom, transparent 60%, black 75%, transparent 100%);
}
#hb5 {
  backdrop-filter: blur(0.5px); -webkit-backdrop-filter: blur(0.5px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 80%, black 90%, transparent 100%);
  mask-image:         linear-gradient(to bottom, transparent 80%, black 90%, transparent 100%);
}

#header-logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--logo-color, #111);
  letter-spacing: -0.06em;
  z-index: 1;
  pointer-events: auto;
  transition: color 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#header-name {
  color: inherit;
  text-decoration: none;
  position: relative;
  cursor: pointer;
}

#header-name::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

#header-name:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

#header-social {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 32px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

#header-social.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.social-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.04em;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.social-link:hover {
  opacity: 0.7;
}

/* ── Custom cursor ──────────────────────────────── */
#cursor-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #111;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(14px, 14px);
  transition: opacity 0.2s ease;
  z-index: 10000;
}

#cursor-tooltip.is-visible {
  opacity: 1;
}

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

body, * { cursor: none !important; }

/* ── Background bloom ───────────────────────────── */
#bg-bloom {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: transparent;
  -webkit-mask-image: radial-gradient(ellipse 140% 55% at 50% 100%, black 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 140% 55% at 50% 100%, black 10%, transparent 75%);
}

/* ── Canvas ─────────────────────────────────────── */
#canvas {
  position: fixed;
  inset: 0;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
}

/* Prevent first-paint grid flash when restoring saved Projects view (mobile-safe). */
body.preload-projects-view #canvas {
  transform: translateY(-100vh);
  pointer-events: none;
}
body.preload-projects-view #project-view {
  transform: translateY(0);
}

#canvas.is-dragging {
  cursor: grabbing;
}

/* ── Grid wrap ───────────────────────────────────── */
#grid-wrap {
  position: absolute;
  top: 0;
  left: 0;
  /* width/height set dynamically by JS (2× the single grid) */
  will-change: transform;
}

/* ── Single grid quadrant ────────────────────────── */
.grid-quadrant {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
  padding: calc(var(--gap) / 2);
}

/* ── Tile ────────────────────────────────────────── */
.tile {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--tile-radius);
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  box-shadow:
    0 1px 1px rgba(0,0,0,0),
    0 2px 2px rgba(0,0,0,0),
    0 4px 6px rgba(0,0,0,0),
    0 8px 16px rgba(0,0,0,0),
    0 20px 40px rgba(0,0,0,0);
  transition: box-shadow 0.5s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow:
    0 4px 8px rgba(0,0,0,0.03),
    0 12px 24px rgba(0,0,0,0.04),
    0 24px 48px rgba(0,0,0,0.03);
}

#canvas.is-zoom-active .tile:hover {
  transform: none;
  box-shadow: none;
}


.tile-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ── Chromatic aberration ────────────────────────── */
.ca-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.ca-r {
  transform: translateX(4px);
  background-color: rgba(255, 30, 60, 0.55);
  background-blend-mode: multiply;
  mix-blend-mode: screen;
}

.ca-b {
  transform: translateX(-4px);
  background-color: rgba(30, 60, 255, 0.55);
  background-blend-mode: multiply;
  mix-blend-mode: screen;
}

/* Touch: .ca-layer stays at opacity 0 but still duplicates the image as
   two extra backgrounds and participates in mix-blend stacking. On iOS Safari
   that can cause random tiles to render blank or never finish painting. */
@media (hover: none) and (pointer: coarse) {
  .tile .ca-layer {
    display: none;
  }
}


/* ── Tile overlay ────────────────────────────────── */
.tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0) 55%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px;
  gap: 5px;
}


.tile-title {
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.idea       { background: #6b7280; }
.status-dot.in-progress { background: #f59e0b; }
.status-dot.shipped    { background: #10b981; }

.tile-tags {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Modal ───────────────────────────────────────── */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  pointer-events: none;
}

#modal-backdrop.is-open {
  pointer-events: all;
}

#modal-card {
  background: #fff;
  border: none;
  position: relative;
  border-radius: 0px;
  overflow: hidden;
  width: 100%;
  max-width: 1100px;
  transform: scale(0.94);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.14);
  font-family: 'DM Sans', sans-serif;
  letter-spacing: -0.02em;
  color: #111;
}

#modal-img-wrap {
  position: relative;
}

.modal-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  display: block;
  object-fit: cover;
}

.modal-thumb-placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 24px 28px 28px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.modal-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: #111;
  letter-spacing: -0.02em;
}

.modal-desc {
  font-size: 12px;
  line-height: 1.7;
  color: #818181;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.modal-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid #d4d4d4;
  color: #818181;
  letter-spacing: -0.02em;
}

.modal-link {
  display: inline-block;
  font-size: 12px;
  padding: 8px 18px;
  border-radius: 6px;
  background: #111;
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease;
  letter-spacing: -0.02em;
}

.modal-link:hover {
  background: #333;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0,0,0,0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 101;
}

.modal-close:hover {
  background: rgba(0,0,0,0.28);
}


/* ── Project view ────────────────────────────────── */
#project-view {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100vh);
  scrollbar-width: none; /* Firefox */
}
#project-view::-webkit-scrollbar {
  display: none; /* Chrome / Safari / Edge */
}

#pv-inner {
  padding: 72px 24px 120px;
  max-width: 1400px;
  margin: 0 auto;
}

#pv-header {
  padding: 64px 0;
  margin-bottom: 8px;
}

.pv-bio-col {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: #111;
  letter-spacing: -0.04em;
  max-width: 560px;
}

/* ── Row list ── */
#pv-grid {
  display: flex;
  flex-direction: column;
}

.pv-card {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 28px 0;
  border-top: 1px solid #e0e0e0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.pv-card:last-child {
  border-bottom: 1px solid #e0e0e0;
}

@media (hover: hover) and (pointer: fine) {
  .pv-card:hover .pv-thumb img { transform: scale(1.04); }
  .pv-card:hover .pv-card-title { opacity: 0.6; }
}

.pv-text-group {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  flex: 1;
  min-width: 0;
}

/* Col 1: title / logo */
.pv-col-title {
  width: 140px;
  flex-shrink: 0;
}

.pv-card-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  color: #111;
  letter-spacing: -0.04em;
  transition: opacity 0.15s ease;
}

/* Col 2: description + CTAs */
.pv-col-mid {
  flex: 1;
  min-width: 0;
}

.pv-card-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: #111;
  letter-spacing: -0.04em;
  max-width: 600px;
  margin-bottom: 10px;
}

.pv-ctas {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pv-cta {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.04em;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.pv-cta-primary,
.pv-cta-secondary {
  color: #111;
}

/* Temporary: Case Study link off until case pages exist — still hovers on desktop */
.pv-cta-temp-disabled {
  opacity: 0.4;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .pv-cta:hover { opacity: 0.5; }
}

/* Col 3: thumbnail */
.pv-thumb {
  width: 220px;
  height: 147px;
  flex-shrink: 0;
  background: #ebebeb;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.pv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

/* ── Footer blur ─────────────────────────────────── */
#footer-blur {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 55;
  pointer-events: none;
}

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

#fb1 {
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to top, black 0%, black 20%, transparent 50%);
  mask-image:         linear-gradient(to top, black 0%, black 20%, transparent 50%);
}
#fb2 {
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(to top, transparent 10%, black 30%, black 45%, transparent 70%);
  mask-image:         linear-gradient(to top, transparent 10%, black 30%, black 45%, transparent 70%);
}
#fb3 {
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  -webkit-mask-image: linear-gradient(to top, transparent 35%, black 50%, black 65%, transparent 85%);
  mask-image:         linear-gradient(to top, transparent 35%, black 50%, black 65%, transparent 85%);
}
#fb4 {
  backdrop-filter: blur(1px); -webkit-backdrop-filter: blur(1px);
  -webkit-mask-image: linear-gradient(to top, transparent 60%, black 75%, transparent 100%);
  mask-image:         linear-gradient(to top, transparent 60%, black 75%, transparent 100%);
}
#fb5 {
  backdrop-filter: blur(0.5px); -webkit-backdrop-filter: blur(0.5px);
  -webkit-mask-image: linear-gradient(to top, transparent 80%, black 90%, transparent 100%);
  mask-image:         linear-gradient(to top, transparent 80%, black 90%, transparent 100%);
}

/* ── View toggle ──────────────────────────────────── */
#view-toggle {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 4px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  pointer-events: all;
  z-index: 60;
  --toggle-bg: #F5F5F5;
}

/* ── Nav row (view switchers + filter icon) ──────── */
#toggle-nav-row {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  width: max-content; /* pill closed width = buttons only, nothing else */
}

#view-toggle.filter-open #toggle-nav-row {
  width: 100%; /* fill pill when filter is open */
}

#toggle-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #027A54;
  pointer-events: none;
  z-index: 0;
}

.toggle-btn {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  color: #111;
  flex-shrink: 0;
  transition: color 0.3s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* When filter panel is open — buttons stretch to fill the pill width */
#view-toggle.filter-open .toggle-btn {
  flex: 1 1 auto;
  min-width: 0;
}
.toggle-btn:focus-visible {
  outline: 2px solid #027A54;
  outline-offset: 2px;
}

.toggle-btn.is-active {
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .toggle-btn:not(.is-active):hover {
    background: rgba(0, 0, 0, 0.10);
  }
}

/* ── Tab icon hover states ──────────────────────── */

/* Canvas: fill rects hidden by default, revealed via clip-path */
#toggle-grid svg .grid-fill {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Active: all squares fully filled (white on dark pill) */
/* transition-delay lets the dark pill arrive and color reach near-white before fills reveal */
#toggle-grid.is-active svg .grid-fill {
  clip-path: inset(0 0 0 0);
  transition-delay: 0.2s;
}

/* Hover: fill from bottom row up, staggered left→right per row */
@media (hover: hover) and (pointer: fine) {
  #toggle-grid:not(.is-active):hover svg .grid-fill:nth-child(3) { clip-path: inset(0 0 0 0); transition-delay: 0s;    }
  #toggle-grid:not(.is-active):hover svg .grid-fill:nth-child(4) { clip-path: inset(0 0 0 0); transition-delay: 0.07s; }
  #toggle-grid:not(.is-active):hover svg .grid-fill:nth-child(1) { clip-path: inset(0 0 0 0); transition-delay: 0.14s; }
  #toggle-grid:not(.is-active):hover svg .grid-fill:nth-child(2) { clip-path: inset(0 0 0 0); transition-delay: 0.21s; }
}

/* Projects: fill hidden by default, revealed via clip-path */
#toggle-projects svg .folder-fill {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Active: folder fully filled white */
#toggle-projects.is-active svg .folder-fill {
  clip-path: inset(0 0 0 0);
  transition-delay: 0.2s;
}

/* Hover: fill rises from bottom up, holds while hovered */
@media (hover: hover) and (pointer: fine) {
  #toggle-projects:not(.is-active):hover svg .folder-fill {
    clip-path: inset(0 0 0 0);
  }
}

/* Filter: knobs slide to new positions and hold while hovered */
#toggle-filter svg circle {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.18s ease-out;
}
@media (hover: hover) and (pointer: fine) {
  #toggle-filter:not(.is-active):hover svg circle:nth-child(2) {
    transform: translateX(3.5px);
  }
  #toggle-filter:not(.is-active):hover svg circle:nth-child(4) {
    transform: translateX(-3.5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #toggle-grid svg .grid-fill,
  #toggle-projects svg .folder-fill,
  #toggle-filter svg circle {
    transition: none;
  }
}

/* Labels — inline flex sibling to the icon, hidden via width:0 clip */
.toggle-label {
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  margin-left: 0;  /* gap animated by GSAP — 0 in closed state so icon stays truly centered */
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  letter-spacing: -0.03em;
  line-height: 1;
  color: currentColor;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

/* Filter icon active dot badge */
#toggle-filter.has-active-filter::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #027A54;
  pointer-events: none;
}

/* Vertical divider between nav buttons and filter icon */
.tgl-divider {
  width: 1px;
  height: 22px;
  background: rgba(0, 0, 0, 0.10);
  flex-shrink: 0;
  margin: 0 2px;
  align-self: center; /* stays vertically centered as buttons grow */
}

/* ── Expandable filter panel ─────────────────────── */
#toggle-filter-panel {
  display: flex;
  flex-direction: column;
  height: 0;
  overflow: hidden;
  opacity: 0;
  width: 0;
  min-width: 0; /* don't inflate pill width in closed state */
  transition: height 0.46s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.2s ease;
}

#view-toggle.filter-open #toggle-filter-panel {
  width: 100%;
}

/* Sections */
.tfp-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 14px 4px 16px;
}

#tfp-show {
  padding-bottom: 16px;
}

.tfp-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-transform: none;
  color: rgba(0, 0, 0, 0.65);
  padding: 0 6px;
  margin-bottom: 4px;
}

/* Extra bottom breathing room on last section, clipped by panel's height:0 when closed */
#tfp-display {
  padding-bottom: 14px;
}

/* Grab indicator — sits inside the panel so it's clipped when closed */
#toggle-filter-panel::before {
  content: '';
  display: block;
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.12);
  margin: 8px auto 4px;
  flex-shrink: 0;
}

/* Section dividers */
.tfp-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── Theme slider (light ↔ dark) ─────────────────────────────── */
.theme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}

.theme-ticker {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  overflow: hidden;
  pointer-events: none;
}

.theme-tick {
  flex: 0 0 3px;
  height: 20px;
  border-radius: 3px;
  background-color: rgba(0, 0, 0, 0.1);
  transform-origin: center;
}

body.dark .theme-tick { background-color: rgba(255, 255, 255, 0.1); }

/* Theme toggle button */
.theme-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  letter-spacing: -0.02em;
  color: rgba(0, 0, 0, 0.65);
  flex-shrink: 0;
}

body.dark .theme-label { color: rgba(255, 255, 255, 0.65); }

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.45s ease, border-color 0.45s ease, transform 0.15s ease;
}

.theme-toggle-btn:active { transform: scale(0.88); }

body.dark .theme-toggle-btn {
  background: #1c1c1c;
  border-color: rgba(255, 255, 255, 0.12);
}

.theme-icon {
  width: 15px;
  height: 15px;
  position: absolute;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.theme-icon-sun {
  color: rgba(0, 0, 0, 0.6);
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-icon-moon {
  color: rgba(255, 255, 255, 0.9);
  opacity: 0;
  transform: rotate(-25deg) scale(0.7);
}

body.dark .theme-icon-sun {
  opacity: 0;
  transform: rotate(25deg) scale(0.7);
}

body.dark .theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ── Show filter horizontal bar ───────────────────── */
#tf-show-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 4px 0;
}

#tf-show-hbar {
  display: flex;
  gap: 3px;
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
}

.tf-show-seg {
  height: 100%;
  border-radius: 6px;
  transition: background 0.25s ease, opacity 0.25s ease;
}

.tf-show-seg[data-filter-type="work"]   { background: #027A54; }
.tf-show-seg[data-filter-type="side"]   { background: #56A87C; }
.tf-show-seg[data-filter-type="sketch"] { background: #8FC9AB; }

.tf-show-seg:not(.is-on) { background: rgba(0, 0, 0, 0.1); }

#tf-show-labels {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tf-show-col {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

#toggle-filter-panel.is-projects-view .tf-show-col[data-filter-type] {
  cursor: default;
  pointer-events: none;
}

.tf-show-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.25s ease;
}

.tf-show-col[data-filter-type="work"]   .tf-show-dot { background: #027A54; }
.tf-show-col[data-filter-type="side"]   .tf-show-dot { background: #56A87C; }
.tf-show-col[data-filter-type="sketch"] .tf-show-dot { background: #8FC9AB; }

.tf-show-col:not(.is-on) .tf-show-dot { background: rgba(0, 0, 0, 0.15); }

.tf-show-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  letter-spacing: -0.02em;
  color: rgba(0, 0, 0, 0.65);
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.tf-show-col:not(.is-on) .tf-show-label {
  color: rgba(0, 0, 0, 0.3);
  text-decoration: line-through;
}

.tf-show-count {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.35);
  transition: color 0.2s ease;
}

.tf-show-col:not(.is-on) .tf-show-count { color: rgba(0, 0, 0, 0.2); }


/* Panel separator to nav row */
#toggle-filter-sep {
  height: 1px;
  background: rgba(0, 0, 0, 0.07);
  margin: 0;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

#view-toggle.filter-open #toggle-filter-sep {
  opacity: 1;
}


/* ── Mobile ──────────────────────────────────────── */
@media (pointer: coarse) {
  #cursor, #cursor-tooltip { display: none; }
  body, * { cursor: auto !important; }
}

@media (max-width: 768px) {
  :root { --cols: 2; --gap: 32px; }
  .pv-col-title { width: 100px; }
  .pv-thumb { width: 120px; height: 80px; }
  .pv-card  { gap: 20px; padding: 22px 0; }
  .pv-card-title { font-size: 14px; }
  /* Match description + link size (was 12px vs 14px — looked mixed) */
  .pv-card-desc,
  .pv-cta { font-size: 14px; }
  .pv-card-desc { margin-bottom: 8px; }
}

@media (max-width: 480px) {
  .pv-card { flex-wrap: wrap; }
  .pv-text-group { flex-direction: column; gap: 8px; }
  .pv-col-title { width: auto; flex-basis: auto; }
  .pv-thumb { display: none; }
  #view-toggle { bottom: 12px; }
}


/* ── About trigger link (in bio) ─────────────────────────────── */
.about-trigger-link {
  color: #111;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.about-trigger-link:hover {
  border-color: #111;
}

/* ── About overlay ───────────────────────────────────────────── */
#about-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  clip-path: circle(0% at 50% 50%);
  pointer-events: none;
  background: rgba(249, 249, 249, 0.92);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#about-overlay.is-open {
  pointer-events: all;
}

#about-inner {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 100vh;
  overflow-y: auto;
  padding: 60px 28px;
  scrollbar-width: none;
}
#about-inner::-webkit-scrollbar { display: none; }

#about-close {
  position: fixed;
  top: 22px;
  right: 22px;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: 0;
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 91;
  opacity: 0.4;
}

#about-close:hover {
  opacity: 1;
}

#about-close:active {
  transform: scale(0.9);
}

#about-content {
  display: flex;
  flex-direction: column;
}

#about-photo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 16px;
}

#about-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
  color: #111;
  margin-bottom: 16px;
}

#about-bio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

#about-bio p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.03em;
  color: #444;
  margin: 0;
}

#about-experience {
  margin-bottom: 48px;
}

#about-exp-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #111;
  margin-bottom: 20px;
}

.about-exp-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-exp-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.about-exp-logo-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-exp-logo {
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
  display: block;
}

.about-exp-logo.logo-sm {
  max-width: 45%;
  max-height: 45%;
}

.about-exp-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.about-exp-company {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #111;
  line-height: 1.3;
}

.about-exp-role {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: #444;
  line-height: 1.3;
}

.about-exp-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: #444;
  flex-shrink: 0;
  margin-left: auto;
}

.about-bio-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 0, 0, 0.3);
  transition: text-decoration-color 0.15s ease;
}

.about-bio-link:hover {
  text-decoration-color: currentColor;
}

body.dark .about-bio-link {
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

body.dark .about-bio-link:hover {
  text-decoration-color: currentColor;
}

#about-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.about-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.04em;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

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

.about-link-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

/* ── Dark mode ───────────────────────────────────────────────── */

/* Page & project view background */
body.dark { --bg: #141414; }

/* Header */
body.dark #header-logo  { color: #ebebeb; }
body.dark .social-link  { color: #ebebeb; }

/* Project view text */
body.dark .pv-bio-col    { color: #ebebeb; }
body.dark .pv-card-title { color: #ebebeb; }
body.dark .pv-card-desc  { color: #ebebeb; }
body.dark .pv-card       { border-color: #2a2a2a; }

/* Thumb containers — slightly lighter than page bg */
body.dark .pv-thumb { background: #1e1e1e; }

/* CTAs */
body.dark .pv-cta-primary,
body.dark .pv-cta-secondary { color: #ebebeb; }

/* View toggle pill */
body.dark #view-toggle {
  background: rgba(20, 20, 20, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
  --toggle-bg: #141414;
}
body.dark .toggle-btn { color: #ebebeb; }
@media (hover: hover) and (pointer: fine) {
  body.dark .toggle-btn:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.1);
  }
}
body.dark .tgl-divider { background: rgba(255, 255, 255, 0.12); }

/* Expandable filter panel — dark mode */
body.dark #toggle-filter-panel::before { background: rgba(255, 255, 255, 0.2); }
body.dark .tfp-label     { color: rgba(255, 255, 255, 0.65); }
body.dark .tfp-divider    { background: rgba(255, 255, 255, 0.07); }
body.dark #toggle-filter-sep { background: rgba(255, 255, 255, 0.07); }
/* Show horizontal bar — dark mode */
body.dark .tf-show-seg:not(.is-on)              { background: rgba(255, 255, 255, 0.1); }
body.dark .tf-show-col:not(.is-on) .tf-show-dot { background: rgba(255, 255, 255, 0.18); }
body.dark .tf-show-label                         { color: rgba(255, 255, 255, 0.65); }
body.dark .tf-show-col:not(.is-on) .tf-show-label { color: rgba(255, 255, 255, 0.25); }
body.dark .tf-show-count                         { color: rgba(255, 255, 255, 0.35); }
body.dark .tf-show-col:not(.is-on) .tf-show-count { color: rgba(255, 255, 255, 0.18); }

/* Modal */
body.dark #modal-card    { background: #1c1c1c; }
body.dark .modal-title   { color: #ebebeb; }
body.dark .modal-desc    { color: #666; }
body.dark .modal-tag     { color: #666; border-color: #2e2e2e; }
body.dark .modal-link    { background: #ebebeb; color: #141414; }
body.dark .modal-link:hover { background: #ccc; }

/* Tile base (shows at edges / before image loads) */
body.dark .tile { background: #1e1e1e; }

/* About overlay — dark */
body.dark #about-overlay {
  background: rgba(20, 20, 20, 0.92);
}
body.dark #about-close {
  color: #ebebeb;
}
body.dark #about-close:hover {
  opacity: 1;
}
body.dark #about-name  { color: #ebebeb; }
body.dark #about-bio p { color: #888; }
body.dark #about-exp-title   { color: #ebebeb; }
body.dark .about-exp-company { color: #ebebeb; }
body.dark .about-exp-role    { color: #666; }
body.dark .about-exp-date    { color: #666; }
body.dark .about-link  { color: #ebebeb; }
body.dark .about-link-dot { background: rgba(255, 255, 255, 0.2); }
body.dark .about-trigger-link { color: #ebebeb; border-color: rgba(255, 255, 255, 0.25); }
body.dark .about-trigger-link:hover { border-color: #ebebeb; }

body.dark #project-view { scrollbar-color: #333 #141414; }
body.dark #project-view::-webkit-scrollbar       { width: 8px; }
body.dark #project-view::-webkit-scrollbar-track  { background: #141414; }
body.dark #project-view::-webkit-scrollbar-thumb  { background: #333; border-radius: 4px; }
body.dark #project-view::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── DVD Easter Egg ──────────────────────────────────── */
#dvd-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 11;
  overflow: hidden;
  cursor: none;
}

#dvd-logo {
  position: absolute;
  top: 0;
  left: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.04em;
  white-space: nowrap;
  will-change: transform;
  pointer-events: none;
  transition: color 0.12s ease;
}

#dvd-hint {
  position: fixed;
  pointer-events: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #111;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(14px, 14px);
  transition: opacity 0.2s ease;
  z-index: 6;
}

#dvd-hint.is-visible {
  opacity: 1;
}

body.dark #dvd-hint,
body.dark #cursor-tooltip {
  color: #fff;
  background: rgba(30,30,30,0.8);
  border-color: rgba(255,255,255,0.1);
}

/* Intro animation: GSAP uses gsap.from() so default opacity is 1 */

/* ── Zoom mode ───────────────────────────────────── */

#canvas.is-zoom-active {
  cursor: default;
  overflow: visible;
}

#zoom-backdrop {
  display: none;
}

/* Zoom info panel — row below the focused tile; top is set by JS */
#zoom-info {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  will-change: transform, opacity;
  display: flex;
  justify-content: center;
}

#zoom-info-row {
  width: calc(74vh * 1.5);
  display: flex;
  justify-content: center;
  align-items: baseline;
}

#zoom-info-title,
#zoom-info-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

#zoom-info-title {
  color: #666;
}

#zoom-info-date {
  color: #8f8f8f;
}

body.dark #zoom-info-title {
  color: #b5b5b5;
}

body.dark #zoom-info-date {
  color: #8a8a8a;
}

/* Keyboard navigation hint — bottom-right, visible only in zoom mode */
#kbd-hint {
  position: fixed;
  bottom: 28px;
  right: 28px;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  color: #141414;
  will-change: opacity;
}

body.dark #kbd-hint {
  color: #f9f9f9;
}

@media (max-width: 768px) {
  #kbd-hint { display: none; }
}
