:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #151412;
  --pink: #ba294d;
  --rule: #bdb9b4;
  --inset: clamp(20px, 3.4vw, 60px);
  --organizers-top: max(23px, env(safe-area-inset-top));
  --header-height: clamp(92px, 15vh, 168px);
  --panel-rail: calc(var(--inset) + 9.5rem);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

@font-face {
  font-family: "Winter Market Letter";
  src: url("/assets/letter-serif.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Gift Jibaek";
  src: local("Jibaek-120g-beta");
}

@font-face {
  font-family: "Gift Sanjak";
  src: local("Kigtype-Sanjak-R"), local("Sanjak-Regular");
}

@font-face {
  font-family: "Poster Heading";
  src: local("AG Ahnsangsoo 2012 Regular"), local("AGAhnsangsoo2012-Regular"),
    local("AG 안상수체 2012 보통"), url("/assets/orbit-poster.woff2") format("woff2");
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { width: 100%; height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 var(--font);
  word-break: keep-all;
}

h1, h2, p, ol { margin: 0; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; }
button, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; }

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

.header {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  padding: max(24px, env(safe-area-inset-top)) var(--inset) 0;
  pointer-events: none;
}

.header a { pointer-events: auto; }
.organizers {
  position: absolute;
  top: var(--organizers-top);
  left: var(--inset);
  width: clamp(109px, 11vw, 178px);
}
.organizers img { width: 100%; }

.pages { position: fixed; z-index: 2; inset: 0; overflow: hidden; pointer-events: none; }
.page {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: var(--header-height) var(--inset) max(30px, env(safe-area-inset-bottom));
  pointer-events: auto;
}
.page[inert] { pointer-events: none; }
.page[data-incoming] { z-index: 3; }
.page h1[tabindex="-1"]:focus { outline: none; }

.market {
  display: flex;
  flex-direction: column;
  padding: 0 var(--inset) max(22px, env(safe-area-inset-bottom));
}
.market-header {
  flex: none;
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  justify-items: end;
  align-content: start;
  min-height: max(86px, calc(env(safe-area-inset-top) + 60px));
  padding-top: max(19px, env(safe-area-inset-top));
  background: var(--paper);
}
.market-items {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  align-items: start;
  gap: clamp(16px, 2vw, 34px) clamp(12px, 1.4vw, 24px);
}
.market-product {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.product-media {
  display: grid;
  justify-items: center;
  width: 100%;
  padding-block: clamp(10px, 1.25vw, 16px);
  overflow: hidden;
}
.product-images {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.product-images img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  pointer-events: none;
}
.product-images-pair { height: auto; gap: clamp(9px, 1.25vw, 17px); }
.product-images-pair img { height: auto; }
.product-media .product-images {
  width: 78%;
  height: auto;
  animation: product-drift 9s ease-in-out infinite;
}
.product-media img { height: auto; }
.market-product:nth-child(3n + 2) .product-media .product-images {
  animation-duration: 10.5s;
  animation-delay: -3s;
  animation-direction: reverse;
}
.market-product:nth-child(3n) .product-media .product-images {
  animation-duration: 11.5s;
  animation-delay: -6s;
}
body:has(.product-popup[open]) .product-media .product-images { animation-play-state: paused; }
.product-caption {
  display: grid;
  gap: .18em;
  margin-top: .44rem;
  font: 400 .84rem/1.45 var(--font);
}
.market-product:hover .product-caption > span:first-child { text-decoration: underline; }

@keyframes product-drift {
  34% { transform: translate(3px, -4px) rotate(.72deg); }
  69% { transform: translate(-2px, 2px) rotate(-.52deg); }
}

.home {
  --poster-copy-inset: clamp(1.25rem, 6vw, 6.25rem);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-rows: minmax(auto, 1fr);
  column-gap: clamp(27px, 3vw, 64px);
  padding: var(--organizers-top) var(--inset)
    max(clamp(24px, 4dvh, 56px), env(safe-area-inset-bottom));
}
.poster-front {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(12px, 1.7dvh, 22px);
  min-height: clamp(500px, 78dvh, 830px);
}
.poster-art { position: relative; container-type: size; }
.home-lettering { position: absolute; inset: 8% 0 0; display: grid; place-items: center; }
.date-wordmark {
  display: block;
  width: min(100%, 236cqh);
  height: auto;
}
.date-pair { animation: date-bob 8.4s ease-in-out infinite; }
.date-pair-2 { animation-duration: 9.1s; animation-delay: -2.45s; }
.date-pair-3 { animation-duration: 8s; animation-delay: -4.2s; }
body:not([data-route="/"], [data-route="/gift"], [data-route="/mates"]) :is(.date-pair, .illustration) { animation-play-state: paused; }

@keyframes date-bob {
  0%, 100% { transform: translateY(0); }
  28% { transform: translateY(-14px); }
  73% { transform: translateY(11px); }
}

.event {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: clamp(12px, 2vw, 32px);
}
.event time { flex: none; }
.event time img { width: clamp(100px, 11.4vw, 220px); }
.venue { min-width: 0; padding-top: 1px; pointer-events: auto; }
.venue-name { width: clamp(134px, 17vw, 355px); }
.venue-address { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: .45rem; }
.street { width: clamp(117px, 14.3vw, 275px); }
.city { width: clamp(85px, 10.3vw, 200px); }

.illustration {
  position: absolute;
  pointer-events: none;
  rotate: var(--lean);
  animation: poster-sway 10s steps(3, end) infinite;
}
.illustration.ink-motion { animation: none; }
.ink-motion img { width: 100%; }
.cake-main {
  --lean: 0deg;
  top: 4%;
  right: 0;
  width: min(31cqw, 34cqh);
}
.cherries-main {
  --lean: 0deg;
  bottom: 0;
  left: 0;
  width: min(28cqw, 31cqh);
}
.snowflake-main {
  --lean: -10deg;
  top: 15%;
  left: 28%;
  width: min(20cqw, 24cqh);
  animation-delay: -2.2s;
}
.candy-main {
  --lean: 9deg;
  right: 17%;
  bottom: 2%;
  width: min(12cqw, 18cqh);
  animation-delay: -5.4s;
}

@keyframes poster-sway {
  30% { transform: translate(1px, -5px) rotate(-.65deg) scale(1.005, .995); }
  58% { transform: translate(-2px, -9px) rotate(.45deg) scale(.995, 1.006); }
  82% { transform: translate(-1px, -3px) rotate(.2deg); }
}

.poster-details {
  display: grid;
  grid-template-rows: auto auto minmax(auto, 1fr);
  gap: clamp(18px, 3dvh, 34px);
}
.poster-details h2 {
  font: 400 clamp(1.45rem, 2.18vw, 2.5rem)/1.08 "Poster Heading", var(--font);
  letter-spacing: -.06em;
}
.poster-copy, .poster-roster {
  margin-block-start: .86rem;
  margin-inline-start: var(--poster-copy-inset);
  font: 400 clamp(.84375rem, 1.04vw, 1.05rem)/1.67 "Gift Sanjak", "Winter Market Letter", Georgia, serif;
}
.poster-copy p + p { margin-top: 1.02em; }
.poster-mark {
  background: linear-gradient(#ffc0ce, #ffc0ce) left bottom .07em / 100% .24em no-repeat;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.poster-roster { padding: 0; }
.poster-roster li + li { margin-top: .08em; }
.poster-roster a {
  text-decoration-color: #ad8791;
  text-underline-offset: .16em;
}
.poster-roster a:hover { color: var(--pink); }
.poster-market {
  display: flex;
  justify-content: end;
  align-self: end;
}
.poster-gift-link {
  display: flex;
  align-items: end;
  gap: clamp(8px, 1.45vw, 22px);
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
}
.poster-gift-caption {
  flex: none;
  margin-block-end: .45em;
  white-space: nowrap;
  font: 400 clamp(.9rem, 1.65vw, 1.45rem)/1.1 "Poster Heading", var(--font);
  letter-spacing: -.03em;
}
.poster-gift-caption > span:nth-child(1) { font-size: .86em; }
.poster-gift-caption > span:nth-child(2) { font-size: .75em; }
.poster-gift-caption > span:nth-child(3) { font-size: .65em; }
.poster-gift-caption > span:nth-child(4) { font-size: .56em; }
.poster-gift-link img {
  width: clamp(128px, 42vw, 224px);
  min-width: 0;
  mix-blend-mode: multiply;
  transition: transform 240ms cubic-bezier(.2, .75, .28, 1);
}
.poster-gift-link:focus-visible img { transform: translateY(-5px) rotate(-3deg); }
@media (hover: hover) {
  .poster-gift-link:hover img { transform: translateY(-5px) rotate(-3deg); }
}
.poster-gift-link:active img { transform: translateY(2px) scale(.98); }

.apply-link {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 4px 0 4px 9px;
  font-size: .83rem;
  font-weight: 650;
  text-decoration: none;
  pointer-events: auto;
}
.apply-link:hover { color: var(--pink); }
.card-page {
  --letter-ink: #293f64;
  --letter-top: clamp(88px, 13dvh, 124px);
  --letter-bottom: max(30px, env(safe-area-inset-bottom));
  display: grid;
  align-content: safe center;
  z-index: 2;
  overflow-x: hidden;
  padding: var(--letter-top) var(--inset) var(--letter-bottom);
  pointer-events: none;
}

.envelope {
  position: relative;
  width: min(90%, 305px);
  margin-inline: auto;
  container-type: inline-size;
  background: url("/assets/gift-paper-grain.svg") var(--paper);
  color: var(--letter-ink);
  box-shadow: 0 12px 34px #25192116, 0 2px 8px #25192109;
  pointer-events: auto;
}
.letter-title {
  padding: 18px 50px 10px 17px;
  font: 400 1.12rem/1.35 "Avenir Next", var(--font);
}
.letter-body {
  padding: 0 17px 19px;
  font: 400 .875rem/1.64 "Winter Market Letter", Georgia, serif;
}
.roster { list-style: none; }
.roster li + li { margin-top: .14em; }
.roster a {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  text-decoration-thickness: .05em;
}

.icon-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.icon-close::before, .icon-close::after {
  content: "";
  grid-area: 1 / 1;
  width: 16px;
  height: 1px;
  background: currentColor;
  transform: rotate(45deg);
}
.icon-close::after { transform: rotate(-45deg); }
.icon-close:hover { color: var(--pink); }
.card-close {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  color: var(--letter-ink);
}

.gift .envelope { width: min(90%, 286px); }
.gift-copy { padding: 5.5cqw 4.4cqw 5.8cqw; }
.gift-title {
  margin-bottom: .68em;
  padding-inline-end: 36px;
  font: 400 clamp(.9375rem, 5.7cqw, 1.0625rem)/1.3 "Gift Jibaek", var(--font);
}
.gift-copy p {
  font: 400 clamp(.8125rem, 4.5cqw, .875rem)/1.6 "Gift Sanjak", "Winter Market Letter", Georgia, serif;
}
.gift-copy p + p { margin-top: .8em; }
.gift-picture { margin: 0; }
.gift-illustration {
  width: 100%;
  max-height: 124px;
  object-fit: contain;
  object-position: center bottom;
  mix-blend-mode: multiply;
}

.gift-market-link {
  display: block;
  width: fit-content;
  margin: 9px 4.4cqw 0;
  padding-block: 7px 12px;
  font: 600 .76rem/1.3 var(--font);
  text-underline-offset: .22em;
}

@media (min-width: 54rem) {
  #poster-intro-title { transform: translateY(-.17em); }
  .gift .envelope { margin-inline: clamp(8px, 1.8vw, 34px) auto; rotate: -4deg; }
  .mates .envelope { margin-inline: auto clamp(8px, 1.8vw, 34px); rotate: 4deg; }
}

@media (max-width: 84rem) {
  .market-items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 53.999rem) {
  body[data-route="/"] .header {
    min-height: max(76px, calc(env(safe-area-inset-top) + 67px));
    background: linear-gradient(white 79%, #fff0);
  }
  .home {
    --poster-copy-inset: clamp(.75rem, 4vw, 2rem);
    display: flex;
    flex-direction: column;
    row-gap: clamp(26px, 7vw, 42px);
    padding-top: max(82px, calc(env(safe-area-inset-top) + 78px));
    scroll-padding-top: 82px;
  }
  .poster-front { flex: none; display: block; min-height: 0; }
  .poster-art { height: clamp(275px, 85vw, 540px); }
  .poster-front .event { margin-top: clamp(12px, 1.7dvh, 22px); }
  .poster-details { flex: 1 0 auto; gap: 24px; }
  .poster-copy, .poster-roster { font-size: .9375rem; }
  .market-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gift .envelope { rotate: -2deg; }
  .mates .envelope { rotate: 2deg; }
}

@media (min-width: 48.001rem) and (max-aspect-ratio: 5 / 4) {
  .market-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: center;
  }
  .market-product { max-width: max(14rem, 30dvh); }
}

.inner {
  width: min(100%, 1120px);
  margin-inline: auto;
  padding: clamp(22px, 4vw, 60px);
  border: 1px solid var(--ink);
  background: var(--paper);
}

.inner h1 {
  font-size: clamp(1.72rem, 3.3vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -.05em;
  overflow-wrap: anywhere;
}

.consign { padding-left: var(--panel-rail); background: var(--paper); }
.consign-sheet {
  width: 100%;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr);
  align-items: start;
  gap: clamp(30px, 5.6vw, 84px);
}
.consign-copy h1 { font-size: clamp(1.7rem, 2.65vw, 3.15rem); }
.consign-copy p { margin-top: 1em; }
.consign-copy .shipping { margin-top: 1.4em; padding-top: 1em; border-top: 1px solid var(--rule); }
.consign-copy .contact { font-size: .86rem; overflow-wrap: anywhere; }
.consign-form { display: grid; gap: 15px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-size: .91rem; font-weight: 650; }
.field small { font-size: .79rem; color: #665d59; }

.field :is(input, textarea) {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  padding: 7px 9px;
}

.field textarea { resize: vertical; }
.field input[type="file"] { padding: 7px; border-style: dashed; font-size: .87rem; }
.field input::file-selector-button {
  margin-right: .65em;
  border: 1px solid var(--ink);
  padding: 3px 8px;
  background: var(--paper);
  color: inherit;
  cursor: pointer;
}
.photo-preview { width: auto; max-height: 128px; margin-top: 4px; object-fit: contain; }
.contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.consent { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; }
.consent input { width: 17px; height: 17px; margin: 3px 0 0; flex: none; accent-color: var(--pink); }
.form-error { color: #ac173b; font-size: .88rem; }
.submit {
  justify-self: start;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 7px 19px;
  background: var(--ink);
  color: var(--paper);
  font-size: .92rem;
  font-weight: 700;
}
.submit:not(:disabled):hover { background: var(--paper); color: var(--ink); }
.submit:disabled { opacity: .66; cursor: progress; }
.receipt { padding: 18px 0; border-block: 1px solid var(--ink); }
.receipt h2 { font-size: clamp(1.4rem, 2vw, 2rem); }
.receipt p { margin-block: .6em 1.1em; }
.receipt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 21px; }
.another-gift { min-height: 44px; padding: 6px 10px; border: 1px solid var(--ink); background: var(--paper); }
.another-gift:hover { color: var(--pink); }

.product-popup {
  position: fixed;
  inset: auto;
  left: var(--ticket-x, 20px);
  top: var(--ticket-y, 20px);
  width: min(320px, calc(100vw - 50px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 12px 17px 18px;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 10px 32px #15141218;
}
.product-popup[open] { animation: ticket-in .23s cubic-bezier(.16, 1, .3, 1); }
.product-popup::backdrop { background: #fff2; }
.product-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-header h2 { font-size: 1.02rem; line-height: 1.25; font-weight: 700; }
.product-header .icon-close { flex: none; margin-right: -10px; }
.product-carousel { display: grid; grid-template-columns: 35px minmax(0, 1fr) 35px; align-items: center; }
.product-gallery { display: grid; place-items: center; height: clamp(115px, 26dvh, 216px); }
.product-description { margin-top: .7rem; font-size: .84rem; line-height: 1.65; }
.product-arrow { height: 44px; border: 0; padding: 0; background: transparent; font-size: 25px; line-height: 1; }
.product-arrow:hover { color: var(--pink); }
.product-price { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--ink); }
.product-price dt, .product-price dd { margin: 0; font-size: .84rem; }
.product-price dd { font-weight: 700; font-variant-numeric: tabular-nums; }

@keyframes ticket-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 48rem) {
  :root { --inset: 18px; --header-height: 215px; }
  .header { padding-top: max(15px, env(safe-area-inset-top)); }
  .organizers { width: clamp(82px, 24vw, 117px); }
  .event { gap: 14px; }
  .event time img { width: clamp(82px, 23vw, 133px); }
  .venue-address { display: grid; gap: 1px; margin-top: 4px; }
  .venue-name { width: clamp(104px, 32vw, 176px); }
  .street { width: clamp(103px, 31vw, 162px); }
  .city { width: clamp(74px, 24vw, 125px); }
  .market-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-page { --letter-top: var(--header-height); }
  .consign { padding: var(--header-height) var(--inset) max(22px, env(safe-area-inset-bottom)); }
  .consign-sheet { grid-template-columns: minmax(0, 1fr); }
  .product-popup {
    left: var(--inset);
    right: var(--inset);
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: auto;
  }
}

@media (max-width: 26rem) {
  .contact-fields { grid-template-columns: minmax(0, 1fr); }
  .consign-sheet { padding: 0; }
}

@media (max-height: 530px) and (orientation: landscape) {
  .event time img { width: clamp(94px, 13vw, 157px); }
}

@media (prefers-reduced-motion: reduce) {
  .date-pair, .illustration, .product-media .product-images { animation: none; }
  .poster-gift-link img { transform: none !important; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
