:root {
  color-scheme: light dark;
  --paper: #f1f2f4;
  --ink: #000;
  --soft: #4b5260;
  --rule: #d6d9de;
  --blank: #e2e5ea;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 18px 32px -18px rgb(0 0 0 / 0.45);
  --lift: 0 2px 4px rgb(0 0 0 / 0.08), 0 30px 48px -20px rgb(0 0 0 / 0.5);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131519;
    --ink: #f5f6f8;
    --soft: #a3a9b4;
    --rule: #2a2e35;
    --blank: #22262d;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 32px -18px rgb(0 0 0 / 0.9);
    --lift: 0 2px 4px rgb(0 0 0 / 0.4), 0 30px 48px -20px rgb(0 0 0 / 0.95);
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    17px/1.5 "Schibsted Grotesk",
    system-ui,
    sans-serif;
}
a {
  color: inherit;
}
a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 6px;
  border-radius: 16px;
}

.intro,
main,
footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 720px) {
  .intro,
  main,
  footer {
    padding: 0 40px;
  }
}

.intro {
  overflow-x: clip;
  padding-top: clamp(40px, 8vw, 96px);
  padding-bottom: clamp(32px, 6vw, 72px);
}
.logo {
  display: block;
  width: clamp(64px, 8vw, 88px);
  height: auto;
  margin-bottom: 20px;
}
h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(64px, 13vw, 184px);
  line-height: 0.86;
  letter-spacing: -0.055em;
}
.intro p {
  max-width: 30ch;
  margin: 28px 0 0;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.35;
  color: var(--soft);
}
.intro nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 28px;
  font-weight: 600;
}
.intro nav a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.intro nav a:hover {
  text-decoration-thickness: 4px;
}

section {
  padding: 40px 0 24px;
  border-top: 1px solid var(--rule);
}
h2 {
  margin: 0 0 40px;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wall {
  list-style: none;
  margin: 0;
  padding: 0 0 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 56px 40px;
}
.wall li {
  transform: rotate(var(--tilt));
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.wall a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
}
.art {
  display: block;
  aspect-ratio: 2 / 1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  transition: box-shadow 0.35s ease;
}
.art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blank {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 16px;
  background: var(--blank);
  font-weight: 800;
  font-size: 26px;
  text-align: center;
  overflow-wrap: anywhere;
}
.name {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.desc {
  color: var(--soft);
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta {
  color: var(--soft);
  font-size: 14px;
  font-weight: 600;
}

.wall li:hover,
.wall li:focus-within {
  transform: rotate(0deg) translateY(-8px);
}
.wall li:hover .art,
.wall li:focus-within .art {
  box-shadow: var(--lift);
}

/* The wall pins itself up once on load; later motion only answers the pointer. */
@keyframes pin {
  from {
    opacity: 0;
    transform: translateY(28px) rotate(calc(var(--tilt) * 4));
  }
  to {
    opacity: 1;
    transform: rotate(var(--tilt));
  }
}
.wall li {
  animation: pin 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: min(calc(var(--i) * 45ms), 900ms);
}

footer {
  padding-top: 24px;
  padding-bottom: 56px;
  color: var(--soft);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .wall li {
    animation: none;
    transition: none;
  }
  .wall li:hover,
  .wall li:focus-within {
    transform: rotate(var(--tilt));
  }
}

/* Hero pile: the top cards fanned like a hand, spreading wider on hover. */
.intro-body {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 960px) {
  .intro-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}
.pile {
  position: relative;
  height: clamp(220px, 34vw, 380px);
  margin: 8px 0 24px;
}
.pile a {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78%, 440px);
  aspect-ratio: 2 / 1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform-origin: 50% 160%;
  transform: translate(-50%, -50%) rotate(calc(var(--n) * 7deg)) translateX(calc(var(--n) * 14px));
  transition:
    transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.3s ease;
  animation: deal 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc((var(--n) + 2) * 70ms);
}
.pile a img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pile:hover a,
.pile:focus-within a {
  transform: translate(-50%, -50%) rotate(calc(var(--n) * 11deg)) translateX(calc(var(--n) * 34px));
}
.pile a:hover,
.pile a:focus-visible {
  box-shadow: var(--lift);
  z-index: 5;
}
@keyframes deal {
  from {
    opacity: 0;
    transform: translate(-50%, -30%) rotate(0deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pile a {
    animation: none;
    transition: none;
  }
  .pile:hover a,
  .pile:focus-within a {
    transform: translate(-50%, -50%) rotate(calc(var(--n) * 7deg)) translateX(calc(var(--n) * 14px));
  }
}

@media (max-width: 600px) {
  .pile a {
    width: 72%;
    transform: translate(-50%, -50%) rotate(calc(var(--n) * 5deg)) translateX(calc(var(--n) * 8px));
  }
  .pile:hover a,
  .pile:focus-within a {
    transform: translate(-50%, -50%) rotate(calc(var(--n) * 7deg)) translateX(calc(var(--n) * 14px));
  }
}

/* Sitemap page: each project card pinned beside the pages it holds. */
.intro p a {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.map {
  list-style: none;
  margin: 0;
  padding: 0 0 40px;
  display: grid;
  gap: 56px;
}
.project {
  display: grid;
  gap: 20px 40px;
  align-items: start;
}
@media (min-width: 760px) {
  .project {
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  }
}
.thumb {
  display: block;
  aspect-ratio: 2 / 1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt));
  transition:
    transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.35s ease;
}
.thumb:hover,
.thumb:focus-visible {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: var(--lift);
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
h3 a {
  text-decoration: none;
}
h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.project .desc {
  margin: 6px 0 14px;
}
.pages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pages a {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.pages a:hover,
.pages a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pages.cols {
  padding-bottom: 48px;
}
@media (prefers-reduced-motion: reduce) {
  .thumb,
  .pages a {
    transition: none;
  }
  .thumb:hover,
  .thumb:focus-visible {
    transform: rotate(var(--tilt));
  }
}
