/* ==========================================================================
   LIN YU — personal portfolio
   A quiet editorial system: warm paper, charcoal ink, restrained motion.
   ========================================================================== */

:root {
  --paper: #f3f1ec;
  --paper-deep: #e9e6df;
  --paper-warm: #eeebe4;
  --ink: #1b1b19;
  --ink-soft: #343430;
  --muted: #78776f;
  --muted-light: #9b9a91;
  --line: rgba(27, 27, 25, 0.16);
  --line-soft: rgba(27, 27, 25, 0.09);
  --dark: #191918;
  --dark-soft: #20201e;
  --dark-line: rgba(240, 238, 231, 0.14);
  --light: #f1efe9;
  --light-muted: #a9a69d;
  --accent: #7e8175;
  --nav-height: 72px;
  --page-pad: clamp(20px, 4.2vw, 64px);
  --ease-out: cubic-bezier(0.22, 0.7, 0.2, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: "Helvetica Neue", "Neue Haas Grotesk", Inter, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 300px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: #2b2b27;
  color: var(--paper);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 18px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  transition: top 0.25s var(--ease-out);
}

.skip-link:focus {
  top: 12px;
}

/* Grain: one quiet texture layer over the whole site. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ==========================================================================
   Top navigation
   ========================================================================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: 0 var(--page-pad);
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.45s var(--ease-soft),
    border-color 0.45s var(--ease-soft),
    backdrop-filter 0.45s var(--ease-soft);
}

.topbar.is-scrolled {
  background: rgba(243, 241, 236, 0.82);
  border-bottom-color: var(--line-soft);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}

.topbar.is-dark {
  background: rgba(25, 25, 24, 0.82);
  border-bottom-color: var(--dark-line);
}

.topbar.is-dark .brand-mark,
.topbar.is-dark .nav-link:hover,
.topbar.is-dark .nav-link.is-active {
  color: var(--light);
}

.topbar.is-dark .brand-sub,
.topbar.is-dark .nav-link,
.topbar.is-dark .topbar-meta {
  color: #928f87;
}

.topbar.is-dark .nav-num {
  color: #5e5c55;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  width: max-content;
  line-height: 1;
}

.brand-mark {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  transition: color 0.45s var(--ease-soft);
}

.brand-sub {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 0.45s var(--ease-soft);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3.4vw, 52px);
  height: 100%;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.09em;
  white-space: nowrap;
  transition: color 0.3s var(--ease-soft);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s var(--ease-out);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link.is-active::after {
  transform: scaleX(1);
}

.nav-num {
  color: var(--muted-light);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  transform: translateY(-1px);
}

.topbar-meta {
  justify-self: end;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.19em;
  white-space: nowrap;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  padding: calc(var(--nav-height) + 28px) var(--page-pad) 30px;
  overflow: hidden;
  isolation: isolate;
}

.hero-halo {
  position: absolute;
  z-index: -1;
  top: -22%;
  left: 50%;
  width: min(1080px, 92vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 48%, rgba(255, 252, 241, 0.9) 0%, rgba(249, 245, 234, 0.4) 35%, rgba(243, 241, 236, 0) 70%);
  filter: blur(10px);
  opacity: 0.9;
}

.hero-inner {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(100svh - var(--nav-height) - 58px);
}

.hero-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}

.hero-meta-top {
  padding-top: 4px;
}

.hero-meta-bottom {
  padding-bottom: 2px;
}

.hero-location {
  text-align: right;
}

.hero-copy {
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(40px, 8vh, 100px) 0;
}

.hero-role {
  margin: 0 0 clamp(26px, 4vh, 46px);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 400;
}

.hero-name {
  font-size: clamp(5.2rem, 12.8vw, 12.5rem);
  font-weight: 300;
  line-height: 0.88;
  letter-spacing: -0.065em;
  padding-left: 0.06em;
  color: var(--ink);
}

.hero-name-en {
  margin-top: clamp(22px, 3.4vh, 38px);
  padding-left: 0.56em;
  color: var(--muted);
  font-size: clamp(0.62rem, 0.9vw, 0.78rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.52em;
  text-transform: uppercase;
}

.hero-slogan {
  position: relative;
  margin: clamp(38px, 6vh, 68px) 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 1.25vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.9;
}

.hero-slogan::before {
  content: "";
  position: absolute;
  top: -22px;
  left: 50%;
  width: 1px;
  height: 12px;
  background: var(--line);
  transform: translateX(-50%);
}

.hero-count,
.hero-year {
  font-variant-numeric: tabular-nums;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease-soft);
}

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

.scroll-cue-line {
  position: relative;
  width: 1px;
  height: 34px;
  overflow: hidden;
  background: var(--line);
}

.scroll-cue-line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 1px;
  height: 100%;
  background: var(--ink);
  animation: scrollLine 2.4s var(--ease-soft) infinite;
}

@keyframes scrollLine {
  0% {
    transform: translateY(0);
  }
  55%,
  100% {
    transform: translateY(200%);
  }
}

/* Opening animation */
.hero-role,
.hero-name,
.hero-name-en,
.hero-slogan {
  opacity: 0;
  animation: heroRise 1.15s var(--ease-out) forwards;
}

.hero-role {
  animation-delay: 0.18s;
}

.hero-name {
  animation-delay: 0.32s;
}

.hero-name-en {
  animation-delay: 0.48s;
}

.hero-slogan {
  animation-delay: 0.62s;
}

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Works
   ========================================================================== */

.works-section {
  position: relative;
  padding: clamp(80px, 10vw, 150px) 0 clamp(110px, 13vw, 190px);
  background: var(--paper);
  border-top: 1px solid var(--line-soft);
}

.works-shell {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.kicker-index {
  color: var(--ink);
  letter-spacing: 0.06em;
}

.kicker-line {
  width: 36px;
  height: 1px;
  background: var(--line);
}

.works-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin-top: clamp(25px, 4vw, 46px);
}

.works-title,
.about-title {
  margin: 0;
  font-size: clamp(3.1rem, 7.2vw, 7.4rem);
  font-weight: 300;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.title-dot {
  color: var(--accent);
}

.works-lede {
  flex: 0 0 auto;
  margin: 0 0 0.4em;
  color: var(--muted);
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.12em;
  text-align: right;
  white-space: pre-line;
}

.works-toolbar {
  position: sticky;
  top: var(--nav-height);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: clamp(40px, 5vw, 64px) 0 clamp(30px, 3.5vw, 46px);
  padding: 13px 0;
  background: rgba(243, 241, 236, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
  backdrop-filter: blur(16px) saturate(1.05);
  border-bottom: 1px solid var(--line-soft);
}

.filters {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.3vw, 34px);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.3s var(--ease-soft);
}

.filter-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s var(--ease-out);
}

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

.filter-btn.is-active {
  color: var(--ink);
}

.filter-btn.is-active::after {
  transform: scaleX(1);
}

.filter-count {
  color: var(--muted-light);
  font-size: 8.5px;
  letter-spacing: 0;
  transform: translateY(-3px);
  font-variant-numeric: tabular-nums;
}

.toolbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar-count {
  font-size: 10px;
  letter-spacing: 0.09em;
  font-variant-numeric: tabular-nums;
}

.toolbar-divider {
  width: 1px;
  height: 13px;
  background: var(--line);
}

.layout-label {
  font-size: 9px;
  letter-spacing: 0.16em;
}

.layout-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-soft);
}

.layout-btn {
  display: grid;
  place-items: center;
  width: 31px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 0.3s var(--ease-soft),
    color 0.3s var(--ease-soft);
}

.layout-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

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

.layout-btn.is-active {
  background: var(--ink);
  color: var(--paper);
}

.works-grid {
  position: relative;
}

.works-grid.masonry {
  column-count: 3;
  column-gap: clamp(24px, 3vw, 46px);
}

.works-grid.masonry .work-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 clamp(38px, 4.8vw, 68px);
  break-inside: avoid;
}

.works-grid.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3.8vw, 58px) clamp(24px, 3vw, 46px);
}

.work-card {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

.work-card.is-in {
  opacity: 1;
  transform: translateY(0);
}

.work-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: zoom-in;
}

.work-media {
  position: relative;
  overflow: hidden;
  background: #e6e3db;
  aspect-ratio: var(--ar, 4 / 5);
}

.work-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 15, 13, 0.28), rgba(15, 15, 13, 0) 42%);
  opacity: 0;
  transition: opacity 0.55s var(--ease-soft);
  pointer-events: none;
}

.work-media img {
  width: 100%;
  height: auto;
  opacity: 0;
  transform: scale(1.001);
  transition:
    opacity 0.8s var(--ease-soft),
    transform 1.2s var(--ease-out);
}

.works-grid.grid .work-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.works-grid.grid .work-media {
  aspect-ratio: 4 / 5;
}

.work-media.is-loaded img {
  opacity: 1;
}

.work-overlay {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f7f4ed;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.45s var(--ease-soft),
    transform 0.45s var(--ease-out);
  pointer-events: none;
}

.work-index {
  font-variant-numeric: tabular-nums;
}

.work-view {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.work-view::after {
  content: "↗";
  font-size: 12px;
  letter-spacing: 0;
}

.work-card:hover .work-media img {
  transform: scale(1.035);
}

.work-card:hover .work-media::after,
.work-card:hover .work-overlay,
.work-open:focus-visible .work-overlay {
  opacity: 1;
}

.work-card:hover .work-overlay,
.work-open:focus-visible .work-overlay {
  transform: translateY(0);
}

.work-info {
  padding-top: 15px;
}

.work-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.work-meta-sep {
  width: 11px;
  height: 1px;
  background: var(--line);
}

.work-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 7px;
}

.work-title {
  margin: 0;
  font-size: clamp(1rem, 1.25vw, 1.16rem);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.work-year {
  flex: 0 0 auto;
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

.work-desc {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.85;
  letter-spacing: 0.025em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.work-caption-empty {
  display: none;
}

.works-empty {
  padding: 100px 0 60px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  color: var(--muted);
}

.works-empty p {
  margin: 0 0 6px;
  font-size: 15px;
}

.works-empty span {
  font-size: 11px;
  letter-spacing: 0.08em;
}

.load-status {
  min-height: 28px;
  padding-top: 34px;
  color: var(--muted-light);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.load-sentinel {
  width: 100%;
  height: 1px;
}

/* ==========================================================================
   About + contact
   ========================================================================== */

.about {
  position: relative;
  padding: clamp(90px, 11vw, 150px) 0 0;
  background: var(--dark);
  color: var(--light);
}

.about-shell {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.dark-kicker {
  color: var(--light-muted);
}

.dark-kicker .kicker-index {
  color: var(--light);
}

.dark-kicker .kicker-line {
  background: var(--dark-line);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: clamp(60px, 9vw, 160px);
  padding: clamp(48px, 6vw, 84px) 0 clamp(80px, 10vw, 140px);
}

.about-title {
  font-size: clamp(3.4rem, 7vw, 7rem);
}

.about-title .title-dot {
  color: #8b8b80;
}

.about-text {
  max-width: 600px;
  margin-top: clamp(38px, 4vw, 58px);
}

.about-text p {
  margin: 0;
  color: #c8c5bc;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 2.15;
  letter-spacing: 0.045em;
  white-space: pre-line;
}

.about-text p:first-child {
  color: #e8e5dd;
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 2.05;
}

.about-text p + p {
  margin-top: 22px;
}

.about-closing {
  position: relative;
  margin: clamp(45px, 5vw, 72px) 0 0;
  padding-left: 24px;
  color: #9e9b92;
  font-size: 13px;
  letter-spacing: 0.1em;
  line-height: 1.9;
}

.about-closing::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 12px;
  height: 1px;
  background: #66665e;
}

.contact-panel {
  align-self: start;
  padding-left: clamp(30px, 4vw, 64px);
  border-left: 1px solid var(--dark-line);
}

.contact-lead {
  margin: 0 0 clamp(34px, 4vw, 48px);
  color: #c8c5bc;
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.95;
  letter-spacing: 0.07em;
  white-space: pre-line;
}

.contact-list {
  border-top: 1px solid var(--dark-line);
}

.contact-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  border-bottom: 1px solid var(--dark-line);
}

.contact-label {
  color: #77776f;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.contact-value {
  min-width: 0;
  color: #e8e5dd;
  font-size: 13px;
  letter-spacing: 0.045em;
  overflow-wrap: anywhere;
}

a.contact-value {
  transition: color 0.3s var(--ease-soft);
}

a.contact-value:hover {
  color: #fffdf7;
}

.copy-btn {
  padding: 4px 0 4px 10px;
  border: 0;
  background: none;
  color: #72726a;
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.3s var(--ease-soft),
    color 0.3s var(--ease-soft);
}

.contact-item:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}

.copy-btn:hover {
  color: #e8e5dd;
}

.contact-email {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  padding-bottom: 9px;
  border-bottom: 1px solid #5f5f58;
  color: #f0ede6;
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  font-weight: 400;
  letter-spacing: 0.015em;
  transition: border-color 0.4s var(--ease-soft);
}

.contact-email:hover {
  border-bottom-color: #efede7;
}

.contact-email-arrow {
  font-size: 0.8em;
  transition: transform 0.4s var(--ease-out);
}

.contact-email:hover .contact-email-arrow {
  transform: translate(3px, -3px);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 26px;
}

.social-link {
  position: relative;
  color: #949189;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease-soft);
}

.social-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.social-link:hover {
  color: #e8e5dd;
}

.social-link:hover::after {
  transform: scaleX(1);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 0 32px;
  border-top: 1px solid var(--dark-line);
}

.footer-copy {
  margin: 0;
  color: #77776f;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 38px);
}

.studio-link,
.back-top {
  color: #8b8981;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease-soft);
}

.studio-link:hover,
.back-top:hover {
  color: #efede7;
}

.back-top span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.3s var(--ease-out);
}

.back-top:hover span {
  transform: translateY(-2px);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  color: var(--light);
  background: #121211;
}

.lightbox-bg {
  position: absolute;
  inset: 0;
  background: #121211;
  opacity: 0;
  transition: opacity 0.45s var(--ease-soft);
}

.lightbox-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  padding: 22px clamp(18px, 4vw, 56px) 18px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.45s var(--ease-soft),
    transform 0.45s var(--ease-out);
}

.lightbox.is-open .lightbox-bg {
  opacity: 0.985;
}

.lightbox.is-open .lightbox-shell {
  opacity: 1;
  transform: none;
}

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
  padding-bottom: 12px;
  color: #838078;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lb-counter {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

.lb-category {
  margin-left: auto;
}

.lb-close {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0 7px 18px;
  border: 0;
  background: none;
  color: #a8a49b;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s var(--ease-soft);
}

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

.lb-close-icon {
  font-size: 21px;
  font-weight: 300;
  line-height: 0.7;
  letter-spacing: 0;
  transform: translateY(-1px);
}

.lb-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: clamp(28px, 4.3vw, 74px);
  flex: 1;
  min-height: 0;
  padding: 10px 0 12px;
}

.lb-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.lb-image-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

#lbImage {
  max-width: 100%;
  max-height: calc(100svh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s var(--ease-soft);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

#lbImage.is-loaded {
  opacity: 1;
}

.lb-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 1px solid rgba(241, 239, 233, 0.18);
  border-top-color: rgba(241, 239, 233, 0.8);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  opacity: 1;
  transition: opacity 0.25s var(--ease-soft);
}

.lb-spinner.is-hidden {
  opacity: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.lb-info {
  align-self: end;
  max-width: 300px;
  padding-bottom: 28px;
}

.lb-info-index {
  display: block;
  margin-bottom: 20px;
  color: #5c5a54;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.lb-title {
  margin: 0;
  color: #f1efe9;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.015em;
}

.lb-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  color: #838078;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lb-sep {
  width: 11px;
  height: 1px;
  background: #4e4c46;
}

.lb-desc {
  margin: 24px 0 0;
  color: #a9a59c;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.035em;
  white-space: pre-line;
}

.lb-hint {
  margin: 36px 0 0;
  color: #58564f;
  font-size: 8.5px;
  line-height: 1.9;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lb-bottom {
  flex: 0 0 auto;
  padding-top: 14px;
  border-top: 1px solid rgba(240, 238, 231, 0.12);
}

.lb-progress {
  height: 1px;
  background: rgba(240, 238, 231, 0.09);
}

.lb-progress span {
  display: block;
  width: 0;
  height: 1px;
  background: #c9c5ba;
  transition: width 0.55s var(--ease-out);
}

.lb-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 13px;
}

.lb-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 94px;
  padding: 9px 14px;
  border: 1px solid rgba(240, 238, 231, 0.18);
  border-radius: 999px;
  background: transparent;
  color: #bcb8ae;
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition:
    border-color 0.3s var(--ease-soft),
    color 0.3s var(--ease-soft),
    background-color 0.3s var(--ease-soft);
}

.lb-arrow:first-child {
  justify-content: flex-start;
}

.lb-arrow:last-child {
  justify-content: flex-end;
}

.lb-arrow:hover {
  border-color: rgba(240, 238, 231, 0.5);
  background: rgba(240, 238, 231, 0.05);
  color: var(--light);
}

.lb-arrow-label {
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Toast / misc
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1200;
  max-width: calc(100vw - 40px);
  padding: 10px 18px;
  border: 1px solid rgba(243, 241, 236, 0.14);
  background: rgba(25, 25, 24, 0.94);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s var(--ease-soft),
    transform 0.3s var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .works-grid.masonry {
    column-count: 2;
  }

  .works-grid.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.8fr);
    gap: 70px;
  }
}

@media (max-width: 960px) {
  :root {
    --nav-height: 64px;
  }

  .topbar-meta {
    display: none;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    gap: 26px;
  }

  .primary-nav {
    justify-self: end;
    gap: clamp(18px, 4vw, 38px);
  }

  .nav-link::after {
    bottom: 16px;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 22px);
  }

  .hero-inner {
    min-height: calc(100svh - var(--nav-height) - 50px);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 70px;
  }

  .contact-panel {
    max-width: 600px;
    padding-left: 0;
    border-left: 0;
  }

  .contact-lead {
    padding-top: 40px;
    border-top: 1px solid var(--dark-line);
  }

  .lb-main {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 30px;
  }
}

@media (max-width: 760px) {
  :root {
    --page-pad: clamp(18px, 5vw, 30px);
  }

  .brand-sub {
    display: none;
  }

  .topbar {
    gap: 16px;
  }

  .nav-num {
    display: none;
  }

  .nav-link {
    font-size: 12px;
    letter-spacing: 0.05em;
  }

  .primary-nav {
    gap: 22px;
  }

  .hero {
    min-height: 100svh;
    padding-bottom: 22px;
  }

  .hero-meta-row {
    font-size: 8px;
    letter-spacing: 0.13em;
  }

  .hero-location {
    max-width: 42vw;
  }

  .hero-name {
    font-size: clamp(4.7rem, 21vw, 8rem);
  }

  .hero-slogan {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
  }

  .scroll-cue {
    gap: 7px;
    font-size: 7.5px;
  }

  .scroll-cue-line {
    height: 26px;
  }

  .hero-count {
    display: none;
  }

  .works-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .works-lede {
    max-width: 280px;
    margin: 0;
    text-align: left;
  }

  .desktop-only {
    display: none;
  }

  .works-toolbar {
    gap: 14px;
    padding: 12px 0;
  }

  .filters {
    gap: 20px;
  }

  .filter-btn {
    font-size: 11px;
  }

  .toolbar-count,
  .toolbar-divider,
  .layout-label {
    display: none;
  }

  .layout-btn {
    width: 29px;
    height: 27px;
  }

  .works-grid.masonry {
    column-count: 1;
  }

  .works-grid.masonry .work-card {
    margin-bottom: 42px;
  }

  .works-grid.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 14px;
  }

  .works-grid.grid .work-title {
    font-size: 0.94rem;
  }

  .works-grid.grid .work-desc {
    display: none;
  }

  .works-grid.grid .work-meta {
    font-size: 8px;
  }

  .work-overlay {
    display: none;
  }

  .work-desc {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .about {
    padding-top: 84px;
  }

  .about-grid {
    padding-top: 42px;
    gap: 56px;
  }

  .about-title {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .about-text p {
    font-size: 13.5px;
    line-height: 2.05;
  }

  .contact-item {
    grid-template-columns: 74px minmax(0, 1fr) auto;
    min-height: 46px;
  }

  .copy-btn {
    opacity: 1;
  }

  .contact-email {
    font-size: 1.1rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 28px;
  }

  .footer-links {
    width: 100%;
    justify-content: space-between;
  }

  .lightbox-shell {
    padding: 16px 16px 14px;
  }

  .lb-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 4px 0 8px;
  }

  .lb-visual {
    min-height: 0;
  }

  #lbImage {
    max-height: calc(100svh - 250px);
  }

  .lb-info {
    align-self: auto;
    max-width: none;
    padding: 0 2px;
  }

  .lb-info-index,
  .lb-hint,
  .lb-category {
    display: none;
  }

  .lb-title {
    font-size: 1.3rem;
  }

  .lb-desc {
    display: -webkit-box;
    margin-top: 13px;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 1.8;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .lb-bottom {
    padding-top: 10px;
  }

  .lb-nav {
    justify-content: space-between;
    padding-top: 10px;
  }

  .lb-arrow {
    min-width: 0;
    padding: 8px 13px;
  }

  .lb-top {
    padding-bottom: 8px;
  }

  .lb-close {
    padding-left: 12px;
  }

  .lb-close span:first-child {
    display: none;
  }
}

@media (max-width: 430px) {
  .brand-mark {
    font-size: 13px;
  }

  .primary-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 11.5px;
  }

  .hero-meta-top span:first-child {
    letter-spacing: 0.1em;
  }

  .hero-role {
    font-size: 9px;
    letter-spacing: 0.2em;
  }

  .hero-name-en {
    letter-spacing: 0.38em;
    padding-left: 0.38em;
  }

  .works-grid.grid {
    grid-template-columns: 1fr;
  }

  .works-grid.grid .work-desc {
    display: -webkit-box;
  }

  .contact-item {
    grid-template-columns: 65px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .contact-label {
    font-size: 8px;
  }

  .contact-value {
    font-size: 12px;
  }
}

@media (max-height: 660px) and (min-width: 761px) {
  .hero-copy {
    padding: 30px 0;
  }

  .hero-name {
    font-size: clamp(4.6rem, 10vw, 8rem);
  }

  .hero-slogan {
    margin-top: 32px;
  }

  .hero-role {
    margin-bottom: 20px;
  }

  .lb-info {
    padding-bottom: 0;
  }

  .lb-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .hero-role,
  .hero-name,
  .hero-name-en,
  .hero-slogan,
  .work-card {
    opacity: 1;
    transform: none;
  }
}
