:root {
  color-scheme: dark;
  --bg: oklch(13.5% 0.005 85);
  --bg-2: oklch(18% 0.005 85);
  --bg-3: oklch(24% 0.005 85);
  --ink: oklch(96% 0.004 85);
  --ink-2: oklch(78% 0.004 85);
  --muted: oklch(60% 0.004 85);
  --rule: oklch(30% 0.005 85);
  --veil: oklch(13.5% 0.005 85 / 0.86);
  --veil-soft: oklch(13.5% 0.005 85 / 0.55);
  --veil-clear: oklch(13.5% 0.005 85 / 0);
  --blend-ink: oklch(99% 0.004 85);
  --focus: oklch(85% 0.12 85);
  --font-name: "Instrument Serif", ui-serif, Georgia, serif;
  --font-body: "IBM Plex Sans Arabic", ui-sans-serif, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --edge: clamp(16px, 2.6vw, 40px);
  --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.125rem;
  --tile: 300px;
  --gap: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--text-md)/1.7 var(--font-body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }

/* ── Corners ── */
.top { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: var(--edge); pointer-events: none; }
.top > * { pointer-events: auto; }
.top__mark { font: 400 1.75rem/1 var(--font-name); text-decoration: none; transition: opacity 0.3s var(--ease); }
.top__mark:hover { opacity: 0.6; }
.top__mark-f { display: none; font-size: 1.5rem; }
.wall-used .top__mark-s { display: none; }
.wall-used .top__mark-f { display: inline; animation: fade 0.9s var(--ease) both; }
.top__hint { transition: opacity 0.6s var(--ease); }
.wall-used .top__hint { opacity: 0; }
.top__hint { padding: 4px 12px; border-radius: 999px; background: var(--veil-soft); font-size: var(--text-sm); color: var(--ink-2); }
.top__link { min-height: 44px; padding: 0 20px; border: 1px solid var(--ink-2); border-radius: 999px; background: var(--veil); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer; transition: background-color 0.3s var(--ease), color 0.3s var(--ease); }
.top__link:hover { background: var(--ink); color: var(--bg); }
.top__actions { display: flex; align-items: center; gap: 8px; }
.top__lang { display: inline-flex; align-items: center; padding: 0 16px; text-decoration: none; font-size: var(--text-sm); }

/* ── The name ── */
.name { margin: 0; padding: 120px var(--edge) 8px; text-align: center; font: 400 clamp(3.6rem, 12.5vw, 13rem)/1 var(--font-name); letter-spacing: -0.01em; text-transform: uppercase; overflow-wrap: break-word; min-width: 0; }
.name__row { display: block; overflow: clip; padding-bottom: 0.06em; }
.name__word { display: inline-block; animation: up 1.4s var(--ease) both; }
.name__row:nth-child(2) .name__word { animation-delay: 0.12s; }
.tagline { text-wrap: balance; text-align: center; color: var(--ink-2); margin-bottom: 48px; animation: fade 1.2s var(--ease) 0.6s both; }

/* ── Wall: a grid without script, an endless plane with it ── */
.wall__plane { display: block; columns: 4 220px; column-gap: 16px; padding: 0 var(--edge) 160px; }
.tile { position: relative; display: block; margin-bottom: 16px; break-inside: avoid; overflow: clip; background: var(--bg-2); }
.tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; transition: transform 0.9s var(--ease), opacity 0.6s var(--ease); }
.tile__play { position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: var(--veil); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: none; }
.tile__play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -9px 0 0 -5px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent var(--ink); }
.tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.js.wall-on body { overflow: hidden; height: 100dvh; }
.js.wall-on .name { position: fixed; inset: 50% 0 auto 0; z-index: 20; padding: 0 var(--edge); transform: translateY(-58%); color: var(--blend-ink); mix-blend-mode: difference; pointer-events: none; transition: opacity 0.9s var(--ease); }
.js.wall-on.wall-used .name { opacity: 0; }
.js.wall-on .tagline { position: fixed; inset: auto 0 calc(var(--edge) + 68px) 0; z-index: 20; width: max-content; max-width: calc(100% - 2 * var(--edge)); margin: 0 auto; padding: 4px 16px; border-radius: 999px; background: var(--veil); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: var(--text-sm); pointer-events: none; color: var(--ink); }
.js.wall-on .wall { position: fixed; inset: 0; z-index: 1; overflow: hidden; cursor: grab; touch-action: none; }
.js.wall-on .wall.is-dragging { cursor: grabbing; }
.js.wall-on .wall__plane { position: absolute; inset: 0; columns: auto; padding: 0; }
.js.wall-on .tile { position: absolute; top: 0; left: 0; margin: 0; width: var(--tile); will-change: transform; }
.js.wall-on .tile.is-out { display: none; }
.js.wall-on .tile img { opacity: 0; transform: scale(1.25); }
.js.wall-on .tile.is-in img { opacity: 0.72; transform: scale(1); }
.js.wall-on .tile.is-in:hover img, .js.wall-on .tile.is-in:focus-visible img { opacity: 1; transform: scale(1.06); }
.js.wall-on .wall.is-dragging .tile img { transition: opacity 0.6s var(--ease); }

/* ── Filters ── */
.filters { position: fixed; inset: auto 0 var(--edge) 0; z-index: 40; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; width: max-content; max-width: calc(100% - 2 * var(--edge)); margin-inline: auto; padding: 4px; border-radius: 999px; background: var(--veil); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: rise 1s var(--ease) 0.9s both; }
.filter { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color 0.3s var(--ease), color 0.3s var(--ease); }
.filter .num { margin-inline-start: 4px; font-size: 0.75rem; color: var(--muted); }
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filter[aria-pressed="true"] .num { color: var(--bg-3); }
.filter:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Contact overlay ── */
.info { overscroll-behavior: contain; position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); clip-path: inset(0 0 100% 0); transition: clip-path 0.9s var(--ease-io); }
.info[hidden] { display: grid; visibility: hidden; }
.info.is-open { clip-path: inset(0 0 0 0); visibility: visible; }
.info__inner { position: relative; z-index: 2; width: min(100% - 2 * var(--edge), 1100px); text-align: center; }
.info__close { position: fixed; top: var(--edge); inset-inline-end: var(--edge); min-height: 44px; padding: 0 20px; border: 1px solid var(--ink-2); border-radius: 999px; background: transparent; cursor: pointer; transition: background-color 0.3s var(--ease), color 0.3s var(--ease); }
.info__close:hover { background: var(--ink); color: var(--bg); }
.info__about { max-width: 44ch; margin: 0 auto 40px; color: var(--ink-2); white-space: pre-line; }
.info__links { margin: 0; padding: 0; list-style: none; }
.info__links a { display: inline-block; font: 400 clamp(2.6rem, min(7vw, 10vh), 6.5rem)/1.02 var(--font-name); text-decoration: none; color: var(--ink); transition: color 0.4s var(--ease), transform 0.6s var(--ease); }
.info__links:hover a { color: var(--bg-3); }
.info__links a:hover { color: var(--ink); transform: translateX(12px); }
.info__links li { overflow: clip; }
.info.is-open .info__links li a { animation: up 1s var(--ease) both; animation-delay: calc(0.25s + var(--i, 0) * 60ms); }
.info__foot { margin-top: 40px; font-size: var(--text-sm); color: var(--muted); }
.info__peek { display: none; }
.js .info__peek { display: block; position: fixed; top: 0; left: 0; z-index: 1; width: 260px; aspect-ratio: 4 / 5; overflow: clip; pointer-events: none; opacity: 0; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(0.8); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
.info__peek img { width: 100%; height: 100%; object-fit: cover; }
.js .info__peek.on { opacity: 1; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1); }

/* ── Viewer ── */
.viewer { overscroll-behavior: contain; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 56px var(--edge) var(--edge); border: 0; background: var(--bg); color: var(--ink); }
.viewer::backdrop { background: var(--bg); }
.viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 16px; }
.viewer__img { width: 100%; height: 100%; min-height: 0; object-fit: contain; animation: zoom 0.7s var(--ease) both; }
.viewer__vid { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: var(--bg); }
.viewer__img[hidden], .viewer__vid[hidden] { display: none; }
.viewer__vid:focus-visible { outline: none; }
.viewer__img.swap { animation: fade 0.45s var(--ease) both; }
.viewer__bar { display: flex; align-items: center; gap: 24px; }
.viewer__cap { min-width: 120px; text-align: center; font: 400 1.5rem/1 var(--font-name); }
.viewer button { min-height: 44px; padding: 0 20px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; cursor: pointer; transition: background-color 0.3s var(--ease); }
.viewer button:hover { background: var(--bg-3); }
.viewer button:disabled { opacity: 0.5; cursor: not-allowed; }
.viewer__close { position: absolute; top: 12px; inset-inline-end: var(--edge); }

@keyframes up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

@media (max-width: 48rem) {
  :root { --tile: 168px; --gap: 14px; }
  .top__hint { display: none; }
  .wall__plane { columns: 2; column-gap: 8px; }
  .tile { margin-bottom: 8px; }
  .js.wall-on .tagline { bottom: calc(var(--edge) + 60px); }
  .filter { padding: 0 12px; flex: none; }
  .filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .js .info__peek { display: none; }
}

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