/* ==========================================================================
   zAPP Ecosystem Stylesheet (zTruyen & zFim)
   Triết lý: Minimalism - Clear - Zen · Thẩm mỹ E-ink & Industrial Craft
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Geist+Mono:wght@400;500;600&family=Geist:wght@400;500;600;700&display=swap');

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

html {
  background: var(--muc);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--muc);
  color: var(--giay);
  font-family: var(--chu-viet);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.65;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* --- CANVAS TRƯỜNG HẠT MỰC CHẠY NỀN --- */
#truong-hat {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

main, header, footer {
  position: relative;
  z-index: 1;
}

/* --- TRỢ NĂNG FOCUS --- */
:focus-visible {
  outline: 2px solid var(--tin-hieu-focus);
  outline-offset: 3px;
}

.bo-qua {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--giay);
  color: var(--muc);
  padding: 10px 18px;
  font-weight: 600;
  text-decoration: none;
}
.bo-qua:focus {
  left: 14px;
  top: 14px;
}

/* --- CONTAINER & BỐ CỤC --- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--le);
}

/* --- ĐỈNH TRANG (STICKY HEADER) --- */
header.dinh {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--muc) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--net-mo);
}

.dinh-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.hieu {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--giay);
  font-family: var(--chu-tay);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: var(--gian-chat);
}

.hieu-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--net);
}

.hieu-sep {
  color: var(--be-tong);
  opacity: 0.5;
}

.hieu-sub {
  font-family: var(--chu-so);
  font-size: 13px;
  color: var(--be-tong);
  letter-spacing: var(--gian-mono);
}

.dinh-menu {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 28px);
  font-family: var(--chu-tay);
  font-size: 14px;
}

.dinh-menu a {
  color: var(--be-tong);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.dinh-menu a:hover {
  color: var(--giay);
}

.dinh-cta {
  color: var(--giay) !important;
  border: 1px solid var(--net);
  border-radius: var(--ban-kinh-sieu-nho);
  padding: 6px 14px;
  font-family: var(--chu-so);
  font-size: 12px;
  letter-spacing: var(--gian-mono);
  background: color-mix(in srgb, var(--than-chi) 70%, transparent);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dinh-cta:hover {
  border-color: var(--tin-hieu-truyen);
  background: var(--tin-hieu-truyen-glow);
}

/* --- HERO SECTION --- */
.hero {
  padding: clamp(60px, 12vh, 120px) 0 clamp(40px, 8vh, 80px);
  border-bottom: 1px solid var(--net-mo);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--chu-so);
  font-size: 12px;
  letter-spacing: var(--gian-mono);
  color: var(--be-tong);
  border: 1px solid var(--net-mo);
  padding: 4px 12px;
  border-radius: var(--ban-kinh-pill);
  background: var(--than-chi);
  margin-bottom: 24px;
}

.hero-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tin-hieu-zen);
  box-shadow: 0 0 8px var(--tin-hieu-zen);
}

.hero h1 {
  font-size: clamp(32px, 5.2vw, 64px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: var(--gian-chat);
  color: var(--xuong);
  margin-bottom: 20px;
  font-family: var(--chu-tay);
}

.hero-lead {
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--be-tong);
  max-width: 760px;
  line-height: 1.6;
  margin-bottom: 36px;
}

.hero-lead strong {
  color: var(--giay);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* --- BUTTONS CHUẨN INDUSTRIAL / TACTILE --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: var(--ban-kinh-sieu-nho);
  font-family: var(--chu-tay);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-truyen {
  background: var(--giay);
  color: var(--muc);
  border: 1px solid var(--giay);
}
.btn-truyen:hover {
  background: var(--trang);
  box-shadow: 0 0 16px rgba(250, 250, 247, 0.25);
  transform: translateY(-1px);
}

.btn-fim {
  background: var(--tin-hieu-fim);
  color: #ffffff;
  border: 1px solid var(--tin-hieu-fim);
}
.btn-fim:hover {
  background: #ff1f2d;
  box-shadow: 0 0 16px var(--tin-hieu-fim-glow);
  transform: translateY(-1px);
}

.btn-sub {
  background: var(--than-chi);
  color: var(--giay);
  border: 1px solid var(--net);
}
.btn-sub:hover {
  border-color: var(--net-dam);
  background: var(--than-sang);
}

/* --- SECTION 1: TRIẾT LÝ TAM TRỤ (MINIMALISM - CLEAR - ZEN) --- */
.triet-ly-sec {
  padding: var(--nhip) 0;
  border-bottom: 1px solid var(--net-mo);
}

.sec-head {
  margin-bottom: clamp(32px, 5vh, 56px);
}

.sec-tag {
  font-family: var(--chu-so);
  font-size: 12px;
  letter-spacing: var(--gian-mono);
  color: var(--be-tong);
  margin-bottom: 8px;
  display: block;
  text-transform: uppercase;
}

.sec-title {
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 700;
  letter-spacing: var(--gian-chat);
  font-family: var(--chu-tay);
  color: var(--xuong);
}

.triet-ly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.triet-ly-card {
  background: var(--than-chi);
  border: 1px solid var(--net);
  border-radius: var(--ban-kinh-sieu-nho);
  padding: 30px 26px;
  position: relative;
  transition: border-color 0.25s ease, transform 0.2s ease;
}

.triet-ly-card:hover {
  border-color: var(--net-dam);
  transform: translateY(-2px);
}

.triet-ly-num {
  font-family: var(--chu-so);
  font-size: 13px;
  color: var(--be-tong);
  margin-bottom: 18px;
  display: block;
}

.triet-ly-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--giay);
  font-family: var(--chu-tay);
}

.triet-ly-card p {
  color: var(--be-tong);
  font-size: 15px;
  line-height: 1.6;
}

/* --- SECTION SHOWCASE SẢN PHẨM (Z-TRUYEN & Z-FIM) --- */
.app-sec {
  padding: var(--nhip) 0;
  border-bottom: 1px solid var(--net-mo);
}

.app-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.app-badge {
  font-family: var(--chu-so);
  font-size: 11px;
  letter-spacing: var(--gian-mono);
  padding: 3px 10px;
  border-radius: var(--ban-kinh-pill);
  text-transform: uppercase;
  font-weight: 600;
}

.app-badge.truyen {
  background: var(--tin-hieu-truyen-glow);
  color: #60a5fa;
  border: 1px solid var(--net-truyen);
}

.app-badge.fim {
  background: var(--tin-hieu-fim-glow);
  color: #f87171;
  border: 1px solid var(--net-fim);
}

.app-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

.app-info h2 {
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 700;
  letter-spacing: var(--gian-chat);
  margin-bottom: 16px;
  color: var(--xuong);
  font-family: var(--chu-tay);
}

.app-desc {
  font-size: 16px;
  color: var(--be-tong);
  margin-bottom: 24px;
  line-height: 1.65;
}

.spec-list {
  list-style: none;
  margin-bottom: 32px;
}

.spec-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--net-mo);
  font-size: 14.5px;
}

.spec-item:first-child {
  border-top: 1px solid var(--net-mo);
}

.spec-key {
  font-family: var(--chu-so);
  font-size: 12px;
  color: var(--be-tong);
  min-width: 130px;
}

.spec-val {
  color: var(--giay);
  font-weight: 500;
}

/* --- KHUNG HÌNH MOCKUP SẢN PHẨM (SPECIMEN FRAME) --- */
.specimen-frame {
  background: var(--than-chi);
  border: 1px solid var(--net);
  border-radius: var(--ban-kinh-sieu-nho);
  padding: 12px;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: hidden;
}

.specimen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 12px;
  border-bottom: 1px solid var(--net-mo);
  margin-bottom: 12px;
  font-family: var(--chu-so);
  font-size: 11px;
  color: var(--be-tong);
}

.specimen-tabs {
  display: flex;
  gap: 8px;
}

.specimen-tab-btn {
  background: transparent;
  border: 1px solid var(--net-mo);
  color: var(--be-tong);
  font-family: var(--chu-so);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.specimen-tab-btn.active, .specimen-tab-btn:hover {
  background: var(--than-sang);
  border-color: var(--net);
  color: var(--giay);
}

.specimen-img-wrap {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--net-mo);
}

.specimen-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 480px;
  transition: opacity 0.3s ease;
}

/* --- LƯỚI TẢI ĐA NỀN TẢNG (DOWNLOAD CHIPS) --- */
.dl-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.dl-chip {
  background: var(--than-chi);
  border: 1px solid var(--net);
  border-radius: var(--ban-kinh-sieu-nho);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--giay);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.dl-chip:hover {
  border-color: var(--net-dam);
  background: var(--than-sang);
  transform: translateY(-2px);
}

.dl-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dl-chip-name {
  font-family: var(--chu-tay);
  font-weight: 600;
  font-size: 14px;
}

.dl-chip-badge {
  font-family: var(--chu-so);
  font-size: 11px;
  color: var(--be-tong);
  border: 1px solid var(--net-mo);
  padding: 1px 6px;
  border-radius: 2px;
}

.dl-chip-meta {
  font-family: var(--chu-so);
  font-size: 12px;
  color: var(--be-tong);
}

/* --- KHU VỰC DOWNLOADER & SHORTLINK (AFTVNEWS / E-INK) --- */
.downloader-sec {
  padding: var(--nhip) 0;
  border-bottom: 1px solid var(--net-mo);
}

.downloader-box {
  background: var(--than-chi);
  border: 1px solid var(--net);
  border-radius: var(--ban-kinh-sieu-nho);
  padding: clamp(24px, 4vw, 42px);
  position: relative;
}

.downloader-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--xuong);
  margin-bottom: 12px;
  font-family: var(--chu-tay);
}

.downloader-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--muc);
  border: 1px solid var(--net);
  border-radius: var(--ban-kinh-sieu-nho);
  padding: 12px 18px;
  margin: 20px 0;
  font-family: var(--chu-so);
  font-size: 13.5px;
}

.downloader-url {
  color: #60a5fa;
  flex: 1;
  min-width: 260px;
  word-break: break-all;
}

.btn-copy {
  background: var(--than-sang);
  border: 1px solid var(--net);
  color: var(--giay);
  font-family: var(--chu-tay);
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: var(--giay);
  color: var(--muc);
}

/* --- FOOTER COLOPHON TỐI GIẢN --- */
footer.chan {
  padding: 60px 0 80px;
  border-top: 1px solid var(--net-mo);
  font-size: 13.5px;
  color: var(--be-tong);
}

.chan-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.chan-links {
  display: flex;
  gap: 20px;
}

.chan-links a {
  color: var(--be-tong);
  text-decoration: none;
  transition: color 0.2s;
}

.chan-links a:hover {
  color: var(--giay);
}

/* --- RESPONSIVE FIXES GATES --- */
@media (max-width: 640px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: center;
  }
  .dinh-menu {
    gap: 12px;
  }
  .dinh-cta {
    display: none;
  }
  .chan-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
