/* ============================================================
   3 Commitments — same navy scrapbook family as The Personal
   Challenge, with numbered pastel badges (matching the source
   slide) in place of tag pills. See /pledge/style.css for the
   full note on the two text contexts (on-navy vs on-paper-card).
   Palette identical to /pledge and the root stylesheet.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Permanent+Marker&family=Work+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #3d4a63;
  --ink-soft: #4a5872;
  --paper: #faf5ea;
  --paper-dim: #efe7d8;
  --accent: #9dbb8a;
  --accent-deep: #466b3d;
  --accent-ink: #232c3e;
  --coral: #d99aa6;
  --coral-deep: #b06e7a;
  --sky: #a9c6de;
  --cream: #e6d98f;
  --muted: #98a2b8;
  --muted-2: #6b6459;
  --line: rgba(250, 245, 234, 0.14);
  --paper-line: rgba(61, 74, 99, 0.16);
  --shadow: 0 14px 30px -14px rgba(15, 19, 28, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  padding-inline: 16px;
  background: var(--ink);
  background-image:
    radial-gradient(ellipse 800px 460px at 12% -8%, rgba(217, 154, 166, 0.12), transparent 60%),
    radial-gradient(ellipse 700px 460px at 100% 4%, rgba(157, 187, 138, 0.12), transparent 55%);
  color: var(--paper);
  font-family: "Work Sans", -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding-bottom: 128px;
}

/* ---------- header ---------- */

.page-header {
  padding-block: 22px 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.back-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sky);
  text-decoration: none;
  margin-bottom: 6px;
}

.back-link:hover { text-decoration: underline; }

.kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
}

.page-header h1 {
  font-family: "Permanent Marker", cursive;
  font-weight: 400;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.1;
  margin: 4px 0 0;
  color: var(--paper);
}

.subline {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 46ch;
}

/* ---------- framing note ---------- */

.framing-note {
  margin: 18px 0 22px;
  background: var(--paper);
  border-radius: 4px 14px 4px 14px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  transform: rotate(-0.6deg);
}

.framing-note svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--coral-deep);
}

.framing-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- commitment card ---------- */

.pledge-card-wrap {
  position: relative;
  margin-top: 10px;
}

.tape {
  position: absolute;
  width: 84px;
  height: 30px;
  opacity: 0.9;
  box-shadow: 0 2px 5px rgba(15, 19, 28, 0.3);
  z-index: 2;
}

.tape-a {
  top: -14px;
  left: 24px;
  transform: rotate(-7deg);
  background: repeating-linear-gradient(45deg, var(--coral) 0 8px, #e8bbc7 8px 16px);
}

.tape-b {
  top: -12px;
  right: 20px;
  transform: rotate(6deg);
  background: repeating-linear-gradient(45deg, var(--sky) 0 8px, #c3d9ec 8px 16px);
}

.pledge-card {
  position: relative;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 30px 26px 26px;
  transform: rotate(0.4deg);
}

.pledge-card::before,
.pledge-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper-dim);
  border-radius: 6px;
  z-index: -1;
}

.pledge-card::before { transform: rotate(-1.4deg) translateY(3px); }
.pledge-card::after { transform: rotate(1deg) translateY(5px); opacity: 0.8; }

.field-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.field {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.field input {
  font-family: "Permanent Marker", cursive;
  font-size: 19px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--paper-line);
  padding: 4px 2px 6px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease;
}

.field input:focus { border-bottom-color: var(--coral-deep); }
.field input::placeholder { color: var(--muted-2); opacity: 0.6; font-family: "Work Sans", sans-serif; font-size: 15px; }

.doodle-divider {
  color: var(--muted-2);
  opacity: 0.4;
  height: 14px;
  margin: 4px 0 22px;
}

.doodle-divider svg { width: 100%; height: 100%; display: block; }

.commit-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.commit-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--badge-color, var(--accent));
  color: var(--accent-ink);
  font-family: "Permanent Marker", cursive;
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px -4px rgba(15, 19, 28, 0.4);
}

.commit-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.commit-prompt {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}

.examples {
  margin: 0;
  font-style: italic;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-2);
}

.commit-body input {
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 4px;
  padding: 9px 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

.commit-body input:focus { border-color: var(--coral-deep); }
.commit-body input::placeholder { color: var(--muted-2); opacity: 0.7; }

.char-count {
  align-self: flex-end;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  color: var(--muted-2);
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.disclaimer {
  margin: 0;
  max-width: 52ch;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.disclaimer strong { color: var(--paper); font-weight: 700; }

.share-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.share-row { display: flex; align-items: center; gap: 10px; }

.share-label {
  font-family: "Work Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--paper);
}

.share-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.share-btn svg { width: 17px; height: 17px; }
.share-btn:hover { border-color: var(--coral-deep); color: var(--coral-deep); }
.share-btn:active { transform: scale(0.94); }
.share-btn:disabled { opacity: 0.5; cursor: progress; }

.module-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.module-links-sep { color: var(--muted); }

.module-link {
  font-family: "Work Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sky);
  text-decoration: none;
}

.module-link:hover { color: var(--paper); text-decoration: underline; }

.credit {
  margin: 0;
  font-family: "Permanent Marker", cursive;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- action bar ---------- */

.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, var(--ink) 60%, rgba(61,74,99,0));
}

.action-bar-inner {
  width: 100%;
  max-width: 620px;
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.btn {
  font-family: "Work Sans", sans-serif;
  font-weight: 700;
  font-size: 14px;
  border-radius: 12px;
  border: none;
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:active { transform: scale(0.97); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-save {
  flex: 1;
  background: var(--coral);
  color: var(--accent-ink);
  box-shadow: 0 10px 26px -10px rgba(217, 154, 166, 0.55);
}

.btn-save:hover { filter: brightness(1.06); }
.btn-save:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-reset {
  background: var(--paper);
  color: var(--muted-2);
  border: 1px solid var(--paper-line);
  width: 48px;
  flex-shrink: 0;
}

.btn-reset:hover { color: var(--coral-deep); border-color: var(--coral); }

#exportCanvas { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
