/* Reset + base typography + shared component primitives */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink-black);
}

body {
  margin: 0;
  /* Vệt loang mực rất mờ trên toàn trang — gợi giấy dó/Liúbái thay vì màu
     đen phẳng tuyệt đối, tăng chất thủy mặc tổng thể theo yêu cầu. */
  background: radial-gradient(ellipse 900px 550px at 12% 6%, rgba(212, 175, 55, 0.035), transparent 60%),
    radial-gradient(ellipse 700px 450px at 88% 94%, rgba(212, 175, 55, 0.03), transparent 60%),
    radial-gradient(ellipse 600px 600px at 94% 18%, rgba(232, 227, 217, 0.018), transparent 65%), var(--ink-black);
  color: var(--ceramic-ivory);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-heading);
  color: var(--ceramic-ivory);
}

h1 {
  font-size: var(--fs-display-xl);
  line-height: var(--lh-tight);
}

h2 {
  font-size: var(--fs-display-md);
}

h3 {
  font-size: var(--fs-heading);
  font-weight: 500;
}

p {
  max-width: 60ch;
}

/* Sentence case enforced in copy; eyebrow labels are the only intentional caps use */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--gold-ink);
  font-weight: 500;
}

/* Accessible focus ring — gold, visible on dark, 3:1+ contrast */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--gold);
  color: var(--ink-fixed);
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

@media (max-width: 640px) {
  .container {
    padding-inline: var(--s-4);
  }
}

.section {
  position: relative;
  /* Bug đã sửa: position:relative KHÔNG tự tạo stacking context nếu không
     kèm z-index — nghĩa là z-index âm của .section-bg-image (ảnh nền góc)
     thoát ra ngoài, kẹt ở stacking context gốc của toàn trang thay vì nằm
     ngay sau nội dung của chính section đó, khiến ảnh biến mất hoàn toàn
     phía sau các section khác. isolation:isolate ép tạo stacking context
     cục bộ mà không cần khai báo z-index. */
  isolation: isolate;
  padding-block: var(--s-10);
}

@media (max-width: 900px) {
  .section {
    padding-block: var(--s-8);
  }
}

@media (max-width: 480px) {
  .section {
    padding-block: var(--s-7);
  }
}

.section-head {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-8);
  max-width: var(--content-narrow);
}

.section-head p {
  color: var(--ceramic-ivory-dim);
  font-size: var(--fs-lead);
}

/* ---------- Seal mark — dấu triện đỏ gắn kèm H1/H2 ---------- */
.seal-heading {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--s-4);
}

.seal-mark {
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--vermilion);
  margin-top: 0.35em;
}

/* ---------- Ink glassmorphism card ---------- */
.ink-card {
  position: relative;
  background: var(--ink-glass-bg);
  backdrop-filter: blur(var(--ink-glass-blur));
  -webkit-backdrop-filter: blur(var(--ink-glass-blur));
  border: 1px solid var(--ink-glass-border);
  box-shadow: var(--ink-glass-shadow);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: border-color var(--dur-base) var(--ease-expo), transform var(--dur-base) var(--ease-expo),
    box-shadow var(--dur-base) var(--ease-expo);
}

/* Ánh vàng "lửa cháy" mờ ảo phía sau card khi hover/focus — bừng sáng nhẹ
   như tia lửa mực dát vàng, không phải hiệu ứng phẳng thông thường. */
.ink-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 28% 12%, rgba(212, 175, 55, 0.4), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-expo);
  pointer-events: none;
}

.ink-card:hover,
.ink-card:focus-within {
  border-color: rgba(212, 175, 55, 0.55);
  transform: translateY(-4px);
  box-shadow: var(--ink-glass-shadow), 0 0 42px rgba(212, 175, 55, 0.22);
}

.ink-card:hover::before,
.ink-card:focus-within::before {
  opacity: 1;
  animation: ink-card-flicker 2.6s ease-in-out infinite;
}

@keyframes ink-card-flicker {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ink-card:hover::before,
  .ink-card:focus-within::before {
    animation: none;
    opacity: 0.85;
  }
}

/* ---------- Gold metallic button ---------- */
.btn {
  /* Cố định, không theo theme — nền nút luôn là gold-metallic (sáng) nên
     chữ luôn cần tối để đủ tương phản, bất kể site đang sáng hay tối. */
  --btn-fg: var(--ink-fixed);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-6);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-expo), box-shadow var(--dur-base) var(--ease-expo),
    filter var(--dur-base) var(--ease-expo), opacity var(--dur-base);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.btn-primary {
  color: var(--btn-fg);
  background: var(--gold-metallic);
  box-shadow: 0 4px 24px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 32px rgba(212, 175, 55, 0.4);
  filter: brightness(1.06);
}

.btn-ghost {
  color: var(--ceramic-ivory);
  background: transparent;
  border-color: var(--btn-ghost-border);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold-ink);
}

/* ---------- Ink stroke divider (SVG paths animated via GSAP) ---------- */
.ink-stroke path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Respect reduced motion at the CSS layer as a baseline safety net */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
