/* ————— Tang Thai Heng · ธีมมืด heritage จาก Figma Make ("ออกแบบเว็บจาก PDF") —————
   tokens ตรงจาก :root ของไฟล์ Make:
   bg #0C0B08 · fg #F0EAD8 · card #141209 · primary(gold) #C8A44A
   secondary #1E1B11 · muted #1A1810 · muted-fg #7A7060 · border #2C2820
   body-copy #C8C0A8 · radius 2px
   fonts: Fraunces (display) · Source Sans 3 (body) · DM Mono (labels/data)   */

:root {
  --background: #0C0B08;
  --foreground: #F0EAD8;
  --card: #141209;
  --primary: #C8A44A;
  --secondary: #1E1B11;
  --muted: #1A1810;
  --muted-foreground: #7A7060;
  --border: #2C2820;
  --ring: #C8A44A;
  --body-copy: #C8C0A8;
  --radius: 2px;
  --font-display: 'Fraunces', 'Noto Serif TC', 'Noto Serif Thai', Georgia, serif;
  --font-body: 'Source Sans 3', 'Noto Sans Thai', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --container: 72rem;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
}

html::-webkit-scrollbar { display: none; }

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ————— ตัวช่วยตามธีม ————— */

.font-display { font-family: var(--font-display); }

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.gold-rule {
  width: 40px;
  height: 2px;
  background: var(--primary);
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.hover-gold { transition: color 0.2s; }
.hover-gold:hover { color: var(--primary); }

/* ————— แถบนำทาง ————— */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(12, 11, 8, 0.95);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--border);
}

.nav-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-chop {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.brand-names {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--foreground);
  line-height: 1;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-top: 3px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--primary); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.25rem;
  height: 1px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ————— ส่วนเปิด ————— */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-shade-b, .hero-shade-r {
  position: absolute;
  inset: 0;
}

.hero-shade-b { background: linear-gradient(to bottom, rgba(12,11,8,0.4), rgba(12,11,8,0.3), var(--background)); }
.hero-shade-r { background: linear-gradient(to right, rgba(12,11,8,0.7), transparent); }

.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding-bottom: 6rem;
  padding-top: 8rem;
}

/* ขนาดตามบันได text-6xl / md:text-8xl / lg:text-9xl ของต้นฉบับ Make เป๊ะ */
.hero h1 {
  font-family: var(--font-display);
  font-size: 3.75rem;
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.025em;
  color: var(--foreground);
  margin: 2rem 0 1rem;
}

@media (min-width: 768px) {
  .hero h1 { font-size: 6rem; }
}

@media (min-width: 1024px) {
  .hero h1 { font-size: 8rem; }
}

.hero h1 .gold { color: var(--primary); }

.hero-meta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}

.hero-names-cn {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--primary);
}

.hero-meta-divider {
  width: 4rem;
  height: 1px;
  background: var(--border);
}

.badges { display: flex; gap: 1rem; }

.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--primary);
  border: 1px solid rgba(200, 164, 74, 0.4);
  padding: 0.375rem 0.75rem;
}

.hero-tags {
  margin-top: 3rem;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.hero-tags .dot { color: var(--border); }

/* ตราวงกลมตั้งไถ่เฮง (โทนทองตามธีม) มุมขวาของ hero */
.hero-seal {
  position: absolute;
  right: 4rem;
  bottom: 7rem;
  z-index: 10;
  width: 240px;
  opacity: 0.9;
}

/* ————— โครง section ————— */

.section {
  padding: 6rem 0;
  scroll-margin-top: 4rem;
}

.section-rule { border-top: 1px solid var(--border); }

.section-head { margin-bottom: 4rem; }

.section-head .gold-rule { margin: 0.75rem 0 1.25rem; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.section-intro {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  line-height: 1.625;
  max-width: 42rem;
}

/* เอฟเฟกต์ปรากฏ — ซ่อนเฉพาะเมื่อ JS ทำงาน */
.js .reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.7s, transform 0.7s;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ————— About ————— */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.two-col.is-centered { align-items: center; }

.prose { display: flex; flex-direction: column; gap: 1.25rem; }

.prose p { color: var(--body-copy); line-height: 1.625; }

.prose strong { color: var(--foreground); font-weight: 600; }

.prose em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--primary);
}

.about-media { display: flex; flex-direction: column; gap: 1.5rem; }

.media-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
}

.media-card img { width: 100%; height: 16rem; object-fit: cover; opacity: 0.8; }

.media-card .media-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12,11,8,0.8), transparent);
}

.media-card .media-caption {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
}

.media-caption .gold { color: var(--primary); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-box {
  border: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-box .num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.1;
}

.stat-box .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  line-height: 1.3;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.subsection { margin-top: 6rem; }

.subsection .gold-rule { margin: 0.75rem 0 2.5rem; }

/* ————— Timeline ————— */

.timeline { position: relative; }

/* เส้นแนวตั้งวางให้ผ่านกึ่งกลางจุด node: year 6rem + gap 2rem + รัศมีจุด 0.375rem */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8.35rem;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 2rem;
  padding: 1.25rem 0;
}

.timeline-item .year {
  width: 6rem;
  flex: none;
  text-align: right;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
}

.timeline-item .entry {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.timeline-item .node {
  flex: none;
  margin-top: 0.3rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--background);
  position: relative;
  z-index: 1;
}

.timeline-item p {
  color: var(--body-copy);
  font-size: 0.875rem;
  line-height: 1.625;
  transition: color 0.2s;
}

.timeline-item:hover p { color: var(--foreground); }

/* ————— ตารางเส้นผม (hairline grid) ————— */

.hairline-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
}

.hairline-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hairline-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.cell {
  background: var(--background);
  padding: 1.5rem;
  transition: background-color 0.2s;
}

.cell:hover { background: var(--card); }

.cell .cell-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.cell .cell-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.cell .cell-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary);
}

/* ————— แถวสเปค (product / contact) ————— */

.spec-list { display: flex; flex-direction: column; gap: 1.5rem; }

.spec-row { border-top: 1px solid var(--border); padding-top: 1.25rem; }

.spec-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.375rem;
}

.spec-row p {
  color: var(--body-copy);
  font-size: 0.875rem;
  line-height: 1.625;
  white-space: pre-line;
}

.product-media { display: flex; flex-direction: column; gap: 1rem; }

.product-media .photo-lg { position: relative; overflow: hidden; }
.product-media .photo-lg img { width: 100%; height: 20rem; object-fit: cover; }
.product-media .photo-lg .shade { position: absolute; inset: 0; background: linear-gradient(to bottom right, rgba(12,11,8,0.2), rgba(12,11,8,0.6)); }

.product-media .photo-sm { position: relative; overflow: hidden; }
.product-media .photo-sm img { width: 100%; height: 12rem; object-fit: cover; }
.product-media .photo-sm .shade { position: absolute; inset: 0; background: linear-gradient(to top, var(--background), transparent); }

.photo-sm .caption { position: absolute; bottom: 1rem; left: 1rem; right: 1rem; }

.photo-sm .caption .brand-line {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--primary);
  font-size: 0.875rem;
}

/* ————— Quality ————— */

.cert-card { padding: 2rem; }

.cert-card .cert-code {
  font-family: var(--font-mono);
  font-size: 1.875rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 1rem;
}

.cert-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.375;
  margin-bottom: 0.75rem;
}

.cert-card p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.625;
  transition: color 0.2s;
}

.cert-card:hover p { color: var(--body-copy); }

.photo-placeholders {
  margin-top: 3rem;
  border: 1px solid var(--border);
  padding: 2rem;
}

.photo-placeholders .section-label { display: block; margin-bottom: 1rem; }

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.placeholder-slot {
  background: var(--card);
  border: 1px dashed var(--border);
  height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-inline: 0.5rem;
}

/* ————— Private Label ————— */

.bullet-list { display: flex; flex-direction: column; gap: 1.25rem; }

.bullet-item { display: flex; gap: 1rem; align-items: flex-start; }

.bullet-item .dot {
  flex: none;
  margin-top: 0.45rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--primary);
}

.bullet-item p { color: var(--body-copy); font-size: 0.875rem; line-height: 1.625; }

.brand-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2.5rem;
  text-align: center;
}

.brand-card .seal { width: 190px; margin: 0 auto 1.5rem; }

.brand-card .cn {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.brand-card .gold-rule { margin: 0 auto 1rem; }

.brand-card .latin {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

/* ————— Export docs ————— */

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.doc-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid var(--border);
  padding: 1rem;
  transition: border-color 0.2s;
}

.doc-item:hover { border-color: rgba(200, 164, 74, 0.3); }

.doc-item .dot {
  flex: none;
  margin-top: 0.45rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--primary);
}

.doc-item p { color: var(--body-copy); font-size: 0.875rem; line-height: 1.625; }

/* ————— Contact ————— */

.contact-brand {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2.5rem;
}

.contact-brand .cn {
  font-family: var(--font-display);
  font-size: 3.75rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.contact-brand .latin {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.contact-brand .mono-tag { display: block; margin-bottom: 2rem; }

.contact-brand .gold-rule { margin-bottom: 1.5rem; }

.contact-brand .note {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.625;
}

.contact-brand .note strong { color: var(--primary); font-weight: 600; }

.contact-side { display: flex; flex-direction: column; gap: 1.5rem; }

.cert-badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.cert-badge {
  border: 1px solid rgba(200, 164, 74, 0.3);
  padding: 1.25rem;
}

.cert-badge .title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.cert-badge .sub { color: var(--muted-foreground); font-size: 0.75rem; }

/* ————— Footer ————— */

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: center; gap: 0.75rem; }

.footer-chop { width: 1.5rem; height: 1.5rem; flex: none; }

/* ————— จอเล็ก ————— */

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 2.5rem; }
  .hairline-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  /* กริด 3 ช่องในเลย์เอาต์ 2 คอลัมน์: ช่องสุดท้ายขยายเต็มแถว กันพื้นสีเส้นขอบโผล่ */
  .hairline-grid.cols-3 .cell:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .placeholder-grid { grid-template-columns: 1fr 1fr; }
  .hero-seal { display: none; }
  .section { padding: 4.5rem 0; }
  .section-head { margin-bottom: 2.5rem; }
  .subsection { margin-top: 4rem; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(12, 11, 8, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1rem;
  }

  .nav-links.is-open { display: flex; }

  .nav-links a { display: block; padding: 0.75rem 0; font-size: 0.8rem; }

  .nav.has-open-menu {
    background: rgba(12, 11, 8, 0.98);
    border-bottom-color: var(--border);
  }
}

@media (max-width: 640px) {
  .hairline-grid.cols-3,
  .hairline-grid.cols-2,
  .doc-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .stat-box { padding: 0.75rem; }
  .timeline::before { left: 5.1rem; }
  .timeline-item { gap: 1.25rem; }
  .timeline-item .year { width: 3.5rem; font-size: 0.8rem; }
  .timeline-item .entry { gap: 1rem; }
  .hero-content { padding-bottom: 4rem; }
  .cert-badges { grid-template-columns: 1fr; }
}
