/* =========================================================
   . . . s a n s a e c o e . . .
   a white sheet of paper, with a few small things on it
   ========================================================= */

:root {
  --paper: #ffffff;
  --ink: #2c2c2b;
  --ink-soft: #4a4844;
  --muted: #7d7a75;
  --faint: #a9a5a0;
  --line: #eae7e1;

  --font-sans: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic",
    "맑은 고딕", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
  --soft: cubic-bezier(0.4, 0.1, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.9;
  font-weight: 400;

  /* Korean never breaks mid-word */
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: break-word;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

::selection {
  background: #eceade;
}

button {
  font: inherit;
  color: inherit;
}

/* =========================
   the sheet of paper
   ========================= */

.paper {
  position: relative;
  min-height: 100svh;
  padding: clamp(40px, 5.4vw, 66px) clamp(20px, 5vw, 64px) clamp(36px, 3.4vw, 50px);
}

/* small wordmark, top centre, a little off */

.mark {
  text-align: center;
  padding-top: 4px;
}

.mark .word {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.34em;
  line-height: 1.8;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transform: rotate(-1.2deg);
}

.mark .tagline {
  margin: 10px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--faint);
  transform: rotate(-1.2deg);
}

/* =========================
   the canvas of objects
   ========================= */

.canvas {
  position: relative;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  height: min(58vw, 70vh, 830px);
}

.item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  transform: rotate(var(--r, 0deg));
  transform-origin: 50% 60%;

  display: flex;
  flex-direction: column;
  align-items: center;

  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: center;
  color: inherit;
  text-decoration: none;
  -webkit-text-decoration: none;

  opacity: 0;
  transition: opacity 0.9s var(--soft), transform 0.7s var(--ease);
  transition-delay: var(--d, 0s);

  -webkit-tap-highlight-color: transparent;
}

.is-ready .item {
  opacity: 1;
}

.item img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 18px 22px rgba(44, 44, 43, 0.05));
  transition: filter 0.6s var(--ease);
}

.item .cap .muted {
  color: var(--faint);
}

.item .cap {
  display: block;
  margin-top: 12px;
  max-width: 14em;
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.5s var(--ease);
}

/* the gentle float — objects breathe a little */

@media (prefers-reduced-motion: no-preference) {
  .is-ready .item img {
    animation: drift 9s ease-in-out infinite;
    animation-delay: var(--d, 0s);
  }

  .is-ready .item:nth-child(even) img {
    animation-duration: 11s;
    animation-direction: alternate-reverse;
  }

  /* the room photo stays put — it is placed straight and still */
  .is-ready .item--print img {
    animation: none;
  }
}

@keyframes drift {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -9px;
  }
}

/* hover: straighten, lift, warm up */

.item:hover,
.item:focus-visible {
  transform: rotate(0deg) translateY(-7px) scale(1.035);
  outline: none;
  z-index: 5;
}

.item:hover img,
.item:focus-visible img {
  filter: drop-shadow(0 26px 30px rgba(44, 44, 43, 0.09));
}

.item:hover .cap,
.item:focus-visible .cap {
  color: var(--ink);
}

.item:active {
  transform: rotate(0deg) translateY(-3px) scale(1.01);
}

.item:focus-visible::after {
  content: "";
  position: absolute;
  inset: -14px -10px;
  border: 1px dashed var(--faint);
  border-radius: 14px;
  pointer-events: none;
}

/* the room photo, as a little print */

.item--print .cap {
  /* the label is gone — the photo itself is the invitation */
  display: none;
}

.item--print img {
  /* no frame — the photo sits on the paper by itself */
  border: 0;
  padding: 0;
  background: none;
  border-radius: 3px;
  box-shadow: 0 20px 32px rgba(44, 44, 43, 0.10);
}

.item--print:hover img,
.item--print:focus-visible img {
  box-shadow: 0 30px 44px rgba(44, 44, 43, 0.14);
}

/* =========================
   hint + footer
   ========================= */

.hint {
  margin: clamp(8px, 1.6vw, 22px) auto 0;
  transform: rotate(-1deg);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--faint);
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.8s var(--ease);
}

.hint .dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 10px 2px;
  border-radius: 50%;
  background: var(--faint);
  vertical-align: middle;
}

.has-opened .hint {
  opacity: 0;
}

.foot {
  margin-top: clamp(14px, 2vw, 30px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: baseline;
  justify-content: center;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.foot a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.foot a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* =========================
   the opened sheet
   ========================= */

.veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 40px);
  background: rgba(251, 250, 247, 0.7);
  -webkit-backdrop-filter: blur(10px) saturate(1.02);
  backdrop-filter: blur(10px) saturate(1.02);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.veil[hidden] {
  display: none;
}

.veil.is-in {
  opacity: 1;
}

.sheet {
  position: relative;
  width: min(100%, 740px);
  max-height: min(88svh, 940px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 40px 90px rgba(44, 44, 43, 0.1),
    0 4px 14px rgba(44, 44, 43, 0.04);
  padding: clamp(24px, 4.2vw, 58px);
  padding-top: 0;

  transform: translateY(16px) scale(0.985);
  transition: transform 0.5s var(--ease);
  scrollbar-width: thin;
}

.veil.is-in .sheet {
  transform: none;
}

.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: calc(clamp(24px, 4.2vw, 58px) * 0.55) 0 10px;
  margin-bottom: 6px;
  background: linear-gradient(
    to bottom,
    #fff 0%,
    #fff 62%,
    rgba(255, 255, 255, 0) 100%
  );
}

.close {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 2px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--faint);
  transition: color 0.3s var(--ease);
}

.close:hover {
  color: var(--ink);
}

.close .x {
  font-size: 15px;
  line-height: 1;
  transform: translateY(-1px);
}

/* sheet typography */

.sheet h2 {
  margin: 0 0 clamp(20px, 3vw, 34px);
  font-size: clamp(21px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.sheet .kicker {
  margin: 0 0 12px;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.prose {
  max-width: 34em;
}

.prose p {
  margin: 0 0 1.3em;
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.prose .stanza {
  margin-bottom: 2em;
}

.prose .stanza:last-child,
.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  font-weight: 600;
  color: var(--ink);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ink);
  background: #f5f3ee;
  border-radius: 3px;
  padding: 0.14em 0.4em;
}

.sheet a.text-link,
.prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: border-color 0.35s var(--ease);
}

.sheet a.text-link:hover,
.prose a:hover {
  border-color: var(--ink);
}

.sheet .callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: clamp(24px, 4vw, 38px) 0;
  padding: clamp(14px, 2.2vw, 20px) clamp(16px, 2.4vw, 24px);
  background: #f8f7f3;
  border-radius: 4px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.sheet .callout .icon {
  flex: none;
  line-height: 1.85;
}

.sheet figure {
  margin: clamp(28px, 5vw, 48px) 0 0;
}

.sheet figure img {
  display: block;
  margin-inline: auto;
  width: auto;
  max-width: 100%;
  max-height: 62svh;
}

.sheet figure img.full {
  width: 100%;
  height: auto;
  max-height: none;
}

.sheet figure.pair {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .sheet figure.pair {
    grid-template-columns: 1fr 1fr;
  }
}

.sheet figure.pair img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: none;
}

/* the story photographs — one full-width picture at a time,
   the words fitting between them just as the story was laid out */

.sheet figure.photo {
  margin: clamp(24px, 4vw, 38px) 0 clamp(28px, 4.6vw, 44px);
}

.sheet figure.photo img {
  width: 100%;
  height: auto;
  max-height: none;
}

/* the one line that opens after the first photograph */

.prose--lead {
  margin-top: 0;
}

/* a quiet gap where the story changes its footing */

.prose--breath {
  margin-top: clamp(38px, 6.2vw, 58px);
}

/* =========================
   a clickable picture — a small stamp that leads somewhere
   ========================= */

.sheet figure.phoenix,
.sheet figure.order {
  text-align: center;
}

/* the manhole sits at the right margin, the cup stays in the middle */

.sheet figure.phoenix {
  text-align: right;
  margin-top: clamp(72px, 14vw, 128px);
}

.sheet figure.phoenix .fig-link {
  align-items: flex-end;
}

.sheet figure.phoenix .fig-cap {
  width: auto;
  text-align: right;
}

.sheet figure.phoenix .fig-link img {
  margin-inline: 0;
}

.sheet .fig-link,
.sheet .cup-link {
  display: inline-block;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.45s var(--ease);
}

.sheet .fig-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}

.sheet figure.phoenix img {
  width: clamp(92px, 22vw, 120px);
  height: auto;
  max-height: none;
  border-radius: 2px;
  box-shadow: 0 10px 18px rgba(44, 44, 43, 0.09);
  transition: box-shadow 0.45s var(--ease), translate 0.45s var(--ease);
}

.sheet .fig-link .fig-cap {
  font-size: 11.5px;
  width: 14em;
  max-width: 100%;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--muted);
  word-break: keep-all;
  transition: color 0.35s var(--ease);
}

.sheet .fig-link:hover img,
.sheet .fig-link:focus-visible img {
  translate: 0 -4px;
  box-shadow: 0 22px 34px rgba(44, 44, 43, 0.14);
}

.sheet .fig-link:hover .fig-cap,
.sheet .fig-link:focus-visible .fig-cap {
  color: var(--ink);
}

.sheet .fig-link:focus-visible,
.sheet .cup-link:focus-visible {
  outline: 1px dashed var(--faint);
  outline-offset: 8px;
}

/* the date, quietly signed at the foot of the story */

.sheet .sheet-date {
  margin: clamp(16px, 2.6vw, 24px) 0 0;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-align: right;
}

/* the cup, and the way to order one — a long breath after the manhole */

.sheet figure.order {
  margin-top: clamp(88px, 14vw, 136px);
}

.sheet figure.order .cup-link {
  display: inline-block;
}

.sheet figure.order img {
  width: clamp(76px, 18vw, 100px);
  height: auto;
  max-height: none;
  transition: translate 0.45s var(--ease), filter 0.45s var(--ease);
  filter: drop-shadow(0 16px 20px rgba(44, 44, 43, 0.06));
}

.sheet figure.order .cup-link:hover img,
.sheet figure.order .cup-link:focus-visible img {
  translate: 0 -4px;
  filter: drop-shadow(0 24px 28px rgba(44, 44, 43, 0.1));
}

.sheet figure.order .order-cta {
  margin: 16px 0 0;
}

.order-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12px;
  letter-spacing: 0.05em;
  transition: background 0.35s var(--ease), color 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.order-btn .arrow {
  font-size: 11px;
  transform: translateY(-1px);
}

.order-btn:hover,
.order-btn:focus-visible {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
  outline: none;
}

.sheet .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: clamp(28px, 4vw, 44px);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 19px;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.btn:hover {
  border-color: var(--ink);
  background: #fbfaf6;
  transform: translateY(-1px);
}

.btn .arrow {
  font-size: 11px;
  transform: translateY(-1px);
}

.sheet-end {
  margin-top: clamp(30px, 5vw, 46px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--faint);
  text-align: right;
}

.sheet-end button {
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.sheet-end button:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* =========================
   motion preferences
   ========================= */

@media (prefers-reduced-motion: reduce) {
  .item,
  .veil,
  .sheet,
  .btn,
  .close,
  .fig-link,
  .cup-link,
  .order-btn,
  .sheet figure.phoenix img,
  .sheet figure.order img {
    transition: none !important;
  }
  .item {
    opacity: 1;
  }
  .sheet {
    transform: none;
  }
}

/* =========================
   narrow screens — the same objects, dropped down the page
   ========================= */

@media (max-width: 1000px) {
  .paper {
    padding-top: clamp(48px, 12vw, 72px);
    padding-left: clamp(26px, 8.5vw, 48px);
    padding-right: clamp(26px, 8.5vw, 48px);
    padding-bottom: 112px;
  }

  .mark .word {
    font-size: 11.5px;
    letter-spacing: 0.28em;
  }

  .mark .tagline {
    margin-top: 14px;
  }

  /* a wide, airy column of small things — like a white sketchbook */
  .canvas {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(64px, 16vw, 100px);
    padding-top: clamp(72px, 18vw, 112px);
  }

  .item {
    position: static;
    width: var(--wm, 132px);
    transform: translateX(var(--shift, 0)) rotate(var(--r, 0deg));
    transition-delay: 0s;
  }

  /* the six scattered things, much smaller on a phone */
  .item[data-sheet="hiyiko"] {
    width: 82px;
  }

  .item[data-sheet="viewfinder"] {
    width: 76px;
  }

  .item--cloudstone {
    width: 66px;
  }

  .item[data-sheet="rental"] {
    width: 56px;
  }

  .item[data-sheet="cookiebox"] {
    width: 72px;
  }

  .item[data-sheet="contact"] {
    width: 82px;
  }

  /* the room photo keeps the centre of the page,
     and the page breathes a long while before the small things */
  .item--print {
    width: min(calc(var(--wm, 290px) * 1.14), 100%);
    margin-bottom: clamp(160px, 34vh, 280px);
  }

  .item:hover,
  .item:focus-visible {
    transform: translateX(var(--shift, 0)) rotate(0deg) scale(1.02);
  }

  .item .cap {
    font-size: 11.5px;
    margin-top: 11px;
    /* a narrow icon keeps a readable line of its own */
    width: max-content;
    max-width: 9.5em;
  }

  .item--print {
    max-width: 100%;
  }

  .hint {
    position: static;
    transform: none;
    display: block;
    margin: clamp(54px, 13vw, 78px) auto 0;
    text-align: center;
  }

  .foot {
    margin-top: clamp(30px, 7vw, 44px);
  }

  .veil {
    padding: 0;
    place-items: stretch;
  }

  .sheet {
    width: 100%;
    max-height: 92svh;
    border: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -20px 60px rgba(44, 44, 43, 0.08);
    align-self: end;
    padding: 0 clamp(20px, 6vw, 34px) clamp(30px, 8vw, 54px);
  }

  .veil.is-in .sheet {
    transform: none;
  }

  .sheet-bar {
    padding-top: 18px;
  }
}
