/* ==========================================================================
   Unified Case Study Design System
   Pure Flat · Zero-Shadow · Zero-Wireframe · Youthful Modern Tonal Layout
   Inspired by crisp Cosmos / Twinkle visual craft on pure white canvas.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('assets/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Garamond;
  src: url('assets/serif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --case-bg: #ffffff;
  --case-surface: #f5f6f8;
  --case-surface-2: #eceef3;
  --case-ink: #111113;
  --case-muted: #686a76;
  --case-soft: #9294a0;
  --case-accent: #4c6ef5;
  --case-accent-soft: #eef2ff;
  --case-measure: 1060px;
}

body.original-hohomart {
  --case-accent: #2478d2;
  --case-accent-soft: #ecf5fd;
}

body.original-anta {
  --case-accent: #dc3616;
  --case-accent-soft: #fef1ee;
  --case-eyebrow-bg: linear-gradient(90deg, #ad1319 0%, #cc2e13 50%, #eb490e 100%);
}

body.original-midea {
  --case-accent: #1864e8;
  --case-accent-soft: #eef4ff;
}

body.original-memory-palace {
  --case-accent: #0ca6a6;
  --case-accent-soft: #eaf7f7;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body,
body.original-hohomart,
body.original-anta,
body.original-midea,
body.original-memory-palace {
  margin: 0;
  color: var(--case-ink);
  background: #ffffff !important;
  font-family: "Inter", 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif !important;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Sticky Flat Borderless Header ---------- */
body .original-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: 68px;
  padding: 0 clamp(24px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0 !important;
  box-shadow: none !important;
  color: var(--case-ink);
}

.original-header .original-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--case-ink);
}

.original-header .original-brand img {
  width: 30px;
  height: 30px;
  display: block;
}

.original-header .brand-wordmark {
  font-size: 17.5px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--case-ink);
}

.original-header .brand-wordmark i {
  font-style: normal;
  color: var(--case-accent);
}

.original-header .header-sep {
  color: #d0d2dc;
  font-size: 13px;
  user-select: none;
}

.original-header > span {
  font-size: 13.5px !important;
  color: var(--case-muted) !important;
  letter-spacing: 0;
}

.original-header .original-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px !important;
  font-size: 13px !important;
}

.original-header svg.icon,
.original-footer svg.icon,
.case-lightbox svg.icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.original-header .header-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  line-height: 1 !important;
  padding: 0 13px;
  border-radius: 10px;
  border: 0 !important;
  background: var(--case-surface);
  color: #202127;
  font-size: 13px !important;
  font-weight: 500;
  box-shadow: none !important;
  transition: background 0.18s ease;
}

.original-header .header-menu summary::after {
  display: none !important;
}

.original-header .header-menu summary svg.icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.original-header .header-menu[open] summary svg.icon {
  transform: rotate(180deg);
}

.original-header .header-menu summary:hover {
  background: var(--case-surface-2);
}

.original-header .header-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 10px;
  background: #141417;
  border: 0 !important;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.original-header .header-back-pill:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Header dropdown menus — Flat Tonal Sheet, Zero Border, Zero Shadow */
.original-header .header-menu nav {
  top: calc(100% + 8px) !important;
  right: 0 !important;
  width: 268px !important;
  padding: 8px !important;
  background: #f3f4f7 !important;
  border: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
  backdrop-filter: none;
}

.original-header .header-menu nav a {
  display: flex !important;
  align-items: baseline;
  gap: 10px;
  min-height: 36px !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  color: #5b5d69 !important;
  transition: background 0.16s ease, color 0.16s ease;
}

.original-header .header-menu nav a:hover {
  background: #ffffff !important;
  color: #111113 !important;
  text-decoration: none !important;
}

.original-header .header-menu nav a[aria-current] {
  background: #ffffff !important;
  color: #111113 !important;
  font-weight: 500;
}

.original-header .header-menu nav a .nav-step-num {
  font-size: 11.5px;
  font-weight: 500;
  color: #9b9da9;
  min-width: 18px;
}

/* Reading Progress Bar disabled globally */
.case-progress-bar {
  display: none !important;
}

.case-progress-bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--case-accent);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* ---------- Unified Main Column ---------- */
body .case-layout,
body.original-hohomart .case-layout {
  --visual-width: 100%;
  width: min(var(--case-measure), calc(100% - 148px)) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* ---------- Opening Hero — Pure Flat, Borderless, Youthful ---------- */
body .project-opening,
body.original-hohomart .project-opening {
  display: grid !important;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr) !important;
  gap: clamp(32px, 4.5vw, 68px) !important;
  align-items: center !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
  padding: clamp(44px, 5.5vh, 72px) 0 clamp(52px, 6vh, 72px) !important;
  border-bottom: 0 !important;
  overflow: visible !important;
}

body .project-heading,
body.original-hohomart .project-heading {
  width: 100% !important;
  max-width: 470px !important;
  margin: 0 !important;
}

body .project-heading .web-eyebrow,
body.original-hohomart .project-heading .web-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px !important;
  border-radius: 999px;
  background: var(--case-eyebrow-bg, var(--case-accent)) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  color: #ffffff !important;
  margin: 0 0 18px !important;
}

body .project-heading .web-eyebrow::before {
  display: none !important;
}

body .project-heading h1,
body.original-hohomart .project-heading h1,
body.original-anta .project-heading h1 {
  margin: 0 !important;
  font-size: clamp(34px, 3.5vw, 52px) !important;
  font-weight: 500 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.045em !important;
  color: #111113 !important;
  max-width: none !important;
}

body .project-heading .project-lead,
body.original-hohomart .project-heading .project-lead {
  margin: 16px 0 28px !important;
  font-size: clamp(16px, 1.3vw, 19px) !important;
  font-weight: 400 !important;
  line-height: 1.72 !important;
  color: var(--case-muted) !important;
  max-width: 430px !important;
}

body .project-meta,
body.original-hohomart .project-meta {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 11px !important;
  padding: 20px 22px !important;
  border-radius: 20px !important;
  background: var(--case-surface) !important;
  border: 0 !important;
  max-width: 450px !important;
}

body .project-meta > div,
body.original-hohomart .project-meta > div {
  display: grid !important;
  grid-template-columns: 118px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: baseline !important;
}

body .meta-label,
body.original-hohomart .meta-label {
  font-size: 12.5px !important;
  color: var(--case-soft) !important;
  line-height: 1.65 !important;
  margin: 0 !important;
}

body .meta-value,
body.original-hohomart .meta-value {
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #202127 !important;
  line-height: 1.65 !important;
}

body .project-heading .project-notes,
body.original-hohomart .project-heading .project-notes {
  margin: 16px 0 0 !important;
  padding: 0 !important;
  border-top: 0 !important;
  list-style: none !important;
  max-width: 450px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body .project-heading .project-notes li,
body.original-hohomart .project-heading .project-notes li {
  display: inline-block;
  padding: 5px 12px !important;
  border-radius: 999px;
  background: var(--case-surface);
  font-size: 12px !important;
  line-height: 1.5 !important;
  color: #5b5d69 !important;
  margin: 0 !important;
}

/* Unified Hero Artwork Frame — Zero Border, Zero Shadow */
body .project-opening .chapter-art,
body.original-hohomart .hoho-visual {
  width: 100% !important;
  max-width: 560px !important;
  height: auto !important;
  max-height: 430px !important;
  aspect-ratio: 16 / 11 !important;
  justify-self: end !important;
  margin: 0 !important;
  border-radius: 26px !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body.original-anta .project-opening .chapter-art,
body.original-midea .project-opening .chapter-art {
  background: #111216 !important;
}

body.original-memory-palace .project-opening .chapter-art {
  background: #eef6f7 !important;
}

body .project-opening .original-artwork {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
}

body.original-memory-palace .project-opening .original-artwork {
  object-fit: contain !important;
}

/* ---------- Chapters — Open Whitespace Rhythm, Zero Wireframe Dividers ---------- */
body .web-chapter:not(.project-opening),
body.original-hohomart .web-chapter:not(.project-opening) {
  display: block !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 64px 0 28px !important;
  border-top: 0 !important;
  scroll-margin-top: 86px !important;
}

body .web-chapter.is-first-chapter {
  padding-top: 40px !important;
}

body .web-chapter.is-continuation {
  padding-top: 20px !important;
  padding-bottom: 20px !important;
}

body .web-chapter.is-continuation .chapter-heading {
  margin-bottom: 14px !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  justify-content: flex-end !important;
}

body .web-chapter.is-continuation .chapter-heading::before {
  display: none !important;
}

body .web-chapter.is-continuation .chapter-heading h2,
body .web-chapter.is-continuation .chapter-heading .chapter-num {
  display: none !important;
}

body .web-chapter.is-continuation .chapter-heading > p {
  font-size: 12.5px !important;
  color: #7c808d !important;
}

/* Swiss Architectural Editorial Chapter Heading */
body .chapter-heading,
body.original-hohomart .chapter-heading {
  position: relative;
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 28px !important;
  padding-top: 20px !important;
  border-top: 1px solid rgba(17, 17, 19, 0.09) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 24px !important;
}

body .chapter-heading::before,
body.original-hohomart .chapter-heading::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 34px;
  height: 2px;
  background: var(--case-accent);
  border-radius: 1px;
}

.chapter-title-group {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.chapter-num {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  padding: 0 16px 0 0;
  border-radius: 0;
  background: transparent;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: var(--case-accent);
  flex: none;
}

.chapter-num::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(16deg);
  width: 1px;
  height: 16px;
  background: rgba(17, 17, 19, 0.16);
}

body .chapter-heading h2,
body.original-hohomart .chapter-heading h2 {
  margin: 0 !important;
  font-size: clamp(23px, 2.2vw, 29px) !important;
  font-weight: 550 !important;
  line-height: 1.24 !important;
  letter-spacing: -0.03em !important;
  color: #111113 !important;
}

body .chapter-heading > p,
body.original-hohomart .chapter-heading > p {
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  background: rgba(17, 17, 19, 0.035) !important;
  border: 1px solid rgba(17, 17, 19, 0.06) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.01em !important;
  color: #5e6270 !important;
  max-width: 420px !important;
  text-align: right !important;
  flex: none !important;
}

body .chapter-heading > p::before,
body.original-hohomart .chapter-heading > p::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 1.5px;
  background: var(--case-accent);
  opacity: 0.85;
  flex: none;
}

/* Gallery Canvas Mats — Pure Flat Tonal Surface, Zero Border, Zero Shadow */
body .web-chapter:not(.project-opening) .chapter-art,
body.original-hohomart .web-chapter:not(.project-opening) .chapter-art {
  position: relative;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  border: 0 !important;
  background: var(--case-surface) !important;
  box-shadow: none !important;
  cursor: zoom-in;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

body .web-chapter:not(.project-opening) .chapter-art:hover {
  border: 0 !important;
  box-shadow: none !important;
}

body.original-anta .web-chapter:not(.project-opening) .chapter-art,
body.original-midea .web-chapter:not(.project-opening) .chapter-art {
  background: #111216 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.chapter-art::after {
  content: "放大查看";
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #141417;
  color: #ffffff;
  border: 0;
  box-shadow: none;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.25s ease;
}

.project-opening .chapter-art::after,
.chapter-art.mp-crafted-board::after {
  display: none !important;
}

.chapter-art.mp-crafted-board {
  cursor: default !important;
  aspect-ratio: auto !important;
  background: transparent !important;
  overflow: visible !important;
}

.web-chapter:not(.project-opening) .chapter-art:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Flat Left Vertical Ruler TOC — Zero Border, Zero Shadow ---------- */
.case-ruler-toc {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.case-ruler-pill {
  position: relative;
  width: 38px;
  height: 152px;
  padding: 16px 0;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.45);
  border: 0;
  box-shadow: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: ns-resize;
  transition: width 0.22s ease, background 0.22s ease;
}

.case-ruler-toc:hover .case-ruler-pill {
  width: 42px;
  background: rgba(20, 20, 24, 0.72);
}

.case-ruler-ticks {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  pointer-events: none;
}

.case-ruler-ticks i {
  display: block;
  height: 1.5px;
  width: 7px;
  border-radius: 99px;
  background: #ffffff;
  opacity: 0.38;
  transition: width 0.14s ease, opacity 0.14s ease;
}

.case-ruler-label {
  padding: 6px 13px;
  border-radius: 999px;
  background: #141417;
  border: 0;
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.22s ease;
}

.case-ruler-toc:hover .case-ruler-label,
.case-ruler-toc.is-active .case-ruler-label {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- Youthful Solid Dark Next-Case Closing Band (Twinkle-inspired) ---------- */
body .original-footer,
body.original-hohomart .original-footer {
  width: 100% !important;
  max-width: none !important;
  margin: 88px 0 0 !important;
  padding: 0 0 56px !important;
  border-top: 0 !important;
  background: #ffffff !important;
  display: block !important;
}

.editorial-footer-inner {
  width: min(var(--case-measure), calc(100% - 148px));
  margin: 0 auto;
  padding: 0;
}

.next-case-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(32px, 4vw, 48px) clamp(28px, 4vw, 48px);
  border-radius: 28px;
  background: #141417;
  border: 0;
  box-shadow: none;
  text-decoration: none !important;
  color: #ffffff;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}

.next-case-card:hover {
  background: #1b1b20;
  transform: translateY(-2px);
}

.next-case-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
  margin-bottom: 10px;
  font-weight: 500;
}

.next-case-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: #ffffff;
}

.next-case-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  border: 0;
  background: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  color: #111113;
  white-space: nowrap;
  flex: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.next-case-card:hover .next-case-cta {
  opacity: 0.92;
  transform: translateX(2px);
}

.editorial-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 26px;
  font-size: 13px;
  color: #8a8c98;
}

.editorial-footer-bar a {
  color: #464854;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.editorial-footer-bar a:hover {
  color: #111113;
}

/* ---------- Lightbox Modal — Flat Zero-Shadow ---------- */
.case-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 3vw, 44px);
  background: rgba(17, 17, 19, 0.86);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.case-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.case-lightbox-stage {
  position: relative;
  width: min(94vw, 1520px);
  max-height: 90vh;
  overflow: auto;
  border-radius: 22px;
  background: #ffffff;
  border: 0;
  box-shadow: none;
}

.case-lightbox-stage.is-dark {
  background: #111216;
}

.case-lightbox-stage svg,
.case-lightbox-stage img {
  display: block;
  width: 100%;
  height: auto;
}

.case-lightbox-close {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 1001;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-radius: 999px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.2s ease;
}

.case-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  html:not(.gaga-mobile-desktop) .case-ruler-toc,
  html:not(.gaga-mobile-desktop) nav.case-page-toc {
    display: none !important;
  }

  html:not(.gaga-mobile-desktop) body .case-layout,
  html:not(.gaga-mobile-desktop) body.original-hohomart .case-layout,
  html:not(.gaga-mobile-desktop) .editorial-footer-inner {
    width: calc(100% - 64px) !important;
  }
}

@media (max-width: 820px) {
  body .original-header {
    height: 58px;
    padding: 0 18px;
    gap: 10px;
  }

  .original-header .brand-wordmark,
  .original-header .header-sep,
  .original-header .header-back-pill {
    display: none;
  }

  body .case-layout,
  body.original-hohomart .case-layout,
  .editorial-footer-inner {
    width: calc(100% - 36px) !important;
  }

  body .project-opening,
  body.original-hohomart .project-opening {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: 32px 0 36px !important;
  }

  body .project-opening .chapter-art,
  body.original-hohomart .hoho-visual {
    justify-self: stretch !important;
    max-width: none !important;
    border-radius: 20px !important;
  }

  body .web-chapter:not(.project-opening),
  body.original-hohomart .web-chapter:not(.project-opening) {
    padding: 44px 0 20px !important;
  }

  body .chapter-heading,
  body.original-hohomart .chapter-heading {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    margin-bottom: 18px !important;
  }

  body .chapter-heading > p,
  body.original-hohomart .chapter-heading > p {
    text-align: left !important;
  }

  body .web-chapter:not(.project-opening) .chapter-art,
  body.original-hohomart .web-chapter:not(.project-opening) .chapter-art {
    border-radius: 18px !important;
  }

  .chapter-art::after {
    display: none;
  }

  .next-case-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    border-radius: 22px;
  }

  .editorial-footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
