/* SMASH — one grid, one type scale, nothing else.
   Press G anywhere to show the 12 columns. */

:root {
  --bg: #fff;
  --ink: #111;
  --muted: #8b8b8b;
  --line: #e6e6e6;

  --cols: 12;
  --margin: clamp(16px, 3.2vw, 56px);
  --gutter: clamp(12px, 1.4vw, 24px);
  --row-gap: clamp(56px, 9vw, 168px);
  --header: 72px;

  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --t-small: 12px;
  --t-body: clamp(14px, 1vw, 16px);
  --t-lead: clamp(20px, 2vw, 32px);
  --t-title: clamp(28px, 3.4vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 var(--t-body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; width: 100%; height: auto; }
picture { display: contents; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: inherit; }
b, strong { font-weight: inherit; }

/* ---- the grid -------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}
[style*="--span"] { grid-column: var(--start) / span var(--span); }

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.grid-overlay span { background: rgb(255 0 60 / 0.07); border-inline: 1px solid rgb(255 0 60 / 0.18); }
.show-grid .grid-overlay { opacity: 1; }

/* ---- header ---------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 10;
  height: var(--header);
  align-items: center;
  font-size: var(--t-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg);
}
.logo { grid-column: 1 / span 3; display: flex; }
.logo svg { display: block; height: 30px; width: auto; }
.nav { grid-column: 4 / span 6; display: flex; gap: 2.2em; }
.contact { grid-column: 12; justify-self: end; }
.nav a, .contact { opacity: 0.55; transition: opacity 0.2s; }
.nav a:hover, .nav a[aria-current], .contact:hover { opacity: 1; }


/* ---- home: one screen, no scroll ---------------------------------------
   The work is seen through the mark: the SMASH logo, stretched edge to edge,
   masks a fast shuffled cut through every project image (as on svartljus.se).
   The static mask below is the no-JS fallback; main.js replaces it with one
   drawn from parameters (mark.js). */

.home { height: 100svh; overflow: hidden; background: #000; color: #fff; }
.home .site-header { display: none; }

.stage { position: fixed; inset: 0; display: block; }
.slide {
  position: absolute;
  inset: 0;
  /* Edge to edge: the mark stretches to the viewport, as on svartljus.se. */
  -webkit-mask: url("/brand/smash-mask.svg") center / 100% 100% no-repeat;
  mask: url("/brand/smash-mask.svg") center / 100% 100% no-repeat;
}
.slide img, .slide canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* S: white ground instead of black. (A, invert, is drawn into the mask.) */
.home.light { background: #fff; }
/* H: the tweak panel, above the full-screen link. */
.tweak { z-index: 100; top: 12px !important; right: 12px !important; width: 280px !important; }

.site-footer {
  align-items: center;
  font-size: var(--t-small);
  letter-spacing: 0.04em;
  color: var(--muted);
}
.f-copy { grid-column: 1 / span 3; }
.f-mail { grid-column: 10 / span 3; justify-self: end; }
.f-top { grid-column: 10 / span 3; justify-self: end; }
.site-footer { margin-top: var(--row-gap); padding-block: 24px; border-top: 1px solid var(--line); }
.site-footer .f-mail { grid-column: 4 / span 6; justify-self: start; }
.f-mail:hover, .f-top:hover { color: var(--ink); }

/* ---- page heads -------------------------------------------------------- */

.page-head { padding-block: clamp(48px, 8vw, 128px) clamp(32px, 4vw, 64px); align-items: baseline; }
.page-title { grid-column: 1 / span 8; font-size: var(--t-title); line-height: 1; letter-spacing: -0.025em; }
.page-meta { grid-column: 10 / span 3; justify-self: end; font-size: var(--t-small); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- work index -------------------------------------------------------- */

.index { row-gap: clamp(40px, 6vw, 112px); align-items: end; }
.tile-media { aspect-ratio: var(--ar); overflow: hidden; background: #f2f2f2; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity 0.4s; }
.tile:hover .tile-media img { transform: scale(1.025); }
.tile-caption {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  margin-top: 10px;
  font-size: var(--t-small);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tile-caption span:last-child { color: var(--muted); }

/* ---- project page ------------------------------------------------------- */

.project-head { padding-block: clamp(48px, 8vw, 128px) clamp(24px, 3vw, 48px); align-items: baseline; }
.project-title { grid-column: 1 / span 7; font-size: var(--t-title); line-height: 1; letter-spacing: -0.025em; }
.project-year, .project-tags { font-size: var(--t-small); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.project-year { grid-column: 9 / span 1; }
.project-tags { grid-column: 10 / span 3; justify-self: end; }

.project-hero { margin: 0; padding-inline: var(--margin); }
.project-hero img, .project-hero video { max-height: calc(100svh - 48px); object-fit: cover; }

.project-lead { margin-top: var(--row-gap); }
.lead { grid-column: 1 / span 9; font-size: var(--t-lead); line-height: 1.3; letter-spacing: -0.01em; }
.lead p + p { margin-top: 0.8em; }

.row { margin-top: var(--row-gap); align-items: end; }
.row-media { align-items: start; }
.row-caption .cell-text { align-self: end; }
.cell-text .prose { max-width: 42ch; }
.prose p + p { margin-top: 1em; }
.prose a, .credits a, .lead a { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.row-caption .prose { font-size: var(--t-small); line-height: 1.55; letter-spacing: 0.01em; }

.credits {
  list-style: none;
  margin: 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  columns: 3 16em;
  column-gap: var(--gutter);
  font-size: var(--t-small);
  line-height: 1.7;
  color: var(--muted);
}

.next {
  margin-top: var(--row-gap);
  padding-block: 32px 8px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.next-label { grid-column: 1 / span 3; font-size: var(--t-small); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.next-title { grid-column: 4 / span 9; font-size: var(--t-title); line-height: 1; letter-spacing: -0.025em; transition: opacity 0.3s; }
.next:hover .next-title { opacity: 0.5; }

/* ---- studio -------------------------------------------------------------- */

.studio { row-gap: var(--row-gap); }
.studio-statement { grid-column: 1 / span 10; font-size: var(--t-lead); line-height: 1.3; letter-spacing: -0.01em; }
.studio-about { grid-column: 7 / span 5; }
.studio-list { grid-column: span 3; margin: 0; font-size: var(--t-small); line-height: 1.8; }
.studio-list:first-of-type { grid-column: 1 / span 3; }
.studio-list dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.studio-list dd { margin: 0; }

/* ---- small screens: the grid keeps its 12 columns, cells take all of them -- */

@media (max-width: 720px) {
  :root { --header: 56px; }
  .logo svg { height: 26px; }
  .logo { grid-column: 1 / span 5; }
  .nav { grid-column: 6 / span 5; gap: 1.2em; }
  .contact { grid-column: 11 / span 2; }
  [style*="--span"], .cell, .tile { grid-column: 1 / -1; }
  .row-media .cell + .cell, .row-caption .cell + .cell { margin-top: var(--gutter); }
  .row-caption .cell-text { margin-top: 16px; }
  .tile-media { aspect-ratio: 4 / 3; }
  .f-copy { grid-column: 1 / span 6; }
  .f-mail, .site-footer .f-mail { grid-column: 7 / span 6; justify-self: end; }
  .f-top { display: none; }
  .page-title, .project-title, .lead, .studio-statement, .studio-about, .studio-list, .studio-list:first-of-type { grid-column: 1 / -1; }
  .page-meta { grid-column: 1 / -1; justify-self: start; margin-top: 12px; }
  .project-year { grid-column: 1 / span 3; margin-top: 16px; }
  .project-tags { grid-column: 4 / span 9; margin-top: 16px; }
  .next-label { grid-column: 1 / -1; }
  .next-title { grid-column: 1 / -1; margin-top: 12px; }
}

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

/* ---- work: the carousel ------------------------------------------------ */

.work-page { height: 100svh; overflow: hidden; background: #000; color: #fff; }
.work-page main { height: 100%; }
.work-page .site-header { position: absolute; inset: 0 0 auto; z-index: 10; background: none; color: #fff; }
.work-page .logo svg { height: 44px; }

.carousel {
  position: fixed;
  inset: 0;
  overflow: hidden;
  perspective: 1400px;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.carousel.is-dragging { cursor: grabbing; }
.ring {
  --w: clamp(150px, 15vw, 250px);
  --h: calc(var(--w) * 1.25);
  --step: calc(360deg / var(--count));
  --r: calc(var(--count) * var(--w) * 1.12 / 6.2832);
  --lay: 0deg;
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
}
.card {
  position: absolute;
  left: calc(var(--w) / -2);
  top: calc(var(--h) / -2);
  width: var(--w);
  height: var(--h);
  /* Hinged at the top edge: standing, the poster faces out of the ring;
     laid down, it points outward like a ray. */
  transform-origin: 50% 0;
  transform: rotateY(calc(var(--i) * var(--step))) translateZ(var(--r)) rotateX(var(--lay));
  backface-visibility: hidden;
  display: block;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card-title {
  position: absolute;
  inset: calc(100% + 10px) 0 auto;
  font-size: var(--t-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover .card-title, .card:focus-visible .card-title { opacity: 1; }
.card:focus-visible { outline: 1px solid #fff; outline-offset: 6px; }

.carousel-views {
  position: fixed;
  inset: auto 0 24px;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 2em;
}
.carousel-views button {
  appearance: none;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: var(--t-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.45;
  cursor: pointer;
  padding: 8px 4px;
}
.carousel-views button[aria-pressed="true"], .carousel-views button:hover { opacity: 1; }
