/* ── Variables ── */
:root {
  --bg-deep: #0c0b0a;
  --bg-card: #141210;
  --bg-elevated: #1c1916;
  --ink: #e8e0d4;
  --ink-muted: #9a9088;
  --ink-faint: #5c554e;
  --accent: #c9a227;
  --accent-dim: #8a7020;
  --accent-glow: rgba(201, 162, 39, 0.15);
  --danger: #a63d3d;
  --success: #4a7c59;
  --border: rgba(201, 162, 39, 0.12);
  --border-strong: rgba(201, 162, 39, 0.28);
  --font-serif: "Noto Serif SC", "Songti SC", serif;
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --radius: 4px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-serif);
  background: var(--bg-deep);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: #e8c84a; }

strong { color: var(--ink); font-weight: 600; }

/* ── Film grain overlay ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12, 11, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: var(--radius);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--ink-muted);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.nav-links a:hover { color: var(--ink); }

.nav-cta {
  padding: 0.5rem 1.25rem !important;
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
  border-radius: var(--radius);
}

.nav-cta:hover {
  background: var(--accent-glow) !important;
  color: var(--accent) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.15s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: #e8c84a;
  border-color: #e8c84a;
  color: var(--bg-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-full { width: 100%; }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 4rem) 2rem 4rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

.hero-glow {
  position: absolute;
  top: 20%;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  filter: blur(60px);
}

.hero-tag {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-desc {
  color: var(--ink-muted);
  max-width: 480px;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stats dt {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
}

.hero-stats dd {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 0.25rem;
}

/* Case file card */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.case-file {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 2rem 2rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: rotate(2deg);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: rotate(2deg) translateY(0); }
  50% { transform: rotate(1deg) translateY(-8px); }
}

.case-stamp {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.35rem 0.75rem;
  border: 2px solid var(--danger);
  color: var(--danger);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  transform: rotate(-12deg);
  opacity: 0.7;
}

.case-id {
  font-size: 0.8rem;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
}

.case-lines {
  list-style: none;
}

.case-lines li {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.case-lines li span:first-child {
  color: var(--ink-faint);
}

.status-ok { color: var(--success); }

/* ── Sections common ── */
section {
  padding: 6rem 2rem;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--accent-dim);
  margin-bottom: 1rem;
}

section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 2rem;
  color: var(--ink);
}

.section-intro {
  color: var(--ink-muted);
  max-width: 640px;
  margin: -1rem 0 3rem;
  font-size: 1rem;
}

/* ── About ── */
.about {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  gap: 3rem;
}

.about-lead {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 720px;
  line-height: 1.9;
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.about-cards article {
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s;
}

.about-cards article:hover {
  border-color: var(--border-strong);
}

.card-icon {
  display: block;
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.about-cards h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.about-cards p {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* ── Services ── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.service-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.service-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--bg-elevated);
  -webkit-text-stroke: 1px var(--border-strong);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.service-card > p {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.service-card ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-card li {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--ink-faint);
}

/* ── Process timeline ── */
.process {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.timeline {
  list-style: none;
  display: grid;
  gap: 0;
  max-width: 640px;
}

.timeline li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.timeline li:last-child { border-bottom: none; }

.step {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  opacity: 0.6;
}

.timeline h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.timeline p {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* ── Principles ── */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.principle-no,
.principle-yes {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.principle-no {
  background: rgba(166, 61, 61, 0.08);
  border: 1px solid rgba(166, 61, 61, 0.2);
  color: var(--ink-muted);
}

.principle-no span {
  color: var(--danger);
  font-weight: 700;
  flex-shrink: 0;
}

.principle-yes {
  background: rgba(74, 124, 89, 0.08);
  border: 1px solid rgba(74, 124, 89, 0.2);
  color: var(--ink-muted);
}

.principle-yes span {
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Contact ── */
.contact {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.contact-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info p {
  color: var(--ink-muted);
  margin-bottom: 2rem;
}

.contact-info address {
  font-style: normal;
}

.contact-info address p {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.contact-info strong {
  display: inline-block;
  min-width: 5em;
  color: var(--ink-faint);
  font-weight: 400;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-form label > span {
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  padding: 0.75rem 1rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239a9088'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.75rem !important;
  cursor: pointer;
}

.checkbox-label input {
  margin-top: 0.25rem;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-label span {
  font-size: 0.85rem !important;
  color: var(--ink-muted) !important;
  line-height: 1.5;
}

.form-note {
  text-align: center;
  font-size: 0.9rem;
  color: var(--success);
  padding: 0.5rem;
}

.form-note.error { color: var(--danger); }

/* ── Footer ── */
.site-footer {
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-brand p {
  font-family: var(--font-display);
  line-height: 1.5;
}

.footer-brand small {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-family: var(--font-serif);
}

.footer-disclaimer {
  max-width: 520px;
  font-size: 0.8rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: calc(var(--header-h) + 2rem);
  }

  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { order: -1; }
  .case-file { max-width: 320px; transform: rotate(0); animation: none; }

  .about-cards,
  .service-grid,
  .principles-grid,
  .contact-split {
    grid-template-columns: 1fr;
  }

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(12, 11, 10, 0.97);
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.35s, opacity 0.35s;
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 480px) {
  .hero-stats { gap: 1.5rem; }
  section { padding: 4rem 1.25rem; }
  .nav { padding: 0 1.25rem; }
}
