/* ============================================================
   ASTR Website — Shared Styles
   Used across all pages. Page-specific styles stay inline.
   ============================================================ */

:root {
  --ink: #14171f;
  --ink-soft: #4a4f5c;
  --ink-muted-on-light: #61666f; /* ≥4.5:1 on --paper and --paper-warm (WCAG AA) */
  --ink-muted: var(--ink-muted-on-light);
  --paper: #f7f4ec;
  --paper-warm: #efe9dc;
  --line: #d9d3c4;
  --navy: #0f1b3d;
  --navy-soft: #1f2d52;
  --red: #b8302a;
  --gold: #a98e4a;
  --gold-ink: #7d6630;  /* gold for small text on light surfaces (AA) */
  --ink-muted-on-dark: rgba(247, 244, 236, 0.6);

  --serif: "Lora", "Cormorant Garamond", Georgia, serif;
  --sans:  "Be Vietnam Pro", "Inter", -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, monospace;

  --max: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Typography — prevent orphan words (chữ đơn lẻ xuống dòng)
   `text-wrap: balance` tự cân bằng số chữ mỗi dòng cho heading.
   Modern browsers: Chrome 114+, Safari 17.4+, Firefox 121+.
   ============================================================ */
h1, h2, h3, h4,
.section-title,
.subhero h1,
.hero h1,
.works-hero h1,
.cta-section h2,
.form-card h2,
.info-card h3,
.nsk-section h2,
.story-content h3,
.reason-heading,
.service-title,
.feature-name {
  text-wrap: balance;
  overflow-wrap: break-word;
  /* Tránh cắt giữa từ — chỉ break tại space */
  word-break: normal;
  hyphens: none;
}

/* Body paragraphs: balance nhẹ hơn để không quá đẹp gây khó đọc */
p, .lead, .section-lead, .hero-sub, .reason-content p {
  text-wrap: pretty;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

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

/* Paper grain texture overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.06'/></svg>");
}

/* POC banner */
.poc-banner {
  background: var(--red);
  color: var(--paper);
  text-align: center;
  padding: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ===================== Header ===================== */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 244, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: var(--max);
  margin: 0 auto;
}
.logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--navy);
}
.logo .dot { color: var(--red); }
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  font-size: 13.5px;
  font-weight: 500;
}
.nav-links a {
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--red); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--red);
  transition: width 0.25s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.active {
  color: var(--red);
}
.nav-links a.active::after {
  width: 100%;
}
.lang-toggle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lang-toggle:hover { color: var(--navy); border-color: var(--navy); }
.lang-toggle .active { color: var(--red); font-weight: 700; }
.lang-toggle .pending { color: var(--ink-muted); font-style: italic; }

/* Mobile menu toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  position: relative;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.nav-toggle:hover,
.nav-toggle:focus-visible { border-color: var(--navy); }
.nav-toggle-bar {
  position: absolute;
  left: 11px;
  width: 16px; height: 1.5px;
  background: var(--navy);
  transition: transform 0.25s ease;
}
.nav-toggle-bar:first-child { top: 15px; }
.nav-toggle-bar:last-child { top: 22px; }
.nav.is-open .nav-toggle-bar:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .nav-toggle-bar:last-child { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 920px) {
  .nav { position: relative; gap: 12px; padding: 14px 20px; }
  .lang-toggle { margin-left: auto; }
  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 4px 20px 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px -18px rgba(15, 27, 61, 0.28);
  }
  .nav.is-open .nav-links { display: flex; }
  .nav-links li + li { border-top: 1px solid var(--line); }
  .nav-links a {
    display: block;
    padding: 16px 0;
    font-size: 16px;
  }
  .nav-links a::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bar { transition: none; }
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 2px;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  font-family: var(--sans);
}
.btn-primary {
  background: var(--navy);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--red);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}
.btn-ghost:hover {
  background: var(--navy);
  color: var(--paper);
}
.btn-arrow { transition: transform 0.25s ease; display: inline-block; }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ===================== Section primitives ===================== */
.section { padding: 140px 0; }
.section-label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.25em;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  text-transform: uppercase;
}
.section-label::before {
  content: "";
  width: 32px; height: 1px;
  background: var(--red);
}
.section-label .num {
  color: var(--ink-muted);
  margin-right: 6px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1.18;
  color: var(--navy);
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}
.section-title .accent { color: var(--red); font-style: italic; }
.section-lead {
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 720px;
}

/* Sub-hero (smaller hero for inner pages) */
.subhero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--line);
}
.subhero .eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--red);
  margin-bottom: 24px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 14px;
}
.subhero .eyebrow::before {
  content: "";
  width: 32px; height: 1px;
  background: var(--red);
}
.subhero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.12;
  color: var(--navy);
  letter-spacing: -0.01em;
  max-width: 900px;
  margin-bottom: 28px;
}
.subhero h1 .accent { color: var(--red); font-style: italic; }
.subhero .lead {
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.8;
  max-width: 720px;
}

/* ===================== Footer ===================== */
footer {
  background: var(--navy);
  color: rgba(247,244,236,0.8);
  padding: 80px 0 32px;
  position: relative;
  z-index: 5;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
@media (max-width: 920px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  color: var(--paper);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}
.footer-logo .dot { color: var(--red); }
.footer-tagline {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(247,244,236,0.7);
  max-width: 320px;
}
footer h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 22px;
  text-transform: uppercase;
}
footer ul {
  list-style: none;
}
footer li {
  font-size: 13.5px;
  padding: 6px 0;
}
footer a:hover { color: var(--paper); }
.footer-bottom {
  border-top: 1px solid rgba(247,244,236,0.15);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: rgba(247,244,236,0.5);
  text-transform: uppercase;
}
@media (max-width: 560px) {
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ===================== Reveal animations ===================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  animation: fadeUp 0.9s ease forwards;
}
.reveal.d1 { animation-delay: 0.1s; }
.reveal.d2 { animation-delay: 0.25s; }
.reveal.d3 { animation-delay: 0.4s; }
.reveal.d4 { animation-delay: 0.55s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; animation: none; }
  html { scroll-behavior: auto; }
}

/* ===================== Common building blocks ===================== */

/* Photo frame placeholder */
.photo-frame {
  position: relative;
  background: linear-gradient(135deg, var(--paper-warm) 0%, #e3d9c2 100%);
  border: 1px solid var(--line);
  overflow: hidden;
}
.photo-frame::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(15,27,61,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(184,48,42,0.06) 0%, transparent 60%);
}
.photo-frame .frame-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  font-style: italic;
  width: 80%;
}
.photo-frame .frame-label .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-muted);
  display: block;
  margin-top: 8px;
  font-style: normal;
}
.photo-frame .photo-tag {
  position: absolute;
  bottom: 16px; left: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  text-transform: uppercase;
  background: rgba(247, 244, 236, 0.85);
  padding: 6px 12px;
  z-index: 3;
}

/* ===================== Real images inside placeholders ===================== */
img.fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  display: block;
}

/* Hide placeholder gradients & labels when a real image is present */
.photo-frame:has(img.fill)::before,
.photo-frame:has(img.fill) .frame-label {
  display: none;
}

/* Photo-frame quote card stays above image */
.photo-frame:has(img.fill) .quote-card { z-index: 3; }

/* Inline form elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.form-group label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-weight: 500;
}
.form-group label .required { color: var(--red); }
.form-group input,
.form-group textarea,
.form-group select {
  font-family: var(--sans);
  font-size: 15px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
  transition: border-color 0.2s ease;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--navy);
}
.form-group textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--sans);
  line-height: 1.6;
}

/* Tag/badge */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.15em;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 4px 10px;
  border-radius: 2px;
  text-transform: uppercase;
  font-weight: 500;
}
.tag.gold { color: var(--gold-ink); border-color: var(--gold); }
.tag.muted { color: var(--ink-muted); border-color: var(--line); }
.tag.solid {
  background: var(--navy);
  color: var(--paper);
  border-color: var(--navy);
}
