:root {
  --bg: #0d1117;
  --bg-card: #151b24;
  --bg-card-hover: #1b2330;
  --bg-elevated: #18202b;
  --canvas-neutral: #f2f4f8;
  --canvas-dark: #141922;
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.22);
  --text: #f3f5f8;
  --text-sub: #9ca7b8;
  --text-muted: #6c7789;
  --btn-grad: linear-gradient(135deg, #10b981 0%, #eab308 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #202937;
  border: 1px solid var(--border-hover);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #d1fae5;
  letter-spacing: 0.5px;
}

.brand-meta strong {
  font-size: 15px;
  font-weight: 700;
}

.brand-meta span {
  font-size: 12px;
  color: var(--text-sub);
  margin-left: 8px;
}

.top-nav {
  display: flex;
  gap: 18px;
}

.top-nav a {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.18s;
}

.top-nav a:hover {
  color: var(--text);
}

/* Hero — Work-first, fits within 390x844 first screen */
.hero {
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--border);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 28px;
  align-items: center;
}

.hero-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--text-sub);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.2px;
  margin-bottom: 10px;
}

.hero-lead {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 20px;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.btn-primary {
  background: var(--btn-grad);
  color: #08120e;
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-outline:hover {
  border-color: #cbd5e1;
}

/* Neutral Work Canvas in Hero */
.hero-showcase {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.hero-showcase:hover {
  border-color: var(--border-hover);
}

.hero-img-stage {
  background: var(--canvas-neutral);
  border-radius: 11px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}

.hero-img-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: var(--text-sub);
  padding: 0 4px;
}

.hero-caption span:last-child {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

/* Works Section */
.section {
  padding: 36px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
}

.cat-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.cat-btn:hover,
.cat-btn.active {
  color: var(--text);
  border-color: #94a3b8;
  background: #202938;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.work-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.work-canvas {
  background: var(--canvas-neutral);
  border-radius: 11px;
  height: 230px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.work-canvas.dark-canvas {
  background: var(--canvas-dark);
  padding: 0;
}

.work-canvas img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.work-canvas.dark-canvas img {
  object-fit: cover;
}

.work-info {
  padding: 14px 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.work-cat {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.work-title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.35;
}

.work-desc {
  font-size: 13.5px;
  color: var(--text-sub);
}

.work-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.work-more {
  color: var(--text);
  font-weight: 600;
}

/* Minimal Contact Section */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
  align-items: start;
}

.contact-card h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.contact-lead {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 500;
}

.contact-sub {
  font-size: 13.5px;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.contact-extra {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.inquiry-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inquiry-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inquiry-textarea {
  width: 100%;
  min-height: 118px;
  background: var(--bg);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
}

footer {
  padding: 26px 0 38px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Project Detail Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 9, 14, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-mask.open {
  display: flex;
}

.modal-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 18px;
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
}

.modal-stage {
  background: var(--canvas-neutral);
  border-radius: 12px;
  height: 330px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.modal-stage.dark-canvas {
  background: var(--canvas-dark);
}

.modal-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 16px;
}

.thumb-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.thumb-btn.active {
  border-color: #cbd5e1;
  color: var(--text);
  font-weight: 600;
}

.modal-note {
  background: var(--bg);
  border-left: 3px solid #10b981;
  padding: 11px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.deliver-list {
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--text-sub);
  margin-bottom: 18px;
}

.deliver-list li {
  margin-bottom: 5px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(5, 8, 12, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 95vw;
  max-height: 92vh;
  background: var(--canvas-neutral);
  padding: 10px;
  border-radius: 10px;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  z-index: 300;
  background: #f8fafc;
  color: #0f172a;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.22s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mobile-First Optimization (390x844 Verified) */
@media (max-width: 780px) {
  .topbar-inner {
    height: 50px;
  }
  .brand-meta span {
    display: none;
  }
  .hero {
    padding: 16px 0 22px;
  }
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero-tag {
    margin-bottom: 8px;
    font-size: 11.5px;
  }
  .hero-title {
    font-size: 21.5px;
    margin-bottom: 6px;
  }
  .hero-lead {
    font-size: 13.5px;
    margin-bottom: 12px;
  }
  /* Put Hero Image ABOVE or snug with compact buttons so both fit in first 844px screen */
  .hero-img-stage {
    height: 215px;
    padding: 8px;
  }
  .hero-actions .btn {
    flex: 1;
    padding: 9px 14px;
    font-size: 13.5px;
  }
  .works-grid,
  .contact-card {
    grid-template-columns: 1fr;
  }
  .work-canvas {
    height: 200px;
  }
  .modal-stage {
    height: 230px;
  }
}
