/* PT Herlina Utama Khatulistiwa — company profile
   Tokens diambil dari brosur: hitam + kuning logo, biru dan krem pipa PVC.
   Mode gelap: html[data-theme="dark"], atau mengikuti sistem jika belum dipilih. */
:root {
  /* Warna brand (tetap di kedua mode) */
  --black: #000;
  --yellow: #F7DF1E;
  --pvc-blue: #1C74C4;
  --pvc-cream: #EFD48A;
  --ppr: #3E9B5A;           /* hijau PPR (dugaan warna produk) */

  /* Warna semantik (mode terang) */
  --surface: #fff;          /* header, hero, katalog, form, footer */
  --paper: #F3F6F8;         /* latar halaman, isian form */
  --ink: #18232D;           /* teks biasa */
  --strong: #000;           /* judul, garis tegas, tombol hitam */
  --on-strong: #fff;        /* teks di atas --strong */
  --muted: #52606C;
  --line: #D3DCE3;
  --grid: #E2E9EF;
  --link: #1C74C4;
  --field-border: #9AA8B3;
  --header-bg: rgba(255,255,255,.94);
  --ok: #10703A;
  --err: #B42318;
  --ico-filter: none;
  --ico-blend: multiply;
  color-scheme: light;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

/* Mode gelap: dipilih manual */
:root[data-theme="dark"] {
  --surface: #121A21;
  --paper: #0B1116;
  --ink: #DCE3E9;
  --strong: #F2F5F7;
  --on-strong: #0B1116;
  --muted: #9AA8B3;
  --line: #24313C;
  --grid: #1A242D;
  --link: #6CB2F2;
  --field-border: #3A4A57;
  --header-bg: rgba(18,26,33,.92);
  --ok: #5DD58E;
  --err: #FF8A80;
  --ico-filter: invert(1) brightness(.9);
  --ico-blend: screen;
  color-scheme: dark;
}
/* Mode gelap: mengikuti sistem jika pengunjung belum memilih */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #121A21;
    --paper: #0B1116;
    --ink: #DCE3E9;
    --strong: #F2F5F7;
    --on-strong: #0B1116;
    --muted: #9AA8B3;
    --line: #24313C;
    --grid: #1A242D;
    --link: #6CB2F2;
    --field-border: #3A4A57;
    --header-bg: rgba(18,26,33,.92);
    --ok: #5DD58E;
    --err: #FF8A80;
    --ico-filter: invert(1) brightness(.9);
    --ico-blend: screen;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--yellow); color: var(--black); padding: .5rem 1rem; font-weight: 700;
}
.skip:focus { top: 1rem; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.35rem;
  font: 700 1rem/1 var(--font); font-stretch: 110%;
  text-decoration: none; border: 2px solid var(--strong); border-radius: 999px;
  cursor: pointer; transition: background-color .15s, color .15s;
}
.btn-yellow { background: var(--yellow); color: var(--black); border-color: var(--black); }
.btn-yellow:hover { background: var(--black); color: var(--yellow); }
.btn-ink { background: var(--strong); color: var(--on-strong); }
.btn-ink:hover { background: var(--yellow); color: var(--black); border-color: var(--black); }
.btn-line { background: transparent; color: var(--strong); }
.btn-line:hover { background: var(--strong); color: var(--on-strong); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; gap: .2rem; }
.brand-name { font-weight: 800; font-stretch: 112%; font-size: 1.05rem; line-height: 1.1; color: var(--strong); }
.brand-tag {
  align-self: flex-start;
  background: var(--black); color: var(--yellow);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  padding: .15rem .7rem; border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line);
}
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a:not(.btn) { text-decoration: none; font-weight: 600; color: var(--ink); }
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.nav .btn { min-height: 42px; padding: .55rem 1.1rem; }

/* Tombol mode gelap/terang */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border: 2px solid var(--strong); border-radius: 999px;
  background: transparent; color: var(--strong);
  cursor: pointer; transition: background-color .15s, color .15s;
}
.theme-toggle:hover { background: var(--strong); color: var(--on-strong); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* ---------- Hero ---------- */
.hero { background: var(--surface); overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-inner {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding-top: clamp(3rem, 7vw, 6rem); padding-bottom: clamp(3rem, 7vw, 6rem);
}
.hero h1 {
  font-size: clamp(2.3rem, 4.4vw, 4rem);
  font-weight: 850; font-stretch: 122%;
  letter-spacing: -.015em; line-height: 1.02;
  color: var(--strong); max-width: 17ch; text-wrap: balance;
}
.lead { margin-top: 1.5rem; font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* The diamond: the brand mark, filled with real PVC pipe */
.hero-mark { position: relative; margin: 0; aspect-ratio: 1; width: 100%; max-width: 520px; justify-self: center; }
.hero-mark > span { position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.mark-outline { background: var(--strong); }
.mark-yellow { background: var(--yellow); inset: 4.5% !important; transform: translate(-7%, 0) scale(.92); }
.mark-photo { inset: 12% !important; }
.mark-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }

@media (prefers-reduced-motion: no-preference) {
  .mark-outline { animation: mark-in .7s cubic-bezier(.2,.7,.2,1) backwards; }
  .mark-yellow  { animation: mark-slide .8s .15s cubic-bezier(.2,.7,.2,1) backwards; }
  .mark-photo   { animation: mark-in .8s .3s cubic-bezier(.2,.7,.2,1) backwards; }
  @keyframes mark-in { from { opacity: 0; transform: scale(.82) rotate(-12deg); } }
  @keyframes mark-slide { from { opacity: 0; transform: translate(-30%, 0) scale(.92); } }
}

/* ---------- Catalog ---------- */
.catalog {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
.section-head { display: grid; grid-template-columns: 1fr 1.3fr; gap: 2rem; align-items: end; margin-bottom: 3rem; }
.section-head h2, .contact h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 850; font-stretch: 122%; color: var(--strong);
}
.section-head p { color: var(--muted); max-width: 52ch; }

.pipe-row {
  display: grid; grid-template-columns: 1.6fr 1fr;
  background: var(--black); color: #fff; border: 2px solid var(--strong);
}
.pipe-row img { width: 100%; height: 100%; max-height: 340px; object-fit: cover; }
.pipe-copy { padding: clamp(1.5rem, 3vw, 2.5rem); display: flex; flex-direction: column; justify-content: center; gap: .9rem; }
.pipe-copy h3 { font-size: 1.9rem; font-weight: 800; font-stretch: 118%; color: var(--yellow); }
.pipe-copy p { color: #D9E1E7; }

.sheet-title { margin: 3.5rem 0 1.25rem; font-size: 1.9rem; font-weight: 800; font-stretch: 118%; color: var(--strong); }
.sheet {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 2px solid var(--strong); border-left: 2px solid var(--strong);
  background: var(--surface);
}
.sheet li {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  padding: 1.5rem 1rem 1.25rem;
  border-right: 2px solid var(--strong); border-bottom: 2px solid var(--strong);
  font-weight: 650; text-align: center; font-size: .98rem;
}
/* Ilustrasi fitting dari brosur: 1 lembar sprite 370x362 px, ditampilkan 1.2x.
   --x/--y = posisi kiri-atas ikon di lembar asli (px). */
.ico {
  --s: 1.2;
  width: calc(var(--w) * 1px * var(--s)); height: calc(var(--h) * 1px * var(--s));
  background: url("/img/fitting-sheet.png") no-repeat;
  background-size: calc(370px * var(--s)) calc(362px * var(--s));
  background-position: calc(var(--x) * -1px * var(--s)) calc(var(--y) * -1px * var(--s));
  mix-blend-mode: var(--ico-blend);
  filter: var(--ico-filter);
}

/* Foto produk hasil generate: jika file ada, ilustrasi disembunyikan.
   Jika file belum ada, <img> dihapus oleh onerror dan ilustrasi tetap tampil. */
.ph { width: 128px; height: 128px; object-fit: contain; background: #fff; border-radius: 4px; }
.sheet li:has(> .ph) > .ico,
.sheet li:has(> .ph) > .ppr-ico { display: none; }

/* PPR */
.pipe-row-ppr { margin-top: 4.5rem; }
.pipe-row.no-img { grid-template-columns: 1fr; }
.sheet-ppr { grid-template-columns: repeat(6, 1fr); }
/* Penampang pipa PPR (pengganti ilustrasi sampai foto tersedia) */
.ppr-ico {
  width: 76px; height: 76px; margin: 16px 0;
  border-radius: 50%;
  border: 14px solid var(--ppr);
  box-shadow: 0 0 0 2px var(--strong), inset 0 0 0 2px var(--strong);
}

/* ---------- Contoh instalasi ---------- */
.install { padding: clamp(4rem, 8vw, 6.5rem) 0; background: var(--paper); }
.install h2 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 850; font-stretch: 122%; color: var(--strong); }
/* Lebar kolom 1 : 2.25 agar foto potret (2:3) dan lanskap (3:2) sama tinggi */
.install-grid { display: grid; grid-template-columns: 1fr 2.25fr; gap: clamp(1rem, 2vw, 1.5rem); align-items: start; }
.install-grid figure { margin: 0; }
.install-grid img { width: 100%; height: auto; border: 2px solid var(--strong); }
.install-grid figcaption { margin-top: .6rem; font-weight: 600; font-size: .95rem; }
.note { margin-top: 1.25rem; font-size: .85rem; color: var(--muted); }

/* ---------- About (letter) ---------- */
.about { background: var(--black); color: #fff; position: relative; overflow: hidden; border-block: 1px solid var(--line); }
.about::after {
  content: ""; position: absolute; right: -140px; top: 50%; width: 420px; height: 420px;
  background: var(--yellow); transform: translateY(-50%) rotate(45deg); opacity: .95;
}
.about-inner { position: relative; z-index: 1; padding-top: clamp(4rem, 8vw, 6.5rem); padding-bottom: clamp(4rem, 8vw, 6.5rem); }
.about blockquote { margin: 0; max-width: 50ch; }
.about blockquote p {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem); line-height: 1.4; font-weight: 500; font-stretch: 104%;
}
.about blockquote p + p { margin-top: 1.25rem; color: #C9D2D9; }
.about footer { margin-top: 2.25rem; display: flex; flex-direction: column; gap: .2rem; padding-left: 1.25rem; border-left: 4px solid var(--yellow); }
.sig-name { font-weight: 800; font-stretch: 115%; font-size: 1.25rem; color: var(--yellow); }
.sig-role { color: #C9D2D9; font-size: .95rem; }

/* ---------- Contact ---------- */
.contact { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.contact-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.contact-info > p { margin-top: 1rem; color: var(--muted); max-width: 44ch; }
.facts { margin: 2rem 0 0; display: grid; gap: 1.5rem; }
.facts div { border-top: 2px solid var(--strong); padding-top: .85rem; }
.facts dt { font-weight: 700; font-size: .95rem; color: var(--muted); }
.facts dd { margin: .3rem 0 0; font-size: 1.15rem; }
.facts dd > a[href^="tel"] { font-size: 1.9rem; font-weight: 800; font-stretch: 115%; text-decoration: none; color: var(--strong); }
.facts address { font-style: normal; }
.person { display: block; margin-top: .15rem; font-weight: 600; color: var(--ink); }
.mail { color: var(--link); font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }
.map-link { display: inline-block; margin-top: .5rem; font-size: .98rem; font-weight: 600; color: var(--link); text-underline-offset: 3px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.form {
  background: var(--surface); border: 2px solid var(--strong);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid; gap: 1.1rem;
}
.form h3 { font-size: 1.5rem; font-weight: 800; font-stretch: 115%; color: var(--strong); }
.field { display: grid; gap: .35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field label { font-weight: 650; font-size: .95rem; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: .75rem .85rem; border: 1.5px solid var(--field-border); border-radius: 6px; background: var(--paper);
  width: 100%;
}
.field ::placeholder { color: var(--muted); opacity: .85; }
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(28,116,196,.3); background: var(--surface); }
.field [aria-invalid="true"] { border-color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 2.25rem 0 5.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; font-size: .92rem; color: var(--muted); }
.brand-foot .brand-name { font-size: .95rem; }

/* Floating WhatsApp (mobile) */
.wa-float { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-mark { max-width: 380px; order: -1; }
  .section-head { grid-template-columns: 1fr; gap: 1rem; }
  .pipe-row { grid-template-columns: 1fr; }
  .sheet, .sheet-ppr { grid-template-columns: repeat(3, 1fr); }
  .contact-inner { grid-template-columns: 1fr; }
  .install-grid { grid-template-columns: 1fr; }
  .install-grid figure:first-child img { max-width: 420px; }
  .about::after { width: 260px; height: 260px; right: -150px; }
}
@media (max-width: 720px) {
  .nav { gap: .75rem; }
  .nav a:not(.btn) { display: none; }
  .brand-name { font-size: .92rem; }
  .sheet, .sheet-ppr { grid-template-columns: repeat(2, 1fr); }
  .ph { width: 104px; height: 104px; }
  .about::after { display: none; }
  .hero-mark { max-width: 290px; }
  .about-inner { border-left: 0; }
  .about { border-top: 10px solid var(--yellow); }
  .field-row { grid-template-columns: 1fr; }
  .site-footer { padding-bottom: 6.5rem; }
  .wa-float {
    display: flex; align-items: center; justify-content: center;
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60;
    min-height: 52px; border-radius: 999px;
    background: var(--yellow); color: var(--black); border: 2px solid var(--black);
    font-weight: 800; text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
  }
  .nav .btn { display: none; }
}
@media (max-width: 420px) {
  .brand-tag { font-size: .66rem; }
  .brand-name { font-size: .84rem; }
  .hero-actions .btn { width: 100%; }
}
