/* ===== Lampiran B colour palette (only these 4 colours) =====
   Primary text   #172033
   Buttons/links  #1D4ED8
   Section bg     #F3F4F6
   Main bg        #FFFFFF
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; } /* keeps anchor clear of sticky header */
body { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 1rem; line-height: 1.65; color: #172033; background: #FFFFFF; }
img { max-width: 100%; display: block; }
a { color: #1D4ED8; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 3px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ----- Header ----- */
.site-header { position: sticky; top: 0; z-index: 10; background: #FFFFFF; border-bottom: 1px solid rgba(23,32,51,.15); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.logo { font-weight: bold; font-size: 1.25rem; color: #172033; text-decoration: none; }
.site-nav ul { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 14px; color: #172033; text-decoration: none; border-bottom: 3px solid transparent; transition: color .2s, border-color .2s; }
.site-nav a:hover { color: #1D4ED8; }
.site-nav a[aria-current="page"] { color: #1D4ED8; border-bottom-color: #1D4ED8; font-weight: bold; }

.menu-toggle { display: none; width: 48px; height: 48px; padding: 0; background: #FFFFFF; border: 1px solid rgba(23,32,51,.25); border-radius: 6px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.menu-toggle .bar { width: 22px; height: 2px; background: #172033; transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----- Buttons ----- */
.btn { display: inline-block; padding: 14px 28px; min-height: 48px; background: #1D4ED8; color: #FFFFFF; font-weight: bold; text-decoration: none; border-radius: 6px; transition: opacity .2s, transform .2s; }
.btn:hover { opacity: .88; transform: translateY(-2px); }

/* ----- Sections ----- */
.section { padding: 80px 0; }
.alt { background: #F3F4F6; }
.label { font-size: .875rem; font-weight: bold; letter-spacing: .08em; color: #1D4ED8; margin-bottom: .5em; }
.subtitle { font-size: 1.25rem; font-weight: bold; }

.hero { padding: 72px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero-text p:not(.label):not(.subtitle) { max-width: 52ch; margin-bottom: 1.6em; }

/* ----- Images + fallback placeholder ----- */
.img-box { position: relative; overflow: hidden; background: #F3F4F6; border: 1px solid rgba(23,32,51,.15); }
.img-box img { width: 100%; height: 100%; object-fit: cover; }
.hero-image { aspect-ratio: 6 / 7; border-radius: 8px; max-width: 440px; width: 100%; justify-self: end; }
.ratio { aspect-ratio: 3 / 2; }
.img-box.no-image img { display: none; }
.img-box.no-image::after { content: "Letakkan gambar: " attr(data-fallback); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: .9rem; color: #172033; }

/* ----- Cards ----- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
.card { background: #FFFFFF; border: 1px solid rgba(23,32,51,.15); border-radius: 8px; box-shadow: 0 1px 3px rgba(23,32,51,.08); transition: box-shadow .2s, transform .2s; overflow: hidden; }
.card:hover { box-shadow: 0 6px 16px rgba(23,32,51,.12); transform: translateY(-3px); }
.skill { padding: 28px; }
.skill p { margin: 0; }
.icon { width: 36px; height: 36px; margin-bottom: 16px; fill: none; stroke: #1D4ED8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card .img-box { border: 0; border-bottom: 1px solid rgba(23,32,51,.15); }
.card-body { padding: 24px; }
.card-body p { margin: 0; }

/* ----- Contact ----- */
.contact .container { max-width: 760px; }
.email { font-weight: bold; }

/* ----- Secondary pages ----- */
.page-title { padding: 96px 0; background: #F3F4F6; min-height: 50vh; }
.page-title h1 { margin: 0; }

/* ----- Footer ----- */
.site-footer { padding: 28px 0; text-align: center; border-top: 1px solid rgba(23,32,51,.15); }
.site-footer p { margin: 0; font-size: .95rem; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-3 { gap: 20px; }
  .hero-grid { gap: 36px; }
  h1 { font-size: 2.4rem; }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image { justify-self: center; order: -1; max-width: 320px; }
  .section { padding: 56px 0; }
  .hero { padding: 40px 0 56px; }
  .menu-toggle { display: flex; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #FFFFFF; border-bottom: 1px solid rgba(23,32,51,.15); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px 24px 16px; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid rgba(23,32,51,.1); }
  .site-nav a[aria-current="page"] { border-bottom-color: #1D4ED8; }
}
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .btn { display: block; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.img-box {
  width: 100%;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: #f3f4f6;
}

.img-box img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* 普通橫圖 */
.img-box.ratio {
  aspect-ratio: 4 / 3;
}

/* 豎屏海報 */
.img-box.portrait {
  aspect-ratio: 3 / 4;
}

/* 豎屏海報不要裁切 */
.img-box.portrait img {
  object-fit: contain;
  background: #ffffff;
}

/* Portfolio video */
.video-box {
  aspect-ratio: 16 / 9;
  background: #172033;
  overflow: hidden;
}

.video-box video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 影片容器 */
.video-box {
  position: relative;
}

/* 聲音控制按鈕 */
.sound-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(23, 32, 51, 0.85);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sound-btn:hover {
  background: #1D4ED8;
}
