/* IoT Zap website - pencil sketch theme. No external fonts, scripts or trackers. */
:root {
  --paper: #fbf8f1;
  --paper-2: #f3eee1;
  --ink: #2b2b2b;
  --graphite: #4a4a4a;
  --pencil: #8d8a82;
  --line: #d9d3c2;
  --green: #7ed9b4;
  --green-ink: #137a58;
  --yellow: #ffe58a;
  --blue: #bcd9f5;
  --pink: #f9c5c5;
  --hand: "Segoe Print", "Bradley Hand", "Chilanka", "Comic Neue", "Comic Sans MS", "Marker Felt", cursive;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wobble: 255px 14px 225px 14px / 14px 225px 14px 255px;
  --wobble-2: 14px 225px 14px 255px / 255px 14px 225px 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 17px/1.65 var(--body);
  background-color: var(--paper);
  /* faint notebook lines */
  background-image: repeating-linear-gradient(transparent 0 31px, rgba(120, 150, 190, .13) 31px 32px);
}
/* paper grain / pencil noise */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
img, svg { max-width: 100%; }
a { color: var(--green-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--yellow); }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 40px); margin-inline: auto; }

h1, h2, h3, .hand { font-family: var(--hand); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 .5em; }
h3 { font-size: 1.25rem; margin: 1.6em 0 .4em; }
p { margin: 0 0 1em; }

/* marker highlight + hand underline */
.hl { background: linear-gradient(transparent 58%, var(--yellow) 58% 92%, transparent 92%); padding: 0 .15em; }
.hl-green { background: linear-gradient(transparent 58%, var(--green) 58% 92%, transparent 92%); padding: 0 .15em; }
.scribble { background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'><path d='M1 5 C 15 1, 25 8, 40 4 S 70 1, 99 5' fill='none' stroke='%232b2b2b' stroke-width='2.2' stroke-linecap='round'/></svg>") bottom / 100% 8px no-repeat; padding-bottom: 8px; }

/* ---------- header / footer ---------- */
.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--hand); font-weight: 700; font-size: 1.5rem; }
.brand:hover { background: none; }
.brand img { width: 40px; height: 40px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 12px; border-radius: var(--wobble); border: 2px solid transparent; font-family: var(--hand); font-weight: 700; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--ink); background: transparent; }
.nav a[aria-current="page"] { background: var(--yellow); }

.site-footer { margin-top: 70px; padding: 28px 0 40px; border-top: 3px dashed var(--pencil); background: var(--paper-2); }
.site-footer .wrap { display: grid; gap: 16px; grid-template-columns: 1.4fr 1fr 1fr; }
.site-footer h4 { font-family: var(--hand); margin: 0 0 8px; font-size: 1.1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.site-footer small { color: var(--graphite); display: block; margin-top: 8px; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- sketch boxes, buttons ---------- */
.card {
  position: relative; background: #fffdf7; border: 2.5px solid var(--ink); border-radius: var(--wobble);
  padding: 22px 24px; box-shadow: 6px 7px 0 -2px var(--line);
}
.card.alt { border-radius: var(--wobble-2); }
.tilt-l { transform: rotate(-.7deg); } .tilt-r { transform: rotate(.7deg); }
.tape::before {
  content: ""; position: absolute; top: -13px; left: 50%; width: 92px; height: 26px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 229, 138, .8); border: 1.5px dashed rgba(0, 0, 0, .25);
}
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; color: var(--ink); background: var(--green);
  border: 2.5px solid var(--ink); border-radius: var(--wobble); text-decoration: none; cursor: pointer;
  font: 700 1.1rem var(--hand); box-shadow: 4px 5px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.btn:hover { background: var(--green); transform: translate(2px, 2px); box-shadow: 2px 3px 0 var(--ink); }
.btn.plain { background: #fffdf7; }
.btn.danger { background: var(--pink); }
.btn svg { width: 22px; height: 22px; }

.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } .tilt-l, .tilt-r { transform: none; } }

.chip { display: inline-block; margin: 4px 6px 4px 0; padding: 4px 14px; font: 700 .95rem var(--hand); border: 2px solid var(--ink); border-radius: var(--wobble); background: #fffdf7; }
.chip:nth-child(3n+1) { background: var(--blue); } .chip:nth-child(3n+2) { background: var(--green); } .chip:nth-child(3n) { background: var(--pink); }

/* ---------- landing ---------- */
.hero { padding: 30px 0 20px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 30px; align-items: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero p.lead { font-size: 1.2rem; color: var(--graphite); max-width: 34em; }
.cta-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.badge-note { font-size: .9rem; color: var(--graphite); margin-top: 14px; }
.section { padding: 54px 0 0; }
.section > .wrap > h2, .section > .narrow > h2 { text-align: center; }
.sub { text-align: center; color: var(--graphite); max-width: 36em; margin: -6px auto 28px; }
.icon-box { width: 56px; height: 56px; margin-bottom: 8px; }
.steps { counter-reset: step; }
.steps .card::after {
  counter-increment: step; content: counter(step); position: absolute; top: -18px; left: -14px; width: 42px; height: 42px;
  display: grid; place-items: center; font: 700 1.4rem var(--hand); background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 50%;
}
code, kbd { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 6px; padding: 1px 6px; }
pre { background: #fffdf7; border: 2px dashed var(--pencil); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 1em; }
pre code { background: none; border: 0; padding: 0; }
details { border: 2px solid var(--ink); border-radius: var(--wobble); background: #fffdf7; padding: 12px 18px; margin-bottom: 12px; }
summary { cursor: pointer; font: 700 1.1rem var(--hand); }
details[open] summary { margin-bottom: 8px; }

/* ---------- legal / document pages ---------- */
.doc-head { padding: 24px 0 8px; text-align: center; }
.doc-head p { color: var(--graphite); }
.doc { padding: 30px clamp(18px, 4vw, 44px) 36px; }
.doc h2 { font-size: 1.55rem; margin-top: 1.8em; padding-bottom: .15em; border-bottom: 2px dashed var(--pencil); }
.doc h2:first-of-type { margin-top: .4em; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.doc li { margin: .3em 0; }
.toc { background: var(--paper-2); border: 2px dashed var(--pencil); border-radius: 12px; padding: 14px 20px; margin: 0 0 8px; }
.toc ol { columns: 2; column-gap: 28px; margin: 6px 0 0; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.toc a { text-decoration: none; }
.note { background: var(--yellow); border: 2px solid var(--ink); border-radius: var(--wobble); padding: 12px 18px; margin: 0 0 1.2em; }
.note.green { background: #d9f5e8; } .note.blue { background: #e3effb; } .note.pink { background: #fde3e3; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
table { width: 100%; border-collapse: collapse; font-size: .96rem; background: #fffdf7; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border: 1.5px solid var(--pencil); }
th { background: var(--paper-2); font-family: var(--hand); }
.updated { font: 700 .95rem var(--hand); color: var(--graphite); }
.allcaps { text-transform: uppercase; font-size: .9em; letter-spacing: .01em; }

/* checklist (deletion page) */
.checks { list-style: none; padding: 0 !important; }
.checks li { position: relative; padding-left: 38px; margin: .7em 0; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 24px; height: 24px; border: 2.5px solid var(--ink); border-radius: 6px 3px 7px 3px;
  background: #fffdf7 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 13 L10 19 L21 5' fill='none' stroke='%23137a58' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 80% no-repeat;
}
.checks.cross li::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 5 L19 19 M19 5 L5 19' fill='none' stroke='%23b03030' stroke-width='3.4' stroke-linecap='round'/></svg>");
}

@media print {
  body::before, .site-header, .site-footer { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* tutorials */
.wide { width: min(980px, 100% - 40px); margin-inline: auto; }
.fig { margin: 1.2em 0 1.8em; padding: 12px; background: #fffdf7; border: 2px solid var(--ink); border-radius: var(--wobble); overflow-x: auto; }
.fig svg { display: block; min-width: 640px; width: 100%; height: auto; }
.fig figcaption { font: 700 .95rem var(--hand); color: var(--graphite); text-align: center; margin-top: 8px; position: sticky; left: 0; }
.lang { display: inline-block; font: 700 .85rem var(--hand); background: var(--blue); border: 2px solid var(--ink); border-radius: var(--wobble); padding: 1px 12px; margin: 10px 0 4px; }
.doc pre { font-size: .84rem; line-height: 1.5; }
.doc pre, .doc code { font-variant-ligatures: none; }
.toc small { color: var(--graphite); }
.doc h3 { margin-top: 1.7em; }
.doc h4 { font: 700 1.05rem var(--hand); margin: 1.4em 0 .3em; }
.stepper-list { counter-reset: s; list-style: none; padding-left: 0 !important; }
.stepper-list li { counter-increment: s; position: relative; padding-left: 48px; margin: 1em 0; min-height: 36px; }
.stepper-list li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font: 700 1.1rem/30px var(--hand); text-align: center; }
.doc .chip { margin: 0 4px; padding: 0 10px; }