/* ==========================================================================
   Education for Paix — edforpaix.tech
   Design language: ballpoint pen on notebook paper.
   Everything visual is a hand-drawn stroke: no photos, no icon fonts.
   Brand tokens live in :root — change --ink to change the whole site's pen.
   ========================================================================== */

:root {
  /* --- the pen --- */
  --ink:        #1b34b8;   /* classic ballpoint blue */
  --ink-deep:   #122481;   /* pressed harder */
  --ink-soft:   #4a5bbd;   /* lighter pass */
  --ink-red:    #c8322b;   /* the teacher's red pen, used sparingly */

  /* --- the paper --- */
  --paper:      #fdfcf7;
  --paper-warm: #f7f3e8;
  --rule:       rgba(27, 52, 184, .13);  /* ruled lines */
  --margin-red: rgba(200, 50, 43, .30);  /* margin line */
  --graphite:   #2f3340;

  --font-hand:  "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --font-note:  "Kalam", "Comic Sans MS", cursive;
  --font-body:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1160px;
  --gap: clamp(1.5rem, 4vw, 3rem);
  --line-h: 30px;          /* ruled-line rhythm */
}

/* ------------------------------- reset ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Ruled notebook paper, drawn with gradients so there is no image to load.
   Horizontal rules + a red margin line down the left on wide screens. */
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, .95rem + .22vw, 1.08rem);
  line-height: var(--line-h);
  color: var(--graphite);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--line-h) - 1px),
      var(--rule) calc(var(--line-h) - 1px),
      var(--rule) var(--line-h)
    );
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 1100px) {
  body {
    background-image:
      linear-gradient(to right, transparent 78px, var(--margin-red) 78px, var(--margin-red) 79px, transparent 79px),
      repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(var(--line-h) - 1px),
        var(--rule) calc(var(--line-h) - 1px),
        var(--rule) var(--line-h)
      );
  }
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

img, svg { display: block; max-width: 100%; }

a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--ink-deep); }

:focus-visible {
  outline: 2.5px dashed var(--ink-red);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--paper);
  padding: .7rem 1.1rem; font-weight: 700;
}
.skip-link:focus { left: .5rem; top: .5rem; }

.wrap {
  width: 100%; max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 5vw, 2.5rem);
}
.wrap.narrow { max-width: 760px; }

/* ----------------------------- typography ------------------------------- */
h1, h2, h3, .brand-text strong {
  font-family: var(--font-hand);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 .5em;
  letter-spacing: .005em;
}
h1 { font-size: clamp(2.7rem, 1.7rem + 4.6vw, 5rem); }
h2 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.2rem); }
h3 { font-size: clamp(1.3rem, 1.15rem + .6vw, 1.6rem); }

p { margin: 0 0 1.15em; }

.lede, .section-lede {
  font-family: var(--font-note);
  font-size: clamp(1.1rem, 1rem + .5vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-deep);
  max-width: 54ch;
}

.fineprint { font-size: .86rem; color: var(--ink-soft); }

/* "handwritten label" above the headline */
.scrawl-label {
  font-family: var(--font-note);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-red);
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .4rem;
}
.ico-star { width: 22px; height: 22px; flex: none; }

/* a word circled by hand, the way you'd emphasise it on paper */
.circled { position: relative; display: inline-block; padding: 0 .18em; white-space: nowrap; }
.circled::after {
  content: "";
  position: absolute; inset: -22% -12% -18% -12%;
  border: 3px solid var(--ink-red);
  /* uneven radii = drawn, not printed */
  border-radius: 62% 38% 55% 45% / 48% 58% 42% 52%;
  transform: rotate(-2.2deg);
  pointer-events: none;
  opacity: .9;
}

/* hand-drawn underline that sits under section headings */
.h-scrawl { position: relative; display: inline-block; padding-bottom: .22em; }
.h-scrawl .underline {
  position: absolute; left: 0; right: 0; bottom: -.1em;
  width: 100%; height: .38em;
  color: var(--ink-red);
  overflow: visible;
}
.h-scrawl.light { color: var(--paper); }
.h-scrawl.light .underline { color: #ffd9a8; }

/* ------------------------------- buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-family: var(--font-note);
  font-weight: 700;
  font-size: 1.05rem;
  padding: .7rem 1.5rem;
  border: 2.5px solid var(--ink);
  /* wobbly, hand-drawn box */
  border-radius: 14px 9px 16px 8px / 8px 16px 9px 14px;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  transition: transform .13s ease, background-color .13s ease, color .13s ease;
}
.btn:hover { transform: translate(-1px, -2px) rotate(-.5deg); }
.btn:active { transform: translate(0, 1px); }
.btn-sm { font-size: .95rem; padding: .4rem 1rem; border-width: 2px; }

.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-deep); color: var(--paper); }

.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: rgba(27, 52, 184, .08); color: var(--ink-deep); }

.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-paper:hover { background: var(--paper-warm); color: var(--ink-deep); }

.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* -------------------------------- header -------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253, 252, 247, .93);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--ink);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 76px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 1.75rem; }
.brand-text small {
  font-family: var(--font-note);
  font-size: .78rem; color: var(--ink-soft);
}

.nav ul { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) {
  font-family: var(--font-note);
  font-size: 1.08rem; font-weight: 700;
  color: var(--ink); text-decoration: none;
  position: relative; padding: .2rem 0;
}
/* hover draws a pen line underneath */
.nav a:not(.btn)::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px;
  background: var(--ink-red);
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .18s ease;
}
.nav a:not(.btn):hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 48px; height: 44px;
  border: 2.5px solid var(--ink);
  border-radius: 12px 8px 14px 7px / 7px 14px 8px 12px;
  background: transparent; color: var(--ink);
  cursor: pointer; padding: 7px;
}
.nav-toggle svg { width: 100%; height: 100%; }

@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; inset: 100% 0 auto 0;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul {
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .4rem clamp(1.15rem, 5vw, 2.5rem) 1.2rem;
  }
  .nav li { border-bottom: 1.5px dashed var(--rule); }
  .nav li:last-child { border: 0; padding-top: 1rem; }
  .nav a:not(.btn) { display: block; padding: .8rem 0; font-size: 1.2rem; }
}

/* --------------------------------- hero --------------------------------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem); }
.hero-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
}
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
}
.hero-text h1 { margin-bottom: .35em; }

.doodle-arrow {
  width: clamp(80px, 12vw, 120px);
  height: auto;
  color: var(--ink-soft);
  margin-top: 1.5rem;
  opacity: .8;
}
@media (max-width: 940px) { .doodle-arrow { display: none; } }

.hero-art .sketch { width: 100%; height: auto; color: var(--ink); }

/* ------------------------------- sections ------------------------------- */
.section { padding-block: clamp(2.75rem, 7vw, 5.5rem); }

/* a section that leans on the paper texture a little harder */
.section-ruled {
  background: var(--paper-warm);
  border-block: 2px solid var(--ink);
}

/* the "ink wash" section — inverted, like a page filled in with pen */
.section-ink {
  background: var(--ink);
  color: var(--paper);
  border-block: 2px solid var(--ink-deep);
}
.section-ink h2, .section-ink h3 { color: var(--paper); }
.section-ink a:not(.btn) { color: #ffd9a8; }

/* ------------------------- mission index card --------------------------- */
.card-note {
  position: relative;
  margin: 2.5rem 0 0;
  padding: clamp(1.8rem, 4vw, 2.75rem);
  background: var(--paper-warm);
  border: 2.5px solid var(--ink);
  border-radius: 6px 14px 8px 16px / 14px 6px 16px 8px;
  box-shadow: 4px 5px 0 rgba(27, 52, 184, .16);
  transform: rotate(-.7deg);
}
.card-note .pin {
  position: absolute; top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 34px;
  color: var(--ink-red);
}
.card-note blockquote { margin: 0; }
.card-note p {
  font-family: var(--font-note);
  font-size: clamp(1.2rem, 1.05rem + .75vw, 1.7rem);
  line-height: 1.5;
  color: var(--ink-deep);
  margin: 0;
}
.mission-note {
  margin-top: 2.25rem;
  font-family: var(--font-body);
  color: var(--graphite);
}
.mission-note em { color: var(--ink); font-style: italic; font-weight: 600; }

/* ---------------------------- belief checklist -------------------------- */
.belief-list {
  list-style: none; padding: 0; margin: 2.5rem 0 0;
  display: grid; gap: 1.6rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.belief-list li { display: flex; gap: 1rem; align-items: flex-start; }
.belief-list .tick {
  width: 34px; height: 34px; flex: none;
  color: var(--ink-red);
  margin-top: .15rem;
}
.belief-list h3 { margin-bottom: .15em; }
.belief-list p { margin: 0; }

/* ----------------------------- sketch cards ----------------------------- */
.sketch-cards {
  display: grid; gap: var(--gap); margin-top: 2.75rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.sk-card {
  padding: 1.6rem 1.5rem 1.8rem;
  border: 2.5px solid var(--ink);
  border-radius: 16px 8px 18px 10px / 10px 18px 8px 16px;
  background: var(--paper);
  transition: transform .16s ease, box-shadow .16s ease;
}
.sk-card:nth-child(even) { transform: rotate(.5deg); }
.sk-card:nth-child(odd)  { transform: rotate(-.5deg); }
.sk-card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 5px 6px 0 rgba(27, 52, 184, .15);
}
.sk-ico {
  width: 100%; max-width: 150px; height: auto;
  color: var(--ink);
  margin-bottom: 1rem;
}
.sk-card h3 { margin-bottom: .3em; }
.sk-card p { margin: 0; font-size: .97rem; }

/* ----------------------------- get involved ----------------------------- */
.involved-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
}
@media (max-width: 940px) {
  .involved-grid { grid-template-columns: 1fr; }
  .involved-art { max-width: 260px; }
}
.involved-art .sketch { width: 100%; height: auto; color: var(--paper); opacity: .92; }

.ask-list {
  list-style: none; padding: 0; margin: 1.5rem 0 0;
  display: grid; gap: .8rem;
}
.ask-list li {
  display: flex; align-items: flex-start; gap: .75rem;
  font-family: var(--font-note); font-size: 1.1rem;
}
.ask-list svg { width: 24px; height: 24px; flex: none; color: #ffd9a8; margin-top: .25rem; }

/* -------------------------------- contact ------------------------------- */
.contact-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: .9fr 1.1fr;
  align-items: start;
}
@media (max-width: 940px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-list {
  display: grid; grid-template-columns: 5.5rem 1fr;
  gap: .4rem 1rem; margin: 1.5rem 0;
  font-family: var(--font-note); font-size: 1.1rem;
}
.contact-list dt { font-weight: 700; color: var(--ink-soft); }
.contact-list dd { margin: 0; }

/* the form as a school worksheet: labels then ruled blanks */
.worksheet {
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 2.5px solid var(--ink);
  border-radius: 10px 18px 8px 16px / 16px 8px 18px 10px;
  background: var(--paper-warm);
  box-shadow: 5px 6px 0 rgba(27, 52, 184, .13);
}
.worksheet h3 { margin-bottom: 1.2rem; }

.field { margin-bottom: 1.35rem; }
.field label {
  display: block;
  font-family: var(--font-note);
  font-weight: 700; font-size: 1.05rem;
  color: var(--ink-deep);
  margin-bottom: .1rem;
}
/* inputs are blank lines on the page, not boxes */
.field input, .field select {
  font-family: var(--font-note);
  font-size: 1.15rem;
  color: var(--ink);
  width: 100%;
  padding: .35rem .2rem;
  background: transparent;
  border: 0;
  border-bottom: 2.5px solid var(--ink-soft);
  border-radius: 0;
}
.field textarea {
  font-family: var(--font-note);
  font-size: 1.1rem;
  color: var(--ink);
  width: 100%;
  padding: .5rem .6rem;
  background: transparent;
  border: 2.5px solid var(--ink-soft);
  border-radius: 8px 14px 7px 12px / 12px 7px 14px 8px;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: rgba(255, 255, 255, .55);
}
.field [aria-invalid="true"] { border-color: var(--ink-red); }
.field select { appearance: none; cursor: pointer; }

.form-status {
  margin: 1rem 0 0;
  font-family: var(--font-note); font-weight: 700; font-size: 1.02rem;
}
.form-status.is-error { color: var(--ink-red); }
.form-status.is-ok { color: var(--ink); }

/* -------------------------------- footer -------------------------------- */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--paper-warm);
  padding-block: 2.5rem;
}
.footer-inner {
  display: grid; gap: var(--gap);
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: start;
}
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: .75rem; }
.footer-brand p { margin: 0; line-height: 1.3; }
.footer-brand strong { font-family: var(--font-hand); font-size: 1.5rem; color: var(--ink); }
.footer-brand span { font-family: var(--font-note); font-size: .85rem; color: var(--ink-soft); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.site-footer a { font-family: var(--font-note); font-size: 1.05rem; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.copyright { font-size: .85rem; color: var(--ink-soft); margin: 0; }

/* --------------------- pen-drawing-in animation ------------------------- */
/* JS measures each path and sets --len; the stroke then draws itself. */
.sketch--animate path,
.sketch--animate circle {
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
}
.sketch--animate.is-drawing path,
.sketch--animate.is-drawing circle {
  animation: draw-stroke .9s ease-out forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes draw-stroke { to { stroke-dashoffset: 0; } }

/* If motion is reduced — or JS never runs — show the finished drawing. */
@media (prefers-reduced-motion: reduce) {
  .sketch--animate path,
  .sketch--animate circle { stroke-dasharray: none; stroke-dashoffset: 0; }
}

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* -------------------------------- print --------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .nav-toggle, .worksheet, .doodle-arrow { display: none; }
  .section-ink { background: #fff; color: #000; border: 1px solid #000; }
  .section-ink h2, .section-ink h3 { color: #000; }
}
