/* abismo — one stylesheet for every page.
   the look is the old site's: white, times, lowercase, tight tracking.
   what changed is everything underneath it. */

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

:root {
  --bg: #ffffff;
  --fg: #0d0d0d;
  --mid: #707070;            /* #888 failed contrast for small text; this passes AA */
  --line: #e8e8e8;
  --nav-h: 42px;
  --pad: 40px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --serif: "Times New Roman", Times, Tinos, serif;  /* tinos only downloads where times is missing (android) */
}
@media (max-width: 700px) { :root { --pad: 20px; } }

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.05em;
  text-transform: lowercase;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { min-height: 100vh; min-height: 100dvh; background: var(--bg); display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 400; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { text-transform: inherit; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: fixed; left: 12px; top: -60px; z-index: 3000; background: var(--fg); color: var(--bg); padding: 8px 12px; }
.skip:focus { top: 8px; }

/* ── nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 1000;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 20px; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.nav-side { display: flex; gap: 22px; align-items: center; }
.nav-right { justify-content: flex-end; }
.nav a, .nav-menu { transition: color 0.15s; }
.nav-side a:hover, .nav-mobile-cta:hover, .nav-menu:hover { color: var(--mid); }
.nav-side a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.nav-logo { display: flex; justify-content: center; padding: 4px 8px; }
.nav-logo img { height: 28px; width: auto; }
.nav-mobile-cta, .nav-menu { display: none; }
.nav-menu { background: none; border: 0; cursor: pointer; justify-self: end; padding: 8px 0 8px 12px; }

@media (max-width: 640px) {
  .nav-side { display: none; }
  .nav-mobile-cta { display: block; grid-column: 1; grid-row: 1; justify-self: start; padding: 8px 12px 8px 0; }
  .nav-logo { grid-column: 2; grid-row: 1; }
  .nav-menu { display: block; grid-column: 3; grid-row: 1; }
}

.menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 999; background: var(--bg);
  padding: 36px var(--pad); overflow-y: auto;
}
.menu[hidden] { display: none; }
.menu nav { display: flex; flex-direction: column; gap: 6px; }
.menu a { font-size: clamp(38px, 11vw, 60px); line-height: 1.05; }
.menu a[aria-current="page"] { color: var(--mid); }
.menu-open { overflow: hidden; }

/* ── footer ──────────────────────────────────────────────────────────── */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px 30px; flex-wrap: wrap;
  padding: 24px var(--pad); padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); font-size: 13px; letter-spacing: -0.03em; color: var(--mid);
}
.footer-links { display: flex; gap: 12px 24px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--fg); }

/* ── home: the ring ──────────────────────────────────────────────────── */
.page-home { height: 100vh; height: 100dvh; overflow: hidden; }
.home { position: fixed; inset: var(--nav-h) 0 0 0; }
.stage { position: absolute; inset: 0; overflow: hidden; }
.stage-spacer { position: absolute; left: 0; top: 0; width: 1px; height: 0; pointer-events: none; }

.item {
  position: absolute; left: 0; top: 0; width: 56px; height: 56px;
  display: flex; flex-direction: column;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
  transition:
    transform 0.85s var(--ease), width 0.85s var(--ease), height 0.85s var(--ease),
    opacity 0.4s ease;
  transition-delay: var(--delay, 0s);
}
.item .tile {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  transform-origin: var(--ox, center) var(--oy, center);
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.2s;
}
.item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.item .label {   /* named for screen readers in the ring, visible under the cards in the grid */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.is-mood { z-index: 1; }
.is-project { cursor: pointer; z-index: 2; }  /* the work sits on top of the memes (the old ring buried it) */
.is-project .tile { background: #fff; outline: 1px solid var(--line); outline-offset: -1px; }
.item.dragging { transition: none !important; cursor: grabbing; z-index: 999 !important; }
.item.dragging .tile { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15); }
.no-anim .item, .no-anim .controls { transition: none !important; }

/* before the script positions them, keep the ring hidden (no flash in the corner) */
.js .stage:not(.ready) .item { opacity: 0; }

/* show projects: covers fly into a grid, the memes step back */
[data-mode="projects"] .stage { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
[data-mode="projects"] .is-mood { opacity: 0; pointer-events: none; }
[data-mode="projects"] .is-project { touch-action: auto; }
[data-mode="projects"] .is-project .label {
  position: static; width: auto; height: 24px; clip: auto; overflow: hidden; text-overflow: ellipsis;
  padding-top: 6px; color: var(--mid); font-size: 14px;
}
[data-mode="projects"] .is-project:hover .tile { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12); }
[data-mode="projects"] .is-project:hover .label,
[data-mode="projects"] .is-project:focus-visible .label { color: var(--fg); }

/* explore: everything scatters; hover to peek, click/tap to hold it open */
@media (hover: hover) and (pointer: fine) {
  [data-mode="explore"] .item:hover { z-index: 900 !important; }
  [data-mode="explore"] .item:not(.dragging):hover .tile { transform: scale(2.4); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18); }
}
[data-mode="explore"] .item.zoomed { z-index: 950 !important; }
[data-mode="explore"] .item.zoomed .tile { transform: scale(var(--zoom, 4.2)); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22); }

.controls {
  position: absolute; left: 50%; top: var(--cy, 46%); z-index: 500;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: top 0.6s var(--ease);
}
.ctl {
  display: block; background: none; border: 0; padding: 5px 10px; line-height: 1.2;
  white-space: nowrap; cursor: pointer; transition: opacity 0.15s;
}
.ctl:hover { opacity: 0.5; }
@media (pointer: coarse) { .ctl { padding: 8px 14px; } }
[data-mode="projects"] .controls { top: 26px; }
[data-mode="projects"] .controls > :not(#show-btn),
[data-mode="explore"] .controls > :not(#explore-btn) { display: none; }
[data-mode="projects"] .ctl, [data-mode="explore"] .ctl { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
[data-mode="explore"] .controls { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); }

.hint {
  position: absolute; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 44px); transform: translateX(-50%);
  z-index: 500; font-size: 13px; color: var(--mid); white-space: nowrap; pointer-events: none;
  background: var(--bg); padding: 2px 8px; opacity: 0; transition: opacity 0.4s;
}
.hint.show { opacity: 1; }

/* no javascript: a plain grid of projects */
.no-js .stage { position: static; overflow: visible; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 64px var(--pad); }
.no-js .page-home { height: auto; overflow: auto; }
.no-js .home { position: static; padding-top: var(--nav-h); }
.no-js .item { position: static; width: auto; height: auto; }
.no-js .is-project .tile { aspect-ratio: 3 / 4; }
.no-js .is-project .label { position: static; width: auto; height: auto; clip: auto; padding-top: 6px; }
.no-js .is-mood, .no-js .controls .ctl:not(a) { display: none; }
.no-js .controls { position: static; transform: none; padding: 0 var(--pad) 40px; align-items: flex-start; }

/* ── memory game ─────────────────────────────────────────────────────── */
.game {
  border: 0; margin: 0; padding: 56px 20px 24px;
  width: 100%; max-width: none; height: 100%; max-height: none;
  background: var(--bg); color: var(--fg);
}
.game[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.game::backdrop { background: var(--bg); }
.game-head { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 10px 26px; margin-bottom: 22px; }
.game-head .stat { color: var(--mid); }
.game-head button { background: none; border: 0; cursor: pointer; padding: 6px 0; transition: opacity 0.15s; }
.game-head button:hover { opacity: 0.5; }
.game-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  width: min(520px, calc(100vw - 40px), calc((100vh - 190px) * 1.3));
  width: min(520px, calc(100vw - 40px), calc((100dvh - 190px) * 1.3));
}
@media (max-width: 480px) and (orientation: portrait) {
  .game-board { grid-template-columns: repeat(3, 1fr); width: min(calc(100vw - 32px), calc((100dvh - 200px) * 0.72)); }
}
.card { position: relative; aspect-ratio: 1; background: none; border: 0; padding: 0; cursor: pointer; perspective: 700px; }
.card-inner { display: block; position: relative; width: 100%; height: 100%; transition: transform 0.4s; transform-style: preserve-3d; }
.card.flipped .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute; inset: 0; overflow: hidden; border: 1px solid var(--line); background: var(--bg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.card-back { display: flex; align-items: center; justify-content: center; }
.card-back img { width: 46%; height: auto; opacity: 0.42; }
.card-front { transform: rotateY(180deg); }
.card-front img { width: 100%; height: 100%; object-fit: cover; }
.card.matched { cursor: default; }
.card.matched .card-face { border-color: var(--fg); }
.game-win { margin-top: 20px; min-height: 20px; }

/* ── content pages ───────────────────────────────────────────────────── */
.page { padding: calc(var(--nav-h) + 80px) var(--pad) 120px; width: 100%; }
.page-wide { max-width: 1040px; }
.page-narrow { max-width: 760px; }
@media (max-width: 700px) { .page { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 80px; } }

.page-title { font-size: clamp(48px, 8vw, 110px); line-height: 0.92; margin-bottom: 64px; }
.page-narrow .page-title { font-size: clamp(44px, 7vw, 84px); margin-bottom: 16px; }
.page-sub { color: var(--mid); letter-spacing: -0.03em; line-height: 1.6; max-width: 460px; margin-bottom: 48px; }
.page-sub a { color: var(--fg); border-bottom: 1px solid currentColor; }
.page-cta { margin-top: 56px; font-size: clamp(24px, 3vw, 34px); }
.page-cta a { border-bottom: 1px solid currentColor; }
.page-cta a:hover { color: var(--mid); }

.block { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding: 40px 0; border-top: 1px solid var(--line); }
.block-label { font-size: 15px; padding-top: 3px; }
.block-body { line-height: 1.7; letter-spacing: -0.03em; max-width: 62ch; }
.block-body p + p { margin-top: 20px; }
.block-body strong { font-weight: 400; letter-spacing: -0.05em; }
.inline { border-bottom: 1px solid var(--line); transition: border-color 0.15s; }
.inline:hover { border-bottom-color: var(--fg); }
.services { list-style: none; }
.services li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.services li:first-child { border-top: 1px solid var(--line); }
.team { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: none; }
.ig-embed { border: 1px solid var(--line); background: #fafafa; margin-bottom: 14px; overflow: hidden; }
.ig-embed iframe { display: block; width: 100%; height: 480px; border: 0; }
.member-name { font-size: 15px; }
.member-role { font-size: 13px; color: var(--mid); margin-top: 3px; }
.member-also { font-size: 13px; color: var(--mid); margin-top: 6px; }
.member-also a { border-bottom: 1px solid var(--line); }
.member-also a:hover { color: var(--fg); }
@media (max-width: 700px) {
  .block { grid-template-columns: 1fr; gap: 14px; padding: 32px 0; }
  .team { grid-template-columns: 1fr; }
}

/* ── work with us ────────────────────────────────────────────────────── */
.brief { display: flex; flex-direction: column; }
.field { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding: 18px 0 12px; }
.field label, .group legend { font-size: 12px; letter-spacing: -0.03em; color: var(--mid); margin-bottom: 8px; }
.field input, .field textarea, .field select {
  border: 0; outline: 0; background: none; font-size: 17px; letter-spacing: -0.03em;
  text-transform: none; resize: vertical; padding: 4px 0; border-radius: 0; width: 100%;
}
.field input::placeholder, .field textarea::placeholder { color: #b5b5b5; text-transform: lowercase; }
.field:focus-within { border-bottom-color: var(--fg); }
.field textarea { min-height: 96px; line-height: 1.5; }
.phone-row { display: flex; gap: 10px; }
.phone-row select { flex: 0 0 96px; cursor: pointer; text-transform: lowercase; }
.group { border: 0; border-bottom: 1px solid var(--line); padding: 22px 0 18px; min-width: 0; }
.group[hidden], [hidden] { display: none !important; }
.group legend { padding: 0; margin-bottom: 14px; float: left; width: 100%; }
.choices { clear: both; display: flex; flex-direction: column; gap: 4px; }
.choice { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.choice input { width: 16px; height: 16px; accent-color: var(--fg); cursor: pointer; flex-shrink: 0; margin: 0; }
#something-else .field { padding-top: 14px; }
.note { margin-top: 14px; font-size: 13px; line-height: 1.5; letter-spacing: -0.02em; color: var(--mid); }
.err { font-size: 13px; color: #b3261e; letter-spacing: -0.02em; min-height: 0; }
.err:empty { display: none; }
.field .err, .group .err { margin-top: 8px; }
.invalid { border-bottom-color: #b3261e !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.submit-row { margin-top: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.btn {
  display: inline-block; background: var(--fg); color: var(--bg); border: 0; cursor: pointer;
  padding: 14px 28px; font-size: 14px; letter-spacing: -0.04em; transition: opacity 0.15s;
}
.btn:hover { opacity: 0.75; }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.thanks { padding: 8px 0; }
.thanks-title { font-size: clamp(44px, 7vw, 84px); line-height: 0.95; margin-bottom: 16px; outline: 0; }

/* ── archive ─────────────────────────────────────────────────────────── */
.page-full { max-width: none; padding-top: calc(var(--nav-h) + 40px); }
.archive-title { font-size: 15px; color: var(--mid); margin-bottom: 32px; }
.archive-title a { color: var(--fg); border-bottom: 1px solid currentColor; }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; max-width: 1400px; }
.post { border: 1px solid var(--line); background: #fafafa; }
.post iframe { display: block; width: 100%; height: 560px; border: 0; }

/* ── project pages ───────────────────────────────────────────────────── */
.project { padding: calc(var(--nav-h) + 24px) var(--pad) 0; width: 100%; max-width: 1440px; margin: 0 auto; }
.project-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px 24px; }
.back, .pager a { color: var(--mid); transition: color 0.15s; }
.back:hover, .pager a:hover { color: var(--fg); }
.pager { display: flex; gap: 26px; }
.project-body { display: grid; gap: 32px; margin-top: 32px; }
.project-logo img { width: 100%; max-width: 300px; height: auto; aspect-ratio: 3 / 2; object-fit: cover; margin-left: -12px; }
.project-name { font-size: clamp(44px, 6vw, 84px); line-height: 0.95; margin: 4px 0 24px; }
.project-text p { font-size: 17px; line-height: 1.6; letter-spacing: -0.025em; max-width: 46ch; }
.project-text p + p { margin-top: 1em; }
.project-cta { margin-top: 28px; }
.project-cta a { border-bottom: 1px solid currentColor; }
.project-cta a:hover { color: var(--mid); }
.project-visuals img { width: 100%; height: auto; margin: 0 auto; }
.pager-bottom { margin-top: 64px; padding: 24px 0; border-top: 1px solid var(--line); justify-content: space-between; }
@media (max-width: 700px) { .project-logo img { max-width: 210px; } }
@media (min-width: 980px) {
  .project-body { grid-template-columns: minmax(300px, 1fr) 1.4fr; gap: 64px; align-items: start; }
  .project-info { position: sticky; top: calc(var(--nav-h) + 32px); }
}

.lost .page-title { margin-bottom: 20px; }

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