@font-face {
  font-family: "Knight Display";
  src: url("assets/fonts/KnightAIAV.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --blackened-umber: #100d0c;
  --deep-umber: #1a1310;
  --chalk: #eee6d7;
  --chalk-dim: #c9bfaf;
  --antique-brass: #c4a268;
  --brass-bright: #ecd495;
  --hairline: rgb(196 162 104 / 0.42);
  --gallery-columns: 6;
  --gallery-rows: 4;
  --pointer-x: 50vw;
  --pointer-y: 50vh;
  color-scheme: dark;
  font-family: "Baskerville", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  background: var(--blackened-umber);
  color: var(--chalk);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 20rem;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  background: var(--blackened-umber);
  -webkit-font-smoothing: antialiased;
}

body[data-cursor="on"],
body[data-cursor="on"] * {
  cursor: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  z-index: 20000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--blackened-umber);
  background: var(--brass-bright);
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.material-stage,
.material-stage__clay,
.material-stage__wash,
.material-stage__grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.material-stage {
  z-index: -3;
  overflow: hidden;
  background: #100d0c;
}

.material-stage__clay {
  inset: -5%;
  background:
    linear-gradient(115deg, rgb(20 12 9 / 0.92), rgb(26 12 13 / 0.72)),
    url("assets/textures/clay-oxblood-4k.jpg") center / cover;
  filter: saturate(0.66) brightness(0.5);
  transform: scale(1.04);
}

.material-stage__wash {
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgb(236 212 149 / 0.08), transparent 22rem),
    radial-gradient(circle at 50% -12%, rgb(196 162 104 / 0.12), transparent 44%),
    linear-gradient(180deg, rgb(0 0 0 / 0.06), rgb(0 0 0 / 0.55));
}

.material-stage__grain {
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.portfolio-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.65rem, 1.15vh, 1.05rem);
  width: 100%;
  height: 100svh;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1.15rem, env(safe-area-inset-right))
    max(0.8rem, env(safe-area-inset-bottom))
    max(1.15rem, env(safe-area-inset-left));
}

.masthead,
.folio-footer {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.masthead {
  min-height: clamp(3.5rem, 7vh, 5.5rem);
  border-bottom: 1px solid var(--hairline);
  padding: 0 clamp(0.2rem, 0.7vw, 0.8rem) clamp(0.65rem, 1vh, 0.95rem);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.65rem, 1.1vw, 1rem);
  min-width: 0;
}

.wordmark__crest {
  display: grid;
  place-items: center;
  width: clamp(2.25rem, 3.2vw, 3.35rem);
  aspect-ratio: 1;
  border: 1px solid var(--hairline);
  color: var(--brass-bright);
  font-family: "Baskerville", Georgia, serif;
  font-size: clamp(1.25rem, 1.8vw, 1.9rem);
  line-height: 1;
  box-shadow: inset 0 0 0 4px rgb(10 7 5 / 0.28);
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.wordmark:hover .wordmark__crest,
.wordmark:focus-visible .wordmark__crest {
  color: var(--blackened-umber);
  border-color: var(--brass-bright);
  background: var(--brass-bright);
}

.wordmark__copy {
  display: grid;
  gap: 0.08rem;
}

.wordmark__name {
  color: var(--chalk);
  font-family: "Knight Display", "Arial Narrow", sans-serif;
  font-size: clamp(1.15rem, 1.75vw, 2rem);
  line-height: 1;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.wordmark__note,
.masthead__edition,
.folio-footer {
  color: var(--chalk-dim);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(0.58rem, 0.63vw, 0.72rem);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.masthead__edition {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.8rem;
}

.masthead__edition b {
  color: var(--brass-bright);
  font-weight: 600;
}

.masthead__rule {
  width: clamp(2rem, 5vw, 5rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--antique-brass), transparent);
}

.gallery-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--hairline);
  padding: clamp(0.5rem, 0.85vw, 0.9rem);
  background: rgb(8 6 5 / 0.25);
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.3),
    0 18px 50px rgb(0 0 0 / 0.28);
}

.frame-corner {
  position: absolute;
  z-index: 10;
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}

.frame-corner::before,
.frame-corner::after {
  position: absolute;
  content: "";
  background: var(--brass-bright);
}

.frame-corner::before {
  width: 1rem;
  height: 1px;
}

.frame-corner::after {
  width: 1px;
  height: 1rem;
}

.frame-corner--nw {
  top: -1px;
  left: -1px;
}

.frame-corner--ne {
  top: -1px;
  right: -1px;
  transform: rotate(90deg);
}

.frame-corner--sw {
  bottom: -1px;
  left: -1px;
  transform: rotate(-90deg);
}

.frame-corner--se {
  right: -1px;
  bottom: -1px;
  transform: rotate(180deg);
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--gallery-rows), minmax(0, 1fr));
  gap: clamp(0.4rem, 0.6vw, 0.78rem);
  width: 100%;
  height: 100%;
  min-height: 0;
  outline: none;
  perspective: 1600px;
}

.project-card {
  --card-rx: 0deg;
  --card-ry: 0deg;
  --light-x: 50%;
  --light-y: 50%;
  --edge: #7f302e;
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  isolation: isolate;
  transform: perspective(900px) rotateX(var(--card-rx)) rotateY(var(--card-ry));
  transform-style: preserve-3d;
  transition:
    transform 360ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 260ms ease;
  will-change: transform;
}

.project-card::before,
.project-card::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: color-mix(in srgb, var(--edge) 58%, #050403);
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card::before {
  top: 3px;
  right: -4px;
  bottom: -3px;
  width: 4px;
  transform: skewY(42deg);
  transform-origin: left top;
}

.project-card::after {
  right: 0;
  bottom: -4px;
  left: 4px;
  height: 4px;
  transform: skewX(48deg);
  transform-origin: left top;
}

.project-card__face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: auto 1fr / 1fr auto;
  gap: 0.3rem;
  overflow: hidden;
  border: 1px solid rgb(238 230 215 / 0.18);
  padding: clamp(0.55rem, 0.8vw, 0.95rem);
  background-image:
    radial-gradient(circle at var(--light-x) var(--light-y), rgb(255 240 202 / 0.12), transparent 46%),
    linear-gradient(145deg, rgb(7 6 5 / 0.1), rgb(7 6 5 / 0.58)),
    var(--texture);
  background-position: center;
  background-size: auto, auto, cover;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.08),
    inset 0 -20px 50px rgb(0 0 0 / 0.12),
    0 8px 16px rgb(0 0 0 / 0.25);
  transform: translateZ(0);
}

.project-card__face::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  border: clamp(0.25rem, 0.42vw, 0.5rem) solid rgb(5 4 3 / 0.13);
  box-shadow: inset 0 0 0 1px rgb(238 230 215 / 0.06);
}

.project-card__number,
.project-card__arrow {
  position: relative;
  z-index: 2;
  color: rgb(238 230 215 / 0.68);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(0.52rem, 0.56vw, 0.67rem);
  line-height: 1;
  letter-spacing: 0.1em;
}

.project-card__arrow {
  grid-column: 2;
  grid-row: 1;
  color: var(--brass-bright);
  font-size: clamp(0.72rem, 0.8vw, 1rem);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card__copy {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  align-self: end;
  display: grid;
  min-width: 0;
  gap: clamp(0.22rem, 0.45vh, 0.42rem);
}

.project-card__name {
  color: #fff9ed;
  font-family: "Knight Display", "Arial Narrow", sans-serif;
  font-size: clamp(0.76rem, min(1.08vw, 1.75vh), 2rem);
  line-height: 0.95;
  letter-spacing: 0.025em;
  text-wrap: balance;
  text-transform: uppercase;
  text-shadow: 0 2px 16px rgb(0 0 0 / 0.5);
}

.project-card__description {
  display: -webkit-box;
  overflow: hidden;
  color: rgb(248 239 221 / 0.78);
  font-size: clamp(0.55rem, min(0.66vw, 1.05vh), 1.05rem);
  line-height: 1.28;
  text-wrap: pretty;
  text-shadow: 0 1px 10px rgb(0 0 0 / 0.68);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-card:hover,
.project-card:focus-visible {
  z-index: 5;
  filter: saturate(1.08) brightness(1.08);
  transform:
    perspective(900px)
    rotateX(var(--card-rx))
    rotateY(var(--card-ry))
    translateY(-4px)
    scale(1.018);
  outline: none;
}

.project-card:hover .project-card__face,
.project-card:focus-visible .project-card__face {
  border-color: rgb(236 212 149 / 0.72);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.14),
    inset 0 -20px 50px rgb(0 0 0 / 0.08),
    0 14px 28px rgb(0 0 0 / 0.42),
    0 0 0 1px rgb(236 212 149 / 0.2);
}

.project-card:hover .project-card__arrow,
.project-card:focus-visible .project-card__arrow {
  transform: translate(2px, -2px);
}

.project-card:focus-visible {
  box-shadow: 0 0 0 2px var(--brass-bright), 0 0 0 5px rgb(16 13 12 / 0.9);
}

.project-card[data-tone="oxblood"] {
  --texture: url("assets/textures/clay-oxblood-4k.jpg");
  --edge: #681b22;
}

.project-card[data-tone="cypress"] {
  --texture: url("assets/textures/clay-cypress-4k.jpg");
  --edge: #244235;
}

.project-card[data-tone="lapis"] {
  --texture: url("assets/textures/clay-lapis-4k.jpg");
  --edge: #203b58;
}

.project-card[data-tone="storm"] {
  --texture: url("assets/textures/clay-storm-4k.jpg");
  --edge: #40596a;
}

.project-card[data-tone="terracotta"] {
  --texture: url("assets/textures/clay-terracotta-4k.jpg");
  --edge: #793a29;
}

.project-card:nth-last-child(3) {
  grid-column: 1 / span 2;
}

.project-card:nth-last-child(2) {
  grid-column: 3 / span 2;
}

.project-card:last-child {
  grid-column: 5 / span 2;
}

.folio-footer {
  min-height: 1.5rem;
  gap: 1rem;
  padding: 0 clamp(0.2rem, 0.7vw, 0.8rem);
}

.folio-footer p {
  margin: 0;
}

.folio-footer a {
  color: var(--chalk-dim);
  transition: color 160ms ease;
}

.folio-footer a:hover,
.folio-footer a:focus-visible {
  color: var(--brass-bright);
  outline: none;
}

.folio-footer__mobile {
  display: none;
}

.royal-cursor {
  position: fixed;
  z-index: 30000;
  top: 0;
  left: 0;
  display: none;
  width: 32px;
  height: 32px;
  pointer-events: none;
  transform: translate3d(-64px, -64px, 0);
  will-change: transform;
}

body[data-cursor="on"] .royal-cursor {
  display: block;
}

.royal-cursor img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 2px 3px rgb(0 0 0 / 0.55))
    drop-shadow(0 0 7px rgb(255 215 0 / 0.5));
  transform: rotate(15deg) scale(1);
  transform-origin: top left;
  transition: transform 180ms cubic-bezier(0.165, 0.84, 0.44, 1);
}

.royal-cursor.is-active img {
  transform: rotate(15deg) scale(0.82);
}

.noscript {
  position: fixed;
  z-index: 40000;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  margin: 0;
  border: 1px solid var(--hairline);
  padding: 0.9rem 1rem;
  color: var(--chalk);
  background: var(--blackened-umber);
  text-align: center;
}

@media (min-width: 48rem) and (max-height: 43rem) {
  .portfolio-shell {
    gap: 0.45rem;
    padding-top: 0.6rem;
    padding-bottom: 0.5rem;
  }

  .masthead {
    min-height: 2.9rem;
    padding-bottom: 0.45rem;
  }

  .wordmark__crest {
    width: 2.2rem;
  }

  .wordmark__note {
    display: none;
  }

  .project-card__description {
    font-size: clamp(0.5rem, 0.72vw, 0.66rem);
  }
}

@media (max-width: 47.99rem) {
  .portfolio-shell {
    gap: 0;
    padding:
      max(0.6rem, env(safe-area-inset-top))
      max(0.75rem, env(safe-area-inset-right))
      max(0.55rem, env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
  }

  .masthead {
    min-height: 4.3rem;
    padding: 0 0.25rem 0.65rem;
  }

  .wordmark__crest {
    width: 2.35rem;
  }

  .wordmark__name {
    font-size: clamp(1rem, 4.7vw, 1.35rem);
  }

  .wordmark__note {
    font-size: 0.52rem;
  }

  .masthead__edition {
    gap: 0.45rem;
    font-size: 0.54rem;
  }

  .masthead__rule {
    display: none;
  }

  .gallery-frame {
    border-top: 0;
    border-bottom: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .frame-corner {
    display: none;
  }

  .project-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: clamp(0.9rem, 3vh, 1.5rem) 0.45rem;
    scroll-behavior: smooth;
    scroll-padding-block: clamp(0.9rem, 3vh, 1.5rem);
    scroll-snap-type: y mandatory;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .project-gallery::-webkit-scrollbar {
    display: none;
  }

  .project-card {
    flex: 0 0 calc(100% - clamp(0.6rem, 2vh, 1.1rem));
    width: 100%;
    min-height: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .project-card:nth-last-child(3),
  .project-card:nth-last-child(2),
  .project-card:last-child {
    grid-column: auto;
  }

  .project-card::before {
    right: -5px;
    width: 5px;
  }

  .project-card::after {
    bottom: -5px;
    height: 5px;
  }

  .project-card__face {
    padding: clamp(1.1rem, 5vw, 1.65rem);
    background-position: center;
  }

  .project-card__face::before {
    border-width: 0.55rem;
  }

  .project-card__number {
    font-size: 0.66rem;
  }

  .project-card__arrow {
    font-size: 1.1rem;
  }

  .project-card__copy {
    align-self: center;
    justify-items: center;
    gap: clamp(0.7rem, 2vh, 1rem);
    padding: 0 0.6rem;
    text-align: center;
  }

  .project-card__name {
    font-size: clamp(1.75rem, min(9vw, 5.6vh), 3.1rem);
    line-height: 0.95;
  }

  .project-card__description {
    max-width: 30rem;
    color: rgb(248 239 221 / 0.85);
    font-size: clamp(0.88rem, min(4vw, 2.2vh), 1.12rem);
    line-height: 1.42;
    -webkit-line-clamp: 3;
  }

  .project-card:hover,
  .project-card:focus-visible {
    transform: none;
  }

  .folio-footer {
    min-height: 2.45rem;
    padding: 0.55rem 0.25rem 0;
    border-top: 1px solid var(--hairline);
  }

  .folio-footer > p:first-child,
  .folio-footer > a {
    display: none;
  }

  .folio-footer__mobile {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.4rem;
  }

  .swipe-cue {
    margin-left: auto;
    color: var(--brass-bright);
  }
}

@media (max-width: 24rem) {
  .masthead__edition > span:first-child {
    display: none;
  }

  .project-card__description {
    max-width: 25ch;
  }
}

@media (pointer: coarse) {
  .royal-cursor {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .project-card,
  .project-card:hover,
  .project-card:focus-visible {
    transform: none;
  }
}

@media (forced-colors: active) {
  .material-stage {
    display: none;
  }

  .project-card__face {
    border: 2px solid CanvasText;
    background: Canvas;
  }

  .project-card__name,
  .project-card__description,
  .project-card__number {
    color: CanvasText;
    text-shadow: none;
  }
}
