:root {
  --paper: #FFFDF7;
  --ink: #1F3A8A;        /* ballpoint blue */
  --text: #26283a;
  --muted: #5d6178;
  --guide: #CFE3F3;      /* notebook rule blue */
  --margin: #F2A0A0;     /* notebook margin pink */
  --sun: #FFC93C;
  --leaf: #2BA84A;
  --crayon: #E8453C;
  --accent: var(--ink);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--paper);
  /* ruled notebook paper */
  background-image: linear-gradient(to bottom, transparent 31px, var(--guide) 32px);
  background-size: 100% 32px;
}
body::before { /* pink margin line */
  content: ""; position: fixed; inset: 0 auto 0 clamp(14px, 6vw, 72px); width: 2px; background: var(--margin); opacity: .7; pointer-events: none;
}
.wrap { width: min(1100px, 100% - 2rem); margin-inline: auto; position: relative; }
main.wrap { padding-block: 1.5rem 3rem; }
a { color: var(--ink); }
h1, h2, h3 { font-family: 'Fredoka', 'Nunito', sans-serif; line-height: 1.2; color: var(--ink); font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 .5rem; }
h2 { font-size: 1.3rem; margin: 0 0 .5rem; }
.lead { font-size: 1.15rem; max-width: 60ch; margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--crayon); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }

/* header / footer */
.site-header { background: var(--paper); border-bottom: 3px solid var(--ink); position: relative; z-index: 2; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .75rem; }
.brand { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 1.5rem; text-decoration: none; color: var(--ink); }
.brand-script { font-family: 'Dancing Script', cursive; font-size: 1.9rem; color: var(--crayon); margin-right: .1em; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-header nav a { text-decoration: none; font-weight: 700; padding: .25rem 0; border-bottom: 3px solid transparent; }
.site-header nav a:hover { border-color: var(--sun); }
.site-footer { background: var(--ink); color: #e8ecff; padding-block: 1.5rem; font-size: .95rem; position: relative; z-index: 2; }
.site-footer a { color: #fff; }
.site-footer p { margin: .25rem 0; }

/* hero: the characteristic thing is a handwriting guide line */
.hero { padding-block: 2.5rem 1.5rem; }
.script-line {
  font-family: 'Dancing Script', cursive; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--crayon);
  margin: 0 0 .25rem; padding-bottom: .15rem; position: relative; width: fit-content; max-width: 100%;
  border-bottom: 2px solid var(--guide);
}
.script-line::after { content: ""; position: absolute; left: 0; right: 0; top: 52%; border-top: 2px dashed var(--margin); opacity: .8; }

/* hobby cards */
.hobbies { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-block: 1rem; }
.hobby {
  display: block; background: #fff; border: 3px solid var(--accent); border-radius: var(--radius);
  padding: 1.5rem; text-decoration: none; color: var(--text);
  box-shadow: 6px 6px 0 var(--accent); transition: transform .12s, box-shadow .12s;
}
.hobby h2 { font-size: 1.7rem; color: var(--accent); }
.hobby:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--accent); }
.chip { display: inline-block; background: var(--sun); color: #3b2c00; font-weight: 700; font-size: .9rem; padding: .15rem .75rem; border-radius: 999px; }
.soon { color: var(--muted); margin-top: 2rem; }

/* page headers */
.crumbs { font-size: .95rem; color: var(--muted); margin-bottom: .75rem; }
.page-head { margin-bottom: 1rem; }
.page-head h1, .detail h1 { color: var(--accent); }

/* buttons */
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-family: 'Fredoka', sans-serif;
  font-weight: 500; font-size: 1.15rem; padding: .7rem 1.6rem; border-radius: 999px; border: 0; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.25); transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn.small { font-size: .95rem; padding: .35rem 1rem; }

/* worksheet grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; margin-block: 1.5rem; }
.sheet { background: #fff; border: 2px solid var(--guide); border-radius: var(--radius); padding: .75rem; display: flex; flex-direction: column; }
.sheet-link { text-decoration: none; color: inherit; }
.sheet .paper { aspect-ratio: 300 / 388; border: 1px solid #d9dbe6; background: #fff; overflow: hidden; border-radius: 6px; }
.paper img, .paper svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet h2 { font-size: 1.05rem; margin: .6rem 0 .4rem; color: var(--text); }
.sheet-link:hover h2 { text-decoration: underline; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; font-size: .85rem; color: var(--muted); }
.empty { background: #fff; padding: 1.5rem; border-radius: var(--radius); border: 2px dashed var(--guide); }

.pager { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0; }
.pager a { padding: .35rem .9rem; border-radius: 999px; background: #fff; border: 2px solid var(--guide); text-decoration: none; font-weight: 700; }
.pager a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* detail page */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem; margin-block: 1.5rem; align-items: start; }
.preview { background: #fff; border: 2px solid var(--guide); border-radius: var(--radius); padding: .5rem; }
.preview iframe { width: 100%; aspect-ratio: 8.5 / 11; border: 0; display: block; background: #f4f4f4; }
.info { background: #fff; border: 2px solid var(--guide); border-radius: var(--radius); padding: 1.5rem; }
.info .meta { color: var(--muted); margin: .75rem 0 1.5rem; }
.info ol { padding-left: 1.2rem; }
.tip { background: #FFF6D6; border-left: 5px solid var(--sun); padding: .6rem .9rem; border-radius: 6px; }
.related ul { columns: 2 260px; padding-left: 1.1rem; }
.prose { max-width: 70ch; background: #fff; padding: 1.5rem 2rem; border-radius: var(--radius); border: 2px solid var(--guide); }

/* ads: reserved height avoids layout shift; spacing keeps ads clear of buttons */
.ad-slot { margin: 2rem auto; min-height: 120px; text-align: center; max-width: 100%; overflow: hidden; }
.ad-label { display: block; color: var(--muted); font-size: .72rem; margin-bottom: .25rem; }
.ad-dev { display: grid; place-items: center; border: 2px dashed #b7bad0; background: rgba(255,255,255,.7); color: var(--muted); font-size: .9rem; }

@media (max-width: 800px) {
  .detail-grid { grid-template-columns: 1fr; }
  body::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
