/* chuyookliew.com — static rebuild. No framework, no build step. */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/nunito-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/nunito-italic-latin.woff2") format("woff2");
}

@view-transition { navigation: auto; }

:root {
  color-scheme: light only;   /* always light, regardless of OS setting */
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6e6e6e;
  --line: #e7e7e7;
  --placeholder: #eeeeee;
  --overlay: rgb(10 10 10 / 0.92);
  --accent: #0a0a0a;

  --font: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 3.25rem);

  --gutter: clamp(1rem, 3.5vw, 3rem);
  --max: 90rem;
  --radius: 2px;
  --header-h: 4.5rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 300 var(--step-0)/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, video, svg, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
strong, b { font-weight: 700; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -3rem; z-index: 100;
  padding: .5rem 1rem; background: var(--fg); color: var(--bg); text-decoration: none;
}
.skip-link:focus { top: .75rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
  view-transition-name: site-header;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }
.logo { display: inline-flex; color: var(--fg); }
.logo svg { width: clamp(150px, 18vw, 200px); height: auto; }
.nav ul { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); list-style: none; margin: 0; padding: 0; }
.nav a {
  font-size: var(--step-0); font-weight: 400; text-decoration: none;
  padding-block: .35rem; background: linear-gradient(currentColor 0 0) left bottom / 0 1.5px no-repeat;
  transition: background-size .3s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { background-size: 100% 1.5px; }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: clamp(4rem, 8vw, 7rem); padding-block: 2rem; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer p { margin: 0; }
.social { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.social a { display: inline-flex; align-items: center; gap: .45rem; color: var(--fg); text-decoration: none; }
.social a:hover { text-decoration: underline; }
.social svg { width: 1.05em; height: 1.05em; fill: currentColor; }

/* ---------------------------------------------------------------- work grid */
.intro { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 4vw, 2.5rem); text-align: center; }
.intro h1 { font-size: var(--step-3); font-weight: 300; margin-bottom: .25em; }
.intro p { color: var(--muted); font-size: var(--step-1); margin: 0; }

.filter { margin-bottom: clamp(1.5rem, 4vw, 3rem); }
.filter ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem clamp(1rem, 2.5vw, 2rem); list-style: none; margin: 0; padding: 0; }
.filter a {
  display: inline-block; padding-block: .4rem; font-weight: 400; text-decoration: none; color: var(--muted);
  background: linear-gradient(currentColor 0 0) left bottom / 0 1.5px no-repeat; transition: background-size .3s var(--ease), color .2s;
}
.filter a:hover { color: var(--fg); }
.filter a[aria-current="page"] { color: var(--fg); background-size: 100% 1.5px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(1.75rem, 3vw, 2.75rem) clamp(1rem, 2.2vw, 2rem);
  list-style: none; margin: 0; padding: 0;
}
.grid > li[hidden] { display: none; }
.card { position: relative; }
.card a { text-decoration: none; }
.card__media { overflow: hidden; background: var(--placeholder); border-radius: var(--radius); }
.card__media img { width: 100%; aspect-ratio: 720 / 598; object-fit: cover; transition: transform .7s var(--ease), opacity .4s; }
.card:hover .card__media img, .card:focus-within .card__media img { transform: scale(1.035); opacity: .82; }
.card__title { margin: .9rem 0 .1rem; font-size: var(--step-1); font-weight: 400; }
.card__title a::after { content: ""; position: absolute; inset: 0; }   /* whole card clickable */
.card__meta { margin: 0; font-size: var(--step--1); color: var(--muted); }

/* ---------------------------------------------------------------- project */
.project {
  display: grid; gap: clamp(2rem, 4vw, 4.5rem);
  padding-top: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 60rem) {
  .project { grid-template-columns: minmax(0, 8fr) minmax(17rem, 3fr); }
  .project__details { order: 2; position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
}
.project__details h1 { font-size: var(--step-2); margin-bottom: .2em; }
.project__client { margin: 0 0 1.5rem; font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.project__desc p:last-child { margin-bottom: 0; }
.project__facts { margin: 1.75rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); display: grid; gap: .9rem; font-size: var(--step--1); }
.project__facts dt { letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.project__facts dd { margin: .15rem 0 0; font-size: var(--step-0); }
.project__facts dd a { color: inherit; }
.project__launch { display: inline-flex; gap: .4rem; margin-top: 1.5rem; font-weight: 600; }

.gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.gallery > * { grid-column: span 6; margin: 0; }
@media (min-width: 40rem) {
  .gallery > .w-1-2 { grid-column: span 3; }
  .gallery > .w-1-3 { grid-column: span 2; }
  .gallery > .w-2-3 { grid-column: span 4; }
}
.gallery a.zoom { display: block; cursor: zoom-in; background: var(--placeholder); }
.gallery img, .gallery video { width: 100%; }
.gallery figcaption { margin-top: .5rem; font-size: var(--step--1); color: var(--muted); }

/* video facade */
.video { position: relative; background: #000; overflow: hidden; border-radius: var(--radius); }
.video > a, .video > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video > a { display: grid; place-items: center; color: #fff; text-decoration: none; }
.video > a img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s, transform .7s var(--ease); }
.video > a:hover img { opacity: .8; transform: scale(1.02); }
.video__play {
  position: relative; display: grid; place-items: center;
  width: clamp(3.5rem, 8vw, 5rem); aspect-ratio: 1; border-radius: 50%;
  background: rgb(0 0 0 / .55); border: 1.5px solid rgb(255 255 255 / .85);
  backdrop-filter: blur(4px); transition: transform .3s var(--ease), background .3s;
}
.video__play svg { width: 38%; margin-left: 8%; fill: #fff; }
.video > a:hover .video__play { transform: scale(1.08); background: rgb(0 0 0 / .75); }
.video__label { position: absolute; left: 1rem; bottom: .8rem; right: 1rem; font-size: var(--step--1); text-shadow: 0 1px 3px rgb(0 0 0 / .7); }

/* slider */
.slider { position: relative; }
.slider__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  margin: 0; padding: 0; list-style: none; scrollbar-width: none; background: var(--placeholder);
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__track > li { flex: 0 0 100%; scroll-snap-align: start; }
.slider__btn {
  position: absolute; top: 50%; translate: 0 -50%; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center; border: 0; cursor: pointer;
  background: rgb(255 255 255 / .85); color: #0a0a0a; box-shadow: 0 2px 10px rgb(0 0 0 / .15);
  opacity: 0; transition: opacity .25s;
}
.slider:hover .slider__btn, .slider__btn:focus-visible { opacity: 1; }
@media (hover: none) { .slider__btn { opacity: 1; } }
.slider__btn[hidden] { display: none; }
.slider__btn[disabled] { opacity: 0 !important; pointer-events: none; }
.slider__btn svg { width: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.slider__btn--prev { left: .75rem; }
.slider__btn--next { right: .75rem; }
.slider__dots { display: flex; justify-content: center; gap: .5rem; margin-top: .75rem; }
.slider__dots button { width: .55rem; height: .55rem; padding: 0; border-radius: 50%; border: 1px solid var(--fg); background: transparent; cursor: pointer; }
.slider__dots button[aria-current="true"] { background: var(--fg); }

/* prev / next */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-top: clamp(3rem, 6vw, 5rem); padding-top: 2rem; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; display: grid; gap: .1rem; }
.pager small { font-size: var(--step--1); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.pager span { font-size: var(--step-1); }
.pager a:hover span { text-decoration: underline; }
.pager__next { text-align: right; }
.pager__all { display: grid !important; place-items: center; width: 2.75rem; height: 2.75rem; }
.pager__all svg { width: 1.25rem; fill: currentColor; }

/* ---------------------------------------------------------------- about */
.about { max-width: 46rem; margin-inline: auto; padding-top: clamp(2.5rem, 7vw, 5.5rem); }
.about__lead { font-size: var(--step-2); font-weight: 300; line-height: 1.35; margin-bottom: 1.5rem; }
.about__lead + p { font-size: var(--step-1); color: var(--muted); }
.about__links { display: flex; flex-wrap: wrap; gap: .75rem; list-style: none; margin: 2rem 0 0; padding: 0; }
.about__links a {
  display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.1rem;
  border: 1px solid var(--fg); border-radius: 999px; text-decoration: none; font-weight: 400;
  transition: background .2s, color .2s;
}
.about__links a:hover { background: var(--fg); color: var(--bg); }
.about__links svg { width: 1rem; height: 1rem; fill: currentColor; }
.about h2 { font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.25rem; }
.facts { columns: 2 18rem; column-gap: 2.5rem; list-style: none; margin: 0; padding: 0; }
.facts li { break-inside: avoid; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.clients { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.clients li { padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: var(--step--1); }

/* ---------------------------------------------------------------- lightbox */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--overlay); color: #fff;
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; grid-template: 1fr auto / 1fr; animation: fade .2s ease-out; }
.lightbox figure { margin: 0; display: grid; place-items: center; padding: 3.5rem clamp(.5rem, 5vw, 5rem) 1rem; min-height: 0; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 7rem); width: auto; height: auto; object-fit: contain; }
.lightbox__bar { display: flex; justify-content: center; align-items: center; gap: 1.5rem; padding: .75rem 1rem 1.25rem; font-size: var(--step--1); }
.lightbox button {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .4); background: transparent; color: #fff; cursor: pointer;
}
.lightbox button:hover { background: rgb(255 255 255 / .12); }
.lightbox button svg { width: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.lightbox__close { position: absolute; top: 1rem; right: 1rem; }
@keyframes fade { from { opacity: 0; } }

/* ---------------------------------------------------------------- search */
.nav ul { align-items: center; }
.search-toggle {
  display: inline-flex !important; align-items: center; gap: .5rem;
  padding: .35rem .5rem .35rem .75rem !important; margin-left: -.25rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: none !important; color: var(--muted); transition: border-color .2s, color .2s;
}
.search-toggle:hover, .search-toggle[aria-current="page"] { color: var(--fg); border-color: var(--fg); }
.search-toggle svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-toggle span { font-size: var(--step--1); }
kbd {
  display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem;
  border: 1px solid var(--line); border-radius: 4px; background: var(--placeholder);
  font: 500 .72rem/1 ui-monospace, "SF Mono", Consolas, monospace; color: var(--muted);
}
@media (max-width: 34rem) {
  .search-toggle { padding: .45rem !important; border-color: transparent; }
  .search-toggle span, .search-toggle kbd { display: none; }
}

.search-form { position: relative; display: flex; align-items: center; flex: 1; }
.search-form svg {
  position: absolute; left: .9rem; width: 1.15rem; height: 1.15rem; pointer-events: none;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
.search-form input {
  width: 100%; padding: .8rem 1rem .8rem 2.75rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--placeholder); color: var(--fg); font: 400 var(--step-0) var(--font);
  outline: none; transition: border-color .2s, background .2s;
}
.search-form input:focus { border-color: var(--fg); background: var(--bg); }
.search-form input::-webkit-search-cancel-button { cursor: pointer; }

.search-panel {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0;
  width: min(30rem, 100vw); height: 100dvh; max-width: none; max-height: none;
  border: 0; border-left: 1px solid var(--line);
  background: var(--bg); color: var(--fg);
  box-shadow: -24px 0 60px rgb(0 0 0 / .18);
  flex-direction: column;
  translate: 100% 0;
  transition: translate .38s var(--ease), overlay .38s allow-discrete, display .38s allow-discrete;
}
.search-panel[open] { display: flex; translate: 0 0; }
@starting-style { .search-panel[open] { translate: 100% 0; } }
.search-panel::backdrop {
  background: rgb(0 0 0 / 0); backdrop-filter: blur(0);
  transition: background .38s, backdrop-filter .38s, overlay .38s allow-discrete, display .38s allow-discrete;
}
.search-panel[open]::backdrop { background: rgb(0 0 0 / .35); backdrop-filter: blur(3px); }
@starting-style { .search-panel[open]::backdrop { background: rgb(0 0 0 / 0); backdrop-filter: blur(0); } }
html.search-open { overflow: hidden; }

.search-panel__head { display: flex; gap: .75rem; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.search-panel__close {
  flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 0; background: none; color: var(--fg); cursor: pointer;
}
.search-panel__close:hover { background: var(--placeholder); }
.search-panel__close svg { width: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.search-panel__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1rem 1.25rem 2rem; }
.search-panel__foot {
  margin: 0; padding: .75rem 1.25rem; border-top: 1px solid var(--line);
  font-size: .75rem; color: var(--muted); display: flex; gap: .3rem; align-items: center; flex-wrap: wrap;
}
@media (hover: none) { .search-panel__foot { display: none; } }

.search-status { margin: 0 0 .75rem; font-size: var(--step--1); color: var(--muted); }
.search-status:empty { display: none; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.result {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; align-items: start;
  padding: .6rem; margin-inline: -.6rem; border-radius: 6px; text-decoration: none;
  transition: background .15s;
}
.result:hover, .result:focus-visible { background: var(--placeholder); outline-offset: 0; }
.result img, .result__icon { width: 100%; aspect-ratio: 720 / 598; object-fit: cover; border-radius: 3px; background: var(--placeholder); }
.result__icon { display: grid; place-items: center; border: 1px solid var(--line); }
.result__icon svg { width: 40%; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.result__body { display: grid; gap: .15rem; min-width: 0; }
.result__title { font-size: var(--step-0); font-weight: 600; line-height: 1.3; }
.result__meta { font-size: .78rem; color: var(--muted); }
.result__snippet { font-size: .82rem; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.results mark { background: color-mix(in srgb, #ffd60a 55%, transparent); color: inherit; border-radius: 2px; padding: 0 .05em; }

.search-empty h2 { font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: .5rem 0 .9rem; font-weight: 400; }
.search-empty h2 ~ h2 { margin-top: 2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.chips a, .chips button {
  display: inline-block; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--fg); font: 400 var(--step--1) var(--font); text-decoration: none; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.chips a:hover, .chips button:hover { border-color: var(--fg); }

.search-page { max-width: 46rem; padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.search-page h1 { font-size: var(--step-2); font-weight: 300; }
.search-page .search-form { margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------- misc */
.notfound { text-align: center; padding-block: 8rem 4rem; }
.notfound h1 { font-size: var(--step-3); font-weight: 300; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

@media print {
  .site-header, .site-footer, .filter, .pager, .slider__btn { display: none !important; }
  .project { grid-template-columns: 1fr; }
}
