:root {
  --accent: #536878;
  --bg: #0f0f0f;
  --fg: #d4d3d1;
  --pad: 1.5rem;
  --gap: 0.75rem;
  --bar: 4.5rem;
  --wide: min(88rem, calc(100% - 2 * min(6rem, 8vw)));
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --fast: 150ms;
  color-scheme: dark;
}

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

html {
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  color: var(--fg);
  overflow-y: scroll;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  font: 1rem/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, p { margin: 0; padding: 0; }
h1 { font: inherit; }
p + p { margin-top: var(--gap); }
img { display: block; max-width: 100%; height: auto; }

nav, .site-footer {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  transition: color var(--fast) var(--ease);
}
a:active, a[aria-current="page"] { color: var(--accent); }
a[aria-current="page"], p a, nav a::after { font-weight: 600; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.skip-link {
  position: absolute;
  top: -4rem;
  left: var(--gap);
  z-index: 30;
  padding: var(--gap);
  background: var(--fg);
  color: var(--bg);
}
.skip-link:focus { top: var(--gap); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[data-protect], .stage {
  -webkit-user-select: none;
  user-select: none;
}
[data-protect] {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--bar);
  padding-inline: var(--pad);
}

.logo {
  display: flex;
  align-items: center;
  height: var(--bar);
}
.logo::before {
  content: "";
  height: 2.06rem;
  aspect-ratio: 1774 / 1407;
  background: currentColor;
  mask: url(logo.svg) center / contain no-repeat;
  transition: background-color var(--fast) var(--ease);
}
.logo:active::before { background: var(--accent); }

nav a, .logo {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

nav { display: flex; gap: 4.5rem; }
nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: var(--pad);
}
nav a::after {
  height: 0;
  overflow: hidden;
  visibility: hidden;
}
nav a[href="/work/"]::after { content: "Work"; }
nav a[href="/photography/"]::after { content: "Photography"; }
nav a[href="/about/"]::after { content: "About"; }

main {
  display: flex;
  flex: 1;
  flex-direction: column;
}
main:focus { outline: none; }

.hero {
  display: flex;
  flex: 1;
  align-items: center;
}

.meta, .shots, .text {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
}

.meta { padding: var(--pad); }
.meta h1 { font-weight: 600; }

.shots {
  display: flex;
  gap: calc(var(--pad) * 2);
  padding: 0 var(--pad) var(--pad);
}
.shots img { flex: 1 1 0; min-width: 0; }

.text { padding: var(--pad); }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.stage p { padding: var(--pad); }

.item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: block;
  width: var(--w);
  height: var(--h);
}
.item:focus-visible { z-index: 1; }
a.item:active { opacity: 0.8; }

.item__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}
.item__frame img { width: 100%; height: 100%; object-fit: cover; }

.item__label {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: var(--gap);
  white-space: nowrap;
}

.stage.is-cards {
  display: flex;
  flex-direction: column;
  gap: var(--bar);
  padding: var(--pad);
  overflow: visible;
}
.is-cards .item {
  position: relative;
  left: auto;
  top: auto;
  width: var(--cw);
  height: auto;
  margin-left: var(--cx);
}
.is-cards .item__frame {
  position: relative;
  inset: auto;
  aspect-ratio: var(--ratio);
}
.is-cards .item__label { position: static; }

@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--accent); }
  .logo:hover::before { background: var(--accent); }
  .item:hover { z-index: 1; }
}

@media (pointer: coarse) {
  p a, .text a { display: inline-block; padding-block: 0.625rem; }
}

@media (prefers-contrast: more) {
  :root { --accent: #6f8797; }
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

.site-header { view-transition-name: header; }
.site-footer { view-transition-name: footer; }

@media (max-width: 48rem) {
  .shots { flex-wrap: wrap; }
  .shots img { flex-basis: 40%; }
}

@media (max-width: 40rem) {
  nav { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
