/* The academy's screens: admissions.html (letter, office, register), the teacher in dressing.html?enroll,
   the student card view. One look for all of it (10/17 night, 제이: "UI가 너무 대충, 고운바탕으로 퀄리티를"):
   고운바탕 (Gowun Batang, OFL, Google Fonts), midnight navy, antique gold hairlines, warm parchment. */
:root {
  --font: "Gowun Batang", "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", serif;
  --night: #0d1028; --night-2: #171b40; --glass: rgba(14, 12, 20, 0.84);
  --gold: #d6b26d; --gold-hi: #f1dba6; --gold-lo: #a9803f; --gold-line: rgba(214, 178, 109, 0.42); --gold-faint: rgba(214, 178, 109, 0.16);
  --ink: #efe4c8; --ink-dim: rgba(239, 228, 200, 0.72); --ink-faint: rgba(239, 228, 200, 0.46);
  --paper: #f3e9d0; --paper-2: #e5d3ab; --paper-ink: #3b2a17; --paper-dim: #7c5b33; --wax: #9d2f27;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.12 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.adm { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--night); color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden; letter-spacing: -0.005em; }
.adm button, .adm input { font-family: var(--font); }
.screen { position: fixed; inset: 0; display: none; place-items: center; padding: 16px; box-sizing: border-box; }
.screen.on { display: grid; }
.adm [hidden], .card-view [hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 28px; box-sizing: border-box;
  border-radius: 999px; font-family: var(--font); font-size: 16px; font-weight: 700; line-height: 1; letter-spacing: 0.04em; cursor: pointer;
  color: var(--ink); background: rgba(14, 12, 20, 0.55); border: 1px solid var(--gold-line); transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { background: rgba(214, 178, 109, 0.12); }
.btn.primary { color: #24180a; border: 1px solid rgba(255, 236, 190, 0.55);
  background: linear-gradient(180deg, #f2dca5 0%, #d9b46b 52%, #b98d48 100%);
  box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.75), 0 8px 26px rgba(214, 178, 109, 0.28), 0 2px 6px rgba(0, 0, 0, 0.35); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.75), 0 12px 32px rgba(214, 178, 109, 0.38), 0 2px 6px rgba(0, 0, 0, 0.35); }
.btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.btn[disabled] { opacity: 0.5; cursor: default; transform: none; }

/* the night sky behind the letter and the office */
.sky { background:
  radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 245, 220, 0.8), transparent 60%),
  radial-gradient(1px 1px at 28% 72%, rgba(255, 245, 220, 0.6), transparent 60%),
  radial-gradient(1.4px 1.4px at 46% 9%, rgba(255, 245, 220, 0.9), transparent 60%),
  radial-gradient(1px 1px at 63% 33%, rgba(255, 245, 220, 0.55), transparent 60%),
  radial-gradient(1.3px 1.3px at 79% 14%, rgba(255, 245, 220, 0.8), transparent 60%),
  radial-gradient(1px 1px at 88% 61%, rgba(255, 245, 220, 0.5), transparent 60%),
  radial-gradient(1px 1px at 8% 52%, rgba(255, 245, 220, 0.5), transparent 60%),
  radial-gradient(1.2px 1.2px at 56% 84%, rgba(255, 245, 220, 0.45), transparent 60%),
  radial-gradient(ellipse 70% 55% at 50% 108%, rgba(232, 160, 80, 0.22), transparent 70%),
  radial-gradient(ellipse 90% 70% at 50% 38%, #1d2250 0%, #10132f 55%, #090a18 100%); }

/* ① the envelope */
.envelope { position: relative; width: min(460px, 88vw); aspect-ratio: 1.58; border-radius: 6px; cursor: pointer;
  background: var(--grain), linear-gradient(170deg, #f6ecd5, #e3cfa4); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), 0 2px 0 rgba(255, 255, 255, 0.3) inset;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .6s; animation: arrive 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes arrive { from { transform: translateY(40px) rotate(-3deg); opacity: 0; } to { transform: rotate(-1.2deg); opacity: 1; } }
.envelope::before { content: ""; position: absolute; inset: 0; border-radius: 6px 6px 0 0; clip-path: polygon(0 0, 100% 0, 50% 50%);
  background: var(--grain), linear-gradient(180deg, #ecdcb6, #d9c08e); filter: drop-shadow(0 3px 3px rgba(80, 50, 20, 0.35)); }
.envelope::after { content: ""; position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
  background: linear-gradient(to top right, transparent calc(50% - 0.6px), rgba(120, 85, 40, 0.18) 50%, transparent calc(50% + 0.6px)) left bottom / 50% 100% no-repeat,
              linear-gradient(to top left, transparent calc(50% - 0.6px), rgba(120, 85, 40, 0.18) 50%, transparent calc(50% + 0.6px)) right bottom / 50% 100% no-repeat; }
.env-label { position: absolute; left: 0; right: 0; bottom: 9%; margin: 0; text-align: center; color: var(--paper-dim); }
.env-label b { display: block; font-size: 21px; letter-spacing: 0.32em; color: #5b3e1e; margin-bottom: 6px; }
.env-label span { font-size: 11px; letter-spacing: 0.42em; }
.seal { position: absolute; z-index: 2; left: 50%; top: 47%; width: 84px; height: 84px; margin: -42px 0 0 -42px; padding: 0; border: 0; cursor: pointer;
  border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 36% 30%, #cf5a4c 0%, #a3342a 38%, #6d1a15 100%);
  box-shadow: 0 6px 14px rgba(60, 10, 5, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(255, 190, 170, 0.35);
  display: grid; place-items: center; animation: pulse 3s ease-in-out infinite 1s; }
.seal::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; border: 1.5px solid rgba(255, 200, 180, 0.35);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4); }
.seal img { width: 52px; height: 52px; border-radius: 50%; filter: grayscale(1) brightness(0.7) sepia(1) hue-rotate(-30deg) saturate(3) contrast(1.4);
  mix-blend-mode: multiply; opacity: 0.85; }
@keyframes pulse { 50% { box-shadow: 0 6px 26px rgba(240, 170, 90, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(255, 190, 170, 0.35); } }
.env-hint { position: absolute; left: 0; right: 0; top: calc(100% + 22px); margin: 0; text-align: center; font-size: 14px; color: var(--ink-dim); letter-spacing: 0.06em; }
/* the painted envelope and seal (assets/academy) */
.envelope.art { aspect-ratio: 1.535; background: url("./assets/academy/envelope.webp") center / 100% 100% no-repeat; box-shadow: none; filter: drop-shadow(0 34px 50px rgba(0, 0, 0, 0.6)); }
.envelope.art::before, .envelope.art::after { display: none; }
.envelope.art .seal { top: 64%; }
.envelope.art .env-label { bottom: auto; top: -78px; }      /* the title floats above the painted envelope */
.envelope.art .env-label b { color: var(--gold-hi); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.envelope.art .env-label span { color: var(--gold); opacity: 0.8; }                   /* on the painted flap's tip */
.seal.art { background: none; box-shadow: none; border-radius: 0; width: 112px; height: 112px; margin: -56px 0 0 -56px; animation: sealglow 3s ease-in-out infinite 1s; }
.seal.art::before { display: none; }
.seal.art img { width: 100%; height: 100%; border-radius: 0; filter: drop-shadow(0 6px 8px rgba(60, 10, 5, 0.5)); mix-blend-mode: normal; opacity: 1; }
@keyframes sealglow { 50% { filter: drop-shadow(0 0 18px rgba(240, 170, 90, 0.55)); } }
.envelope.wait { visibility: hidden; animation: none; }      /* until the paintings are in (admissions.js) */
.envelope.open { transform: translateY(60px) scale(0.9) rotate(-1.2deg); opacity: 0; pointer-events: none; }

/* the letter */
.paper { position: relative; width: min(540px, 92vw); max-height: calc(100dvh - 32px); overflow: auto; box-sizing: border-box; padding: 44px 44px 36px;
  background: var(--grain), radial-gradient(ellipse at 50% 0%, #faf2de, transparent 70%), linear-gradient(#f4ead1, #e7d6b0);
  color: var(--paper-ink); text-align: center; border-radius: 3px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), inset 0 0 60px rgba(150, 105, 50, 0.22); animation: unfold .9s cubic-bezier(.2, .8, .2, 1) both; }
/* (10/27, 제이: "스크롤 좀 고쳐줘 미운 스크롤이") a short window: the letter scrolls with a thin ink-brown bar on the
   parchment, not the browser's grey one */
/* (again, 제이: "스크롤이 애매하게 들어가서 안 예뻐") no bar at all: the parchment and its border stay still and only the
   words inside scroll (.paper-in); while more of the letter is below, they fade out just above the bottom border */
.paper { display: flex; flex-direction: column; overflow: hidden; }
.paper[hidden] { display: none; }
.paper-in { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
.paper-in::-webkit-scrollbar { display: none; }
/* (11/3, 제이: "여기 버튼이 묻힌") the button is the last thing in the scrolling words, so their box cut off its shadow and the
   bottom of its rounded edge; room below it, borrowed from the paper's own bottom padding (the layout stays put) */
.paper-in { padding-bottom: 20px; margin-bottom: -20px; }
.paper-in.more { --fade-b: 70px; }
.paper-in.past { --fade-t: 36px; }
.paper-in.more, .paper-in.past {
  -webkit-mask-image: linear-gradient(transparent, #000 var(--fade-t, 0px), #000 calc(100% - var(--fade-b, 0px)), transparent);
  mask-image: linear-gradient(transparent, #000 var(--fade-t, 0px), #000 calc(100% - var(--fade-b, 0px)), transparent); }
.paper-in:not(.more) { --fade-b: 0px; }   /* (at the end: no fade below; scrolled down: a short one above, under the top border) */
.paper-down { position: absolute; left: 50%; bottom: 26px; width: 34px; height: 26px; margin-left: -17px; padding: 0; border: 0; background: none;
  color: #9a7234; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .3s; }
.paper.art .paper-down { bottom: 38px; }
.paper.more .paper-down { opacity: 0.85; pointer-events: auto; animation: downbob 1.8s ease-in-out infinite; }
.paper-down svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.paper-down:hover { color: #7a5420; }
@keyframes downbob { 50% { transform: translateY(4px); } }
.paper.art { background: url("./assets/academy/letter.webp") center / 100% 100% no-repeat; padding: 60px 64px 50px; }
.paper.art::before { display: none; }
.paper::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(124, 91, 51, 0.45); outline: 1px solid rgba(124, 91, 51, 0.22); outline-offset: 4px; pointer-events: none; }
@keyframes unfold { from { transform: translateY(26px) scaleY(0.55); opacity: 0; } to { transform: none; opacity: 1; } }
.paper-emblem { width: 58px; height: 58px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(169, 128, 63, 0.6), 0 4px 10px rgba(80, 50, 20, 0.25); }
.paper-kicker { margin: 14px 0 0; font-size: 11px; letter-spacing: 0.46em; color: var(--paper-dim); }
.paper-title { margin: 6px 0 0; font-size: 30px; font-weight: 700; letter-spacing: 0.24em; color: #4a3218; }
.rule { display: flex; align-items: center; gap: 10px; margin: 18px auto 22px; width: 70%; color: var(--gold-lo); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, currentColor, transparent); }
.rule i { width: 7px; height: 7px; transform: rotate(45deg); background: currentColor; }
.paper-body p { margin: 0 0 10px; font-size: 18px; line-height: 1.85; word-break: keep-all; }
/* the school's oath in the letter (제이 10/17): a quieter voice, set in from the margins */
.paper-body p.oath { margin: 0 6% 10px; font-size: 16px; line-height: 1.8; color: #5a4024; }
.paper-body p.oath + p:not(.oath) { margin-top: 16px; }
@keyframes ink { from { opacity: 0; filter: blur(3px); transform: translateY(3px); } to { opacity: 1; filter: none; transform: none; } }
/* (10/23 제이: "한번에 쫙 보여주기") the whole letter unfolds at once with the paper: lines, signature, stamp and button,
   nothing inking in after it (the stamp and the button coming a beat later looked like a glitch) */
.paper-sign { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 22px 6px 0; }
.paper-sign span { white-space: nowrap; font-size: 15px; color: var(--paper-dim); letter-spacing: 0.12em; }
/* the school's stamp (GPT, red ink; 제이 10/19), pressed over the end of the office's name, the ink soaking into the paper */
.paper-sign .stamp { width: 96px; height: 96px; margin: -26px 0 -26px -30px; mix-blend-mode: multiply; opacity: 0.88;
  transform: rotate(-11deg); }
.paper .btn { margin-top: 26px; }

/* ② the office */
#office { place-items: end center; padding: 0; }
.office-bg { position: absolute; inset: 0; background-color: #120e0b; }
.office-bg.art { background: #120e0b url("./assets/academy/office.webp") center / cover no-repeat; }
.office-bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(5, 4, 3, 0.55) 100%), linear-gradient(to top, rgba(6, 5, 4, 0.9) 0%, rgba(6, 5, 4, 0.1) 42%, rgba(6, 5, 4, 0.3) 100%); }
/* the teacher stands on the rug before the fireplace (office.webp = our hall's fireplace corner, repainted): about the
   size the room gives her (10/17 제이: "선생님이 너무 커"), feet above the dialogue, a soft contact shadow under them */
.office-stage { --t-h: min(56vh, 600px); --t-feet: 14vh; --t-x: 68%; }
.teacher { position: absolute; left: var(--t-x); bottom: var(--t-feet); transform: translateX(-50%); height: var(--t-h); max-width: 94vw; object-fit: contain; pointer-events: none;
  z-index: 1; animation: rise .9s ease-out both; }
.teacher-shadow { position: absolute; z-index: 1; left: var(--t-x); bottom: calc(var(--t-feet) - var(--t-h) * 0.022); width: calc(var(--t-h) * 0.3); height: calc(var(--t-h) * 0.05);
  transform: translateX(-54%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(8, 4, 2, 0.62) 0%, rgba(8, 4, 2, 0.35) 45%, rgba(8, 4, 2, 0) 72%); filter: blur(3px); animation: rise .9s ease-out both; }
.teacher.missing { display: none; }
/* while the register is open the teacher steps aside (wide screens): the book on the left, she on the right */
.teacher { transition: left .7s cubic-bezier(.2, .8, .2, 1), height .7s; }
#office.writing { --t-x: 74%; }
#office.writing .ledger { left: 4vw; right: auto; margin: 0; width: min(640px, 54vw); }
@media (max-width: 900px) { #office.writing { --t-x: 50%; } #office.writing .ledger { left: 0; right: 0; margin: 0 auto; width: min(700px, calc(100vw - 32px)); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* the dialogue (office and the dressing room share it) */
.dialogue, .enroll-talk { position: relative; z-index: 2; box-sizing: border-box; cursor: pointer; color: var(--ink); font-family: var(--font);
  background: linear-gradient(180deg, rgba(24, 20, 30, 0.92), rgba(12, 10, 16, 0.94)); border: 1px solid var(--gold-line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 240, 210, 0.06); backdrop-filter: blur(8px); }
.dialogue::before, .enroll-talk::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--gold-faint); border-radius: 12px; pointer-events: none; }
.dialogue { width: min(780px, calc(100vw - 32px)); margin: 0 16px max(18px, env(safe-area-inset-bottom)); padding: 30px 30px 26px; }
@media (min-width: 901px) { #office { place-items: end start; } #office .dialogue { width: min(600px, 52vw); margin-left: max(28px, 4vw); }
  #office .go { left: max(28px, 4vw); transform: none; } #office .go:hover { transform: translateY(-1px); } }
.who { position: absolute; top: -15px; left: 24px; margin: 0; padding: 8px 16px 7px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1;
  letter-spacing: 0.1em; color: #24180a; background: linear-gradient(180deg, #f2dca5, #c99d55); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.say { margin: 0; font-size: 19px; line-height: 1.8; min-height: 3.6em; word-break: keep-all; }
.next { position: absolute; right: 22px; bottom: 16px; width: 9px; height: 9px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg); animation: bob 1.3s ease-in-out infinite; }
.typing .next, .idle .next { visibility: hidden; }
@keyframes bob { 50% { transform: translateY(4px) rotate(45deg); } }
.go { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: calc(max(18px, env(safe-area-inset-bottom)) + 178px); }
.go:hover { transform: translateX(-50%) translateY(-1px); }

/* the register: an open book */
.ledger { position: absolute; z-index: 2; top: max(24px, 12vh); left: 0; right: 0; margin: 0 auto; width: min(700px, calc(100vw - 32px));
  display: grid; grid-template-columns: 1fr 1fr; animation: unfold .7s cubic-bezier(.2, .8, .2, 1) both;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6)); }
.ledger[hidden] { display: none; }
/* the painted register: one picture behind both pages */
.ledger.art { background: url("./assets/academy/ledger.webp") center / 100% 100% no-repeat; aspect-ratio: var(--ledger-ar, 1.5); padding: 0; box-sizing: border-box; gap: 0;
  /* (10/23 제이: "화살표 방향으로 옮겨서 내용을 페이지 중앙에") the two pages sit on the painted paper (ledger.webp: left page 6-46 %,
     right page 53-94 % of the width, past the spine's shade; 5-91 % of the height). Percent padding here was a share of the SCREEN's
     width, which pushed both pages in toward the spine; fr tracks are a share of the book itself. */
  grid-template-columns: 6fr 40fr 7fr 41fr 6fr; grid-template-rows: 5fr 86fr 9fr; }
.ledger.art .ledger-page.left { grid-column: 2; grid-row: 2; }
.ledger.art .ledger-page.right { grid-column: 4; grid-row: 2; }
.ledger.art .ledger-page { background: none; box-shadow: none; min-height: 0; padding: 6% 4%; }
.ledger.art .ledger-page.left::after, .ledger.art .ledger-page.right::before { display: none; }
.ledger-page { position: relative; box-sizing: border-box; min-height: 300px; padding: 30px 30px 26px; color: var(--paper-ink);
  background: var(--grain), linear-gradient(90deg, #e3d0a6 0%, #f3e9d0 14%, #f5ecd6 100%); border-radius: 6px 2px 2px 6px;
  box-shadow: -3px 3px 0 #d8c39a, -6px 6px 0 #cbb489; }
.ledger-page.right { background: var(--grain), linear-gradient(270deg, #e3d0a6 0%, #f3e9d0 14%, #f5ecd6 100%); border-radius: 2px 6px 6px 2px;
  box-shadow: 3px 3px 0 #d8c39a, 6px 6px 0 #cbb489; display: flex; flex-direction: column; gap: 12px; }
.ledger-page.left::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 34px; background: linear-gradient(90deg, transparent, rgba(110, 75, 35, 0.22)); }
.ledger-page.right::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 34px; background: linear-gradient(270deg, transparent, rgba(110, 75, 35, 0.22)); pointer-events: none; }
.ledger-head { margin: 0; font-size: 12px; letter-spacing: 0.4em; color: var(--paper-dim); text-align: center; }
.ledger-head b { display: block; font-size: 22px; letter-spacing: 0.3em; color: #4a3218; margin-bottom: 4px; }
.ledger-mark { display: block; width: 92px; height: 92px; margin: 26px auto 12px; border-radius: 50%; opacity: 0.2; filter: sepia(1) grayscale(0.4); }
.ledger-date { margin: 0; text-align: center; font-size: 14px; color: var(--paper-dim); letter-spacing: 0.08em; }
.ledger-label { font-size: 12px; font-weight: 700; letter-spacing: 0.3em; color: var(--paper-dim); }
.ledger input { font-size: 26px; color: #2a1c0e; background: transparent; border: 0; border-bottom: 1.5px dashed rgba(124, 91, 51, 0.6);
  padding: 8px 2px 10px; outline: none; border-radius: 0; width: 100%; box-sizing: border-box; }
/* (10/23 제이: "여기에 적어주세요 글자가 잘려보인다") the hint is smaller than the name it waits for: it fits the page from phones to wide screens */
.ledger input::placeholder { color: rgba(124, 91, 51, 0.45); font-size: 0.74em; }
/* (10/22, privacy policy) the age line under the name: 14 or older, or a guardian's yes */
.ledger-age { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.55; color: #4a3218; cursor: pointer; word-break: keep-all; }
.ledger-age[hidden] { display: none; }
.ledger-privacy { align-self: flex-start; margin: -4px 0 0 25px; font-size: 11.5px; color: var(--paper-dim); text-underline-offset: 2px; }
.ledger-privacy[hidden] { display: none; }
.ledger .ledger-age input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; padding: 0; border: 0; accent-color: #8a5b14; cursor: pointer; }
.ledger input:focus { border-bottom: 1.5px solid #a9803f; }
.written { margin: 4px 0 0; min-height: 1.5em; font-size: 34px; font-weight: 700; color: #8a5b14; text-shadow: 0 0 14px rgba(232, 180, 90, 0.55); }
.written:empty { display: none; }
.written.on { animation: ink 1.5s ease forwards; }
.ledger-no { margin: 0; font-size: 15px; color: var(--paper-dim); letter-spacing: 0.12em; }
.ledger .btn { align-self: flex-start; margin-top: auto; }
/* (10/23 제이: "노트에 중앙 배열, 양쪽 페이지 모두") both pages hold their words in the middle, across and down */
.ledger-page.left { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ledger-page.right { align-items: center; justify-content: center; text-align: center; }
.ledger #name { text-align: center; }
.ledger-age { align-self: center; text-align: left; }
.ledger-privacy { align-self: center; margin: -4px 0 0; }
.ledger .btn { align-self: center; margin-top: 6px; }
.btn.ink { color: var(--paper); background: linear-gradient(180deg, #5d4123, #3b2814); border: 1px solid rgba(60, 40, 20, 0.6); box-shadow: 0 6px 16px rgba(60, 40, 20, 0.35); }
.btn.ink:hover { background: linear-gradient(180deg, #6b4c2a, #45301a); }
@media (max-width: 600px) {
  .ledger { grid-template-columns: 1fr; top: 3vh; }
  .ledger:not(.art) .ledger-page.left { display: none; }
  /* (10/23 제이: "왜 모바일에선 왼쪽 페이지에 아무것도 안 보여?") the left page keeps its title, crest and date, small (was hidden) */
  .ledger.art .ledger-page.left { padding: 4% 3%; }
  .ledger.art .ledger-head { font-size: 7.5px; letter-spacing: 0.32em; }
  .ledger.art .ledger-head b { font-size: 15px; letter-spacing: 0.24em; margin-bottom: 2px; }
  .ledger.art .ledger-mark { width: 50px; height: 50px; margin: 12px auto 8px; }
  .ledger.art .ledger-date { font-size: 10px; letter-spacing: 0.04em; }
  /* (10/23 제이: "모바일에선 폰트 사이즈를 줄여야") a phone's page is short: smaller words so they fit it, centred like the PC's */
  .ledger.art .ledger-page.right { padding: 4% 3%; gap: 4px; }
  .ledger.art .ledger-label { font-size: 10px; }
  .ledger.art .written { font-size: 24px; }
  .ledger.art .ledger-no { font-size: 11.5px; letter-spacing: 0.04em; }
  .ledger.art #name { font-size: 15px; padding: 4px 2px 6px; }
  .ledger.art #name::placeholder { font-size: 0.9em; }
  .ledger.art .ledger-age { font-size: 10px; gap: 5px; line-height: 1.4; }
  .ledger.art .ledger-privacy { font-size: 9.5px; margin-top: -2px; }
  .ledger.art .ledger-age input { width: 13px; height: 13px; margin-top: 1px; }
  .ledger.art .btn { min-height: 32px; padding: 0 12px; font-size: 12px; margin-top: 2px; }
  .ledger-page.right { border-radius: 6px; box-shadow: 0 4px 0 #d8c39a, 0 8px 0 #cbb489; min-height: 250px; }
  .dialogue { padding: 26px 22px 22px; }
  .say { font-size: 17px; }
  .office-stage { --t-h: 44vh; --t-feet: 22vh; --t-x: 50%; }
  .paper { padding: 38px 28px 30px; }
  .paper-title { font-size: 26px; }
  .paper-body p { font-size: 16.5px; }
  /* (10/17: the letter grew the oath) the painted letter's wide margins are for PCs; a phone keeps the words wide */
  .paper.art { padding: 46px 30px 34px; }
  .paper-body p.oath { margin: 0 0 10px; font-size: 15.5px; }
  .paper-sign span { letter-spacing: 0.06em; }
}
@media (prefers-reduced-motion: reduce) { .adm *, .enroll-talk, .card-flip { animation: none !important; transition: none !important; } .paper-body p, .paper-sign { opacity: 1; } }

/* the teacher in the dressing room (dressing.html?enroll) */
.enroll-talk { position: fixed; z-index: 5; left: 24px; bottom: max(24px, env(safe-area-inset-bottom)); width: min(540px, calc(100vw - 48px - 380px)); padding: 28px 26px 22px; }
.enroll-talk .say { font-size: 17px; min-height: 3.4em; }
.enroll-talk .enroll-next { display: flex; margin-top: 14px; min-height: 44px; padding: 0 26px; font-size: 14px; position: relative; z-index: 1; }   /* (10/20) 다음, under the words */
.enroll-talk .enroll-next[hidden], .enrolling .foot[hidden] { display: none; }
.enroll-talk:has(.enroll-next:not([hidden])) > .next { display: none; }   /* the button is the way on: no second arrow on the right */
@media (max-width: 760px) {
  .enroll-talk { width: calc(100vw - 24px); left: 12px; bottom: calc(46vh + 30px); padding: 24px 18px 18px; }
  .enroll-talk .say { font-size: 15.5px; }
  .enroll-talk.over-card { top: max(28px, env(safe-area-inset-top)); bottom: auto; }
}

/* "처음부터": a quiet button in the top-right corner of the intro screens */
.restart { position: fixed; z-index: 9; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); min-height: 36px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--gold-line); background: rgba(14, 12, 20, 0.6); color: var(--ink-dim); font-family: var(--font);
  font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: 0.04em; cursor: pointer; backdrop-filter: blur(6px); }
.restart:hover { color: var(--ink); background: rgba(214, 178, 109, 0.14); }
.restart.left { right: auto; left: max(26px, env(safe-area-inset-left)); top: calc(max(22px, env(safe-area-inset-top)) + 96px); }   /* under the dressing room's title */
@media (max-width: 760px) { .restart.left { left: auto; right: 12px; top: max(14px, env(safe-area-inset-top)); bottom: auto; } }

/* the student card */
.card-view { position: fixed; z-index: 6; inset: 0; display: grid; place-items: center; padding: 16px; font-family: var(--font);
  background: radial-gradient(ellipse at 50% 45%, rgba(30, 32, 70, 0.55), rgba(5, 5, 10, 0.88)); backdrop-filter: blur(6px); }
.card-view[hidden] { display: none; }
/* (10/25, 제이's iPad: "학생증만 스크롤이 돼야 하는데 화면 전체가 올라가") taller than the screen, the card's window scrolls by
   itself (never the page behind it); the card also shrinks with a short screen so the buttons under it mostly fit */
.card-view { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; place-items: safe center; -webkit-overflow-scrolling: touch; }
.card-wrap { display: grid; justify-items: center; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
.card-flip { width: min(640px, 92vw, max(300px, calc((100dvh - 240px) * 1.586))); aspect-ratio: 1012 / 638; perspective: 1600px; cursor: pointer; animation: cardin 1s cubic-bezier(.2, .8, .2, 1) both; }
/* (10/25, 제이: "학생증이 너무 커 보여, 화면이 작을 때는 줄어들게") tablets and smaller laptops: at most 520 px wide */
@media (max-width: 1380px) { .card-flip { width: min(520px, 92vw, max(280px, calc((100dvh - 240px) * 1.586))); } }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3, .7, .2, 1); }
.card-flip.back .card-inner { transform: rotateY(180deg); }
.card-inner canvas { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 3.4%;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(214, 178, 109, 0.25); }
.card-inner canvas.b { transform: rotateY(180deg); }
@keyframes cardin { from { transform: translateY(50px) rotateX(35deg) scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
/* "카드를 누르면 뒷면을 볼 수 있어요." (제이 10/19: easy to see): gold, a flip mark before it, a slow breath */
.card-hint { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 7px 16px 7px 12px; border-radius: 999px;
  color: #ecd3a0; font-size: 15px; letter-spacing: 0.04em; background: rgba(217, 181, 111, 0.12); border: 1px solid rgba(217, 181, 111, 0.4);
  animation: hint-breathe 2.8s ease-in-out infinite; }
.card-hint::before { content: '↻'; font-size: 17px; line-height: 1; color: #f3dca8; }
@keyframes hint-breathe { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; box-shadow: 0 0 14px rgba(217, 181, 111, 0.25); } }
@media (prefers-reduced-motion: reduce) { .card-hint { animation: none; } }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.card-view .btn { font-family: var(--font); }
