/* ============================================================================
   claudia-diploma.css · Pyon Go! — Kanji Guild Proof Pass
   Landscape JIS-B5. A porcelain-signal certificate with a visible 38-kanji
   achievement rail and the cast's completion poseology.
   ========================================================================== */

@page { size: 257mm 182mm; margin: 0; }

:root {
  --d-porcelain: #f8f6ef;
  --d-celadon: #dceae3;
  --d-celadon-deep: #a9cec3;
  --d-signal: #69b7c7;
  --d-teal: #28535b;
  --d-teal-dark: #183c43;
  --d-red: #c84e59;
  --d-gold: #b38d48;
  --d-faint: rgba(40,83,91,.11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #e9efec;
}

.screen-only {
  max-width: 257mm;
  margin: 14px auto;
  padding: 10px 14px;
  border: 1px solid rgba(40,83,91,.22);
  border-radius: 10px;
  background: #fff;
  color: var(--d-teal-dark);
  font-family: var(--f-body);
  font-size: 12px;
  text-align: center;
}

.diploma {
  position: relative;
  isolation: isolate;
  width: 257mm;
  min-height: 182mm;
  margin: 0 auto;
  padding: 8mm 10mm;
  overflow: hidden;
  color: var(--ink);
  background: var(--d-porcelain);
  box-shadow: 0 18px 50px rgba(24,60,67,.16);
}
@media screen and (max-width: 1000px) {
  .diploma {
    zoom: calc((100vw - 16px) / 257mm);
  }
}

/* Generated SparkleSnap editorial plate: intentionally quieter than the
   content, with brand color appearing as a near-watermark at the page edge. */
.diploma::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: url('../assets/diploma/pyon-go-proof-pass-editorial-v2.png') center / 100% 100% no-repeat;
  opacity: .08;
  pointer-events: none;
}

.diploma__inner {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 166mm;
  padding: 1mm 5mm 0;
  display: flex;
  flex-direction: column;
}

.diploma__masthead {
  width: 100%;
  max-width: 205mm;
  margin: 0 auto;
  min-height: 13mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2mm 2mm;
  border-bottom: 1px solid rgba(40,83,91,.2);
  text-align: left;
}

.diploma__brand {
  color: var(--d-teal-dark);
  font-family: var(--f-serif-jp);
  font-size: 1.05rem;
  font-weight: 900;
}

.diploma__edition,
.diploma__serial {
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.diploma__serial {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diploma__serial span {
  padding: 5px 8px;
  border: 1px solid var(--d-teal);
  border-radius: 99px;
  color: var(--d-teal-dark);
}

.diploma__serial b {
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--d-teal-dark);
  color: #fff;
}

.diploma__hero {
  display: grid;
  grid-template-columns: 1fr 34mm;
  align-items: center;
  gap: 7mm;
  width: 100%;
  max-width: 195mm;
  margin: 2mm auto 0;
}

.diploma__heading { text-align: left; }

.diploma__jp {
  color: var(--d-red);
  font-family: var(--f-serif-jp);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .42em;
}

.diploma__title {
  margin: 0;
  color: var(--d-teal-dark);
  font-family: var(--f-serif-jp);
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: .055em;
  line-height: .98;
}

.diploma__sub {
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: var(--f-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.diploma__guild-seal {
  position: relative;
  width: 31mm;
  height: 31mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--d-gold);
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 42%, transparent 43%),
    repeating-conic-gradient(from -4deg, var(--d-celadon) 0 7deg, transparent 7deg 15deg),
    var(--d-porcelain);
  color: var(--d-teal-dark);
  box-shadow: inset 0 0 0 3px var(--d-porcelain), inset 0 0 0 4px rgba(40,83,91,.35);
}

.diploma__guild-seal strong {
  font-family: var(--f-serif-jp);
  font-size: 2.05rem;
  line-height: .9;
}

.diploma__guild-kicker,
.diploma__guild-total {
  font-family: var(--f-mono);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.diploma__recipient {
  width: 100%;
  max-width: 172mm;
  margin: 1mm auto 0;
  text-align: center;
}

.diploma__recipient-label {
  display: block;
  color: var(--d-red);
  font-family: var(--f-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.diploma__name {
  display: block;
  min-height: 10mm;
  padding: 0 6mm 1mm;
  border-bottom: 1.5px solid var(--d-teal);
  outline: none;
  color: var(--d-teal-dark);
  font-family: var(--f-serif-jp);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
}

.diploma__name:empty::before {
  content: var(--pyon-go-diploma-name-prompt, "Type or write the learner’s name");
  color: rgba(40,83,91,.34);
  font-family: var(--f-body);
  font-size: .74rem;
  font-weight: 500;
}

.diploma__name:focus {
  border-bottom-color: var(--d-red);
  background: rgba(255,255,255,.6);
}

.diploma__body {
  max-width: 186mm;
  margin: 1.5mm auto 2mm;
  color: var(--ink-soft);
  font-family: var(--f-body);
  font-size: .73rem;
  line-height: 1.55;
  text-align: center;
}

.diploma__body b,
.diploma__body i { color: var(--d-teal-dark); }

.diploma__proofs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5mm;
  width: 100%;
  max-width: 205mm;
  margin: 0 auto 2mm;
}

.proof-stamp {
  position: relative;
  min-height: 19mm;
  padding: 2.6mm 2mm 2mm 12mm;
  border: 1px solid rgba(40,83,91,.28);
  border-radius: 9px 3px 9px 3px;
  background: rgba(255,255,255,.68);
  text-align: left;
  box-shadow: 3px 3px 0 var(--d-faint);
}

.proof-stamp__mark {
  position: absolute;
  top: 50%;
  left: 2.4mm;
  width: 8mm;
  height: 8mm;
  display: grid;
  place-items: center;
  transform: translateY(-50%) rotate(-4deg);
  border: 1.5px solid var(--d-red);
  border-radius: 50%;
  color: var(--d-red);
  font-family: var(--f-serif-jp);
  font-size: 8px;
  font-weight: 900;
}

.proof-stamp b,
.proof-stamp small { display: block; }

.proof-stamp b {
  color: var(--d-teal-dark);
  font-family: var(--f-body);
  font-size: .68rem;
  line-height: 1.2;
}

.proof-stamp small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 6.8px;
  letter-spacing: .03em;
}

.diploma__kanji-pass {
  width: 100%;
  max-width: 205mm;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(40,83,91,.28);
  border-radius: 7px;
  background: rgba(220,234,227,.46);
}

.diploma__kanji-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3mm 2.2mm;
  background: var(--d-teal-dark);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 6.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.diploma__kanji-label b { color: #dff4ef; }

.diploma__kanji-roster {
  display: grid;
  grid-template-columns: repeat(19, 1fr);
  gap: 0;
}

.diploma__kanji-roster span {
  min-height: 8mm;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(40,83,91,.12);
  border-bottom: 1px solid rgba(40,83,91,.12);
  background: rgba(255,255,255,.62);
  color: var(--d-teal-dark);
  font-family: var(--f-serif-jp);
  font-size: .8rem;
  font-weight: 800;
}

.diploma__kanji-roster span:nth-child(19n),
.diploma__kanji-roster span:last-child { border-right: 0; }

.diploma__kanji-roster span:nth-child(3n) { color: var(--d-red); }
.diploma__kanji-roster span:nth-child(n+20) { border-bottom: 0; }

.diploma__finish {
  display: grid;
  grid-template-columns: 1fr 70mm 1fr;
  align-items: end;
  gap: 3mm;
  width: 100%;
  max-width: 205mm;
  min-height: 31mm;
  margin: auto auto 0;
}

.sign-block { text-align: center; }

.sign-line {
  min-width: 48mm;
  padding: 1.3mm 1mm 0;
  border-top: 1px solid rgba(40,83,91,.45);
  outline: none;
  color: var(--d-teal-dark);
  font-family: var(--f-serif-jp);
  font-size: .84rem;
}

.sign-block small {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 7px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.diploma__celebration {
  position: relative;
  align-self: end;
  height: 31mm;
}

.diploma__cheer {
  position: absolute;
  top: -2mm;
  left: 50%;
  z-index: 6;
  padding: 1mm 2.5mm;
  transform: translateX(-50%) rotate(-2deg);
  border: 1px solid var(--d-gold);
  border-radius: 99px;
  background: #fffdf6;
  color: var(--d-red);
  font-family: var(--f-mono);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
}

.diploma__celebration .pose-stage--diploma {
  --pose-h: 112px;
  max-width: 265px;
  margin: 0 auto;
  transform: translateY(1mm);
}

.diploma__celebration .pose-focus--badge {
  width: 48px;
  height: 48px;
  top: 28px;
  border-color: var(--d-red);
  background: rgba(255,255,255,.91);
  color: var(--d-red);
  font-size: 1rem;
  box-shadow: 4px 4px 0 rgba(40,83,91,.13);
}

/* The V3 f12 figures begin just above the nominal bottom-middle cell (Selene
   y=817, Marina y=824; the preceding figures end at y=807/808). A 101px host
   opens that safe gutter without exposing artwork from the frame above. */
.diploma__celebration .pose-actor--selene,
.diploma__celebration .pose-actor--marina {
  width: 92px;
  height: 101px;
  background-size: 285.2px 285.2px;
  background-position: 50% 100%;
}

.diploma__foot {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 1.4mm 2mm 0;
  color: var(--ink-soft);
  font-family: var(--f-mono);
  font-size: 6.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

@media screen and (max-width: 980px) {
  .diploma { transform-origin: top left; }
}

@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .screen-only { display: none !important; }
  .diploma { width: 257mm !important; min-height: 182mm !important; box-shadow: none !important; }
  .diploma__name:empty::before { content: ""; }
  [contenteditable] { caret-color: transparent; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
