/* ==========================================================================
   Components
   ========================================================================== */

/* --- Tipografi ---------------------------------------------------------- */
.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: var(--fw-light);
  letter-spacing: -0.02em;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-light);
  letter-spacing: -0.005em;
}

.h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-regular);
}

.body-1 {
  font-size: var(--fs-body-1);
  line-height: var(--lh-body-1);
}

.body-2 {
  font-size: var(--fs-body-2);
  line-height: var(--lh-body-2);
}

.eyebrow {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-text);
  margin-bottom: 20px;
}

/* --- Button ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-4);
  height: var(--btn-h);
  padding-inline: var(--btn-pad-x);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-button);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
  z-index: 0;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

/* Fill sweep: z-index -1 taruh dia di belakang text/icon (in-flow content)
   tapi di depan background asli .btn — nggak perlu bungkus text pakai span. */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c-btn-hover-fill);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-btn-fill) var(--ease-btn-fill);
}

.btn:hover:not(:disabled)::before,
.btn:focus-visible:not(:disabled)::before {
  transform: scaleX(1);
}

.btn:hover:not(:disabled),
.btn:focus-visible:not(:disabled) {
  color: var(--c-btn-hover-text);
  border-color: var(--c-btn-hover-fill);
  transition: color var(--dur-btn-fill) var(--ease-btn-fill) 100ms,
    border-color var(--dur-btn-fill) var(--ease-btn-fill),
    background-color var(--dur-btn-fill) var(--ease-btn-fill);
}

.btn__icon {
  flex: none;
}

.btn--outline {
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
}

.btn--solid {
  background: var(--c-ink);
  color: var(--c-on-dark);
  border: 1px solid var(--c-ink);
}

.btn--on-dark {
  background: transparent;
  border-color: var(--c-border-dark);
  color: var(--c-on-dark);
}

/* --- Varian brand (primary / secondary) ----------------------------------
   Dulu ini cuma hidup di scope .page-home, jadi tombol yang sama di about,
   halaman service, dan case study tampil tanpa gradient / garis orange.
   Sekarang jadi foundation bersama; halaman tinggal menimpa token warnanya
   kalau latarnya beda (mis. `.cta` di halaman bertema gelap). */
.btn--primary {
  --c-btn-hover-fill: var(--c-accent-orange);
  --c-btn-hover-text: var(--c-ink);
  background: var(--grad-brand);
  border: 1px solid transparent;
  color: var(--c-on-dark);
}

.btn--secondary {
  --c-btn-hover-fill: var(--c-accent-orange);
  --c-btn-hover-text: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-accent-orange);
  color: var(--c-text);
}

/* Di atas latar gelap garisnya abu, bukan orange — dipakai tombol Details di
   kartu Selected Work (home) dan tombol dokumen di halaman case study. */
.btn--secondary.btn--on-dark {
  background: transparent;
  border-color: var(--c-border-on-dark);
  color: var(--c-on-dark);
}

.btn--sm {
  height: var(--btn-h-sm);
  padding-inline: var(--space-6);
}

.btn--block {
  display: flex;
  width: 100%;
  height: var(--btn-h);
}

/* --- Placeholder gambar -------------------------------------------------- */
.placeholder {
  display: block;
  width: var(--placeholder-size);
  height: var(--placeholder-size);
  border: 1px solid var(--c-border);
  background: transparent;
}

.card__icon {
  display: block;
  width: 160px;
  height: 160px;
}

/* --- Card (services) ----------------------------------------------------- */
.card {
  background: var(--c-surface-alt);
}

.card__body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-8);
}

.panel__content.card__body {
  position: relative;
}

#services .panel__content.card__body {
  transition: background 200ms ease;
}

.panel__content.card__body:hover {
  background: linear-gradient(180deg,
      var(--c-hover-gradient-start) 0%,
      var(--c-hover-gradient-mid) 96%,
      var(--c-hover-gradient-end) 100%);
}

.panel__content.card__body:hover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--c-accent-orange);
}

/* Placeholder di atas, teks + tombol didorong ke bawah */
.card__text {
  margin-top: auto;
  padding-top: var(--space-10);
}

.card__text .h3 {
  margin-bottom: var(--space-4);
}

.card__text .body-2 {
  color: var(--c-text-muted);
}

.card__body .btn {
  align-self: flex-start;
  margin-top: var(--space-7);
}

/* --- Why Pixelzenic ------------------------------------------------------ */
.why__item {
  background: none;
}

.why__body {
  display: flex;
  flex-direction: column;
  min-height: 364px;
  padding: 0 var(--space-6) var(--space-5) var(--space-8);
  border-left: 1px solid var(--c-border);
}

.why__icon {
  display: block;
  width: 100px;
  height: 100px;
}

/* Teks didorong rata bawah — pola sama seperti .card__text di Services */
.why__text {
  margin-top: auto;
}

.why__text .h3 {
  margin-bottom: var(--space-4);
}

.why__text .body-2 {
  color: var(--c-text-muted);
}

/* --- Work card ----------------------------------------------------------- */
.work-card {
  background: var(--c-surface-dark);
}

.work-card__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: var(--space-8);
}

.work-card__title {
  color: var(--c-on-dark);
  margin-bottom: var(--space-5);
}

.work-card__desc {
  color: var(--c-on-dark-muted);
  max-width: 34ch;
}

.work-card__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-7);
}

.work-card--empty>.panel__content {
  height: 100%;
}

/* --- Meta list (industry / scope) ---------------------------------------- */
.meta {
  display: grid;
  row-gap: var(--space-3);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

.meta__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  column-gap: var(--space-5);
}

.meta dt {
  color: var(--c-on-dark-muted);
}

.meta dd {
  margin: 0;
  color: var(--c-on-dark);
}

/* Disabled: submit tidak aktif sampai semua field wajib terisi. */
.btn:disabled {
  border-color: var(--c-border);
  background: var(--c-surface-tint);
  color: #a5a5a5;
  cursor: not-allowed;
}

.btn:disabled .btn__icon {
  opacity: 0.5;
}

/* --- Form field ---------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
}

/* Honeypot: invisible ke user/screen reader, tetap kebaca bot yang auto-fill semua field. */
.field__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact__status {
  display: none;
  align-items: flex-start;
  gap: 8px;
  min-height: 0;
  padding: 16px;
  border-left: 3px solid transparent;
  background: var(--c-surface-tint);
  color: var(--c-text);
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--dur-panel, 700ms) var(--ease-reveal, cubic-bezier(.16, 1, .3, 1));
}

.contact__status[data-state] {
  display: flex;
}

.contact__status.is-in {
  clip-path: inset(0);
}

.contact__status[data-state="success"] {
  border-left-color: var(--c-brand-yellow, #FFD540);
}

.contact__status[data-state="error"] {
  border-left-color: #c0392b;
  color: #c0392b;
}

.contact__status-icon {
  flex: none;
  margin-top: 2px;
  display: none;
}

.contact__status[data-state="success"] .contact__status-icon--success,
.contact__status[data-state="error"] .contact__status-icon--error {
  display: block;
}

.contact__status-text {
  margin: 0;
  flex: 1;
}

.contact__status-countdown {
  flex: none;
  color: #a5a5a5;
  font-variant-numeric: tabular-nums;
  display: none;
}

.contact__status[data-state="success"] .contact__status-countdown {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .contact__status {
    clip-path: none;
    transition: none;
  }
}

.field__label {
  font-size: var(--fs-body-2);
  line-height: var(--lh-body-2);
  color: var(--c-text);
}

.field__input {
  height: 40px;
  border: 0;
  border-bottom: 1px solid var(--c-border);
  background: transparent;
  font-size: var(--fs-body-1);
  color: var(--c-text);
  border-radius: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field__input::placeholder {
  color: #a5a5a5;
}

.field__input--area {
  height: auto;
  min-height: 96px;
  padding-block: var(--space-3) var(--space-4);
  line-height: var(--lh-body-1);
  resize: vertical;
}

.field__optional {
  color: var(--c-text-muted);
}

/* Hover: bottom-line turns orange, stays distinct from the active state. */
.field__input:hover:not(:focus) {
  border-bottom-color: var(--c-accent-orange);
}

/* Focus / typing: bottom-line only, 2px in orange.
   The inset shadow supplies the second pixel so the 40px height never shifts. */
.field__input:focus,
.field__input:focus-visible {
  outline: none;
  border-bottom-color: var(--c-accent-orange);
  box-shadow: inset 0 -1px 0 var(--c-accent-orange);
}