/* ============================================================
   homio.build — shared stylesheet (landing + Sổ tay + utility pages)
   Static, no framework. System font stack by design (LCP budget).
   Palette evolves the original coming-soon page: warm paper white,
   deep construction-green ink, hairline rules — "hồ sơ công trình"
   editorial voice.
   ============================================================ */

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

:root {
  --green-ink: #0E3B22;   /* deep panel green */
  --green-dark: #1B6B3A;
  --green: #2D9B57;
  --green-pale: #A7D7B8;
  --tint: #F0FAF4;
  --paper: #FDFEFD;
  --ink: #111827;
  --ink-soft: #4B5563;
  --ink-faint: #6B7280;
  --line: #E9EDEA;
  --line-soft: #F0F2F0;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 28px rgba(15, 61, 34, 0.07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
          "Noto Sans", sans-serif;
  --max: 1080px;
  --max-text: 720px;
}

html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 88% -12%, rgba(45, 155, 87, 0.10), transparent 60%),
    radial-gradient(900px 520px at -12% 8%, rgba(27, 107, 58, 0.06), transparent 55%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@media (min-width: 720px) { body { font-size: 18px; } }

img, svg { max-width: 100%; height: auto; display: block; }

/* The hidden attribute must always win (fail closed) — author display rules on
   .btn etc. would otherwise override the UA's [hidden]{display:none}. The
   alpha-only #enter-app gate depends on this. */
[hidden] { display: none !important; }
a { color: var(--green-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }

:focus-visible {
  outline: 3px solid rgba(45, 155, 87, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------------- header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(253, 254, 253, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--green-dark);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--green-dark); }
.brand .roof {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px;
  box-shadow: 0 4px 14px rgba(27, 107, 58, 0.28);
}
.brand .dot-build { color: var(--ink-faint); font-weight: 600; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.site-nav a.nav-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 9px;
}
.site-nav a.nav-link:hover { color: var(--green-dark); background: var(--tint); }
@media (max-width: 480px) {
  .site-nav a.nav-hide-sm { display: none; }
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff;
  text-decoration: none;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.2;
  padding: 13px 26px;
  border: 0;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(27, 107, 58, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(27, 107, 58, 0.36);
}
.btn:disabled { opacity: 0.65; cursor: default; transform: none; }
.btn-sm { font-size: 14px; padding: 9px 18px; box-shadow: 0 4px 12px rgba(27, 107, 58, 0.24); }
.btn-ghost {
  background: #fff;
  color: var(--green-dark);
  border: 1.5px solid var(--green-pale);
  box-shadow: none;
}
.btn-ghost:hover { color: var(--green-dark); background: var(--tint); box-shadow: none; }

/* ---------------- section scaffolding ---------------- */

.section { padding: 64px 0; }
@media (min-width: 720px) { .section { padding: 88px 0; } }

.kicker {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(26px, 4.6vw, 38px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 620px;
}
.section-sub {
  margin-top: 14px;
  color: var(--ink-soft);
  max-width: 620px;
}

.badge {
  display: inline-block;
  background: var(--tint);
  border: 1.5px solid var(--green-pale);
  color: var(--green-dark);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
}

/* ---------------- waitlist form ---------------- */

.waitlist {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  max-width: 560px;
  text-align: left;
}
.waitlist[data-mounted="0"] { min-height: 220px; }
.waitlist h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.waitlist .waitlist-sub { color: var(--ink-soft); font-size: 14.5px; margin-top: 4px; }
.waitlist form { margin-top: 16px; display: grid; gap: 10px; }
.waitlist .row-2 { display: grid; gap: 10px; }
@media (min-width: 560px) { .waitlist .row-2 { grid-template-columns: 1fr 1fr; } }

.field {
  width: 100%;
  font-family: var(--font);
  font-size: 15.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.15s ease;
  appearance: none;
}
select.field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B7280' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  color: var(--ink-soft);
}
.field:focus { outline: none; border-color: var(--green); }
.field::placeholder { color: #9CA3AF; }

.waitlist .microline { font-size: 13px; color: var(--ink-faint); }
.waitlist-status { font-size: 14.5px; line-height: 1.6; }
.waitlist-status.is-error { color: #B4552D; font-weight: 600; }
.waitlist-success {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--tint);
  border: 1.5px solid var(--green-pale);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--green-ink);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.6;
}
/* honeypot — keep in DOM, remove from every human flow */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* ---------------- footer ---------------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  padding: 44px 0 30px;
  font-size: 14px;
  color: var(--ink-soft);
}
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; } }
.site-footer .brand { margin-bottom: 10px; }
.footer-tagline { max-width: 260px; }
.footer-col h4 {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col a { color: var(--ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--green-dark); text-decoration: underline; }
.footer-bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-faint);
}
.footer-bottom a { color: var(--ink-faint); }
.footer-bottom a:hover { color: var(--green-dark); }

/* ---------------- article / prose (Sổ tay) ---------------- */

.article-head { padding: 40px 0 8px; }
.breadcrumb {
  font-size: 13.5px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--green-dark); text-decoration: underline; }
.breadcrumb .sep { color: #C9CFCB; }

.prose-wrap { max-width: var(--max-text); margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .prose-wrap { padding: 0 32px; } }

.article-title {
  font-size: clamp(28px, 5.4vw, 42px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.022em;
  margin: 14px 0 14px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  color: var(--ink-faint);
  font-size: 13.5px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.prose { padding: 8px 0 24px; }
.prose > * + * { margin-top: 1.15em; }
.prose p { color: #1F2937; }
.prose a { font-weight: 600; }
.prose strong { font-weight: 750; color: var(--ink); }
.prose h2 {
  font-size: clamp(21.5px, 3.4vw, 27px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-top: 2em;
  padding-top: 0.4em;
}
.prose h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green-dark), var(--green-pale));
  margin-bottom: 14px;
}
.prose h3 {
  font-size: clamp(18px, 2.6vw, 20.5px);
  font-weight: 750;
  line-height: 1.3;
  margin-top: 1.7em;
}
.prose ul, .prose ol { padding-left: 1.35em; display: grid; gap: 0.55em; }
.prose li::marker { color: var(--green); font-weight: 700; }
.prose .table-scroll {
  overflow-x: auto;
  border: 1.5px solid var(--line);
  border-radius: 12px;
}
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 480px; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.prose th { background: var(--tint); color: var(--green-ink); font-weight: 750; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose em { color: var(--ink-soft); }

/* CTA boxes inside articles */
.cta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  background: var(--tint);
  border: 1.5px solid var(--green-pale);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 2em 0;
}
.cta-inline p { font-size: 15px; color: var(--green-ink); font-weight: 600; margin: 0; }
.cta-end {
  background: linear-gradient(135deg, var(--green-ink), var(--green-dark));
  color: #EAF6EE;
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  margin: 2.4em 0 1em;
}
.cta-end p { color: #EAF6EE; font-size: 16.5px; font-weight: 600; line-height: 1.65; margin: 0 0 18px; }
.cta-end .btn { background: #fff; color: var(--green-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.cta-end .btn:hover { color: var(--green-ink); }

/* article cards (hub, landing preview, cam-on) */
.card-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.card-grid.cols-2 { max-width: 760px; }
@media (min-width: 720px) { .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }

.article-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--green-pale);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}
.article-card .card-tag {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}
.article-card h3 { font-size: 17.5px; font-weight: 750; line-height: 1.35; letter-spacing: -0.01em; }
.article-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.article-card .card-more { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--green-dark); }

/* ---------------- small utilities ---------------- */

.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
