/* ==========================================================
   Edisi No. 20 — zine ulang tahun untuk sahabat
   Arah visual: cetak risograph dua-tinta (biru & pink fluoro)
   di kertas daur ulang. Hurufnya padat, sedikit salah cetak.
   ========================================================== */

:root {
  --paper: #efebe0;
  --blue: #2340d8;
  --pink: #ff4fa3;
  --yellow: #ffe14d;
  --ink: #17161d;

  --display: 'Archivo', 'Arial Narrow', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--display);
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* butiran kertas daur ulang */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
button { font: inherit; }

.mono { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.02em; }
.note { color: var(--blue); }

.headline {
  font: 900 clamp(3.2rem, 11vw, 7.5rem)/0.84 var(--display);
  font-variation-settings: 'wdth' 62;
  text-transform: uppercase;
  color: var(--blue);
  /* salah cetak: tinta pink bergeser sedikit dari biru */
  text-shadow: 0.04em 0.03em 0 var(--pink);
}
.headline--light { color: var(--paper); text-shadow: 0.04em 0.03em 0 var(--blue); }

/* efek duotone: foto hitam-putih dicetak dengan tinta biru */
.duotone {
  position: relative;
  background: var(--blue);
  overflow: hidden;
}
.duotone img {
  filter: grayscale(1) contrast(1.25) brightness(1.08);
  mix-blend-mode: screen;
}
.duotone::after {
  /* pola titik halftone */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(35, 64, 216, 0.35) 0.9px, transparent 1.2px) 0 0 / 4px 4px;
  pointer-events: none;
}

/* ================= SAMPUL ================= */
.cover {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 1rem var(--gutter) 2.5rem;
  overflow: hidden;
}
.cover-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--ink);
  text-transform: uppercase;
}
.cover-name {
  position: relative;
  margin: 0.15em 0 0.2em -0.03em;
  font: 900 clamp(4rem, 21.5vw, 17rem)/0.8 var(--display);
  font-variation-settings: 'wdth' 62;
  letter-spacing: -0.01em;
  color: var(--blue);
  white-space: nowrap;
  isolation: isolate;
}
.cover-name::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--pink);
  transform: translate(0.035em, 0.025em);
  mix-blend-mode: multiply;
  z-index: -1;
}

.cover-body {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.cover-photo {
  height: 100%;
  min-height: 300px;
  max-height: 62vh;
  rotate: -1.2deg;
}
.cover-photo img { width: 100%; height: 100%; object-fit: cover; }

.coverlines { list-style: none; display: grid; gap: 1.25rem; padding-top: 0.5rem; }
.coverlines li {
  font: 600 clamp(1.1rem, 2vw, 1.5rem)/1.15 var(--display);
  font-variation-settings: 'wdth' 80;
  padding-bottom: 1.25rem;
  border-bottom: 1.5px dashed var(--ink);
}
.coverlines li:last-child { border-bottom: 0; }
.coverlines b { display: block; font-weight: 900; color: var(--pink); text-transform: uppercase; font-size: 0.7em; letter-spacing: 0.04em; }

.sticker {
  position: absolute;
  left: calc(54% - 96px);
  top: -44px;
  width: 124px;
  height: 124px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font: 900 3.2rem/0.85 var(--display);
  font-variation-settings: 'wdth' 62;
  rotate: 12deg;
  box-shadow: 3px 3px 0 var(--ink);
}
.sticker small { font-size: 1.05rem; text-transform: uppercase; }

/* ================= PHOTOBOX ================= */
.booth { padding: clamp(4rem, 10vh, 7rem) var(--gutter); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
}
.strips {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3.5rem);
}
.strip {
  width: clamp(150px, 22vw, 230px);
  padding: 10px 10px 0;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 16px 30px -18px rgba(23, 22, 29, 0.6);
}
.strip:nth-child(1) { rotate: -3deg; margin-top: 2rem; }
.strip:nth-child(2) { rotate: 1.5deg; }
.strip:nth-child(3) { rotate: -1deg; margin-top: 4rem; }
.frame {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  border: 0;
  padding: 0;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}
.frame img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.4s ease, mix-blend-mode 0s; }
.frame.is-color { background: none; }
.frame.is-color img { filter: none; mix-blend-mode: normal; }
.frame.is-color::after { opacity: 0; }
.frame:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.strip-label {
  padding: 0.5rem 0 0.8rem;
  text-align: center;
  font-size: 0.6875rem;
  text-transform: uppercase;
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #fff;
  pointer-events: none;
  animation: flash 0.45s ease-out forwards;
}
@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } }

/* ================= STRUK ================= */
.receipt-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
  background: var(--pink);
}
.printer { justify-self: center; width: min(340px, 100%); }
.printer-slot {
  height: 18px;
  border-radius: 9px;
  background: var(--ink);
  position: relative;
  z-index: 2;
}
.receipt {
  margin: -9px 14px 0;
  padding: 1.8rem 1.2rem 1.4rem;
  background: #fbfaf5;
  color: var(--ink);
  line-height: 1.5;
  /* gerigi sobekan di bawah */
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 10px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 10px repeat-x;
  clip-path: inset(0 0 100% 0);
  transform: translateY(-40px);
}
.receipt.is-printed {
  animation: print 2.4s steps(24) forwards;
}
@keyframes print {
  to { clip-path: inset(0 0 0 0); transform: translateY(0); }
}
.r-center { text-align: center; }
.r-strong { font-weight: 600; }
.r-small { font-size: 0.6875rem; margin: 0.6rem 0; }
.r-row { display: flex; justify-content: space-between; gap: 0.75rem; }
.r-row span:first-child { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.r-row span:first-child::after { content: " ................................................"; white-space: nowrap; }
.r-row span:last-child { white-space: nowrap; }
.r-rule { border-top: 1.5px dashed var(--ink); margin: 0.8rem 0; }
.r-total { font-size: 0.9375rem; }
.barcode {
  height: 46px;
  margin: 0.8rem 1rem 0;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px,
    var(--ink) 8px 11px, transparent 11px 12px, var(--ink) 12px 13px, transparent 13px 16px);
}

/* ================= SURAT ================= */
.letter {
  padding: clamp(4rem, 12vh, 8rem) var(--gutter);
  background: var(--blue);
  color: var(--paper);
}
.letter-lead { text-transform: uppercase; color: var(--yellow); margin-bottom: 2rem; }
.letter-body {
  max-width: 58rem;
  font: 700 clamp(1.6rem, 3.6vw, 3rem)/1.12 var(--display);
  font-variation-settings: 'wdth' 75;
}
.letter-body p + p { margin-top: 0.8em; }
.letter mark {
  color: inherit;
  background: linear-gradient(var(--yellow), var(--yellow)) left / 0% 100% no-repeat;
  padding: 0 0.1em;
  transition: background-size 0.9s cubic-bezier(.6, 0, .3, 1);
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}
.letter mark.is-on { background-size: 100% 100%; color: var(--ink); transition: background-size 0.9s cubic-bezier(.6, 0, .3, 1), color 0.3s ease 0.4s; }
.letter-sign { margin-top: 2.5rem; color: var(--yellow); }

/* ================= KUPON ================= */
.coupon-wrap {
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}
.coupon {
  display: flex;
  width: min(620px, 100%);
  margin-top: 2rem;
  align-self: center;
  background: var(--yellow);
  rotate: -1.5deg;
  box-shadow: 5px 5px 0 var(--ink);
}
.coupon-stub {
  display: grid;
  place-items: center;
  padding: 1rem 0.8rem;
  border-right: 2px dashed var(--ink);
  font-weight: 600;
  text-align: center;
  writing-mode: vertical-rl;
  rotate: 180deg;
}
.coupon-main { flex: 1; padding: 1.2rem clamp(1rem, 3vw, 1.6rem); }
.coupon-label { text-transform: uppercase; font-weight: 600; }
.scratch {
  position: relative;
  margin: 0.9rem 0;
  min-height: 130px;
}
.scratch-prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 0.2rem;
}
.scratch-prize strong {
  font: 900 clamp(2rem, 7vw, 3.2rem)/0.9 var(--display);
  font-variation-settings: 'wdth' 62;
  text-transform: uppercase;
  color: var(--pink);
  text-shadow: 0.03em 0.03em 0 var(--ink);
}
.scratch-prize span { margin-top: 0.4rem; font-weight: 600; }
#scratchCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  transition: opacity 0.6s ease;
}
.scratch.is-done #scratchCanvas { opacity: 0; pointer-events: none; }
.coupon-fine { font-size: 0.6875rem; }

.end {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem var(--gutter);
  border-top: 3px solid var(--ink);
  text-transform: uppercase;
}

/* ================= RESPONSIF ================= */
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .cover-body { grid-template-columns: minmax(0, 1fr); }
  .cover-photo { min-height: 0; aspect-ratio: 4 / 3; height: auto; }
  .sticker { left: auto; right: 0; top: -40px; width: 96px; height: 96px; font-size: 2.4rem; }
  .sticker small { font-size: 0.8rem; }

  /* strip foto bisa digeser ke samping */
  .strips {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(var(--gutter) * -1);
    padding: 1rem var(--gutter) 2rem;
  }
  .strip { flex: 0 0 62%; scroll-snap-align: center; }
  .strip:nth-child(n) { margin-top: 0; }

  .receipt-wrap { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .receipt.is-printed { animation: none; clip-path: none; transform: none; }
}
