@import url('./background-img.css');
:root {
  --bg-out: #d8d3cf;
  --ink: #0e0d0d;
  --bone: #f4f1ee;
  --red: #c8202a;
  --red-deep: #5a0b10;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg-out: #0a0909;
  }
}
:root[data-theme='dark'] {
  --bg-out: #0a0909;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  height: 100%;
}
body {
  background: var(--bg-out);
  font-family: var(--sans);
  color: var(--bone);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.wrap {
  display: flex;
  align-items: center;
  gap: 28px;
}
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--ink);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  container-type: inline-size;
}
.stage::before {
  content: '';
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 150px);
  background: linear-gradient(
    to bottom,
    rgba(14, 13, 13, 0.6) 0%,
    rgba(14, 13, 13, 0.3) 50%,
    rgba(14, 13, 13, 0) 100%
  );
  pointer-events: none;
}
@media (min-width: 600px) {
  .stage {
    height: min(92dvh, 860px);
    width: calc(min(92dvh, 860px) * 9 / 16);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  }
}
.nav {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: rgba(14, 13, 13, 0.55);
  color: var(--bone);
  place-items: center;
  cursor: pointer;
}
@media (min-width: 600px) {
  .nav {
    display: grid;
  }
}
.nav:disabled {
  opacity: 0.3;
  cursor: default;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button {
  font-family: inherit;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 2px;
}

/* photo placeholders: swap .ph background for the real prewed photo */
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}
.slide.on {
  opacity: 1;
  visibility: visible;
}
.ph {
  position: absolute;
  inset: 0;
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  top: 34%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  opacity: 0.35;
}

.shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(14, 13, 13, 0.92) 0%,
    rgba(14, 13, 13, 0.5) 38%,
    rgba(14, 13, 13, 0) 66%
  );
  pointer-events: none;
}
.txt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 24px calc(env(safe-area-inset-bottom, 0px) + 18vh);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18dvh);
  text-shadow: 0 2px 18px rgba(14, 13, 13, 0.55);
}
.txt.mid {
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 96px;
}

/* header + progress */
.bars {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 3px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0;
}
.bars i {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(244, 241, 238, 0.3);
  overflow: hidden;
}
.bars b {
  display: block;
  height: 100%;
  width: 0;
  background: var(--bone);
}
.head {
  position: absolute;
  z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 22px);
  left: 12px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.head > span:not(.sp) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.head small {
  white-space: nowrap;
  flex: none;
  font-weight: 400;
  opacity: 0.6;
  font-size: 13px;
}
.head .ib {
  width: 36px;
  height: 36px;
  flex: none;
}
.sp {
  flex: 1;
  min-width: 0;
}
.mono {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  border: 1.5px solid var(--bone);
  display: grid;
  place-items: center;
  font: italic 500 12px var(--serif);
}
.sp {
  flex: 1;
}
.ib {
  background: none;
  border: 0;
  color: var(--bone);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
}

/* type */
.pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(244, 241, 238, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 12px;
}
.disp {
  font: 400 clamp(56px, 9.5dvh, 84px)/0.98 var(--serif);
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144;
}

.disp em {
  font-style: italic;
  font-weight: 400;
}
.disp.s {
  font-size: clamp(40px, 6.6dvh, 58px);
}
.disp.xl {
  font-size: min(22vw, 13dvh); /* cadangan */
  font-size: min(23cqw, 13dvh); /* pakai lebar frame, bukan lebar layar */
  line-height: 0.88;
  letter-spacing: -0.03em;
}
.disp.xl span,
.disp.xl em {
  display: block;
}
.disp.xl em {
  text-align: right;
  margin-top: -0.04em;
}
.txt.diag {
  --lift: 12dvh;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--lift));
}
.txt.diag .sub,
.txt.diag .hint {
  text-align: right;
}
.nm {
  font-size: 16px;
  font-weight: 600;
  margin-top: 10px;
}
.sub {
  font-size: 15px;
  opacity: 0.72;
  margin-top: 4px;
  line-height: 1.5;
}
.hint {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 18px;
}
.body {
  font-size: 15px;
  line-height: 1.65;
  opacity: 0.88;
  max-width: 34ch;
  margin-top: 12px;
}
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.open .clamp {
  -webkit-line-clamp: unset;
  display: block;
}
.ar {
  font:
    400 30px/1.6 'Noto Naskh Arabic',
    'Scheherazade New',
    serif;
  direction: rtl;
  text-align: center;
  margin-bottom: 14px;
}
.cd {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 22px;
  max-width: 320px;
}
.cd div {
  background: rgba(14, 13, 13, 0.35);
  border-radius: 14px;
  padding: 12px 0;
  text-align: center;
}
.cd b {
  display: block;
  font: 500 30px/1 var(--serif);
}
.cd span {
  font-size: 12px;
  opacity: 0.75;
}
.ev {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(244, 241, 238, 0.25);
}
.ev b {
  display: block;
  font: 500 24px var(--serif);
}
.ev span {
  font-size: 14px;
  opacity: 0.75;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.chip {
  appearance: none;
  border: 1px solid rgba(244, 241, 238, 0.55);
  background: transparent;
  color: var(--bone);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 999px;
  min-height: 44px;
  cursor: pointer;
}
.chip.solid {
  background: var(--bone);
  color: var(--ink);
  border-color: var(--bone);
}
.acct {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(14, 13, 13, 0.4);
  border: 1px solid rgba(244, 241, 238, 0.2);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 10px;
}
.acct small {
  display: block;
  font-size: 12px;
  opacity: 0.7;
}
.acct strong {
  display: block;
  font: 500 21px var(--serif);
  margin: 2px 0;
}
.acct .chip {
  padding: 8px 14px;
  min-height: 36px;
}

/* bottom bar */
.bar {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 14px);
}
.bar form {
  flex: 1;
}
.bar input {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(244, 241, 238, 0.5);
  background: rgba(14, 13, 13, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--bone);
  font: 500 14px var(--sans);
  padding: 0 18px;
}
.bar input::placeholder {
  color: var(--bone);
  opacity: 0.85;
}

/* gate */
.gate {
  position: absolute;
  inset: 0;
  z-index: 40;
  transition:
    opacity 0.35s,
    visibility 0.35s;
}
.gate.off {
  opacity: 0;
  visibility: hidden;
}
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 82px);
  transform: translate(-50%, 8px);
  background: var(--bone);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  transition: 0.25s;
  z-index: 50;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: reduce) {
  .slide,
  .gate,
  .toast {
    transition: none;
  }
}
