/* ===========================================================================
   Maxwell — shared styles
   Three looks, all built on real grade-school primary paper.
   Pick a look by setting <body class="opt-classic | opt-photo | opt-bold">.
   =========================================================================== */

:root {
  --paper: #fffdf8;          /* warm newsprint white            */
  --line-blue: #9db8d6;      /* head/base ruling                */
  --line-base: #7fa3c9;      /* slightly stronger baseline      */
  --line-red: #d98c8c;       /* dashed midline                  */
  --margin-red: #e7b3b3;     /* left margin rule                */
  --band: clamp(64px, 11vh, 116px);   /* height of one writing row */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
}

body {
  display: grid;
  place-items: center;
  padding: 6vmin;
  background-color: var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;                 /* one calm screen, no scroll */
  -webkit-font-smoothing: antialiased;
}

/* ---- Paper: blue head + base lines with a red dashed midline ------------- */
.paper-lines {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='100' viewBox='0 0 40 100'><line x1='0' y1='2' x2='40' y2='2' stroke='%239db8d6' stroke-width='2'/><line x1='0' y1='98' x2='40' y2='98' stroke='%237fa3c9' stroke-width='2.5'/><line x1='0' y1='55' x2='40' y2='55' stroke='%23d98c8c' stroke-width='1.6' stroke-dasharray='7 5'/></svg>");
  background-size: 40px var(--band);
  background-repeat: repeat;
}

/* faint left margin rule (hidden on small screens) */
.paper-lines::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: clamp(28px, 7vw, 96px);
  width: 2px;
  background: var(--margin-red);
  opacity: .7;
}
@media (max-width: 620px) {
  .paper-lines::before { display: none; }
}

/* subtle paper grain for realism */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .04;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* ---- The name ----------------------------------------------------------- */
.stage {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  z-index: 1;
}

.name {
  display: block;
  width: min(86vw, 1080px);
  height: auto;
  /* lift the graphite a hair off the page */
  filter: drop-shadow(0 1px 0 rgba(40, 38, 45, .18));
  transform-origin: 50% 60%;
  /* slight crooked placement + a very gentle "bumpy bus" sway */
  animation: bus-sway 11s ease-in-out infinite;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
}

/* very subtle continuous wobble, like writing on a moving bus */
@keyframes bus-sway {
  0%   { transform: rotate(-1.7deg) translateY(0); }
  33%  { transform: rotate(-1.4deg) translateY(-0.5px); }
  66%  { transform: rotate(-1.7deg) translateY(0.5px); }
  100% { transform: rotate(-1.7deg) translateY(0); }
}

/* big tap/click shake — fun for a kid */
.name.shake { animation: bus-shake .6s ease-in-out; }
@keyframes bus-shake {
  0%,100% { transform: rotate(-2deg); }
  15% { transform: rotate(3deg)  translateX(-6px); }
  30% { transform: rotate(-4deg) translateX(6px); }
  45% { transform: rotate(3deg)  translateX(-5px) translateY(2px); }
  60% { transform: rotate(-3deg) translateX(4px); }
  80% { transform: rotate(1deg)  translateX(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .name { animation: none; transform: rotate(-1.6deg); }
}

/* =========================================================================
   OPTION VARIANTS
   ========================================================================= */

/* Option A — Classic primary tablet (white ruled paper) */
.opt-classic { /* uses defaults */ }

/* Option B — Real notebook photo background */
.opt-photo {
  background-color: #efeae1;
  background-image: url("assets/paper-photo.png");
  background-size: cover;
  background-position: center;
}
.opt-photo .name {
  width: min(82vw, 1000px);
  /* a touch more shadow so graphite reads on the photographed paper */
  filter: drop-shadow(0 1px 1px rgba(40, 38, 45, .22));
}

/* Option C — Playful big, wide-ruled cream paper */
.opt-bold {
  --paper: #fffef2;
  --band: clamp(90px, 15vh, 150px);   /* wide rule */
}
.opt-bold .name {
  width: min(96vw, 1500px);           /* HUGE — close to the edges */
}
