/* ==========================================================================
   WIZKET — sign-it.css · "Sign it" final CTA (Branding page, #start)
   A brand birth certificate with a signature pad → a wax seal → a magazine cover with your
   autograph, spinning newspapers, camera flashes. js/sign-it.js sets data-phase on .sg
   (sign · seal · show · done). Paper, seal and magazine keep their own palettes.
   Prefix: sg-
   ========================================================================== */
.sg {
  --side: clamp(20px, 6vw, 110px);
  position: relative;
  isolation: isolate;
  overflow: clip;
  min-height: 100svh;
  padding: clamp(90px, 13vh, 130px) var(--side) clamp(50px, 8vh, 80px);
  background:
    radial-gradient(50% 55% at 50% 60%, var(--petrol) 0%, transparent 70%),
    var(--bg);
}
.sg::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.6; }
.sg__inner { position: relative; width: min(1040px, 100%); margin: 0 auto; display: grid; justify-items: center; text-align: center; }
.sg__copy { display: grid; justify-items: center; }
.sg__copy .ws-eyebrow { justify-content: center; }
.sg__title { margin: 0; font: 400 clamp(2.4rem, min(5.6vw, 10vh), 6rem)/0.9 var(--font-display); text-transform: uppercase; color: var(--text); }
.sg__title > span { display: inline-block; }
.sg__sub { margin: 10px 0 0; font: 600 clamp(1rem, 1.3vw, 1.2rem)/1.4 var(--font-body); color: var(--muted); }

.sg-dot { position: absolute; z-index: 6; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px rgba(253, 95, 7, 0.9); pointer-events: none; opacity: 0; visibility: hidden; }

.sg-stage { position: relative; width: 100%; min-height: clamp(400px, 56vh, 480px); margin-top: clamp(22px, 4vh, 34px); display: grid; place-items: center; }

/* ---- the certificate ---- */
.sg-cert {
  position: relative;
  width: min(640px, 100%);
  display: grid;
  gap: 16px;
  padding: clamp(26px, 3.4vw, 40px) clamp(22px, 3.6vw, 46px) clamp(22px, 3vw, 32px);
  background: #f8f1e2;
  box-shadow:
    inset 0 0 0 9px #f8f1e2, inset 0 0 0 10.5px #c9a77c, inset 0 0 0 14px #f8f1e2, inset 0 0 0 15px #c9a77c,
    0 50px 90px -40px rgba(0, 0, 0, 0.8);
  color: #2b2418;
  text-align: left;
  font-family: Georgia, "Times New Roman", serif;
  transition: transform 0.7s cubic-bezier(0.6, 0, 0.3, 1), opacity 0.6s;
}
.sg-cert__k { margin: 0; text-align: center; font: 700 12px/1 Georgia, serif; letter-spacing: 0.3em; text-transform: uppercase; color: #8a6a3c; }
.sg-cert__rows { margin: 0; display: grid; gap: 10px; }
.sg-cert__rows div { display: grid; grid-template-columns: 140px 1fr; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #e3d6bb; }
.sg-cert__rows dt { font: 700 10.5px/1 var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: #8a7a60; }
.sg-cert__rows dd { margin: 0; font: italic 600 clamp(18px, 2vw, 24px)/1.15 Georgia, serif; }
.sg-pad { position: relative; display: grid; grid-template-columns: 140px 1fr; align-items: end; gap: 12px; height: 110px; }
.sg-pad__k { padding-bottom: 12px; font: 700 10.5px/1 var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: #8a7a60; }
.sg-pad__c { width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sg-pad__line { position: absolute; left: 152px; right: 0; bottom: 12px; height: 0; border-bottom: 2px dashed #b9a57f; pointer-events: none; }
.sg-pad__hint { position: absolute; left: 152px; right: 0; bottom: 30px; text-align: center; font: italic 500 16px/1 Georgia, serif; color: #b9a57f; pointer-events: none; transition: opacity 0.3s; }
.sg-pad__hint.is-gone { opacity: 0; }
.sg-cert__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.sg__link { font: 600 13px/1 var(--font-body); color: #8a7a60; text-decoration: underline; text-underline-offset: 3px; }
.sg .sg__end .sg__link { color: var(--muted); }
.sg__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sg-type { flex: 1 1 180px; }
.sg-type input { width: 100%; padding: 8px 2px; border: 0; border-bottom: 1px solid #d8c9a8; background: transparent; outline: none; font: italic 500 15px/1 Georgia, serif; color: #2b2418; }
.sg-type input:focus { border-bottom-color: #fd5f07; }
.sg__official { padding: 11px 18px; border-radius: 999px; background: #fd5f07; font: 700 13px/1 var(--font-body); color: #fff; transition: opacity 0.3s, transform 0.3s var(--ease-out); }
.sg__official:disabled { opacity: 0.35; cursor: not-allowed; }
.sg__official:not(:disabled):hover { transform: translateY(-2px); }
.sg__official:focus-visible { outline: 2px solid #2b2418; outline-offset: 3px; }

.sg-seal {
  position: absolute;
  right: 26px;
  bottom: 70px;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #ff9a5c, #fd5f07 55%, #c2410c);
  box-shadow: 0 0 0 6px rgba(194, 65, 12, 0.35), 0 10px 20px -6px rgba(0, 0, 0, 0.5), inset 0 -6px 12px rgba(0, 0, 0, 0.25);
  rotate: -14deg;
  pointer-events: none;
  opacity: 0;
  transform: scale(2.6);
}
.sg-seal::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.55); }
.sg-seal b { font: 400 19px/1 var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: #fff; }
.sg:not([data-phase="sign"]) .sg-seal { opacity: 1; transform: none; transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.15s; }
.sg[data-phase="seal"] .sg-cert { animation: sg-thud 0.4s ease-out 0.15s; }
@keyframes sg-thud { 40% { transform: translateY(6px) scale(0.99); } }
.sg[data-phase="show"] .sg-cert, .sg[data-phase="done"] .sg-cert { transform: translateY(-40%) rotate(-14deg) scale(0.5); opacity: 0; pointer-events: none; }

/* ---- the show: magazine + newspapers + notifications ---- */
.sg-show { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; visibility: hidden; }
.sg[data-phase="show"] .sg-show, .sg[data-phase="done"] .sg-show { visibility: visible; }
.sg-mag {
  position: relative;
  z-index: 2;
  width: clamp(240px, 26vw, 300px);
  aspect-ratio: 3 / 4;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  justify-items: center;
  padding: 16px 18px 18px;
  overflow: hidden;
  background: radial-gradient(80% 60% at 50% 45%, #3a2a55 0%, #15191c 75%);
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
  opacity: 0;
  transform: scale(1.8) rotate(6deg);
}
.sg[data-phase="show"] .sg-mag, .sg[data-phase="done"] .sg-mag { opacity: 1; transform: rotate(-2deg); transition: transform 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) 0.15s, opacity 0.2s 0.15s; }
.sg-mag p { margin: 0; }
.sg-mag__title { font: 400 clamp(58px, 6.4vw, 76px)/0.85 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; color: #fd5f07; }
.sg-mag__issue { margin-top: 4px !important; font: 700 9.5px/1 var(--font-body); letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.7; }
.sg-mag__nb { --m1: #fd5f07; --m2: #fff; --mrad: 48%; align-self: center; display: grid; place-items: center; width: 44%; aspect-ratio: 1 / 1.1; border-radius: var(--mrad); background: var(--m1); box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.7); }
.sg-mag__nb b { font: 400 clamp(46px, 5vw, 60px)/1 var(--font-display); color: var(--m2); }
.sg-mag__h { font: 400 clamp(19px, 2vw, 23px)/0.98 var(--font-display); text-align: center; text-transform: uppercase; }
.sg-mag__sig { position: absolute; z-index: 2; right: 4px; bottom: 92px; width: 70%; filter: invert(1) brightness(1.8) drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 0 6px rgba(253, 95, 7, 0.8)); rotate: -10deg; }
.sg-mag__fans { margin-top: 8px !important; font: 600 11px/1 var(--font-body); letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.75); }
.sg-mag__fans b { font: 400 18px/1 var(--font-display); color: #fd5f07; font-variant-numeric: tabular-nums; }

.sg-paper { position: absolute; z-index: 1; left: 50%; top: 50%; display: grid; gap: 7px; width: 220px; padding: 14px 16px; background: #efe8da; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.7); text-align: left; color: #15191c; opacity: 0; transform: translate(-50%, -50%) scale(0.1) rotate(720deg); }
.sg-paper b { padding-bottom: 6px; border-bottom: 2px solid #15191c; text-align: center; font: 700 15px/1 Georgia, serif; }
.sg-paper em { font: 700 16px/1.1 Georgia, serif; font-style: normal; }
.sg-paper i { display: block; height: 5px; background: #c9c1b0; }
.sg[data-phase="show"] .sg-paper, .sg[data-phase="done"] .sg-paper { opacity: 1; transform: translate(calc(-50% - min(300px, 32vw)), calc(-50% - 60px)) rotate(-9deg); transition: transform 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) 0.45s, opacity 0.2s 0.45s; }
.sg[data-phase="show"] .sg-paper--b, .sg[data-phase="done"] .sg-paper--b { transform: translate(calc(-50% + min(300px, 32vw)), calc(-50% + 70px)) rotate(8deg); transition-delay: 0.85s; }

.sg-notes { position: absolute; z-index: 3; right: 0; top: 0; margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; width: min(260px, 40%); text-align: left; }
.sg-notes li { padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line2); box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.6); font: 500 12px/1.3 var(--font-body); color: var(--muted); animation: sg-note 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.sg-notes li b { color: var(--text); }
@keyframes sg-note { from { opacity: 0; transform: translateX(20px) scale(0.95); } }
.sg[data-phase="done"] .sg-notes { opacity: 0.5; transition: opacity 0.6s; }

.sg-flashes { position: absolute; z-index: 7; inset: -40px; pointer-events: none; }
.sg-flashes i { position: absolute; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, 0.45) 35%, transparent); animation: sg-flash 0.42s ease-out forwards; }
@keyframes sg-flash { 0% { opacity: 0; transform: scale(0.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: scale(1.2); } }

/* ---- the end ---- */
.sg__end { display: grid; justify-items: center; gap: 16px; margin-top: clamp(14px, 3vh, 26px); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out), visibility 0.6s; }
.sg[data-phase="done"] .sg__end { opacity: 1; visibility: visible; transform: none; }
.sg__final { margin: 0; font: 400 clamp(1.8rem, 3.2vw, 3rem)/1 var(--font-display); text-transform: uppercase; color: var(--text); }
.sg__btns { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 22px; }
.sg__cta { height: 58px; padding: 0 32px; font-size: 16px; }
.sg__note { margin: 16px 0 0; font: 500 11.5px/1.4 var(--font-body); color: var(--muted); }

@media (max-width: 767px) {
  .sg-cert__rows div, .sg-pad { grid-template-columns: 1fr; gap: 4px; }
  .sg-pad { height: 130px; grid-template-rows: auto 1fr; }
  .sg-pad__k { padding: 0; }
  .sg-pad__line, .sg-pad__hint { left: 0; }
  .sg-seal { width: 82px; height: 82px; right: 14px; bottom: 96px; }
  .sg-seal b { font-size: 15px; }
  .sg-paper { width: 170px; }
  .sg-paper em { font-size: 13px; }
  .sg[data-phase="show"] .sg-paper, .sg[data-phase="done"] .sg-paper { transform: translate(-90%, -140%) rotate(-9deg); }
  .sg[data-phase="show"] .sg-paper--b, .sg[data-phase="done"] .sg-paper--b { transform: translate(-10%, 50%) rotate(8deg); }
  .sg-notes { display: none; }
  .sg__end .cta { width: 100%; }
}
