/* Homepage: the drawer, the four object chapters, hosting teaser and bio. */

/* ---------- Hero ---------- */
.hero { padding: clamp(118px, 17vh, 168px) var(--gutter) clamp(70px, 9vw, 120px); text-align: center; }
.hero h1 { font: 400 clamp(3.5rem, 10.2vw, 10.6rem)/.88 var(--serif); letter-spacing: -.058em; }
.hero h1 em { color: var(--signal); }
.intro { max-width: 31em; margin: clamp(18px, 2.2vw, 30px) auto 0; color: var(--soft); font-size: clamp(1.04rem, 1.35vw, 1.24rem); letter-spacing: -.012em; text-wrap: balance; }

.desk { position: relative; width: min(1000px, 100%); height: clamp(250px, 40vw, 420px); margin: clamp(40px, 5vw, 70px) auto 0; }
.desk::after { content: ""; position: absolute; z-index: 0; left: 3%; right: 3%; bottom: -30px; height: 44px; border-radius: 50%; background: rgb(44 46 32 / .3); filter: blur(18px); }
.tray {
  position: absolute; z-index: 1; left: 3.5%; right: 3.5%; bottom: 0; height: 54%;
  border-radius: 8px 8px 0 0; background: linear-gradient(#585e4a, #6e745d 40%);
  box-shadow: inset 0 10px 18px -6px rgb(0 0 0 / .45);
}
.fan { position: absolute; z-index: 2; inset: 0 6% 4%; display: flex; align-items: flex-end; justify-content: center; clip-path: inset(-100% -30% 0 -30%); }
.print {
  position: relative; flex: none; width: 30%; margin-inline: -3.6%;
  padding: clamp(5px, .8vw, 10px) clamp(5px, .8vw, 10px) 22%;
  background: var(--card); border-radius: 3px;
  box-shadow: 0 1px 0 rgb(0 0 0 / .06), 0 18px 30px -16px rgb(30 30 20 / .55);
  transform: translateY(var(--y)) rotate(var(--r)); transform-origin: 50% 100%;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
  animation: rise 1.1s var(--ease) backwards; animation-delay: calc(.25s + var(--i) * .1s);
}
.print:nth-child(1) { --r: -10deg; --y: 9%; --i: 0; }
.print:nth-child(2) { --r: -3.5deg; --y: -2%; --i: 1; }
.print:nth-child(3) { --r: 3.5deg; --y: -2%; --i: 2; }
.print:nth-child(4) { --r: 10deg; --y: 9%; --i: 3; }
.print img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 1px; }
.print span {
  position: absolute; left: 50%; top: -12px; translate: -50% -60%; opacity: 0; pointer-events: none;
  padding: 7px 12px; border-radius: 999px; background: var(--ink); color: var(--cream);
  font: 500 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  transition: opacity .3s, translate .4s var(--ease);
}
.print:hover, .print:focus-visible { z-index: 3; transform: translateY(-30%) rotate(calc(var(--r) * .25)); box-shadow: 0 1px 0 rgb(0 0 0 / .06), 0 36px 50px -24px rgb(30 30 20 / .55); }
.print:hover span, .print:focus-visible span { opacity: 1; translate: -50% -100%; }
@keyframes rise { from { transform: translateY(80%) rotate(0deg); } }
.front {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 40%;
  display: grid; place-items: center; align-content: center; gap: clamp(8px, 1.2vw, 14px);
  border-radius: 6px 6px 10px 10px;
  background: linear-gradient(178deg, #bfc1a9 0%, #aaae95 50%, #9a9f86 100%);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .4), inset 0 -10px 0 rgb(0 0 0 / .07), inset 0 0 0 1px rgb(60 66 46 / .3), 0 24px 40px -22px rgb(40 44 30 / .7);
}
.label {
  position: relative; padding: clamp(4px, .5vw, 6px) clamp(14px, 1.6vw, 20px);
  background: linear-gradient(#d8cca5, #c2b58e); border-radius: 3px;
  box-shadow: inset 0 1px 0 #f9efcf, inset 0 0 0 1px rgb(90 80 50 / .45), 0 2px 3px rgb(40 40 25 / .3);
}
.label::before, .label::after { content: ""; position: absolute; top: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: #6b6346; }
.label::before { left: 5px; } .label::after { right: 5px; }
.label span { display: block; padding: .14em .6em; background: #f8f3e2; border: 1px solid #9a9478; font: italic 400 clamp(15px, 2.2vw, 26px)/1.1 var(--serif); letter-spacing: -.03em; }
.pull { width: clamp(52px, 7vw, 84px); height: clamp(10px, 1.3vw, 15px); border: 3px solid #8f8565; border-top: 0; border-radius: 0 0 60px 60px; box-shadow: 0 3px 2px -1px rgb(40 40 25 / .3); }

/* ---------- Work chapters ---------- */
.work { position: relative; }
.anchor { display: block; height: 0; }
.chapter {
  position: relative; z-index: 1; color: var(--fg); background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0; margin-top: calc(var(--radius) * -1);
  box-shadow: 0 -30px 60px -40px rgb(0 0 0 / .5);
}
.chapter:first-of-type { margin-top: 0; }
.chapter-inner {
  width: min(1320px, 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(28px, 6vw, 110px);
  padding-block: clamp(80px, 11vh, 130px) clamp(70px, 9vh, 110px);
  transform-origin: 50% 0; scale: calc(1 - var(--p, 0) * .05); opacity: calc(1 - var(--p, 0) * .55);
}
.chapter:nth-of-type(even) .chapter-photo { order: 2; }
.chapter-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; animation: drift 7s ease-in-out infinite alternate; }
@keyframes drift { to { translate: 0 -10px; rotate: .6deg; } }
.chapter h2 { font: 400 clamp(3rem, 6.2vw, 6.4rem)/.92 var(--serif); letter-spacing: -.055em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips li { padding: 6px 11px; border-radius: 999px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 32%, transparent); }
.chips li:first-child { background: var(--fg); color: var(--on-fg); box-shadow: none; }
.note { margin-top: clamp(22px, 2.6vw, 34px); max-width: 24em; font: 400 clamp(1.3rem, 1.85vw, 1.72rem)/1.3 var(--serif); letter-spacing: -.022em; text-wrap: pretty; }
.desc { margin-top: 16px; max-width: 40ch; color: var(--soft); font-size: 1.03rem; }
.js .chapter-photo[data-reveal] { translate: 0 0; scale: .9; rotate: -4deg; transition-property: opacity, scale, rotate; }
.js .chapter-photo[data-reveal].is-in { scale: 1; rotate: 0deg; }

/* ---------- Hosting teaser ---------- */
.hosting {
  --fg: var(--cream); --on-fg: var(--night);
  position: relative; z-index: 2; margin-top: calc(var(--radius) * -1);
  border-radius: var(--radius) var(--radius) 0 0; background: var(--night); color: var(--cream); overflow: hidden;
}
.hosting-inner {
  width: min(1320px, 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: clamp(40px, 7vw, 120px);
  padding-block: clamp(90px, 11vw, 160px);
}
.hosting h2 { font: 400 clamp(3rem, 5.6vw, 6rem)/.95 var(--serif); letter-spacing: -.055em; }
.hosting h2 em { color: #ff8b67; }
.hosting p { max-width: 40ch; margin-top: 26px; color: #c9cbbf; font-size: 1.08rem; line-height: 1.6; }
.stays { position: relative; height: clamp(340px, 36vw, 520px); }
.stay {
  position: absolute; width: 44%; padding: 10px 10px 0; background: var(--card); color: var(--ink); border-radius: 3px;
  box-shadow: 0 30px 50px -24px rgb(0 0 0 / .7);
  transform: translate(var(--x), var(--y)) rotate(var(--r));
  transition: transform .7s var(--ease);
}
.stay img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.stay figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 11px 3px 13px; font: italic 400 clamp(.95rem, 1.2vw, 1.12rem)/1.2 var(--serif); }
.stay figcaption span { font: 500 .64rem/1 var(--mono); font-style: normal; letter-spacing: .07em; text-transform: uppercase; color: var(--soft); }
.stay:nth-child(1) { left: 0; top: 10%; --r: -7deg; --x: 0; --y: 0; }
.stay:nth-child(2) { left: 28%; top: 0; z-index: 2; --r: 1.5deg; --x: 0; --y: 0; }
.stay:nth-child(3) { right: 0; top: 13%; --r: 8deg; --x: 0; --y: 0; }
.stays:hover .stay:nth-child(1) { --x: -6%; --r: -10deg; }
.stays:hover .stay:nth-child(3) { --x: 6%; --r: 11deg; }
.stays:hover .stay:nth-child(2) { --y: -4%; --r: 0deg; }

/* ---------- About ---------- */
.about {
  width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; grid-template-columns: .78fr 1.22fr; align-items: center; gap: clamp(40px, 8vw, 120px);
  padding-block: clamp(100px, 12vw, 170px);
}
.portrait { position: relative; padding: 12px 12px 54px; background: var(--card); border-radius: 3px; rotate: -3deg; box-shadow: 0 30px 50px -30px rgb(40 40 25 / .55); }
.portrait::before { content: ""; position: absolute; top: -16px; left: 50%; width: 120px; height: 32px; translate: -50% 0; rotate: -4deg; background: rgb(232 222 190 / .78); box-shadow: 0 1px 2px rgb(0 0 0 / .1); }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; filter: grayscale(1) contrast(1.05); transition: filter .8s var(--ease); }
.portrait:hover img { filter: none; }
.portrait figcaption { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font: italic 400 1.15rem/1 var(--serif); color: var(--soft); }
.about h2 { font: 400 clamp(2.8rem, 5vw, 5rem)/1 var(--serif); letter-spacing: -.055em; }
.about h2 span { color: var(--signal); }
.about-copy > p { margin-top: 22px; max-width: 46ch; color: var(--soft); font-size: 1.1rem; line-height: 1.6; }
.history { margin-top: 36px; border-bottom: 1px solid var(--line); }
.history div { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding-block: 16px; border-top: 1px solid var(--line); }
.history dt { padding-top: 3px; color: var(--soft); }
.history dd { font-weight: 500; }
.history small { display: block; margin-top: 2px; color: var(--soft); font-size: .9rem; font-weight: 400; }

/* ---------- Arrival to the apartments (animation in hosting-arrival.js) ---------- */
.hosting-arrival h2 { font-family: var(--serif); }
.hosting-arrival button { border: 0; border-radius: 999px; padding: .7rem 1.1rem; background: rgb(26 26 22 / .06); font-weight: 500; transition: background .25s; }
.hosting-arrival button:hover { background: rgb(26 26 22 / .12); }
.hosting-arrival-progress { width: 140px; height: 3px; border-radius: 3px; }

/* ---------- Stacking cards on large screens ---------- */
@media (min-width: 900px) and (min-height: 680px) {
  .chapter { position: sticky; top: 0; min-height: 100vh; min-height: 100svh; display: grid; align-items: center; }
}
@media (max-width: 899px) {
  .chapter-inner, .hosting-inner, .about { grid-template-columns: 1fr; }
  .chapter:nth-of-type(even) .chapter-photo { order: 0; }
  .chapter-photo { width: min(560px, 100%); justify-self: center; }
  .chapter-inner { gap: 8px; padding-block: 64px 80px; scale: none; opacity: 1; }
  .stays { height: clamp(300px, 78vw, 480px); margin-top: 10px; }
  .about { gap: 56px; }
  .portrait { width: min(320px, 74%); justify-self: center; }
}
@media (max-width: 640px) {
  .hero { padding-top: 112px; }
  .hero h1 { font-size: clamp(3.3rem, 15vw, 5rem); }
  .hero h1 em { display: block; }
  .desk { height: auto; aspect-ratio: 1.75; margin-top: 28px; }
  .fan { inset: 0 4% 6%; }
  .print { width: 31%; margin-inline: -4.4%; padding: 4px 4px 22%; }
  .print span { display: none; }
  .front { height: 36%; }
  .chapter h2 { font-size: clamp(2.7rem, 12vw, 3.6rem); }
  .stay { padding: 6px 6px 0; }
  .stay figcaption { padding: 8px 2px 10px; font-size: .82rem; }
  .stay figcaption span { display: none; }
  .history div { grid-template-columns: 1fr; gap: 2px; }
}
