:root {
  --red: #c0383a;
  --ink: #080808;
  --gap: clamp(8px, .89vw, 17px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Outfit, Arial, sans-serif;
}

body:has(dialog[open]) {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  padding: 0;
  border: 0;
  font: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

h1, h2, h3, p, figure {
  margin: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #fa7d77;
  outline-offset: 5px;
}

mark {
  color: #fff;
  background: var(--red);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.page-frame {
  position: relative;
  max-width: 1920px;
  margin: auto;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  z-index: 500;
  top: -80px;
  left: 15px;
  padding: 12px 18px;
  color: #fff;
  background: var(--ink);
}

.skip-link:focus {
  top: 10px;
}

/* Header */

.site-header,
.desktop-nav,
.hero-chat,
.red-action,
.section-switcher,
.section-switcher a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.site-header {
  position: absolute;
  z-index: 100;
  inset: 0 0 auto;
  align-items: flex-start;
  padding: 27px 4.16%;
  color: var(--red);
}

.site-signature {
  flex-shrink: 0;
  font-size: clamp(14px, 1.67vw, 32px);
  font-weight: 300;
}

.header-email {
  color: #811919;
  font-size: clamp(11px, 1.04vw, 20px);
}

.desktop-nav {
  padding-top: 6px;
  font-size: clamp(10px, .83vw, 15px);
  text-transform: uppercase;
}

.desktop-nav a {
  opacity: .68;
}

.desktop-nav a:hover,
.desktop-nav [aria-current] {
  opacity: 1;
}

.site-header a:hover,
.desktop-nav [aria-current] {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.header-on-image,
.header-on-image .header-email {
  color: #fff;
}

.menu-toggle,
.mobile-nav,
.dialog-controls {
  display: none;
}

/* Home */

.home-hero,
.work-hero {
  position: relative;
  height: min(56.25vw, 1080px);
  overflow: hidden;
}

.home-hero {
  min-height: 510px;
}

.artist-portrait {
  position: absolute;
  top: 10%;
  left: 2.6%;
  width: 43.86%;
  height: 87.22%;
  object-fit: contain;
  object-position: bottom left;
}

.hero-type {
  position: absolute;
  top: 10%;
  left: 42%;
  width: 62%;
}

.hero-type h1 {
  font-size: clamp(75px, 15.68vw, 301px);
  line-height: 1;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.hero-type h1 span {
  display: block;
}

.hero-type p {
  margin: .12em 0 0 .4em;
  font-size: clamp(16px, 2.08vw, 40px);
}

.hero-chat,
.red-action {
  color: #fff;
  background: var(--red);
  font-weight: 700;
}

.hero-chat {
  position: absolute;
  top: 75.9%;
  left: 42.8%;
  width: 68.5%;
  height: 12.6%;
  padding: 0 2%;
  font-size: clamp(23px, 3.33vw, 64px);
}

.hero-chat:hover,
.red-action:hover {
  background: #a82a2c;
}

.hero-chat span,
.red-action span {
  opacity: 0;
}

.hero-chat:hover span,
.red-action:hover span {
  opacity: 1;
}

.home-grid,
.tools-icons,
.game-layout,
.game-small-images,
.game-screens,
.illustration-gallery,
.victorian-study,
.sketch-stack,
.potion-row,
.hunters-row,
.cave-intro {
  display: grid;
  gap: var(--gap);
}

.home-grid {
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: min(2.44vw, 47px) 4.16% min(4.55vw, 87px);
}

.about-panel,
.game-aside {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.about-panel {
  display: flex;
  flex-direction: column;
  margin-top: -28px;
}

.about-panel h2 {
  font-size: clamp(38px, 6.61vw, 127px);
  line-height: 1.13;
  letter-spacing: -.075em;
}

.about-name {
  margin-bottom: min(1.9vw, 36px);
  font-size: clamp(15px, 2.08vw, 40px);
  text-align: right;
}

.about-copy h3,
.tools-heading,
.game-description h3,
.concept-description h2 {
  margin-bottom: var(--gap);
  font-size: clamp(20px, 1.67vw, 32px);
  line-height: 1.25;
}

.about-copy p,
.game-description p,
.concept-description p {
  margin-bottom: var(--gap);
  font-size: clamp(14px, 1.25vw, 24px);
  line-height: 1.4;
}

.tools-heading {
  margin-top: auto;
}

.tools-icons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  place-items: center;
}

.tool-icon,
.tool-icon-procreate-frame {
  width: 100%;
  max-width: 78px;
  aspect-ratio: 1;
  object-fit: contain;
}

.tool-icon-procreate-frame {
  position: relative;
  overflow: hidden;
}

.tool-icon-procreate-frame img {
  position: absolute;
  top: -1.35%;
  left: -40.74%;
  width: 180.15%;
  height: 102.7%;
  max-width: none;
  object-fit: fill;
}

/* Portfolio tiles */

.category-tile {
  position: relative;
  height: min(51.4vw, 987px);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}

.category-image,
.work-hero-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-image {
  z-index: -2;
  transition: transform .4s;
}

.tile-game .category-image {
  object-position: 49% 45%;
}

.tile-illustration .category-image {
  object-position: 55% center;
}

.category-tile::after {
  position: absolute;
  z-index: -1;
  inset: 55% 0 0;
  background: linear-gradient(transparent, #0007);
  content: "";
}

.category-tile:hover .category-image {
  transform: scale(1.045);
}

.tile-number {
  position: absolute;
  top: -5%;
  left: -2%;
  font-size: clamp(120px, 15.625vw, 300px);
  font-weight: 700;
  line-height: .93;
  letter-spacing: -.09em;
}

.tile-bottom {
  position: absolute;
  inset: auto 0 3%;
  text-align: center;
}

.tile-bottom strong,
.tile-bottom small {
  display: block;
}

.tile-bottom strong {
  font-size: clamp(17px, 2.5vw, 48px);
}

.tile-bottom small {
  font-size: clamp(9px, 1.04vw, 20px);
}

/* Contact */

.contact-footer {
  padding: min(2.25vw, 43px) 4.16% min(3.3vw, 64px);
  color: #fff;
  background: var(--red);
}

.contact-wrap h2 {
  margin-bottom: 10px;
  font-size: clamp(44px, 5vw, 96px);
}

.contact-links a {
  display: grid;
  grid-template-columns: clamp(22px, 2.55vw, 49px) minmax(0, 1fr);
  align-items: center;
  gap: min(2.4vw, 46px);
  width: fit-content;
  max-width: 100%;
  margin-top: 7px;
  font-size: clamp(19px, 3.33vw, 64px);
  line-height: 1.18;
}

.contact-links svg {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.contact-links span {
  overflow-wrap: anywhere;
}

/* Work pages */

.work-hero {
  min-height: 400px;
  color: #fff;
  background: #4b544e;
}

.work-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0004, transparent 74%);
  pointer-events: none;
  content: "";
}

.work-hero-titles {
  position: absolute;
  z-index: 1;
  inset: 34.8% 4.16% auto;
  line-height: 1.13;
}

.work-hero-titles p {
  font-size: clamp(23px, 3.33vw, 64px);
}

.work-hero-titles h1 {
  font-size: clamp(38px, 5vw, 96px);
}

.game-content {
  padding-top: min(2.6vw, 50px);
}

.project-title {
  margin-bottom: min(1.8vw, 34px);
  color: var(--red);
  font-size: clamp(33px, 3.82vw, 73px);
  line-height: 1.18;
  padding-left: 4.16%;
}

.game-layout {
  position: relative;
  grid-template-columns: 30.5% minmax(0, 1fr);
  align-items: start;
  padding-left: 4.16%;
}

.red-action {
  padding: 20px min(1.56vw, 30px);
  font-size: clamp(19px, 2.08vw, 40px);
}

.game-small-images,
.game-description {
  width: 75%;
  margin: min(2vw, 38px) 0 0 auto;
}

.game-hand {
  position: absolute;
  z-index: 0;
  top: 100px;
  left: 5%;
  width: 9.32%;
  transform: rotate(25.82deg);
  transform-origin: top;
  pointer-events: none;
}

/* Artwork: natural image proportions replace individual aspect ratios. */

.artwork-zoom {
  display: block;
  width: 100%;
  overflow: hidden;
  background: transparent;
  cursor: zoom-in;
}

.artwork-zoom img {
  width: 100%;
  height: auto;
}

.artwork-zoom:hover img {
  filter: brightness(.95);
}

.artwork-static {
  cursor: default;
}

.artwork-static:hover img {
  filter: none;
}

.illustration-gallery,
.concept-gallery {
  padding-top: var(--gap);
}

.victorian-study {
  grid-template-columns: 29.17% 42.65% 22.08%;
  align-items: start;
  gap: .9%;
  margin-top: var(--gap);
}

.victorian-blockout img {
  height: 100%;
  object-fit: cover;
}

.concept-description {
  padding: 0 12px;
}

.concept-description .red-action {
  margin-top: var(--gap);
  font-size: clamp(15px, 1.9vw, 38px);
}

.art-separator {
  height: var(--gap);
  margin: var(--gap) 0;
  background: #d9d9d9;
}

.potion-row {
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  margin-top: var(--gap);
}

.hunters-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cave-intro {
  align-items: start;
}

.house-variations {
  margin-top: var(--gap);
}

/* Navigation and overlays */

.section-switcher {
  margin: min(8.3vw, 160px) auto min(7.1vw, 136px);
  padding: 0 12.25%;
}

.section-switcher a {
  font-size: clamp(21px, 3.33vw, 64px);
}

.section-switcher a:hover {
  color: var(--red);
}

.highlight-extensions {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.highlight-extension {
  position: absolute;
  background: var(--red);
}

.art-dialog {
  width: min(95vw, 1600px);
  max-width: none;
  max-height: 94vh;
  padding: 40px 20px 20px;
  border: 0;
  color: #fff;
  background: transparent;
}

.art-dialog::backdrop {
  background: rgb(0 0 0 / 90%);
}

.dialog-close {
  position: absolute;
  top: 0;
  right: 8px;
  width: 45px;
  height: 45px;
  color: inherit;
  background: transparent;
  font-size: 35px;
}

.dialog-figure {
  text-align: center;
}

.dialog-figure img {
  width: auto;
  max-height: calc(94vh - 110px);
  margin: auto;
  object-fit: contain;
  touch-action: pan-y pinch-zoom;
}

.dialog-figure figcaption {
  padding-top: 12px;
  font-size: 24px;
}

.cave-intro {
    grid-template-columns: 40% 60%;
    gap: 20px;
}

.cave-intro .artwork-static img {
    width: auto;
    height: auto;
    max-height: 800px;
}

.cave-copy {
    padding: var(--gap) 0 0;
    width: 40%;
}

/* Tablet */

@media (max-width: 1100px) {
  .header-email {
    display: none;
  }
}

@media (max-width: 1000px) {
  .cave-intro {
    grid-template-columns: 60% 40%;
    gap: 20px;
  }

  .cave-intro .artwork-static img {
    width: 100%;
    height: auto;
  }

  .cave-copy {
    padding: var(--gap) 0 0;
    width: 60%;
  }


  .site-header {
    position: fixed;
    align-items: center;
    height: 66px;
    padding: 10px 5%;
    color: var(--red);
    background: rgb(255 255 255 / 97%);
  }

  .site-signature {
    font-size: 20px;
  }

  .desktop-nav,
  .game-hand {
    display: none;
  }

  .menu-toggle {
    display: grid;
    gap: 5px;
    width: 44px;
    padding: 11px 8px;
    color: inherit;
    background: transparent;
  }

  .menu-toggle span {
    height: 2px;
    background: currentColor;
  }

  .mobile-nav:not([hidden]) {
    position: fixed;
    inset: 66px 0 auto;
    display: grid;
    max-height: calc(100dvh - 66px);
    padding: 10px 5% 18px;
    overflow-y: auto;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 16px 30px #0002;
    animation: menuDrop .25s ease-out;
    z-index: 10;
  }

  .mobile-nav a {
    padding: 14px 8px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
  }

  .mobile-nav [aria-current] {
    color: var(--red);
    font-weight: 700;
  }

  .home-grid,
  .game-aside,
  .victorian-study,
  .cave-intro {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid {
    padding: 38px 5% 48px;
  }

  .about-panel,
  .category-tile:last-child,
  .game-aside > .red-action,
  .victorian-study .concept-description {
    grid-column: 1 / -1;
  }

  .about-panel {
    display: block;
    margin: 0 0 20px;
  }

  .about-panel h2 {
    font-size: 90px;
  }

  .about-name {
    font-size: 29px;
  }

  .tools-heading {
    margin-top: 24px;
  }

  .tools-icons {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    max-width: 570px;
  }

  .tool-icon,
  .tool-icon-procreate-frame {
    max-width: 64px;
  }

  .category-tile {
    height: 65vw;
  }

  .category-tile:last-child {
    height: 58vw;
  }

  .tile-bottom strong {
    font-size: 34px;
  }

  .tile-bottom small {
    font-size: 14px;
  }

  .game-layout {
    grid-template-columns: 1fr;
    padding: 0 5%;
  }

  .game-aside {
    display: grid;
    gap: var(--gap);
  }

  .game-aside > .red-action {
    margin: 0;
  }

  .game-small-images,
  .game-description {
    width: 100%;
    margin: 0;
  }

  .project-title {
    padding: 0 5%;
    
  }

  .red-action {
    padding: 14px 20px;
  }

  .concept-description {
    padding: 14px 5%;
  }

  .section-switcher {
    padding: 0 5%;
  }
}

/* Phone */

@media (max-width: 760px) {
  html {
    scroll-padding-top: 80px;
  }

  .home-hero {
    display: grid;
    grid-template-columns: 54% 46%;
    align-items: center;
    height: auto;
    min-height: 0;
    padding-top: 70px;
  }

  .artist-portrait {
    position: relative;
    top: auto;
    left: -7%;
    width: 115%;
    height: max(260px, 62vw);
    max-width: none;
  }

  .cave-intro {
    grid-template-columns: 60% 40%;
    gap: 0px;
  }

  .cave-intro .artwork-static img {
    width: 100%;
    height: auto;
  }

  .cave-copy {
    width: 90%;
  }

    .hero-type {
        position: static;
        z-index: 1;
        width: auto;
        margin-left: -5%;
    }

  .hero-type h1 {
    font-size: clamp(34px, 15.5vw, 100px);
    line-height: .95;
    letter-spacing: -.065em;
  }

  .hero-type p {
    margin-top: 12px;
    font-size: clamp(10px, 5vw, 17px);
  }

  .hero-chat {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    height: 74px;
    padding: 0 5%;
    font-size: 30px;
  }

  .hero-chat span,
  .red-action span {
    display: none;
  }

  .about-panel {
    display: grid;
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
    gap: 12px;
  }

  .about-panel h2,
  .about-name {
    grid-column: 1 / -1;
  }

  .about-panel h2 {
    font-size: clamp(68px, 17vw, 94px);
  }

  .about-name {
    margin-bottom: 12px;
    font-size: 24px;
  }

  .about-copy {
    grid-area: 3 / 1;
  }

  .tools-heading,
  .tools-icons {
    grid-area: 3 / 2;
    align-self: start;
    margin: 0;
  }

  .tools-heading {
    font-size: clamp(15px, 3.5vw, 22px);
  }

  .tools-icons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 36px;
  }

  .about-copy p,
  .game-description p,
  .concept-description p {
    font-size: 16px;
    line-height: 1.5;
  }

  .contact-footer {
    padding: 30px 5% 42px;
  }

  .contact-links a {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 19px;
    min-height: 42px;
    font-size: clamp(15px, 4vw, 30px);
  }

  .work-hero {
    height: 420px;
    min-height: 0;
  }

  .work-hero-titles {
    inset: auto 5% 16%;
  }

  .work-hero-titles p {
    font-size: clamp(21px, 5vw, 34px);
  }

  .work-hero-titles h1 {
    font-size: clamp(30px, 8vw, 63px);
  }

  .project-title {
    font-size: clamp(30px, 8vw, 56px);
    overflow-wrap: anywhere;
  }

  .potion-row,
  .hunters-row {
    grid-template-columns: 1fr;
  }

  .section-switcher {
    padding: 0 5%;
    margin: 55px auto;
  }

  .section-switcher a {
    min-height: 48px;
    font-size: clamp(15px, 3vw, 26px);
  }

  .art-dialog {
    width: 100%;
    max-height: 100dvh;
    padding: 50px 12px 16px;
  }

  .dialog-figure img {
    max-height: calc(100dvh - 130px);
  }
}

@media (max-width: 540px) {
  .home-grid,
  .game-aside,
  .cave-intro {
    grid-template-columns: 1fr;
  }

  .game-small-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-tile,
  .category-tile:last-child {
    height: min(118vw, 500px);
  }

  .tile-number {
    font-size: clamp(128px, 40vw, 196px);
  }

  .tile-bottom {
    bottom: 6%;
  }

  .section-switcher {
    display:flex;
    gap: 0;
  }

  .section-switcher a {
    min-height: 62px;
    border-bottom: 1px solid #ddd;
    font-size: 20px;
  }
}

@keyframes menuDrop {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}