/* =============================================================================
   Pages — home, projects, project detail, about, contact, recruitment
   ========================================================================== */

/* ── Home: full-bleed hero ────────────────────────────────────────────────── */

.hero {
  position: relative;
  /* dvh keeps the hero flush with the visible viewport on mobile, where the
     URL bar retracts. Engines that don't know the unit would otherwise drop
     the declaration entirely and collapse the hero to its content height, so
     keep the plain vh fallback first. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}

.hero__media,
.hero__media video,
.hero__media canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero__media img.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}

.hero__media.has-poster img.hero__poster {
  opacity: 1;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 90% at 50% 45%, rgba(10, 10, 11, 0.1) 0%, rgba(10, 10, 11, 0.72) 62%, rgba(10, 10, 11, 0.96) 100%);
}

.hero__grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}

.hero__content {
  position: relative;
  text-align: center;
  padding: 0 var(--gutter);
  max-width: 1100px;
}

/* The hero mark is a wide, short lockup (the INTERACTIVE · DESIGN · MEDIA
   kicker), so it is sized to stay a supporting line rather than dominate. */
.hero__logo {
  width: clamp(180px, 28vw, 400px);
  height: auto;
  margin: 0 auto var(--sp-6);
  animation: heroFade 1.4s var(--ease) both;
}

.hero__title {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  letter-spacing: -0.03em;
  font-weight: 500;
  animation: heroFade 1.4s 0.15s var(--ease) both;
  text-wrap: balance;
}

.hero__tagline {
  margin-top: var(--sp-6);
  color: rgba(244, 242, 238, 0.72);
  font-size: clamp(0.9375rem, 1.3vw, 1.125rem);
  line-height: var(--lh-relaxed);
  max-width: 56ch;
  margin-inline: auto;
  animation: heroFade 1.4s 0.3s var(--ease) both;
}

.hero__actions {
  margin-top: var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  animation: heroFade 1.4s 0.45s var(--ease) both;
}

@keyframes heroFade {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__scroll {
  position: absolute;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.hero__scroll i {
  display: block;
  width: 1px;
  height: 46px;
  background: linear-gradient(180deg, var(--fg-mute), transparent);
  position: relative;
  overflow: hidden;
}

.hero__scroll i::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 14px;
  background: var(--fg);
  animation: scrollCue 2.1s var(--ease-inout) infinite;
}

@keyframes scrollCue {
  0% {
    transform: translateY(-100%);
  }
  60%,
  100% {
    transform: translateY(340%);
  }
}

.hero__marquee {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(244, 242, 238, 0.1);
  background: rgba(10, 10, 11, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding-block: var(--sp-3);
  overflow: hidden;
}

.hero__marquee .marquee__item {
  height: 28px;
}

.hero__marquee .marquee__item img {
  max-height: 26px;
  max-width: 96px;
}

@media (max-width: 720px) {
  .hero__marquee {
    display: none;
  }
}

/* ── Home: sections ───────────────────────────────────────────────────────── */

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 7rem);
}

.intro-grid__aside {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.intro-grid__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.intro-grid__body p {
  color: var(--fg-dim);
  line-height: var(--lh-relaxed);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
}

.capability-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.capability {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(1.5rem, 3vw, 2.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-height: 210px;
  transition: background var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.capability::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur) var(--ease);
}

.capability:hover {
  background: var(--bg-soft);
}

.capability:hover::after {
  transform: scaleX(1);
}

.capability__index {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--fg-mute);
  letter-spacing: var(--ls-label);
}

.capability__title {
  font-size: var(--fs-h3);
  font-weight: 500;
  margin-top: auto;
  line-height: var(--lh-snug);
}

@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .capability-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .capability-list {
    grid-template-columns: 1fr;
  }
}

/* CTA band ----------------------------------------------------------------- */

.cta-band {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  padding-block: clamp(4rem, 9vw, 8rem);
  text-align: center;
}

.cta-band__glow {
  position: absolute;
  width: 60vw;
  height: 60vw;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 62%);
  pointer-events: none;
}

.cta-band__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
}

/* ── Projects listing ─────────────────────────────────────────────────────── */

.projects-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: var(--sp-7);
  flex-wrap: wrap;
}

.projects-groups {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vw, 5rem);
}

.year-group__head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}

.year-group__year {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  line-height: 1;
}

.year-group__count {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-mute);
}

/* ── Project detail ───────────────────────────────────────────────────────── */

.detail-hero {
  position: relative;
  min-height: clamp(400px, 68vh, 760px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  padding-top: calc(var(--header-h) + var(--sp-8));
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

.detail-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.detail-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: slowZoom 18s var(--ease-inout) both;
}

@keyframes slowZoom {
  from {
    transform: scale(1.14);
  }
  to {
    transform: scale(1.02);
  }
}

.detail-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 10, 11, 0.55) 0%, rgba(10, 10, 11, 0.22) 40%, rgba(10, 10, 11, 0.97) 100%);
}

.detail__title {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: 500;
  margin-top: var(--sp-4);
  max-width: 22ch;
  text-wrap: balance;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-5);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: var(--sp-6);
}

.meta-grid__item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.meta-grid__label {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.meta-grid__value {
  font-size: var(--fs-body);
  color: var(--fg);
}

@media (max-width: 760px) {
  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-6) var(--sp-5);
  }
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.75rem, 1.6vw, 1.5rem);
}

.detail-gallery figure {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.detail-gallery figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.detail-gallery figure:hover img {
  transform: scale(1.04);
}

.detail-gallery .g-full {
  grid-column: span 12;
}
.detail-gallery .g-half {
  grid-column: span 6;
}
.detail-gallery .g-third {
  grid-column: span 4;
}

.detail-gallery .g-full img {
  aspect-ratio: 16 / 9;
}
.detail-gallery .g-half img {
  aspect-ratio: 4 / 3;
}
.detail-gallery .g-third img {
  aspect-ratio: 1 / 1;
}

@media (max-width: 760px) {
  .detail-gallery .g-half,
  .detail-gallery .g-third {
    grid-column: span 12;
  }
}

.next-project {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-soft);
  isolation: isolate;
  min-height: clamp(260px, 38vw, 420px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.next-project__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.next-project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.4);
  transition: transform 1.2s var(--ease), filter var(--dur) var(--ease);
}

.next-project:hover .next-project__media img {
  transform: scale(1.05);
  filter: grayscale(0);
}

.next-project__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 10, 11, 0.72), rgba(10, 10, 11, 0.88));
  transition: opacity var(--dur) var(--ease);
}

.next-project:hover .next-project__scrim {
  opacity: 0.78;
}

.next-project__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-5);
}

.next-project__title {
  font-size: clamp(1.5rem, 3.4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-snug);
  max-width: 24ch;
}

/* ── About ────────────────────────────────────────────────────────────────── */

.about-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.about-figure {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
}

.about-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.about-body p {
  color: var(--fg-dim);
  line-height: var(--lh-relaxed);
  font-size: clamp(1rem, 1.15vw, 1.125rem);
}

@media (max-width: 900px) {
  .about-hero-grid {
    grid-template-columns: 1fr;
  }

  .about-figure {
    aspect-ratio: 16 / 10;
  }
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-6);
}

.approach-step {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line-strong);
}

.approach-step__index {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--accent);
  letter-spacing: var(--ls-label);
}

.approach-step__title {
  font-size: var(--fs-h3);
  font-weight: 500;
}

.approach-step p {
  color: var(--fg-dim);
  font-size: var(--fs-small);
  line-height: var(--lh-relaxed);
}

@media (max-width: 900px) {
  .approach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .approach-grid {
    grid-template-columns: 1fr;
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-5);
  border-top: 1px solid var(--line);
  padding-top: var(--sp-6);
}

@media (max-width: 700px) {
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Contact ──────────────────────────────────────────────────────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-7);
}

.contact-block {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.contact-block__label {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.contact-block__value {
  font-size: clamp(1.0625rem, 1.5vw, 1.375rem);
  line-height: var(--lh-snug);
  color: var(--fg);
  max-width: 26ch;
}

.contact-block__value a:hover {
  color: var(--accent);
}

.map-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
}

.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-soft);
}

/* Leaflet ships a light theme; align its chrome with the dark site. */
.map-frame .leaflet-container {
  background: var(--bg-soft);
  font-family: inherit;
}

/* 高德 ships light tiles; the same treatment the old OSM embed used keeps the
   map in the site's dark palette without affecting the controls. */
.map-frame .leaflet-tile-pane {
  filter: grayscale(1) invert(0.92) contrast(0.9);
}

.map-frame .leaflet-control-attribution {
  background: rgba(10, 10, 11, 0.72);
  color: var(--fg-mute);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-sm) 0 0 0;
}

.map-frame .leaflet-control-attribution a {
  color: inherit;
}

.map-frame .leaflet-control-zoom a {
  background: rgba(10, 10, 11, 0.72);
  color: var(--fg);
  border-color: var(--line);
}

.map-frame .leaflet-control-zoom a:hover {
  background: rgba(10, 10, 11, 0.92);
  color: var(--accent);
}

.map-pin {
  display: grid;
  place-items: center;
}

.map-pin span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--sp-6);
  text-align: center;
  color: var(--fg-mute);
  font-size: var(--fs-small);
  letter-spacing: var(--ls-label);
}

.wechat-card {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.wechat-card img {
  width: 104px;
  height: 104px;
  border-radius: var(--radius);
  background: #fff;
  padding: 4px;
}

.wechat-card__text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.wechat-card__text strong {
  font-weight: 500;
}

.wechat-card__text span {
  font-size: var(--fs-small);
  color: var(--fg-mute);
  line-height: var(--lh-normal);
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .map-frame {
    aspect-ratio: 3 / 2;
  }
}

/* ── Recruitment / job detail ─────────────────────────────────────────────── */

.job-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.job-aside {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-6));
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.job-aside__row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--line);
}

.job-aside__row:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.job-aside__label {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.job-aside__value {
  font-size: var(--fs-body);
}

@media (max-width: 900px) {
  .job-detail-grid {
    grid-template-columns: 1fr;
  }

  .job-aside {
    position: static;
  }
}

.apply-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.apply-panel a {
  color: var(--accent);
  word-break: break-all;
}

.apply-panel a:hover {
  text-decoration: underline;
}
