* {
  box-sizing: border-box;
}

:root {
  --page-pad: clamp(24px, 6vw, 110px);
  --text-color: #222222;
  --muted: #888;
  --border: #ddd;
  --content-offset: 64px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: #1a1a1a;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-shell {
  min-height: 100vh;
}

/* =========================
   SHARED HEADER / NAV
   ========================= */

.topbar-shell {
  width: 100%;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 3000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 52px var(--page-pad) 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-family: "IBM Plex Mono", monospace;
}

.topbar-brand {
  color: #222;
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-weight: 400;
  white-space: nowrap;
}

.topbar-brand:hover {
  text-decoration: none;
  opacity: 0.68;
}

/* Equal-weight line icons */
.topbar-burger,
.mobile-nav-close {
  position: relative;
  width: 26px;
  height: 22px;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
  box-sizing: content-box;
  flex-shrink: 0;
}

.topbar-burger {
  display: none;
}

.topbar-burger span,
.mobile-nav-close span {
  position: absolute;
  left: 0;
  top: 50%;
  display: block;
  width: 26px;
  height: 1.5px;
  margin-top: -0.75px;
  background: #222;
  opacity: 1;
  border-radius: 0;
  transform-origin: 50% 50%;
  -webkit-transform-origin: 50% 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition:
    transform 0.28s ease,
    opacity 0.18s ease,
    background-color 0.18s ease;
}

.topbar-burger:hover span,
.mobile-nav-close:hover span {
  opacity: 0.78;
}

.topbar-burger span:nth-child(1) {
  transform: translateY(-4px);
  -webkit-transform: translateY(-4px);
}

.topbar-burger span:nth-child(2) {
  transform: translateY(4px);
  -webkit-transform: translateY(4px);
}

.mobile-nav-close span:nth-child(1) {
  transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
}

.mobile-nav-close span:nth-child(2) {
  transform: rotate(-45deg);
  -webkit-transform: rotate(-45deg);
}

.topbar-nav {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: -10px;
}

.nav-toggle,
.nav-link {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  color: #222;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-link:hover,
.nav-menu a:hover {
  opacity: 0.68;
  text-decoration: none;
}

.topbar-sep {
  color: #8a8a8a;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.08em;
  user-select: none;
  margin: 0 14px;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 210px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.97);
  border: none;
  box-shadow: none;
  display: none;
  z-index: 2000;
  box-sizing: border-box;
  text-align: right;
}

.nav-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
  background: transparent;
}

.nav-dropdown:hover .nav-menu {
  display: block;
}

.nav-menu a {
  display: block;
  color: #222;
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  padding: 1px 0;
  text-align: right;
}

body.nav-collapsed .topbar-burger {
  display: inline-block;
}

body.nav-collapsed .topbar-nav {
  display: none;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  overflow-y: auto;
}

body.nav-is-open .mobile-nav-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 52px var(--page-pad) 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-family: "IBM Plex Mono", monospace;
}

.mobile-nav-brand {
  color: #222;
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-weight: 400;
  white-space: nowrap;
}

.mobile-nav-brand:hover {
  opacity: 0.68;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-links li {
  text-align: center;
}

.mobile-nav-links .mobile-nav-section {
  display: block;
  color: #222;
  text-decoration: none;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 12px;
  cursor: default;
}

.mobile-nav-links .mobile-nav-sub {
  display: block;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  line-height: 2;
}

.mobile-nav-links .mobile-nav-sub:hover {
  color: #222;
  text-decoration: none;
}

.mobile-nav-links .mobile-nav-divider {
  width: 24px;
  height: 1px;
  background: #ddd;
  margin: 6px auto;
}

.mobile-nav-links .mobile-nav-contact {
  display: block;
  color: #222;
  text-decoration: none;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  line-height: 1;
}

.mobile-nav-links .mobile-nav-contact:hover {
  opacity: 0.68;
  text-decoration: none;
}

/* =========================
   SHARED FOOTER
   ========================= */

.piece-footer-custom {
  width: 100%;
  margin: 5em 0 5em 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}

.piece-footer-align {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 var(--page-pad);
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
}

.piece-footer-custom .footer-inner {
  text-align: right;
  font-weight: 300;
}

.piece-footer-custom a {
  color: #666;
  text-decoration: none;
}

.piece-footer-custom a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Hide old footer system */
.footer {
  display: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* =========================
   EXISTING GLOBAL LAYOUT
   ========================= */

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px 56px;
}

.home {
  padding-top: 3vh;
}

.home-mark {
  margin: 0 0 22px;
  font-size: clamp(72px, 18vw, 220px);
  line-height: 0.9;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.home-copy {
  max-width: 980px;
  font-size: 14px;
  text-transform: uppercase;
}

.home-copy p {
  margin: 0 0 12px;
}

.entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
  font-size: 14px;
}

.page-title {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 400;
  text-transform: uppercase;
}

.page-body {
  max-width: 1200px;
}

.page-body p {
  margin: 0 0 16px;
  max-width: 980px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 42px;
  align-items: start;
}

.work-grid {
  display: grid;
  gap: 52px;
}

.preview {
  display: grid;
  gap: 16px;
}

.preview-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.preview-meta {
  font-size: 12px;
  color: #4d4d4d;
}

.preview-meta p {
  margin: 0 0 4px;
}

.work-shell {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px 56px;
}

.work-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 300px;
  gap: 48px;
  align-items: start;
  margin-bottom: 28px;
}

.work-title {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 400;
  text-transform: uppercase;
}

.meta-block,
.sales-block {
  font-size: 12px;
  color: #333333;
}

.meta-block p,
.sales-block p {
  margin: 0 0 10px;
}

.gallery {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.gallery img {
  background: #f5f5f5;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  font-size: 12px;
}

.section-list {
  display: grid;
  gap: 28px;
}

.section-list article p:last-child {
  margin-bottom: 0;
}

.small-note {
  color: #777777;
  font-size: 12px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 640px) {
  body:not(.nav-collapsed) .topbar-burger {
    display: inline-block;
  }

  body:not(.nav-collapsed) .topbar-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --page-pad: 16px;
  }

  .topbar {
    padding-top: 36px;
    padding-bottom: 20px;
    gap: 18px;
  }

  .topbar-brand {
    font-size: 24px;
  }

  .topbar-nav {
    gap: 0;
  }

  .nav-toggle,
  .nav-link,
  .topbar-sep {
    font-size: 13px;
    letter-spacing: 0.08em;
  }

  .topbar-sep {
    margin: 0 10px;
  }

  .nav-dropdown {
    padding-bottom: 8px;
    margin-bottom: -8px;
  }

  .nav-menu {
    min-width: 180px;
    padding: 10px 12px;
    left: auto;
    right: 0;
    transform: none;
    top: calc(100% + 2px);
  }

  .nav-menu::before {
    top: -10px;
    height: 10px;
  }

  .nav-menu a {
    font-size: 13px;
  }

  .mobile-nav-header {
    padding-top: 36px;
    padding-bottom: 20px;
  }

  .mobile-nav-brand {
    font-size: 24px;
  }
}

@media (max-width: 900px) {
  .two-col,
  .work-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .preview-images {
    grid-template-columns: 1fr;
  }

  .home-mark {
    font-size: clamp(56px, 15vw, 120px);
  }

  .container,
  .work-shell {
    padding-left: 18px;
    padding-right: 18px;
  }
}
