/* Demo Kontraktor Contoh untuk portofolio Hastasurya. Perusahaan dan proyek fiktif. */
:root {
  --bg: #0d0d0c;
  --bg-2: #141413;
  --surface: #1a1a18;
  --surface-2: #222220;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .24);
  --text: #f3f1ec;
  --muted: #a9a59c;
  --accent: #d9c6a1;
  --wa: #25d366;
  --paper: #f4f2ee;
  --radius: 14px;
  /* Sans geometris yang tegas di ukuran besar dan tetap rapi di ukuran kecil */
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Tekstur kertas halus supaya latar gelap tidak terasa datar */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > :not(dialog) { position: relative; z-index: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
section[id] { scroll-margin-top: 84px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.draft {
  background: var(--accent);
  color: #1a1712;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  padding: 7px 16px;
}
.draft a { color: inherit; }

/* Header */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 13, 12, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; margin-right: auto; }
.brand span { font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.nav-links { display: none; gap: 26px; font-size: 14px; color: var(--muted); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font: 600 14.5px/1 var(--sans);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-light { background: var(--text); color: #121211; }
.btn-light:hover { background: #fff; }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { padding: 10px 16px; font-size: 13.5px; }

/* Hero */
.hero { padding: 48px 0 64px; }
.hero .wrap { display: grid; gap: 44px; }
/* Satu ketebalan untuk semua judul; penekanan hanya lewat warna */
h1, h2, h3 { font-family: var(--sans); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(32px, 7.5vw, 54px); }
h1 em, h2 em { font-style: normal; color: var(--accent); }
.lead { color: var(--muted); font-size: 17px; max-width: 34em; margin: 22px 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 40px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.stats div { min-width: 0; }
.stats dt { font-weight: 500; letter-spacing: -.02em; font-size: clamp(28px, 7vw, 40px); line-height: 1; }
.stats dd { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }

.hero-media { position: relative; margin: 0; padding-bottom: 54px; }
.hero-main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.hero-main img { width: 100%; height: 100%; object-fit: cover; }
.hero-inset {
  position: absolute;
  right: 14px;
  bottom: 0;
  width: 46%;
  border-radius: 12px;
  overflow: hidden;
  border: 4px solid var(--bg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  aspect-ratio: 4 / 3;
}
.hero-inset img { width: 100%; height: 100%; object-fit: cover; }
.tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(13, 13, 12, .78);
  backdrop-filter: blur(6px);
  color: var(--text);
  letter-spacing: .01em;
}

/* Klien kembali */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.trust .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 34px; padding-top: 22px; padding-bottom: 22px; }
.trust p { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.trust ul { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: 0; padding: 0; list-style: none; }
.trust li { font-size: 18px; font-weight: 600; }
.trust li small { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-left: 6px; }

/* Section umum */
.section { padding: 84px 0; }
.section-head { display: grid; gap: 14px; margin-bottom: 40px; max-width: 720px; }
.section-head h2 { font-size: clamp(30px, 6vw, 46px); }
.section-head p { margin: 0; color: var(--muted); }

/* Layanan */
.services { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.service { background: var(--bg); padding: 28px 24px; }
.service .num { font-size: 13px; color: var(--accent); font-weight: 600; }
.service h3 { font-size: 24px; margin: 14px 0 10px; }
.service p { margin: 0; color: var(--muted); font-size: 15px; }

/* Studi kasus */
.case { display: grid; gap: 28px; padding: 30px 0; border-top: 1px solid var(--line); }
.case:first-of-type { border-top: 0; padding-top: 0; }
.case h3 { font-size: 30px; }
.case .meta { margin: 8px 0 16px; font-size: 13.5px; color: var(--accent); font-weight: 500; }
.case p { color: var(--muted); margin: 0 0 22px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair figure, .steps figure { margin: 0; position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); }
.pair img, .steps img { width: 100%; height: 100%; object-fit: cover; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.steps.three { grid-template-columns: repeat(3, 1fr); }
.steps figcaption, .pair figcaption {
  position: absolute; left: 8px; bottom: 8px;
  font-size: 11.5px; font-weight: 600; padding: 5px 9px; border-radius: 999px;
  background: rgba(13, 13, 12, .78); backdrop-filter: blur(6px);
}
.steps figcaption b { color: var(--accent); margin-right: 4px; }

/* Portofolio */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 0 -20px 14px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  min-height: 44px;
  padding: 9px 15px;
  font: 500 13.5px/1 var(--sans);
  cursor: pointer;
}
.chip span { opacity: .6; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--text); color: #121211; border-color: var(--text); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); margin-bottom: 26px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.grid { display: grid; gap: 18px; }
.card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card .count { position: absolute; right: 10px; top: 10px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(13, 13, 12, .75); }
.card .body { padding: 16px 18px 18px; }
.badge { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge.built { background: rgba(217, 198, 161, .16); color: var(--accent); }
.badge.design { background: rgba(255, 255, 255, .08); color: var(--muted); }
.card h3 { font-size: 19px; margin: 10px 0 4px; }
.card .where { font-size: 13.5px; color: var(--muted); margin: 0; }
.empty { color: var(--muted); padding: 30px 0; }

/* Proses */
.process { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.process li { display: grid; grid-template-columns: 52px 1fr; gap: 6px 16px; padding: 22px 0; border-top: 1px solid var(--line); counter-increment: step; }
.process li::before { content: "0" counter(step); font-weight: 500; font-size: 28px; line-height: 1; color: var(--accent); grid-row: span 2; }
.process h3 { font-size: 20px; }
.process p { margin: 0; color: var(--muted); font-size: 15px; }

/* Area */
.areas { display: grid; gap: 14px; }
.area { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--bg-2); }
.area h3 { font-size: 28px; margin-bottom: 14px; }
.area ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.area li { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 13px; font-size: 14px; }
.area p { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative;
  font-weight: 600; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 13px; font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--accent); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 22px; color: var(--muted); max-width: 46em; }

/* Kontak */
.contact { display: grid; gap: 28px; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; display: grid; gap: 16px; }
.form .row { display: grid; gap: 16px; }
label.field { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font: 400 15.5px/1.4 var(--sans);
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field .opt { font-weight: 400; opacity: .7; }
.form .btn { width: 100%; padding: 15px 22px; font-size: 15px; background: var(--wa); color: #06210f; }
.form .note { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.contact-info h2 { font-size: clamp(30px, 6vw, 46px); margin-bottom: 16px; }
.contact-info > p { color: var(--muted); margin: 0 0 26px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-list a, .contact-row { display: flex; gap: 14px; align-items: center; text-decoration: none; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.contact-list a:hover { border-color: var(--line-strong); }
.contact-list svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.contact-list small { display: block; color: var(--muted); font-size: 12px; }
.contact-list span { font-weight: 600; font-size: 15px; word-break: break-word; }

footer { border-top: 1px solid var(--line); padding: 36px 0 110px; font-size: 13px; color: var(--muted); }
footer .wrap { display: grid; gap: 16px; }
footer .brand span { color: var(--text); }
footer p { margin: 0; }

.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--wa); color: #06210f; text-decoration: none;
  padding: 14px 18px; border-radius: 999px; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.wa-float.show { opacity: 1; transform: none; pointer-events: auto; }
.wa-float svg { width: 22px; height: 22px; }

/* Dialog proyek */
dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--bg-2);
  color: var(--text);
  overflow: auto;
}
dialog::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(4px); }
.viewer { position: relative; background: #000; aspect-ratio: 4 / 3; max-height: 66dvh; width: 100%; }
.viewer img { width: 100%; height: 100%; object-fit: contain; }
.viewer button {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(13, 13, 12, .7); color: var(--text); font-size: 22px; line-height: 1;
}
.viewer .prev { left: 10px; }
.viewer .next { right: 10px; }
.viewer .counter { position: absolute; left: 12px; top: 12px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(13, 13, 12, .75); }
.dlg-close {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(13, 13, 12, .75); color: var(--text); font-size: 22px;
}
.thumbs { display: flex; gap: 8px; padding: 12px 16px 0; overflow-x: auto; }
.thumbs button { flex: none; width: 74px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface-2); opacity: .6; transition: opacity .2s ease, border-color .2s ease; }
.thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dlg-body { padding: 18px 20px 24px; }
.dlg-body h3 { font-size: 28px; margin: 10px 0 6px; }
.dlg-body .where { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }
.dlg-body .actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .form .row { grid-template-columns: 1fr 1fr; }
  .areas { grid-template-columns: 1fr 1fr; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  footer .wrap { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 960px) {
  .wrap { padding: 0 32px; }
  .nav-links { display: flex; }
  .hero { padding: 72px 0 92px; }
  .hero .wrap { grid-template-columns: 1.02fr .98fr; align-items: center; gap: 56px; }
  .section { padding: 112px 0; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .services { grid-template-columns: repeat(3, 1fr); }
  .case { grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: center; padding: 44px 0; }
  .process { grid-template-columns: repeat(5, 1fr); gap: 20px; }
  .process li { grid-template-columns: 1fr; padding-top: 24px; }
  .process li::before { grid-row: auto; margin-bottom: 10px; }
  .contact { grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
  .form { padding: 30px; }
  .filters { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
  .wa-float span { display: inline; }
}
@media (max-width: 479px) {
  .nav .btn { display: none; }
}
@media (max-width: 420px) {
  .wa-float span { display: none; }
  .wa-float { padding: 15px; }
  .stats dd { font-size: 12px; }
}
/* Animasi halus: hero saat dibuka, konten saat di-scroll, dan galeri */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dlg-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (prefers-reduced-motion: no-preference) {
  .motion .hero h1,
  .motion .hero .lead,
  .motion .hero .cta-row,
  .motion .hero .stats { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .motion .hero h1 { animation-delay: .08s; }
  .motion .hero .lead { animation-delay: .18s; }
  .motion .hero .cta-row { animation-delay: .26s; }
  .motion .hero .stats { animation-delay: .34s; }
  .motion .hero-main img { animation: settle 1.1s cubic-bezier(.2, .7, .2, 1) .1s both; }
  .motion .hero-media > .tag { animation: rise .6s ease .6s both; }
  .motion .hero-inset { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .5s both; }

  .motion .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), transform .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
  }
  .motion .reveal.in { opacity: 1; transform: none; }

  dialog[open] { animation: dlg-in .28s cubic-bezier(.2, .7, .2, 1); }
  dialog[open]::backdrop { animation: fade .28s ease; }
  dialog.closing { animation: dlg-out .2s ease forwards; }
  dialog.closing::backdrop { animation: fade .2s ease reverse forwards; }
  #viewer-img { transition: opacity .2s ease, transform .2s ease; }
  #viewer-img.swap { opacity: 0; transform: translateX(var(--dx, 0)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
