@font-face {
  font-family: Newsreader;
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("../fonts/noto-serif-sc-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f4efe6;
  --ink: #221d19;
  --rule: #cfc5b8;
  --muted: #6c6054;
  --accent: #812e3c;
  --side-inset: max(clamp(1.15rem, 4vw, 4rem), env(safe-area-inset-left), env(safe-area-inset-right));
  --site-width: min(100% - 2 * var(--side-inset), 74rem);
  --header-inset: calc(clamp(.65rem, 1.35vw, 1.15rem) + env(safe-area-inset-top));
  --masthead-size: 3.8rem;
  --serif: Newsreader, "Noto Serif SC", Georgia, serif;
  --display: "Big Caslon", var(--serif);
  --sans: system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-padding-top: calc(var(--header-inset) + var(--masthead-size) + .5rem);
  scrollbar-gutter: stable both-edges;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.4 var(--serif);
  -webkit-font-smoothing: antialiased;
}
button, a { color: inherit; }
a { text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
main:focus { outline: none; }
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 6; inset: .4rem auto auto .45rem; padding: .55rem .7rem; background: var(--paper); }
.topbar {
  position: sticky;
  z-index: 5;
  top: var(--header-inset);
  width: var(--site-width);
  margin: var(--header-inset) auto 0;
  border-radius: .65rem;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px #664e3533, 0 4px 15px #664e3510;
}
.masthead {
  min-height: var(--masthead-size);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding-inline: clamp(.85rem, 1.8vw, 1.4rem);
}
.brand { margin-top: .12em; font-size: 2rem; line-height: 1; }
.brand, .product h2, .product h3 { font-family: var(--display); font-weight: 500; letter-spacing: .012em; }
.header-tools { display: flex; align-items: center; }
.header-tools { gap: clamp(.35rem, 1.2vw, 1rem); font: 600 .875rem/1.3 var(--sans); }
.social { display: grid; place-items: center; width: 2.25rem; height: 2.75rem; }
.social img { height: 1.23rem; width: 1.23rem; }
@media (hover: hover) {
  .brand:hover { color: var(--accent); }
}
body[data-scene="milk"] { background: #e8ded0; }
.milk-portfolio {
  --scene-gap: clamp(.85rem, 2.5vw, 2.1rem);
  direction: ltr;
  --stage-height: min(43rem, calc(100svh - var(--masthead-size) - var(--scene-gap) * 2 - var(--header-inset) - env(safe-area-inset-bottom)));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(.85rem, 1.8vw, 1.5rem);
  width: var(--site-width);
  margin-inline: auto;
  padding-block: var(--scene-gap);
}
.milk-court { min-width: 0; }
.milk-stage {
  position: relative;
  height: var(--stage-height);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
  border-radius: .4rem;
  background: #b38763 url("../assets/home-oak.webp") center / cover;
  box-shadow: 0 0 0 1px #58371539, 0 14px 37px #67472234;
}
.milk-stage:focus-visible { outline-color: #5a3627; }
.milk-stage.is-wiping { cursor: grabbing; }
.milk-stage canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.requires-script { position: fixed; inset: auto 1rem 1rem; padding: 1rem; border: 1px solid var(--rule); background: var(--paper); }

.exhibit-content {
  --art-height: clamp(6rem, 24svh, 14rem);
  display: grid;
  grid-template: "heading" auto "details" minmax(0, 1fr) "actions" auto / minmax(0, 1fr);
  gap: clamp(.55rem, 1.35vw, 1rem);
  max-height: var(--stage-height);
  padding: clamp(.9rem, 2vw, 1.42rem);
  background: var(--paper);
  border-radius: .55rem;
  box-shadow: 0 0 0 1px #58371520, 0 12px 30px #67472223;
}
html[dir="rtl"] .exhibit-content { direction: rtl; }
.work-heading { grid-area: heading; display: flex; align-items: center; gap: .7rem; min-width: 0; }
.work-details {
  grid-area: details;
  display: grid;
  align-content: start;
  gap: .84rem;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.work-actions { grid-area: actions; display: flex; align-items: center; gap: .18rem; }
.app-icon { flex: none; width: clamp(2.4rem, 4vw, 3.35rem); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 23%; border: 1px solid #29180719; }
.product h2, .product h3 { margin: .07em 0 0; font-size: clamp(1.7rem, 3.2vw, 2.75rem); line-height: 1.02; }
.product p { margin: 0 0 .36em; color: #2c2520; font-size: clamp(1.05rem, 1.55vw, 1.3rem); line-height: 1.24; text-wrap: pretty; }
html[lang|="zh"] .product p { font-size: clamp(.92rem, 1.45vw, 1.13rem); line-height: 1.5; }
.product p.product-description, .product p.game-description {
  margin: 0;
  color: var(--muted);
  font-size: clamp(.91rem, 1.18vw, 1.05rem);
  line-height: 1.46;
}
html[lang|="zh"] .product p.product-description, html[lang|="zh"] .product p.game-description { line-height: 1.58; }
.store, .game-link { display: inline-flex; align-items: center; min-height: 2.75rem; flex: none; }
.store img { height: clamp(1.7rem, 2.4vw, 2.02rem); width: auto; }
.game-link { gap: .35rem; color: var(--accent); font: 580 .88rem/1.2 var(--sans); }
@media (hover: hover) { .game-link:hover { text-decoration: underline; text-underline-offset: 3px; } }
.work-toggle { display: none; }
.artwork {
  width: 100%;
  height: var(--art-height);
  overflow: hidden;
  border-radius: .4rem;
  border: 1px solid #37221428;
}
.phones {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8%;
  padding: .44rem 6%;
  background: #fdd144;
}
.phones > img { height: auto; width: auto; max-height: 100%; max-width: 46%; object-fit: contain; border-radius: .28rem; box-shadow: 0 2px 6px #24170f38; }
.product-dear .phones { background: #e4d4ed; }
.work-image { background: #e9ddc7; }
.work-image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.work-image-pair {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: .35rem;
  padding: .35rem;
}
.game-media { background: #211e1e; }

@media (min-width: 861px) {
  .milk-portfolio { grid-template-columns: minmax(0, 1fr) minmax(18rem, 34%); }
  .exhibit-content { height: var(--stage-height); }
  .work-details { grid-template-rows: minmax(5rem, 1fr) auto; align-content: stretch; }
  .work-details .artwork { height: 100%; min-height: 0; }
  .revealed-work .exhibit.is-discovered:not([hidden]) { animation: work-enter .24s cubic-bezier(.23, 1, .32, 1) both; }
  @keyframes work-enter { from { opacity: 0; transform: translateX(.5rem); } }
}
@media (max-width: 860px) {
  .milk-portfolio {
    --stage-height: min(74svh, 41rem, calc(100svh - var(--masthead-size) - var(--scene-gap) * 2 - var(--header-inset)));
  }
  .revealed-work {
    position: fixed;
    z-index: 4;
    inset-inline: max(.55rem, env(safe-area-inset-left)) max(.55rem, env(safe-area-inset-right));
    bottom: calc(.65rem + env(safe-area-inset-bottom));
    width: min(calc(100% - 1.35rem), 34rem);
    margin-inline: auto;
  }
  .revealed-work .exhibit.is-discovered:not([hidden]) {
    animation: work-rise .25s cubic-bezier(.32, .72, 0, 1) both;
  }
  @keyframes work-rise { from { transform: translateY(calc(100% + 1rem)); } }
  .exhibit-content {
    --art-height: clamp(4.3rem, 18svh, 9.5rem);
    grid-template: "heading actions" auto "details details" minmax(0, 1fr) / minmax(0, 1fr) auto;
    gap: .55rem .32rem;
    max-height: min(52dvh, calc(100dvh - var(--masthead-size) - 2.25rem - var(--header-inset) - env(safe-area-inset-bottom)));
    padding: .58rem .68rem .72rem;
    border-radius: .76rem;
    box-shadow: 0 0 0 1px #58371522, 0 8px 30px #51351d40;
  }
  .work-heading { gap: .44rem; }
  .work-details { gap: .6rem; }
  .app-icon { width: clamp(1.6rem, 6.6vw, 2.25rem); }
  .product h2, .product h3 { font-size: clamp(1.16rem, 4.5vw, 1.58rem); }
  .store img { height: 1.7rem; }
  .game-link { padding-inline: .35rem; }
  .work-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: .3rem;
    background: transparent;
    cursor: pointer;
  }
  .work-toggle::after {
    content: "";
    width: .52rem;
    height: .52rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(.12rem) rotate(225deg);
  }
  .work-toggle[aria-expanded="true"]::after { transform: translateY(-.12rem) rotate(45deg); }
  .exhibit[data-expanded="false"] .exhibit-content {
    grid-template: "heading actions" auto / minmax(0, 1fr) auto;
    padding-block: .25rem;
  }
  .exhibit[data-expanded="false"] .work-details { display: none; }
  .work-image-pair { grid-template: minmax(0, 1fr) / repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  :root { --masthead-size: 3.5rem; }
  .brand { font-size: clamp(1.48rem, 6vw, 1.7rem); }
  .header-tools { gap: .35rem; font-size: .75rem; }
  .social { width: 1.8rem; }
  .social img { width: 1.05rem; height: 1.05rem; }
}
@media (max-width: 355px) {
  .masthead { gap: .45rem; padding-inline: .65rem; }
  .work-heading .app-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .revealed-work .exhibit.is-discovered:not([hidden]) { animation: none; }
}
