/* chuiuoi.online homepage. Direction: "The dark room" (tasteskill, seed 1690334529).
   One dark field, lit things in it: each project is a lit window. */

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/be-vietnam-pro-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/be-vietnam-pro-vietnamese-500-normal.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/be-vietnam-pro-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #111111;
  --surface: #1c1c1c;
  --ink: #f2f2f2;
  --muted: #a3a3a3;
  --accent: #a08672;
  --accent-ink: #111111;
  --window: #efe4d4;
  --window-dim: #b9ab98;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.5rem, 1.1rem + 1.1vw, 2.25rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);

  --margin: clamp(16px, 2.1vw, 30px);
  --gap-section: clamp(120px, 16vw, 220px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: var(--step-body);
  line-height: 1.6;
  font-weight: 400;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.nowrap { white-space: nowrap; }

.skip {
  position: absolute; left: var(--margin); top: -100px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 14px;
}
.skip:focus { top: var(--margin); }

/* The one solid light element: the primary action. */
.action {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  background: var(--accent); color: var(--accent-ink);
  font-size: var(--step-small); font-weight: 500; text-decoration: none;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease);
}
.action:hover { background: #b39a86; }
.action:active { transform: translateY(1px) scale(0.98); }

/* Navigation split between the top corners. */
.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: var(--margin);
  font-size: 15px;
}
.bar-links { display: flex; gap: 22px; align-items: center; min-height: 44px; flex-wrap: wrap; }
.bar-links a { text-decoration: none; color: var(--muted); transition: color 160ms var(--ease); }
.bar-links a:hover { color: var(--ink); }
.bar-links .wordmark { color: var(--ink); font-weight: 500; }

/* Hero: two prints in darkness. */
.hero { position: relative; min-height: 100svh; overflow: hidden; }
.print { position: absolute; }
.print img { width: 100%; height: 100%; object-fit: cover; }
.print-large { left: 38vw; top: 9svh; width: min(42vw, 67svh); aspect-ratio: 4 / 5; }
.print-small { left: 9vw; top: 52svh; width: 12vw; aspect-ratio: 1; }
.print-small img { object-position: 28% 50%; filter: brightness(0.62) contrast(1.05) grayscale(0.2); }
.crossfade { position: relative; width: 100%; height: 100%; }
.crossfade img { position: absolute; inset: 0; transition: opacity 1.6s ease-in-out; }
.crossfade img:first-child { object-position: 31% 50%; }
.crossfade img:nth-child(2) { object-position: 17% 50%; opacity: 0; }
.crossfade.second img:first-child { opacity: 0; }
.crossfade.second img:nth-child(2) { opacity: 1; }
.hero h1 {
  position: absolute; left: var(--margin); bottom: var(--margin);
  max-width: 16ch;
  font-size: var(--step-lead); font-weight: 400; line-height: 1.12; letter-spacing: -0.02em;
}
.hero-note {
  position: absolute; right: var(--margin); bottom: var(--margin);
  width: min(24ch, 22vw); color: var(--muted); font-size: 16px; line-height: 1.5;
}

/* Intro: a staircase statement. */
.intro {
  position: relative; min-height: 100svh;
  display: grid; align-content: center;
  padding: var(--gap-section) var(--margin) 0 4vw;
}
.stairs { font-size: var(--step-lead); font-weight: 500; line-height: 1.08; letter-spacing: -0.02em; max-width: 72vw; }
.stairs span { display: block; white-space: nowrap; }
.stairs span:nth-child(2) { padding-left: 12vw; color: var(--muted); }
.stairs span:nth-child(3) { padding-left: 24vw; }
.intro-prints {
  position: absolute; right: var(--margin); top: calc(50% - 12vw);
  width: 20vw; display: grid; gap: 16px;
}
.intro-prints img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.intro-prints img:nth-child(2) { object-position: 50% 45%; filter: brightness(0.72) contrast(1.08); }
.intro-note { margin-top: 12vh; max-width: 46ch; font-size: 15px; color: var(--muted); }
.intro-note time { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Work: projects scattered down the page with pauses between them. */
.work { padding: var(--gap-section) var(--margin) 0; }
.work h2 { font-size: var(--step-head); font-weight: 400; line-height: 1; letter-spacing: -0.03em; }
.knock { margin-top: 48px; max-width: 560px; }
.knock label { display: block; font-size: var(--step-body); margin-bottom: 12px; }
.knock-field {
  display: flex; align-items: baseline; gap: 2px;
  background: var(--surface); padding: 14px 16px;
  font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.01em;
  transition: background-color 180ms var(--ease);
}
.knock-field:focus-within { background: #262626; }
.knock input {
  flex: 1 1 auto; min-width: 0; width: 6ch;
  background: transparent; border: 0; padding: 0; margin: 0;
  color: var(--ink); font: inherit; letter-spacing: inherit;
}
.knock input::placeholder { color: #6f6f6f; }
.knock input:focus { outline: none; }
.knock-field:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.knock-domain { color: var(--muted); white-space: nowrap; }
.knock-result { margin-top: 12px; min-height: 3.2em; font-size: 16px; color: var(--muted); }
.knock-result strong { color: var(--ink); font-weight: 500; }
.knock-result a { color: var(--ink); }

.scatter { margin-top: 26vh; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.scatter-empty { grid-column: 1 / -1; color: var(--muted); max-width: 46ch; }
.proj { margin-bottom: 26vh; }
.proj:nth-child(3n + 1) { grid-column: 1 / 7; }
.proj:nth-child(3n + 2) { grid-column: 9 / 13; margin-top: -80px; }
.proj:nth-child(3n + 3) { grid-column: 3 / 10; }
.proj:last-child { margin-bottom: 0; }
.proj-name { font-size: var(--step-small); color: var(--muted); margin-bottom: 10px; }
.proj-media { display: block; position: relative; overflow: hidden; background: var(--surface); }
.proj:nth-child(3n + 1) .proj-media { aspect-ratio: 3 / 2; }
.proj:nth-child(3n + 2) .proj-media { aspect-ratio: 4 / 5; }
.proj:nth-child(3n + 3) .proj-media { aspect-ratio: 16 / 9; }
.proj-media img, .proj-media svg { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.proj-media:hover img, .proj-media:hover svg, .proj-media:focus-visible img, .proj-media:focus-visible svg { transform: scale(1.03); }
.proj-desc { margin-top: 14px; font-size: clamp(15px, 1.1vw, 17px); max-width: 52ch; }
.proj-link { margin-top: 6px; font-size: var(--step-small); color: var(--muted); }
.proj-link a { color: var(--ink); }

/* About: an inset panel; the photo takes the Mac mini's own rounded-square footprint. */
.about { padding: var(--gap-section) 20px 0; }
.panel {
  position: relative; overflow: hidden;
  min-height: 110svh; background: var(--surface);
  padding: 56px;
}
.panel h2 {
  max-width: 15ch; font-size: var(--step-head); font-weight: 400; line-height: 1.02; letter-spacing: -0.03em;
}
.about-text { position: absolute; left: 63%; top: 56px; width: min(320px, 30%); display: grid; gap: 56px; }
.about-text h3 { font-size: var(--step-body); font-weight: 500; margin-bottom: 8px; }
.about-text p { font-size: 16px; line-height: 1.55; }
.shaped {
  position: absolute; left: 56px; bottom: calc(-38vw * 0.2); width: 38vw; aspect-ratio: 1;
  clip-path: inset(0 round 17%);
}
.shaped img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; filter: brightness(0.85) contrast(1.05); }

/* Contact: a visit card on a photograph. */
.contact { position: relative; margin-top: var(--gap-section); min-height: 100svh; overflow: hidden; background: var(--bg); }
.contact-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%;
  filter: brightness(0.8);
}
.card {
  position: relative; margin: 60px 60px 60px auto; width: 380px; z-index: 1;
  background: var(--ink); color: var(--bg);
  padding: 32px 32px 0;
}
.card h2 { font-size: var(--step-lead); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; }
.card-address { margin-top: 18px; font-size: 16px; }
.card-hours { margin-top: 18px; font-size: 16px; }
.card-hours div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.card-hours dd { font-variant-numeric: tabular-nums; }
.action-wide { display: flex; width: calc(100% + 64px); margin: 28px -32px 0; min-height: 52px; font-size: 16px; }

/* Footer: ground and ink invert; the wordmark returns at full width. */
.foot {
  position: sticky; bottom: 0; z-index: 0;
  min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto auto;
  background: var(--ink); color: var(--bg);
  padding: 40px var(--margin) 20px;
}
main { position: relative; z-index: 1; background: var(--bg); padding-bottom: var(--gap-section); }
.foot-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; font-size: 15px; line-height: 1.5; }
.foot-cols > * { grid-column: span 2; }
.foot-cols > .credits { grid-column: 8 / 13; }
.foot-cols p + p { margin-top: 2px; }
.foot-cols .foot-head { color: var(--bg); font-weight: 500; margin-bottom: 6px; }
.foot-cols p { color: #3d3d3d; }
.foot-cols a { color: var(--bg); }
.foot-word { grid-row: 3; width: 100%; height: auto; margin-bottom: 20px; overflow: visible; }
.foot-word text { font-family: "Be Vietnam Pro", system-ui, sans-serif; font-size: 118px; font-weight: 500; letter-spacing: -0.04em; fill: var(--bg); }
.foot-legal { grid-row: 4; font-size: var(--step-small); color: #3d3d3d; }

/* Entrances: hidden only when the script is running, so nothing stays hidden without it. */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 900ms var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
.contact-photo { animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.02) translateX(0); } to { transform: scale(1.1) translateX(-2%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { transform: none; transition: opacity 300ms linear; }
  .contact-photo { animation: none; }
  .crossfade img { transition: none; }
  .proj-media img, .proj-media svg { transition: none; }
}

/* Tablet: the large print leads, the small one sits low on the left margin. */
@media (min-width: 761px) and (max-width: 1100px) {
  .print-large { left: auto; right: var(--margin); top: 10svh; width: min(60vw, 52svh); }
  .print-small { left: var(--margin); top: 44svh; width: 22vw; }
  .hero-note { width: 30ch; }
}

/* Phone: its own composition. */
@media (max-width: 760px) {
  .bar-links a:not(.wordmark) { display: none; }
  .action { min-height: 40px; padding: 0 14px; }
  .print-large { left: auto; right: var(--margin); top: 12svh; width: 78vw; }
  .print-large { width: 78vw; }
  .print-small { left: var(--margin); top: calc(12svh + 78vw * 1.25 - 24px - 30vw); width: 30vw; }
  .hero { min-height: max(100svh, calc(12svh + 78vw * 1.25 + 190px)); }
  .hero h1 { font-size: 6.4vw; bottom: calc(var(--margin) + 70px); max-width: 18ch; }
  .hero-note { left: var(--margin); right: auto; width: auto; max-width: 34ch; font-size: 15px; }

  .intro { min-height: auto; padding: var(--gap-section) var(--margin) 0; }
  .stairs { font-size: min(5.2vw, 20px); line-height: 1.3; max-width: none; }
  .stairs span { white-space: normal; }
  .stairs span:nth-child(2) { padding-left: 6vw; }
  .stairs span:nth-child(3) { padding-left: 12vw; }
  .intro-prints { position: static; width: auto; margin-top: 48px; grid-template-columns: 1fr 1fr; gap: 10px; }
  .intro-note { margin-top: 32px; }

  .knock-field { font-size: 20px; }
  .scatter { display: block; margin-top: 72px; }
  .proj { margin: 0 0 72px; }
  .proj:nth-child(3n + 2) { width: 68%; margin-left: auto; margin-top: 0; }
  .proj:nth-child(3n + 3) { width: 82%; }

  .about { padding: var(--gap-section) 10px 0; }
  .panel { padding: 28px 20px 0; min-height: 0; }
  .panel h2 { font-size: 8.5vw; max-width: none; }
  .about-text { position: static; width: auto; margin-top: 36px; gap: 32px; }
  .shaped { position: relative; left: auto; bottom: auto; width: 86vw; margin: 48px auto 0; margin-bottom: calc(-86vw * 0.25); }

  .contact { min-height: 0; }
  .contact-photo { position: relative; height: 70svh; }
  .card { position: relative; top: auto; width: auto; margin: -80px 16px 0; }
  .action-wide { min-height: 56px; }

  .foot-cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .foot-cols > *, .foot-cols > .credits { grid-column: auto; }
  .foot-cols > .credits { grid-column: 1 / -1; }
  .foot-legal { font-size: 13px; }
}
