*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(201,168,106,.10), transparent 55%),
              radial-gradient(900px 600px at 80% 20%, rgba(255,255,255,.05), transparent 60%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text-main);
}

html, body{
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* กันล้นจอแนวนอน */
}

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

body{
  min-height: 100vh;
  background-color: #0f1114; /* กัน fallback เป็นขาว */
}

main{
  display: block;
}

.wrap{
  min-height: 100vh;
}

/* ===== Global link reset ===== */
a{
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0;
}

a:hover{
  text-decoration: none;
}

/* กันเส้นใต้ที่บางเบราว์เซอร์ใส่ให้เอง */
a:visited{ color: inherit; }

/* Accessible focus (แทนเส้นใต้) */
a:focus-visible{
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Brand: KRUNIKI (header left) */
.brandText{
  font-family: "Times New Roman", Times, serif;
  color: var(--gold);
  letter-spacing: .06em;
  font-weight: 700;
}

.brand .dot{
  background: var(--gold);
}

h1,h2,h3{
  font-family: "Times New Roman", Times, serif;
  color: var(--text-main);
  letter-spacing: -.01em;
}

/* ===== Anti horizontal scroll (iPad/iOS safe) ===== */
html, body{
  width: 100%;
  overflow-x: hidden;
}

/* กัน iOS มีพื้นหลังขาวเวลาเด้ง/ยืด */
html{
  background: var(--bg);
}
body{
  background-color: var(--bg);
}

/* รูป/สื่อห้ามดันเว็บล้น */
img, svg, video, canvas{
  max-width: 100%;
  height: auto;
}

/* กันกรณีบาง element ยาวจนดันล้น (ข้อความ/ลิงก์) */
*{
  word-wrap: break-word;
}
