/* Dearly Drawn home, modernist build after brandonyasin.com.
   Numbers come from docs/ref/site-studies/brandonyasin.md ("Toàn bộ chuyển động"). */
:root {
  /* day values; proto.js retints these by the hour in Sài Gòn */
  --bg: #f2eee6;
  --ink: #161613;
  --muted: #77736a;
  --paper: #e7e1d5;
  --dim: 0;
  --gate-bg: #2a2a26;
  --gate-ink: #ddd6c6;
  --m: 16px;
  --gap: 8px;
  --head-h: 84px;
  --f-text: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-sign: "Mrs Saint Delafield", "Snell Roundhand", cursive;
}
@media (max-width: 1024px) { :root { --head-h: 56px; } }
@media (max-width: 767px) { :root { --m: 8px; --head-h: 40px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  margin: 0; height: 100dvh; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.3 var(--f-text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .6s ease, color .6s ease;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--ink) 18%, transparent); }
/* small text controls get a 24px+ tap area without moving their label */
.hit { padding: 8px 8px; margin: -8px -8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* small caps line: 12px, uppercase, like font-body-12 */
.t12 { font-size: 12px; line-height: 1; text-transform: uppercase; letter-spacing: 0; }
.t13 { font-size: 13px; line-height: 1.3; }
.t18 { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.25; font-weight: 300; letter-spacing: -.01em; }
.t24 { font-size: clamp(16px, 1.67vw, 24px); line-height: 1.2; font-weight: 300; letter-spacing: -.01em; }
.t40 { font-size: clamp(26px, 2.78vw, 40px); line-height: 1.1; font-weight: 300; letter-spacing: -.02em; }
.thead { font-size: clamp(28px, 3.34vw, 48px); line-height: 1.12; font-weight: 300; letter-spacing: -.01em; }

/* Rolling label: two copies, the second waits below; hover rolls both up */
.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.roll > span { display: block; }
.roll > span + span { position: absolute; top: 100%; left: 0; }
/* a line that slides up from under its own edge */
.mask { display: block; overflow: hidden; }
.mask > span { display: block; }

/* ---------- Header ---------- */
.head {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--head-h); padding: 16px var(--m) 0;
  pointer-events: none;
}
.head > * { pointer-events: auto; }
.head-brand { position: absolute; left: var(--m); top: 16px; }
.head-sign { position: absolute; left: 28.4%; top: 6px; width: 132px; height: 52px; color: var(--ink); }
.head-sign span { display: inline-block; width: max-content; font: 40px/52px var(--f-sign); white-space: nowrap; clip-path: inset(0 100% 0 0); }
.head-nav { position: absolute; left: 57.3%; top: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.head-egg { position: absolute; right: var(--m); top: 10px; width: 52px; height: 52px; }
.head-egg svg { width: 100%; height: 100%; overflow: visible; }
.head-egg circle { fill: none; stroke: currentColor; stroke-width: 1; }
.head-egg .egg-dot { fill: currentColor; stroke: none; }
@media (max-width: 1024px) {
  .head-sign { display: none; }
  .head-nav { left: auto; right: calc(var(--m) + 64px); flex-direction: row; gap: 20px; }
  .head-egg { top: 4px; width: 40px; height: 40px; }
}
@media (max-width: 767px) {
  .head-brand, .head-nav { top: 10px; }
  .head-nav { right: calc(var(--m) + 44px); gap: 14px; }
  .head-egg { top: 4px; width: 32px; height: 32px; }
}
.is-menu .head { visibility: hidden; }

/* ---------- Pages: each is its own scroller, so the menu can shrink it into a tile ---------- */
.stage { position: fixed; inset: 0; overflow: hidden; background: color-mix(in srgb, var(--bg) 84%, #000); }
.page {
  position: fixed; inset: 0; z-index: 1;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  background: var(--bg);
  --cut: 100%;
  clip-path: polygon(0 0, var(--cut) 0, var(--cut) 100%, 0 100%);
  transform-origin: center center;
  visibility: hidden;
  transition: background-color .6s ease;
}
.page::-webkit-scrollbar { display: none; }
.page.is-current { visibility: visible; z-index: 2; }
.page.is-tile { visibility: visible; cursor: pointer; }
.page.is-tile * { pointer-events: none; }
/* a finger on a tile drags the row instead of scrolling the page inside it */
.is-menu .stage, .is-menu .page { touch-action: none; user-select: none; -webkit-user-select: none; }
.page-inner { min-height: 100%; }

/* inside a tile: the page's own copy of the header, and its name */
.page-head { position: absolute; inset: 0 0 auto 0; z-index: 9; visibility: hidden; }
.is-menu .page-head { visibility: visible; }
.page-head .head-sign span { clip-path: none; }
.page-title {
  position: absolute; left: 0; top: var(--page-scroll, 0px); z-index: 10; width: 100%;
  padding: 64px var(--m) 0; overflow: hidden; visibility: hidden; pointer-events: none;
}
.page--faq .page-title { display: none; }
.page-title span { display: block; font-size: clamp(54px, 4.17vw, 72px); line-height: 1; letter-spacing: -.04em; text-transform: lowercase; }

/* ---------- Home: the run of cards ---------- */
.gallery {
  position: absolute; inset: auto 0 0 0;
  height: calc(100dvh - var(--head-h));
  display: flex; flex-wrap: nowrap; align-items: flex-end; gap: var(--gap);
  padding: 0 var(--m) var(--m);
  overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none;
}
.gallery.is-intro { visibility: hidden; opacity: 0; }
.g-item { position: relative; flex-shrink: 0; width: 83%; transform-origin: bottom; will-change: transform; cursor: pointer; }
@media (min-width: 768px) { .g-item { width: 36.6%; } }
@media (min-width: 1025px) { .g-item { width: calc(28.74% - var(--gap)); } }
.g-item:nth-child(1) { z-index: 10; } .g-item:nth-child(2) { z-index: 9; } .g-item:nth-child(3) { z-index: 8; }
.g-item:nth-child(4) { z-index: 7; } .g-item:nth-child(5) { z-index: 6; } .g-item:nth-child(6) { z-index: 5; }
.g-item:nth-child(7) { z-index: 4; }
.g-wrap, .g-stage { transform-origin: 50% 50%; }
.g-name-wrap { margin-bottom: 8px; overflow: hidden; }
@media (min-width: 1025px) { .g-name-wrap { margin-bottom: 16px; } }
.g-name { position: relative; overflow: hidden; line-height: 1; }
.g-name span { display: block; }
.g-name span + span { position: absolute; top: 100%; left: 0; }
.g-img { position: relative; aspect-ratio: 396 / 496; overflow: hidden; background: color-mix(in srgb, var(--ink) 6%, var(--bg)); }
.g-img img { -webkit-user-drag: none; width: 100%; height: 100%; object-fit: cover; object-position: top; transform: scale(1.15); transform-origin: 50% 50%; }
.g-img::after, .c-img::after { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--dim); pointer-events: none; transition: opacity .6s ease; }
.flyer { position: fixed; z-index: 100; margin: 0; overflow: hidden; pointer-events: none; }
.flyer img { width: 100%; height: 100%; object-fit: cover; object-position: top; transform-origin: 50% 50%; }

/* ---------- Opening gate: unchanged from the live home ---------- */
.gate { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.gate-door { position: absolute; top: 0; bottom: 0; width: calc(50% + 1px); overflow: hidden; animation: 1.2s cubic-bezier(0.5, 0, 0.75, 0) 0.55s both; }
.gate-l { left: 0; animation-name: gate-left; }
.gate-r { right: 0; animation-name: gate-right; }
.gate-face {
  position: absolute; top: 0; bottom: 0; width: 200%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--gate-bg); color: var(--gate-ink); text-align: center;
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
}
.gate-l .gate-face { left: 0; }
.gate-r .gate-face { right: 0; }
.gate-word, .gate-sub { animation: gate-word .5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.gate-word { font-style: italic; font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem); line-height: 1; }
.gate-sub { font-size: 1.2rem; color: #b8b1a2; animation-delay: .08s; }
@keyframes gate-left { to { transform: translateX(-100%); } }
@keyframes gate-right { to { transform: translateX(100%); } }
@keyframes gate-word { from { opacity: 0; transform: translateY(10px); } }
.gate-seen .gate { display: none; }

@media (prefers-reduced-motion: reduce) {
  .gate { display: none; }
  .head-sign span { clip-path: none; }
  .gallery.is-intro { visibility: visible; opacity: 1; }
}

/* Preserve the prototype's visual world; showroom chrome lives outside every invitation. */
:root { --ease-out: cubic-bezier(.23, 1, .32, 1); --viewer-bar: 56px; }
html { -webkit-tap-highlight-color: transparent; }
a, button { touch-action: manipulation; }
.head-egg { pointer-events: none; }
.head-nav button, .viewer-bar button, .contact-top button { min-height: 44px; }
.head-nav { top: 0; }
.head-brand { min-width: 44px; min-height: 44px; }
.viewer[hidden], .viewer-recovery[hidden], .viewer-status[hidden] { display: none; }
.viewer { position: fixed; inset: 0; z-index: 70; background: var(--bg); color: var(--ink); }
.viewer-bar { height: calc(var(--viewer-bar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--m) 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.viewer-back { display: inline-flex; align-items: center; gap: 6px; }
.viewer-back svg { width: 20px; height: 20px; }
.viewer svg, .contact svg { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-title { font-weight: 400; }
.viewer-content { position: absolute; inset: calc(var(--viewer-bar) + env(safe-area-inset-top)) 0 0; background: #fff; }
.viewer-mount, .viewer iframe { width: 100%; height: 100%; border: 0; display: block; }
.viewer iframe { opacity: 0; }
.viewer-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 24px; padding: 24px; background: var(--bg); color: var(--ink); text-align: center; }
.viewer-recovery { display: flex; flex-wrap: wrap; gap: 24px; }
.viewer-recovery a, .viewer-recovery button { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 5px; }
.viewer-flyer { z-index: 90; background: var(--bg); }
.contact { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; max-height: 90dvh; padding: 0; border: 0; background: var(--paper); color: #161613; overflow-y: auto; overscroll-behavior: contain; }
.contact::backdrop { background: rgb(0 0 0 / .45); }
.contact-panel { padding: 20px max(var(--m), env(safe-area-inset-left)) max(48px, env(safe-area-inset-bottom)); }
.contact-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 64px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; }
.contact-intro h2 { font-weight: 300; font-size: clamp(28px, 3.3vw, 48px); line-height: 1.15; letter-spacing: -.025em; }
.contact-intro p { font-weight: 300; font-size: 18px; line-height: 1.5; margin-top: 24px; max-width: 34ch; }
.contact-links a { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 8px 0; }
.contact-links a > .t12 { grid-column: 1 / -1; }
.contact-address { font-size: clamp(26px, 3vw, 44px); line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.contact-links svg { width: 28px; height: 28px; align-self: center; transition: transform 200ms var(--ease-out); }
.contact-copy { min-height: 44px; text-decoration: underline; text-underline-offset: 4px; margin-bottom: 32px; }
.contact-links a:active svg { transform: translate(2px, -2px); }
.no-script { position: fixed; inset: 80px 16px auto; z-index: 60; padding: 24px; background: var(--paper); color: #161613; line-height: 1.6; }
.no-script a { text-decoration: underline; }
@media (hover: hover) and (pointer: fine) {
  .contact-links a:hover svg { transform: translate(3px, -3px); }
}
@media (max-width: 767px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-top { margin-bottom: 32px; }
  .contact-panel { padding-left: 20px; padding-right: 20px; }
  .contact-copy { margin-bottom: 20px; }
  .viewer-title { max-width: 30%; text-align: center; line-height: 1.3; }
  .viewer-bar { gap: 8px; }
  .viewer-back { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; }
  .contact-links svg { transform: none !important; }
}
