/* ==========================================================================
   Porchlink theme: Chalk (maths tutor)
   Light = whiteboard with marker, dark = blackboard with chalk.
   1. Colours  2. Type  3. Hand-drawn link shapes  4. Underline stroke (signature)
   ========================================================================== */
/* 1. Colours */
[data-theme="chalk"] {
  --bg: #F7F8F6; --surface: #FFFFFF; --ink: #1B2A4A; --muted: #55607A;
  --accent: #1E4DB7; --accent-ink: #ffffff; --line: rgba(27, 42, 74, .35); --focus: #D64545;
  --board: #22332B; --chalk: #EDEBE4; --chalk-2: #F2D45C; --doodle: rgba(30, 77, 183, .12); --mark: #D64545;
  --font-display: 'Caveat', 'Comic Sans MS', cursive;
  --radius: 255px 18px 225px 18px / 18px 225px 18px 255px; --radius-card: 20px 240px 20px 230px / 230px 20px 240px 20px;
}
[data-theme="chalk"][data-mode="dark"] {
  --bg: #22332B; --surface: #2A3E34; --ink: #EDEBE4; --muted: #B9C2B5;
  --accent: #F2D45C; --accent-ink: #22332B; --line: rgba(237, 235, 228, .4); --focus: #F2D45C;
  --board: #1A2822; --doodle: rgba(237, 235, 228, .1); --mark: #F28B82;
}
/* 2. Type */
[data-theme="chalk"] .pl-name { font-weight: 700; font-size: clamp(2.4rem, 11vw, 3rem); line-height: 1; position: relative; padding-bottom: 6px; }
[data-theme="chalk"] .pl-feature-title, [data-theme="chalk"] .pl-info h2, [data-theme="chalk"] .pl-form h2 { font-weight: 700; font-size: 1.6rem; line-height: 1; }
[data-theme="chalk"] .pl-code-value { font-size: 1.8rem; font-weight: 700; color: var(--mark); }
[data-theme="chalk"] .pl-bg svg { width: 100%; height: 100%; }
/* 3. Links: wobbly marker outlines */
[data-theme="chalk"] .pl-link { border: 2px solid var(--ink); background: transparent; }
[data-theme="chalk"] .pl-link:nth-child(even) { --radius: 18px 225px 18px 255px / 255px 18px 225px 18px; }
[data-theme="chalk"] li:nth-child(even) > .pl-link { border-radius: 18px 225px 18px 255px / 255px 18px 225px 18px; }
[data-theme="chalk"] .pl-link:hover { background: var(--surface); transform: rotate(-.6deg); }
[data-theme="chalk"] .pl-link--primary { background: var(--accent); border-color: var(--accent); }
[data-theme="chalk"] .pl-link--primary:hover { background: var(--accent); }
[data-theme="chalk"] .pl-avatar { border: 3px solid var(--ink); border-radius: 50% 46% 52% 48% / 48% 52% 46% 50%; }
[data-theme="chalk"] .pl-feature, [data-theme="chalk"] .pl-info, [data-theme="chalk"] .pl-form, [data-theme="chalk"] .pl-group { border: 2px solid var(--line); }
/* 4. Signature: a marker underline is drawn under the name on load */
[data-theme="chalk"] .pl-name::after {
  content: ""; position: absolute; left: 6%; right: 6%; bottom: -4px; height: 12px;
  background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M3 8c40-6 90-7 194-3' fill='none' stroke='%23D64545' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  transform-origin: left; transform: scaleX(1);
}
[data-theme="chalk"][data-mode="dark"] .pl-name::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M3 8c40-6 90-7 194-3' fill='none' stroke='%23F2D45C' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="chalk"].pl-ready .pl-name::after { animation: ch-under .7s .45s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes ch-under { from { transform: scaleX(0); } to { transform: scaleX(1); } }
