/* HELLO Academy — "notebook" design (Elia's pick, 2026-10-12).
   Lined paper, a red margin line, sticky notes with tape, doodles, and small playful animations.
   Everything respects prefers-reduced-motion. */
:root {
  --ink: #1d2a52; --ink-2: #55608a; --paper: #fffdf4; --line: #cfe3ff; --margin: #ff8a8a;
  --yellow: #fff3a1; --green: #c8f2d4; --pink: #ffd3e3; --blue: #d4e6ff; --hl: #ffe45c; --red: #ff6b6b;
  --tape: rgba(150, 195, 255, .7);
  --shadow: 0 10px 18px -10px rgba(29, 42, 82, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.55 'Varela Round', system-ui, sans-serif;
  background: var(--paper) repeating-linear-gradient(180deg, transparent 0 31px, var(--line) 31px 32px);
  background-attachment: local; min-height: 100vh;
}
body::before { content: ""; position: fixed; top: 0; bottom: 0; right: 36px; width: 2px; background: var(--margin); opacity: .8; pointer-events: none; z-index: 0; }
@media (min-width: 700px) { body::before { right: 72px; } }

/* ---------- header ---------- */
header { position: relative; z-index: 1; padding: 28px 56px 10px 20px; max-width: 980px; margin: 0 auto; }
header h1 { font: 700 clamp(54px, 13vw, 92px)/.85 'Amatic SC', cursive; margin: 0; text-align: right; letter-spacing: 1px; }
header h1 b { display: inline-block; background: var(--hl); padding: 0 .12em; transform: rotate(-2deg); border-radius: 4px; }
header .sub { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
header .doodle { position: absolute; font-size: 30px; animation: bob 4s ease-in-out infinite; }
header .d1 { left: 18px; top: 26px; transform: rotate(-14deg); }
header .d2 { left: 70px; top: 70px; font-size: 22px; animation-delay: -1.5s; }
@keyframes bob { 50% { translate: 0 -6px; rotate: 6deg; } }

main { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 8px 56px 60px 18px; }
@media (min-width: 700px) { main, header { padding-right: 96px; } }

h2 { font: 400 26px/1.15 'Secular One', sans-serif; margin: 0 0 10px; }
h3 { font: 400 21px/1.2 'Secular One', sans-serif; margin: 4px 0 6px; }
a { color: #2f6fd6; }

/* ---------- sticky notes (every .card) ---------- */
.card {
  position: relative; background: var(--yellow); padding: 22px 18px 18px; margin: 22px 0; border-radius: 3px 3px 14px 3px;
  box-shadow: var(--shadow); transform: rotate(var(--tilt, -1deg));
  animation: noteIn .45s cubic-bezier(.25, 1.4, .5, 1) both; animation-delay: calc(var(--i, 0) * 70ms);
}
.card::before { /* tape */
  content: ""; position: absolute; top: -11px; left: 50%; width: 84px; height: 22px; margin-left: -42px;
  background: var(--tape); transform: rotate(calc(var(--tilt, -1deg) * -3)); border-radius: 2px;
}
.card:nth-of-type(4n+2) { --tilt: 1deg; background: var(--green); }
.card:nth-of-type(4n+3) { --tilt: -.6deg; background: var(--pink); }
.card:nth-of-type(4n+4) { --tilt: .8deg; background: var(--blue); }
@keyframes noteIn { from { opacity: 0; transform: translateY(18px) rotate(calc(var(--tilt, -1deg) * 4)) scale(.96); } }

/* the auth note and the top bars are calmer */
#auth.card { background: #fff; max-width: 520px; }
#app > .card.row, #nav.card { background: #fff; padding: 14px; transform: none; margin: 14px 0; }
#app > .card.row::before, #nav.card::before { display: none; }
#who { font: 400 19px 'Secular One', sans-serif; align-self: center; margin-left: auto; }

/* ---------- list items inside notes ---------- */
.item { padding: 12px 2px; border-bottom: 2px dashed rgba(29, 42, 82, .18); animation: noteIn .4s ease both; }
.item:last-child { border-bottom: 0; }
.item small { color: var(--ink-2); }
.muted { color: var(--ink-2); }

/* ---------- buttons ---------- */
button {
  font: 400 16px 'Secular One', sans-serif; color: var(--ink); background: #fff; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 14px 16px 12px 18px; padding: 8px 14px; margin: 3px;
  box-shadow: 2px 3px 0 var(--ink); transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), box-shadow .15s, background .2s;
}
button:hover { transform: translateY(-2px) rotate(-1.5deg); box-shadow: 3px 5px 0 var(--ink); }
button:active { transform: translateY(1px) scale(.96); box-shadow: 1px 1px 0 var(--ink); }
button[aria-current="page"], #loginBtn, #docForm [value=submit], #postForm > button:not([type=button]), #quizForm > button, #gradeForm button, #chatForm button {
  background: var(--red); color: #fff; border-color: var(--red); box-shadow: 2px 3px 0 #b84343;
}
#nav { display: flex; flex-wrap: wrap; gap: 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }

/* ---------- form fields: writing on paper ---------- */
input, textarea, select {
  display: block; width: 100%; font: inherit; color: var(--ink); margin: 8px 0 14px; padding: 10px 12px;
  background: rgba(255, 255, 255, .75); border: 2px solid rgba(29, 42, 82, .25); border-radius: 12px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--ink); background: #fff; box-shadow: 0 0 0 4px rgba(255, 228, 92, .7); }
textarea { min-height: 120px; resize: vertical;
  background: #fff repeating-linear-gradient(180deg, transparent 0 27px, #e4eefc 27px 28px); line-height: 28px; }
label { font-weight: 700; font-size: 14px; }
.choice { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 6px 0; }
.choice input { width: auto; margin: 0; }
.question { padding: 10px 0; border-bottom: 2px dashed rgba(29, 42, 82, .15); }

/* ---------- profile photo: a polaroid ---------- */
img { width: 96px; height: 96px; object-fit: cover; border: 6px solid #fff; border-bottom-width: 18px; border-radius: 2px;
  box-shadow: var(--shadow); transform: rotate(-4deg); margin: 4px 0 10px; }

/* ---------- messages ---------- */
#authMsg, #docMsg, #gradeMsg, #postMsg, #profileMsg, #quizMsg { font-weight: 700; min-height: 1.2em; }
#authMsg:not(:empty) { color: #c0392b; animation: shake .4s; }
@keyframes shake { 25% { translate: -5px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }

/* chat: speech bubbles */
#content .item b + p { margin: 4px 0 0; }

.card.rule { background: #ffd3e3; --tilt: 1.2deg; }

.topic { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 2px dashed var(--ink); border-radius: 999px; padding: 2px 4px 2px 12px; }
.topic button { padding: 0 8px; margin: 0; box-shadow: none; border: 0; background: transparent; }

.card.detention-note { --tilt: -1.6deg; background: #ff6b6b; color: #fff; border: 3px dashed #fff; outline: 4px solid #ff6b6b; text-align: center; animation: noteIn .45s cubic-bezier(.25,1.4,.5,1) both, alarm 1.6s ease-in-out .5s 3; }
.detention-note h2 { font-size: 30px; margin: 4px 0; }
.detention-note .mission { font-size: 19px; background: rgba(255,255,255,.18); border-radius: 12px; padding: 10px; }
.detention-note .muted { color: rgba(255,255,255,.85); font-size: 13px; }
.detention-note .siren { font-size: 44px; animation: siren .5s ease-in-out infinite alternate; display: inline-block; }
@keyframes siren { to { transform: rotate(14deg) scale(1.12); } }
@keyframes alarm { 50% { box-shadow: 0 0 0 10px rgba(255,107,107,.35), var(--shadow); } }

.gd-badge { display: inline-block; margin-top: 8px; background: #1f6b3a; color: #fff; font: 400 14px 'Secular One', sans-serif; padding: 4px 12px; border-radius: 999px; transform: rotate(-2deg); box-shadow: 2px 3px 0 #0f3d20; animation: noteIn .5s .3s both; }
.gd-foot { position: relative; z-index: 1; text-align: center; color: var(--ink-2); font-size: 13px; padding: 10px 56px 30px 18px; }
#nav button[aria-current="page"] { background: #1f6b3a; border-color: #1f6b3a; box-shadow: 2px 3px 0 #0f3d20; }

.detention-note .jingle { background: #fff; color: #ff6b6b; border-color: #fff; box-shadow: 2px 3px 0 #b84343; font-size: 14px; }

.card.strikes-note { background: #ffe0b3; --tilt: -1deg; }
.balls { letter-spacing: 2px; font-size: 1.1em; }
.card.out-card { background: #1d2a52; color: #fff; text-align: center; --tilt: 0deg; }
.out-card .big { font-size: 46px; animation: siren .6s ease-in-out infinite alternate; display: inline-block; }
.out-card .muted { color: rgba(255,255,255,.8); }
.strike-row .row { margin-top: 4px; }

.term-divider { margin: 18px 0 6px; padding: 6px 12px; text-align: center; font: 400 17px 'Secular One', sans-serif; color: var(--ink-2);
  border-top: 3px dashed rgba(29, 42, 82, .3); }
.card.new-card-note { background: #1f6b3a; color: #fff; text-align: center; --tilt: 1deg; }
.new-card-note .big { font-size: 46px; animation: siren .7s ease-in-out infinite alternate; display: inline-block; }

/* report cards: a fancy certificate in Clara's colour, stickers slapped on the corners */
.report { position: relative; margin: 26px 4px; padding: 34px 30px 22px; background: var(--rc, #fff3a1); border-radius: 6px; text-align: center;
  border: 3px double var(--ink); outline: 8px solid #fff; box-shadow: 0 0 0 11px var(--ink), 0 22px 30px -14px rgba(29, 42, 82, .5);
  animation: noteIn .55s cubic-bezier(.25, 1.4, .5, 1) both; transform: rotate(-.6deg); }
.rc-head { font: 700 46px/.9 'Amatic SC', cursive; letter-spacing: 2px; }
.rc-title { font: 400 19px 'Secular One', sans-serif; display: inline-block; background: var(--hl); padding: 0 10px; border-radius: 4px; transform: rotate(-2deg); margin: 6px 0 12px; }
.rc-name { font: 400 30px 'Secular One', sans-serif; border-bottom: 2px solid var(--ink); display: inline-block; padding: 0 18px 2px; margin-bottom: 14px; }
.rc-text { font-size: 18px; line-height: 1.7; min-height: 3em; white-space: normal; }
.rc-foot { display: flex; justify-content: space-between; align-items: end; margin-top: 18px; }
.rc-sign { font: 700 32px 'Amatic SC', cursive; border-top: 2px solid var(--ink); padding: 0 16px; }
.rc-seal { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font: 700 11px/1.2 'Secular One', sans-serif;
  border: 3px dotted #fff; outline: 3px solid var(--red); transform: rotate(-12deg); }
.rc-sticker { position: absolute; font-size: 34px; transform: rotate(var(--r)); filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, .25));
  animation: pop .45s cubic-bezier(.3, 1.8, .5, 1) both; animation-delay: calc(.25s + var(--i, 0) * 90ms); }
@keyframes pop { from { opacity: 0; transform: scale(.2) rotate(40deg); } }
.rc-preview-title { margin: 22px 0 0; }
.swatch { width: 38px; height: 38px; border-radius: 50%; padding: 0; }
.swatch.on { outline: 4px solid var(--ink); outline-offset: 2px; }
.stk { font-size: 22px; padding: 4px 8px; }
.stk.on { background: var(--hl); transform: rotate(-6deg) scale(1.1); }
.card.end-sem { background: #1f6b3a; color: #fff; --tilt: .6deg; }
.end-sem label { color: #fff; }
.big-btn { display: block; width: 100%; font-size: 26px; padding: 16px; background: var(--hl); border-width: 3px; box-shadow: 4px 6px 0 var(--ink);
  animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.03); } }
#endMsg, #rcMsg { font-weight: 700; }

/* confetti (fx.js) */
.confetti { position: fixed; top: -12px; z-index: 50; pointer-events: none; font-size: 22px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }

/* ---------- phones: more room for content, one swipeable sticky tab row ---------- */
@media (max-width: 600px) {
  body::before { right: 14px; }
  header { padding: 16px 28px 4px 12px; }
  header h1 { font-size: 58px; }
  header .sub { font-size: 13px; }
  header .d1 { left: 8px; top: 14px; font-size: 24px; }
  header .d2 { display: none; }
  .gd-badge { font-size: 12px; margin-top: 6px; }
  main { padding: 4px 28px 40px 12px; }
  .gd-foot { padding: 8px 28px 24px 12px; }
  .card { margin: 18px 0; padding: 18px 14px 14px; }
  #app > .card.row { padding: 6px 12px; margin: 8px 0; }
  #who { font-size: 16px; }
  #logout { padding: 4px 10px; font-size: 14px; }
  #nav.card { position: sticky; top: 0; z-index: 20; flex-wrap: nowrap; overflow-x: auto; padding: 8px; margin: 8px -6px 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; box-shadow: 0 8px 14px -10px rgba(29, 42, 82, .5);
    -webkit-mask-image: linear-gradient(to left, #000 88%, transparent); mask-image: linear-gradient(to left, #000 88%, transparent); }
  #nav::-webkit-scrollbar { display: none; }
  #nav button { flex: none; white-space: nowrap; font-size: 15px; padding: 6px 12px; margin: 2px; }
  #nav button:hover { transform: none; }
  h2 { font-size: 23px; }
  .report { padding: 28px 14px 16px; margin: 22px 10px; }
  .rc-head { font-size: 38px; }
  .rc-name { font-size: 25px; }
  .rc-sticker { font-size: 28px; }
  .rc-seal { width: 62px; height: 62px; font-size: 9px; }
  .big-btn { font-size: 22px; }
  .swatch { width: 32px; height: 32px; margin: 2px; }
  .stk { font-size: 19px; padding: 3px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
