/* ==========================================================================
   AnPhatBuild Landing — mobile-first
   Palette: Mực than #16232D · Vàng An Phát #C9A227→#E8CD7A · Giấy #F6F8F9
   Type: Be Vietnam Pro (hiển thị + nội dung) · IBM Plex Mono (nhãn kỹ thuật)
   ========================================================================== */

/* ---------- Fonts (self-hosted, hỗ trợ tiếng Việt) ---------- */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/be-vietnam-pro-v12-latin_vietnamese-300.woff2') format('woff2'); }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/be-vietnam-pro-v12-latin_vietnamese-regular.woff2') format('woff2'); }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/be-vietnam-pro-v12-latin_vietnamese-600.woff2') format('woff2'); }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/be-vietnam-pro-v12-latin_vietnamese-800.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-mono-v20-latin_vietnamese-500.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
  --ink: #16232D;
  --ink-2: #0F1922;
  --gold: #C9A227;
  --gold-2: #E8CD7A;
  --paper: #F6F8F9;
  --line: #DCE3E8;
  --line-dark: rgba(232, 205, 122, .25);
  --text: #22333B;
  --text-soft: #5A6B76;
  --text-inv: #EDF2F5;
  --text-inv-soft: #A8B8C2;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(22, 35, 45, .10);
  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --pad-section: clamp(52px, 9vw, 92px);
  --header-h: 64px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { font-family: var(--font-body); color: var(--text); background: #fff; line-height: 1.65; font-size: 16px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3 { font-weight: 800; line-height: 1.15; color: var(--ink); letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6.5vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 4.5vw, 2.4rem); }
h3 { font-size: 1.15rem; }

.container { width: min(1160px, 100% - 40px); margin-inline: auto; }
.container-narrow { width: min(760px, 100% - 40px); }

/* Nhãn kỹ thuật — chữ ký thị giác của trang (kiểu chú thích bản vẽ) */
.eyebrow {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-soft);
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 34px; height: 1px; background: currentColor; box-shadow: -0px 3px 0 -2px currentColor, 0 -3px 0 -2px currentColor; }
.eyebrow::after { content: ''; width: 8px; height: 8px; border: 1px solid currentColor; transform: rotate(45deg); }
.eyebrow-gold { color: var(--gold-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  padding: 12px 22px; border-radius: 8px; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-lg { padding: 15px 28px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: var(--ink-2); box-shadow: 0 6px 18px rgba(201, 162, 39, .35);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(201, 162, 39, .45); }
.btn-ghost { border-color: rgba(237, 242, 245, .4); color: var(--text-inv); }
.btn-ghost:hover { border-color: var(--gold-2); color: var(--gold-2); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand img { width: 118px; height: auto; }
.main-nav { display: none; }
.header-cta { padding: 9px 16px; font-size: .88rem; }

/* ---------- Hero ---------- */
.hero { position: relative; background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%); color: var(--text-inv); overflow: hidden; }
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(232, 205, 122, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 205, 122, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 30% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 30% 20%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; padding: clamp(48px, 9vw, 96px) 0 clamp(44px, 7vw, 80px); display: grid; gap: 36px; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--gold-2); position: relative; }
.hero h1 em::after { content: ''; position: absolute; left: 0; right: 0; bottom: .04em; height: 3px; background: linear-gradient(90deg, var(--gold-2), transparent); }
.hero-sub { margin-top: 18px; color: var(--text-inv-soft); max-width: 52ch; font-size: 1.02rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; margin-top: 34px; padding-top: 24px; border-top: 1px dashed var(--line-dark); }
.hero-stats dt { font-family: var(--font-mono); font-weight: 500; font-size: 1.5rem; color: var(--gold-2); line-height: 1.1; }
.hero-stats dd { font-size: .82rem; color: var(--text-inv-soft); }

.hero-photo { position: relative; }
.hero-photo img { border-radius: var(--radius); box-shadow: var(--shadow); }
.photo-tag {
  position: absolute; left: 14px; bottom: 14px; font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .1em; color: var(--ink-2); background: var(--gold-2); padding: 4px 10px; border-radius: 4px;
}
.reg-mark { position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold-2); }
.reg-tl { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.reg-br { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }

/* ---------- Sections chung ---------- */
.section { padding: var(--pad-section) 0; }
.section-head { margin-bottom: clamp(28px, 5vw, 44px); max-width: 640px; }
.section-paper { background: var(--paper); }
.section-ink { background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%); color: var(--text-inv); position: relative; overflow: hidden; }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .section-head p:not(.eyebrow) { color: var(--text-inv-soft); }

/* ---------- Dịch vụ ---------- */
.services-grid { display: grid; gap: 22px; }
.service-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-photo { aspect-ratio: 3 / 2; overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { color: var(--text-soft); font-size: .93rem; }
.card-body ul { list-style: none; display: grid; gap: 6px; font-size: .9rem; }
.card-body li { padding-left: 20px; position: relative; }
.card-body li::before { content: ''; position: absolute; left: 0; top: .5em; width: 10px; height: 10px; border: 2px solid var(--gold); border-radius: 2px; transform: rotate(45deg); border-left: 0; border-top: 0; }
.card-link { margin-top: auto; font-weight: 600; font-size: .92rem; color: var(--ink); text-decoration: none; }
.card-link:hover { color: var(--gold); }

/* ---------- Dự án ---------- */
.projects-grid { display: grid; gap: 18px; }
.project-card { position: relative; border-radius: var(--radius); overflow: hidden; margin: 0; }
.project-card img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: transform .35s ease; }
.project-card:hover img { transform: scale(1.04); }
.project-card figcaption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 30px 18px 14px;
  background: linear-gradient(transparent, rgba(15, 25, 34, .88));
  color: #fff; display: flex; flex-direction: column; gap: 2px;
}
.project-card figcaption strong { font-size: .98rem; }
.project-card figcaption span { font-family: var(--font-mono); font-size: .72rem; color: var(--gold-2); letter-spacing: .06em; }

/* ---------- Quy trình ---------- */
.process-track { list-style: none; display: grid; gap: 26px; counter-reset: step; position: relative; }
.process-track li { position: relative; padding-left: 62px; }
.step-no {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px;
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 500;
  color: var(--ink-2); background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-radius: 8px; font-size: .95rem;
}
.process-track li:not(:last-child)::before {
  content: ''; position: absolute; left: 21px; top: 50px; bottom: -22px;
  border-left: 1px dashed var(--line-dark);
}
.process-track h3 { margin-bottom: 4px; font-size: 1.05rem; }
.process-track p { color: var(--text-inv-soft); font-size: .92rem; max-width: 46ch; }

/* ---------- Cam kết (spec sheet) ---------- */
.spec-sheet { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-sheet > div { display: grid; grid-template-columns: 110px 1fr; border-bottom: 1px solid var(--line); }
.spec-sheet > div:last-child { border-bottom: 0; }
.spec-sheet dt {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: var(--paper); padding: 16px 14px; border-right: 1px solid var(--line);
  display: flex; align-items: center;
}
.spec-sheet dd { padding: 16px 18px; font-size: .95rem; }

/* ---------- Liên hệ ---------- */
.section-contact .hero-grid-bg { mask-image: radial-gradient(ellipse 80% 90% at 75% 30%, #000 20%, transparent 72%); -webkit-mask-image: radial-gradient(ellipse 80% 90% at 75% 30%, #000 20%, transparent 72%); }
.contact-grid { position: relative; display: grid; gap: 36px; }
.contact-pitch p { color: var(--text-inv-soft); margin-top: 12px; max-width: 46ch; }
.contact-channels { list-style: none; margin-top: 26px; display: grid; gap: 14px; }
.contact-channels li, .contact-channels a { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.chan-key { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); min-width: 76px; }
.contact-channels strong { color: #fff; font-weight: 600; }
.contact-channels a:hover strong { color: var(--gold-2); }

.lead-form {
  background: #fff; border-radius: 14px; padding: 26px 24px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  display: grid; gap: 16px;
}
.lead-form h3 { font-size: 1.3rem; }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 600; font-size: .88rem; color: var(--ink); }
.field input[type="text"], .field input[type="tel"], .field textarea {
  font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--paper); width: 100%; transition: border-color .15s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--gold); outline: none; background: #fff; }
.field input:user-invalid { border-color: #C0392B; }
.chips { border: 0; }
.chips legend { margin-bottom: 8px; }
.chips { display: block; }
.chips label { display: inline-block; margin: 0 8px 8px 0; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: .86rem; font-weight: 500; color: var(--text-soft); transition: all .15s ease;
}
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--gold-2); }
.chips input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.form-note { font-size: .78rem; color: var(--text-soft); text-align: center; }
.form-success { background: #E8F6EC; color: #1E7A3C; border-radius: 8px; padding: 12px 14px; font-size: .92rem; font-weight: 500; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; background: #fff; }
.faq-item summary {
  cursor: pointer; font-weight: 600; padding: 16px 46px 16px 18px; list-style: none; position: relative; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); color: var(--gold); font-size: 1.2rem;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 18px 16px; color: var(--text-soft); font-size: .94rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-2); color: var(--text-inv-soft); padding: 44px 0 0; font-size: .9rem; }
.footer-inner { display: grid; gap: 24px; padding-bottom: 28px; }
.footer-brand { font-weight: 800; font-size: 1.3rem; color: #fff; letter-spacing: -.01em; }
.footer-brand span { color: var(--gold-2); }
.site-footer address { font-style: normal; line-height: 1.9; }
.site-footer a { color: var(--text-inv); text-decoration: none; }
.site-footer a:hover { color: var(--gold-2); }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .08); padding: 16px 0 76px; font-size: .78rem; }

/* ---------- Thanh CTA di động ---------- */
.mobile-cta {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: 1fr 1fr 1.2fr;
  background: var(--ink-2); border-top: 1px solid rgba(232, 205, 122, .3);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px;
}
.mobile-cta a {
  display: grid; place-items: center; padding: 11px 6px; border-radius: 8px;
  font-size: .85rem; font-weight: 600; text-decoration: none;
}
.mc-call { color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.mc-zalo { color: #fff; background: #0068FF; }
.mc-quote { color: var(--ink-2); background: linear-gradient(135deg, var(--gold-2), var(--gold)); }

/* ---------- Hiệu ứng cuộn ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .service-card, .project-card img { transition: none; }
}

/* ==========================================================================
   ≥ 640px — Tablet: lưới 2 cột, quy trình 2×2
   ========================================================================== */
@media (min-width: 640px) {
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card:last-child { grid-column: span 2; flex-direction: row; }
  .service-card:last-child .card-photo { flex: 0 0 42%; aspect-ratio: auto; }
  .service-card:last-child .card-photo img { height: 100%; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .process-track { grid-template-columns: repeat(2, 1fr); gap: 30px 40px; }
  .process-track li:not(:last-child)::before { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; align-items: start; }
  .spec-sheet > div { grid-template-columns: 150px 1fr; }
}

/* ==========================================================================
   ≥ 1024px — Desktop: hero 2 cột, nav đầy đủ, ẩn thanh CTA di động
   ========================================================================== */
@media (min-width: 1024px) {
  .main-nav { display: flex; gap: 28px; }
  .main-nav a { text-decoration: none; font-weight: 500; font-size: .92rem; color: var(--text); }
  .main-nav a:hover { color: var(--gold); }
  .brand img { width: 152px; }
  .header-cta { padding: 11px 20px; font-size: .92rem; }

  .hero-inner { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 56px; }
  .hero-photo { transform: rotate(.5deg); }

  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .service-card:last-child { grid-column: auto; flex-direction: column; }
  .service-card:last-child .card-photo { flex: none; aspect-ratio: 3 / 2; }

  .projects-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 240px; }
  .project-lg { grid-column: span 2; grid-row: span 2; }
  .project-card img { aspect-ratio: auto; height: 100%; }

  .process-track { grid-template-columns: repeat(4, 1fr); gap: 40px 32px; }
  .process-track li { padding-left: 0; padding-top: 60px; }
  .step-no { top: 0; left: 0; }
  .process-track li:not(:last-child)::before {
    display: block; left: 56px; right: -20px; top: 21px; bottom: auto;
    border-left: 0; border-top: 1px dashed var(--line-dark);
  }

  .contact-grid { grid-template-columns: 1fr 460px; gap: 64px; align-items: center; }
  .lead-form { padding: 32px 32px 26px; }

  .mobile-cta { display: none; }
  .footer-legal { padding-bottom: 16px; }
  .footer-inner { grid-template-columns: 1.2fr 1fr; }
}
