/* Home: one sentence about the maker, four facts, then every work on one board. */
.hello {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  gap: clamp(10px, 1vw, 14px) clamp(28px, 4.4vw, 68px);
  padding: clamp(18px, 2vw, 28px) 0 clamp(20px, 2.1vw, 30px);
}
.hello h1 {
  grid-row: 1 / -1;
  align-self: end;
  display: grid;
  gap: clamp(10px, 1.1vw, 16px);
  letter-spacing: normal;
}
.hello-name {
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 1vw, 14px);
}
/* The portrait signs the note on the right. It is a cut-out: no shape behind it. */
.hello-photo {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-self: start;
  width: auto;
  height: clamp(56px, 4.9vw, 70px);
}
.hello-ko {
  font: 600 clamp(24px, 2.1vw, 30px) / 1.15 Essay, AppleMyungjo, serif;
  letter-spacing: -0.05em;
}
.hello-name i {
  font: italic 400 clamp(16px, 1.35vw, 20px) / 1 Georgia, serif;
  letter-spacing: -0.04em;
  color: #7a655b;
}
.hello-line {
  font: 600 clamp(41px, 5.5vw, 79px) / 1.17 Essay, AppleMyungjo, serif;
  letter-spacing: -0.058em;
  text-wrap: balance;
}
.hello-deck {
  grid-column: 2;
  grid-row: 2;
  padding-bottom: clamp(4px, 0.9vw, 14px);
}
.hello-deck p {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.65;
  letter-spacing: -0.017em;
  color: #56514a;
}
.hello-deck .lineact {
  margin-top: 2px;
  color: var(--ink);
}
.hello-deck .lineact:hover {
  color: var(--rust);
}

/* English runs longer than Korean at the same size, and its second name is Hangul. */
:lang(en) .hello-line {
  font-size: clamp(34px, 4.3vw, 62px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.hello-name i:lang(ko) {
  font: 600 clamp(15px, 1.3vw, 19px) / 1 Essay, AppleMyungjo, serif;
  letter-spacing: -0.04em;
}
:lang(en) .hello-deck p {
  max-width: 23em;
}

.proof {
  border-top: 1px solid var(--line);
}
.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding-block: clamp(12px, 1.2vw, 16px);
}
.figures > div {
  display: flex;
  flex-direction: column-reverse;
  /* Reversed column: "end" is the top, so the figures line up across cells. */
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  text-align: center;
  border-left: 1px solid var(--line);
}
.figures > div:first-child {
  border-left: 0;
}
.figures dd {
  margin: 0;
  font: 600 clamp(32px, 3.2vw, 46px) / 1.1 Essay, AppleMyungjo, serif;
  letter-spacing: -0.045em;
  font-variant-numeric: lining-nums;
}
.figures dt {
  font-size: clamp(13px, 1.05vw, 15px);
  line-height: 1.45;
  color: var(--muted);
  text-wrap: balance;
}
.figures cite {
  font: 600 1em/1 Essay, AppleMyungjo, serif;
  white-space: nowrap;
}
.outlets {
  display: flex;
  align-items: center;
  gap: 12px clamp(16px, 3vw, 44px);
  padding-block: 3px;
  border-block: 1px solid var(--line);
}
.outlets > span {
  flex: none;
  font-size: 13px;
  color: var(--muted);
}
.outlets ul {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 0 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.outlets a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 4px;
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #2a2622;
}
.outlets a:hover {
  color: var(--rust);
}

.board {
  padding: clamp(22px, 2.2vw, 32px) 0 clamp(38px, 4.6vw, 66px);
  scroll-margin-top: 12px;
}
.board-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: clamp(12px, 1.3vw, 18px);
}
.board-bar h2 {
  font: 600 clamp(28px, 2.6vw, 36px) / 1.2 Essay, AppleMyungjo, serif;
  letter-spacing: -0.05em;
}
.chips {
  display: flex;
  gap: 8px;
}
.chips button {
  min-height: 44px;
  padding: 0 clamp(13px, 1.3vw, 18px);
  border: 1px solid #bfb9ad;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 550;
  white-space: nowrap;
  color: #3a352f;
}
.chips button:hover {
  border-color: var(--ink);
}
.chips button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.widgets {
  display: grid;
  grid-template-columns: 5.6fr 4.6fr 2.2fr;
  gap: 16px;
}
.widget {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  min-width: 0;
  height: clamp(270px, 23vw, 330px);
  overflow: hidden;
  border-radius: 26px;
  color: #382c23;
}
.w-pitcher {
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
}
.w-pieceful {
  background: linear-gradient(108deg, #f8eee2 5%, #f3e5d1 58%, #ebd4b8);
}
.w-pitcher {
  background: #172b26;
  color: #f3f2df;
}
.w-book {
  background: #f6e9b8;
  color: #4b2a16;
}
/* Each container-unit size follows a fixed one, for browsers without container queries. */
.widget-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 24px 0 22px 24px;
  padding: clamp(18px, 5.2cqw, 30px) 0 clamp(18px, 5.2cqw, 28px) clamp(18px, 5.4cqw, 34px);
}
.widget-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-size: clamp(14px, 3.2cqw, 17px);
  font-weight: 620;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.widget-label img {
  flex: none;
  width: 28px;
  width: clamp(26px, 6cqw, 32px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 23%;
}
.widget h3 {
  margin-top: clamp(0px, 4.4cqw - 12px, 14px);
  font: 600 32px / 1.24 Essay, AppleMyungjo, serif;
  font-size: clamp(27px, 7.4cqw, 42px);
  letter-spacing: -0.055em;
}
.w-pitcher h3 {
  font-family: inherit;
  font-size: 30px;
  font-size: clamp(25px, 7.9cqw, 42px);
  font-weight: 770;
  letter-spacing: -0.06em;
}
/* The headline opens the screens; its hit area is the whole widget. */
.widget-open {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-align: left;
}
:lang(en) .widget h3 {
  font-size: 28px;
  font-size: clamp(24px, 6.4cqw, 40px);
  line-height: 1.16;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
:lang(en) .w-pitcher h3 {
  font-size: 26px;
  font-size: clamp(22px, 6.2cqw, 34px);
  letter-spacing: -0.04em;
}
.widget-open::after {
  content: "";
  position: absolute;
  inset: 0;
}
.widget-open:focus-visible {
  outline: 0;
}
.widget-open:focus-visible::after {
  border-radius: 26px;
  outline: 3px solid #d75645;
  outline-offset: -3px;
}
.w-book:focus-visible {
  outline: 3px solid #d75645;
  outline-offset: 3px;
}
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stores a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.widget .stores {
  position: relative;
  z-index: 1;
  margin-top: auto;
}
.widget .stores a {
  padding: 0 13px;
  font-size: 13px;
}
.w-pieceful .stores a {
  border-color: #4a3a2e;
  background: #fffaf2;
}
.w-pieceful .stores a:hover {
  background: #fff;
}
.w-pitcher .stores a {
  border-color: #e6f1dd8c;
}
.w-pitcher .stores a:hover {
  background: #ffffff1c;
}
.widget-shot {
  z-index: -1;
  align-self: stretch;
  justify-self: center;
  width: min(80%, 258px);
  /* Runs past the widget's bottom edge, so the tilt never shows a corner. */
  margin: 24px 0 -18px;
  margin: clamp(20px, 6cqw, 30px) 0 -18px;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  background: #fcfbf8;
  box-shadow: 0 14px 34px #543b2533;
  transform: rotate(3deg);
  transform-origin: 50% 0;
}
/* The screen images are cut to start at the record or the strike zone. */
.widget-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
}
.w-pitcher .widget-shot {
  width: min(90%, 250px);
  margin-bottom: 0;
  border: 1px solid #e6f1dd38;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #112521;
  box-shadow: 0 10px 30px #080e0990;
  transform: none;
}
.w-book {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 12px;
  text-align: center;
}
.w-book img {
  width: auto;
  height: 68%;
  max-width: 78%;
  object-fit: contain;
  box-shadow: 0 2px 3px #6b4a1a33, 8px 12px 22px -8px #6b4a1a80;
  transition: transform 0.2s ease;
}
.w-book span {
  font-size: 14px;
  font-size: clamp(13px, 7cqw, 16px);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.02em;
}
.board-plain {
  margin-top: 24px;
  font-size: 15px;
  color: var(--muted);
}
.board-plain a {
  margin-left: 12px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.apps {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 26px) 8px;
  margin: clamp(22px, 2.5vw, 36px) 0 0;
  padding: 0;
  list-style: none;
}
.app {
  position: relative;
  min-width: 0;
}
.app-open {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  text-align: center;
}
.app-open img {
  width: min(100%, clamp(58px, 5.4vw, 76px));
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 1px 2px #2a211a1a, 0 8px 16px -9px #2a211a59;
  transition: transform 0.18s ease;
}
.app-open:focus-visible {
  outline-offset: 5px;
  border-radius: 12px;
}
.app-open span {
  max-width: 100%;
  padding-inline: 4px;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #2c2823;
  text-wrap: balance;
  /* A long single word such as "Neighborhood" breaks with a hyphen, not into the next cell. */
  overflow-wrap: anywhere;
  hyphens: auto;
}
/* Pointer and keyboard users see what a work is before opening it. The note
   never takes the pointer, so the icons and buttons around it stay reachable. */
.app-tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 5;
  width: max-content;
  max-width: min(264px, 80vw);
  padding: 11px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px -16px #2a211a66;
  text-align: left;
  pointer-events: none;
  transform: translateX(calc(-50% + var(--shift, 0px)));
  transition: opacity 0.14s ease;
}
.app-tip span {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  color: #3d3731;
}
.app-tip small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.app.is-below .app-tip {
  top: calc(100% + 8px);
  bottom: auto;
}
@media (hover: hover) and (pointer: fine) {
  .app:hover .app-tip,
  .app.is-keyed .app-tip {
    display: block;
  }
  /* One note at a time, and Escape puts it away. */
  .apps:hover .app.is-keyed:not(:hover) .app-tip,
  .apps.is-quiet .app-tip {
    display: none;
  }
  @starting-style {
    .app:hover .app-tip,
    .app.is-keyed .app-tip {
      opacity: 0;
    }
  }
  .app-open:hover img,
  .w-book:hover img {
    transform: translateY(-3px);
  }
}
.board-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.board:not([data-show="all"]) .widgets {
  grid-template-columns: 1fr;
}
.board[data-show="app"] .widget:not([data-kind="app"]),
.board[data-show="game"] .widget:not([data-kind="game"]) {
  display: none;
}
.home-story {
  border-top: 1px solid var(--line);
}

/* The screens dialog is where a phone visitor reaches the store. */
.detail .storelinks a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-color: transparent;
  border-radius: 999px;
  background: #f4ede2;
  color: #1f1a18;
  font-size: 14px;
}
.detail .storelinks a:hover {
  background: #fff;
}
.modalend .lineact {
  color: #d5c9bd;
}
.gallerypane {
  margin-bottom: 17px;
}

/* Just above the phone layout the two columns are narrow: keep the Korean sentence on two lines. */
@media (min-width: 761px) and (max-width: 860px) {
  :lang(ko) .hello-line {
    font-size: 37px;
  }
}
/* English lines run longer: between a phone and 1000px its first screen is one
   column, with the portrait at the right of the name as on a phone. */
@media (min-width: 761px) and (max-width: 1000px) {
  :lang(en) .hello {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 14px;
  }
  :lang(en) .hello h1 {
    grid-row: auto;
  }
  :lang(en) .hello-photo {
    grid-column: auto;
    grid-row: auto;
    position: absolute;
    top: clamp(18px, 2vw, 28px);
    right: 0;
    height: 60px;
  }
  :lang(en) .hello-name {
    min-height: 60px;
    align-items: flex-end;
    padding-right: 70px;
  }
  :lang(en) .hello-deck {
    grid-column: 1;
    grid-row: auto;
    padding: 0;
  }
  :lang(en) .hello-deck p {
    max-width: none;
  }
  :lang(en) .outlets {
    display: block;
    padding-block: 12px 6px;
  }
  :lang(en) .outlets ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2px;
  }
  :lang(en) .outlets a {
    padding-inline: 0;
  }
}
/* Below this width three widgets in a row leave no room for two store buttons. */
@media (max-width: 1279px) {
  .widgets {
    grid-template-columns: 1.7fr 1fr;
  }
  .w-pieceful {
    grid-column: 1 / -1;
  }
  .widget {
    height: 300px;
  }
}
@media (max-width: 1039px) {
  .apps {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .hello {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 14px;
    padding: 20px 0 22px;
  }
  .hello h1 {
    grid-row: auto;
  }
  /* On a phone the portrait keeps to the right of the name; the headline gets the full width. */
  .hello-photo {
    grid-column: auto;
    grid-row: auto;
    position: absolute;
    top: 20px;
    right: 0;
    height: 56px;
  }
  .hello-name {
    min-height: 56px;
    align-items: flex-end;
    padding-right: 64px;
  }
  .hello-deck {
    grid-column: 1;
    grid-row: auto;
    padding: 0;
  }
  .figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-block: 0;
  }
  .figures > div {
    align-items: flex-start;
    padding: 14px 10px 14px 16px;
    text-align: left;
  }
  .figures > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .figures > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .outlets {
    display: block;
    padding-block: 12px 6px;
  }
  .outlets ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2px;
  }
  .outlets a {
    padding-inline: 0;
  }
  :lang(en) .outlets ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :lang(en) .hello-line br {
    display: none;
  }
  .board-bar {
    flex-wrap: wrap;
  }
  .chips {
    flex-basis: 100%;
  }
  .chips {
    gap: 6px;
  }
  .chips button {
    font-size: 14px;
  }
  .widgets,
  .board:not([data-show="all"]) .widgets {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .widget,
  .w-pitcher {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    border-radius: 22px;
  }
  .widget-copy {
    padding: 20px 20px 0;
  }
  .widget h3,
  .w-pitcher h3 {
    margin-top: 12px;
    font-size: clamp(27px, 8.2cqw, 40px);
  }
  .widget .stores {
    margin-top: 16px;
  }
  .widget-shot,
  .w-pitcher .widget-shot {
    width: min(62%, 250px);
    height: clamp(200px, 60cqw, 290px);
    margin-top: 20px;
  }
  .widget-shot {
    height: calc(clamp(200px, 60cqw, 290px) + 18px);
  }
  .w-book {
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
    padding: 16px 20px;
    text-align: left;
  }
  .w-book img {
    height: 96px;
    max-width: none;
  }
  .w-book span {
    font-size: 16px;
  }
  .apps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 6px;
  }
  .app-open img {
    width: min(100%, 68px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-open img,
  .w-book img,
  .app-tip {
    transition: none;
  }
}
