/* connectasketch.com — paper-prototype studio */
:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6da;
  --card: #fbfaf6;
  --grid: rgba(47, 95, 196, .085);
  --grid-major: rgba(47, 95, 196, .14);
  --ink: #1d2129;
  --pencil: #5b606d;
  --rule: #cfc8b8;
  --hot: #d9481f;
  --hot-soft: rgba(217, 72, 31, .10);
  --link: #2f5fc4;
  --note: #f6e27f;
  --note-ink: #3b3412;
  --shadow: 0 1px 0 rgba(29, 33, 41, .06), 0 10px 30px -18px rgba(29, 33, 41, .35);
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Literata", "Iowan Old Style", Georgia, serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14171c;
    --paper-2: #1b1f26;
    --card: #1e232b;
    --grid: rgba(126, 162, 255, .06);
    --grid-major: rgba(126, 162, 255, .11);
    --ink: #ebe7dd;
    --pencil: #a2a7b2;
    --rule: #353b46;
    --hot: #ff7b52;
    --hot-soft: rgba(255, 123, 82, .12);
    --link: #86a8ff;
    --note: #54491a;
    --note-ink: #f3e7b0;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14171c;
  --paper-2: #1b1f26;
  --card: #1e232b;
  --grid: rgba(126, 162, 255, .06);
  --grid-major: rgba(126, 162, 255, .11);
  --ink: #ebe7dd;
  --pencil: #a2a7b2;
  --rule: #353b46;
  --hot: #ff7b52;
  --hot-soft: rgba(255, 123, 82, .12);
  --link: #86a8ff;
  --note: #54491a;
  --note-ink: #f3e7b0;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 30px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px dashed var(--hot); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--card); padding: 6px 10px; z-index: 10; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- masthead ---------- */
.mast { border-bottom: 1.5px solid var(--ink); background: color-mix(in srgb, var(--paper) 92%, transparent); position: relative; z-index: 2; }
.mast .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.15rem/1 var(--display); letter-spacing: -.01em; }
.brand svg { width: 34px; height: 22px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 500 .9rem/1.2 var(--display); }
.nav a { color: var(--pencil); text-decoration: none; padding: 4px 0; border-bottom: 1.5px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--hot); }
.theme-btn { font: 500 .8rem/1 var(--mono); background: none; border: 1.5px solid var(--rule); color: var(--pencil); border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.theme-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.9rem); font-weight: 750; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.eyebrow { font: 500 .78rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--pencil); margin: 0 0 14px; }
.lede { font-size: 1.18rem; line-height: 1.6; color: var(--pencil); max-width: 40em; }
.hand { font-family: var(--hand); font-size: 1.45em; line-height: 1; color: var(--hot); font-weight: 600; }

/* ---------- hero ---------- */
.hero { padding: 48px 0 56px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.hero h1 em { font-style: normal; position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: .02em; height: .36em; background: var(--note); z-index: -1; transform: rotate(-1deg); }
.hero h1 { position: relative; z-index: 0; }
.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; max-width: 36em; }
.steps li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: baseline; }
.steps b { font: 600 .85rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--hot); }
.steps span { color: var(--pencil); font-size: .98rem; }

/* ---------- the demo prototype ---------- */
.demo { position: relative; }
.demo-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; font: 500 .8rem/1.2 var(--mono); color: var(--pencil); }
.toggle { font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px; padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.toggle::before { content: ""; width: 12px; height: 12px; border: 1.5px solid var(--ink); border-radius: 2px; background: transparent; }
.toggle[aria-pressed="true"]::before { background: var(--hot); border-color: var(--hot); box-shadow: inset 0 0 0 2px var(--card); }
.board { display: grid; gap: 20px; }
@media (min-width: 560px) { .board { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); align-items: start; justify-content: center; } }
.phone { width: 100%; max-width: 260px; margin: 0 auto; aspect-ratio: 9 / 16.5; background: var(--card); border: 2px solid var(--ink); border-radius: 26px; padding: 26px 12px 18px; position: relative; box-shadow: var(--shadow); transform: rotate(-1.2deg); }
.phone::before { content: ""; position: absolute; top: 10px; left: 50%; width: 46px; height: 5px; margin-left: -23px; border-radius: 4px; background: var(--rule); }
.screens { position: relative; height: 100%; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 9px; opacity: 0; visibility: hidden; transition: opacity .25s ease; }
.screen.on { opacity: 1; visibility: visible; }
.no-js .screens { height: auto; display: grid; gap: 30px; }
.no-js .phone { aspect-ratio: auto; transform: none; }
.no-js .screen { position: static; opacity: 1; visibility: visible; }
.s-title { font: 700 1.5rem/1 var(--hand); color: var(--ink); text-align: center; padding: 2px 0 6px; border-bottom: 1.5px solid var(--ink); }
.s-back { font: 600 1.05rem/1 var(--hand); color: var(--pencil); }
.box { border: 1.5px solid var(--ink); border-radius: 6px; padding: 8px 9px; font: 600 1.12rem/1.1 var(--hand); color: var(--ink); background: transparent; position: relative; }
.img-x { border: 1.5px solid var(--ink); border-radius: 6px; min-height: 64px; background:
  linear-gradient(to top right, transparent calc(50% - 1px), var(--rule) calc(50% - .5px), var(--rule) calc(50% + .5px), transparent calc(50% + 1px)),
  linear-gradient(to bottom right, transparent calc(50% - 1px), var(--rule) calc(50% - .5px), var(--rule) calc(50% + .5px), transparent calc(50% + 1px)); }
.scribble { height: 7px; border-radius: 4px; background: var(--rule); }
.scribble.w60 { width: 60%; } .scribble.w80 { width: 80%; } .scribble.w40 { width: 40%; }
.row { display: flex; gap: 8px; align-items: center; }
.row .dot { width: 26px; height: 26px; flex: none; border: 1.5px solid var(--ink); border-radius: 50%; }
.row .lines { flex: 1; display: grid; gap: 5px; }
.map-sketch { flex: 1; min-height: 120px; border: 1.5px solid var(--ink); border-radius: 6px; position: relative; overflow: hidden; background:
  repeating-linear-gradient(0deg, transparent 0 22px, var(--rule) 22px 23.5px),
  repeating-linear-gradient(90deg, transparent 0 30px, var(--rule) 30px 31.5px); }
.map-sketch .pin { position: absolute; width: 14px; height: 14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--hot); }
.check { font: 600 1.1rem/1.2 var(--hand); display: flex; gap: 8px; align-items: center; }
.check::before { content: "✓"; width: 20px; height: 20px; border: 1.5px solid var(--ink); border-radius: 3px; display: inline-grid; place-items: center; font: 700 .8rem/1 var(--mono); color: var(--hot); }
.spacer { flex: 1; }
/* hotspots: links drawn over the sketch */
.hot { display: block; text-decoration: none; color: inherit; position: relative; border-radius: 6px; }
.hot::after { content: ""; position: absolute; inset: -4px; border: 2px dashed transparent; border-radius: 8px; transition: border-color .2s, background-color .2s; }
.show-links .hot::after, .hot:hover::after, .hot:focus-visible::after { border-color: var(--hot); background: var(--hot-soft); }
.hot:focus-visible { outline: none; }
.hot .tag { position: absolute; right: -6px; top: -12px; font: 600 .62rem/1 var(--mono); color: #fff; background: var(--hot); border-radius: 999px; padding: 3px 6px; opacity: 0; transition: opacity .2s; z-index: 1; }
.show-links .hot .tag, .hot:hover .tag, .hot:focus-visible .tag { opacity: 1; }
/* the flow map beside the phone */
.flow { background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); }
.flow svg { display: block; width: 100%; height: auto; }
.flow .node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.flow .node text { font: 600 15px var(--hand); fill: var(--ink); }
.flow .node { cursor: pointer; }
.flow .node.on rect { fill: var(--note); stroke: var(--hot); stroke-width: 2.5; }
.flow .node:focus-visible rect { stroke: var(--hot); stroke-dasharray: 4 3; }
.flow .edge { stroke: var(--link); stroke-width: 1.5; fill: none; }
.flow .edge.lit { stroke: var(--hot); stroke-width: 2.5; }
.flow-cap { font: 500 .78rem/1.45 var(--mono); color: var(--pencil); margin: 10px 0 0; }
.annot { font: 600 1.25rem/1.15 var(--hand); color: var(--hot); margin: 14px 0 0; transform: rotate(-1.5deg); }

/* ---------- sections ---------- */
.section { padding: 56px 0; border-top: 1.5px solid var(--ink); }
.section-head { display: grid; gap: 8px 40px; margin-bottom: 28px; }
@media (min-width: 820px) { .section-head { grid-template-columns: 1fr 1fr; align-items: end; } }
.section-head p { color: var(--pencil); margin: 0; }
.cards { display: grid; gap: 18px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card { display: block; background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; padding: 20px 20px 18px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); position: relative; transition: transform .15s ease; }
.card:hover { transform: translateY(-2px); }
.card:hover::after { content: ""; position: absolute; inset: -6px; border: 2px dashed var(--hot); border-radius: 14px; pointer-events: none; }
.card .k { font: 500 .74rem/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--hot); display: block; margin-bottom: 12px; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--pencil); margin: 0; font-size: .98rem; }

/* ---------- inner pages ---------- */
.page-head { padding: 44px 0 30px; }
.page-head .lede { margin-bottom: 0; }
.page-body { padding: 8px 0 64px; }
.page-body .wrap { display: grid; gap: 36px; }
@media (min-width: 960px) { .page-body .wrap { grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; } }
.prose { max-width: 42em; }
.prose h2 { margin-top: 1.7em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.archival { position: relative; background: var(--card); border: 1.5px solid var(--ink); border-radius: 4px; padding: 26px 22px 12px; margin: 10px 0 28px; box-shadow: var(--shadow); }
.archival::before { content: ""; position: absolute; top: -9px; left: 22px; width: 84px; height: 18px; background: var(--note); opacity: .85; transform: rotate(-2deg); }
.archival .label { font: 500 .74rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--pencil); margin-bottom: 12px; }
.archival h3 { font-size: 1.05rem; margin-top: 1.2em; }
.archival p, .archival li { font-size: .98rem; }
.side { display: grid; gap: 18px; align-content: start; }
.note { background: var(--note); color: var(--note-ink); padding: 16px 18px 14px; border-radius: 2px; transform: rotate(.8deg); box-shadow: var(--shadow); font-size: .95rem; }
.note h2 { font: 600 1.5rem/1 var(--hand); margin: 0 0 8px; letter-spacing: 0; }
.note dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font: 400 .82rem/1.4 var(--mono); }
.note dt { opacity: .7; }
.note dd { margin: 0; }
.note p { margin: 0 0 .6em; }
.note a { color: inherit; }

/* tour */
.tour-list { list-style: none; margin: 0; padding: 0; counter-reset: t; display: grid; gap: 10px; }
.tour-list a { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 8px; color: var(--ink); text-decoration: none; }
.tour-list a:hover { border-color: var(--hot); }
.tour-list .n { font: 600 .82rem/1 var(--mono); color: var(--hot); }
.tour-list .t { font: 650 1.02rem/1.25 var(--display); }
.tour-list .d { display: block; font: 400 .9rem/1.4 var(--body); color: var(--pencil); margin-top: 2px; }
.tour-list .go { font: 500 .78rem/1 var(--mono); color: var(--pencil); }
.slide { background: var(--card); border: 1.5px solid var(--ink); border-radius: 8px; box-shadow: var(--shadow); padding: 18px; margin: 0 0 24px; }
.slide-frame { position: relative; aspect-ratio: 800 / 618; border: 1.5px dashed var(--rule); border-radius: 4px; background: var(--paper); overflow: hidden; }
.slide-frame .hs { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; border: 2px dashed var(--hot); background: var(--hot-soft); border-radius: 6px; color: var(--ink); text-decoration: none; font: 600 clamp(.85rem, 2.6vw, 1.25rem)/1.05 var(--hand); padding: 2px; }
.slide-frame .hs:hover { background: color-mix(in srgb, var(--hot) 22%, transparent); }
.slide-frame .cap { position: absolute; left: 4%; top: 6%; right: 4%; font: 700 clamp(1.1rem, 3.6vw, 2rem)/1.1 var(--hand); color: var(--pencil); }
.slide-meta { font: 500 .76rem/1.5 var(--mono); color: var(--pencil); margin: 10px 0 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 32px 0 0; }
.pager a { display: block; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--card); color: var(--ink); text-decoration: none; }
.pager a:hover { border-color: var(--hot); }
.pager small { display: block; font: 500 .72rem/1.3 var(--mono); color: var(--pencil); text-transform: uppercase; letter-spacing: .08em; }
.pager span { font: 650 .98rem/1.3 var(--display); }
.pager a.next { text-align: right; grid-column: 2; }

/* tables, timeline, index */
.table-scroll { overflow-x: auto; margin: 0 0 1.4em; }
table.grid { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--card); }
table.grid th, table.grid td { border: 1.5px solid var(--ink); padding: 9px 11px; text-align: left; vertical-align: top; }
table.grid th { font: 600 .78rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .06em; background: var(--paper-2); }
.timeline { list-style: none; margin: 0 0 1.5em; padding: 0 0 0 22px; border-left: 2px dashed var(--link); }
.timeline li { position: relative; margin: 0 0 18px; }
.timeline li::before { content: ""; position: absolute; left: -30px; top: 6px; width: 12px; height: 12px; border: 2px solid var(--link); background: var(--paper); border-radius: 2px; }
.timeline .when { display: block; font: 600 .78rem/1.3 var(--mono); color: var(--hot); text-transform: uppercase; letter-spacing: .08em; }
.index-list { list-style: none; margin: 0; padding: 0; columns: 1; }
@media (min-width: 760px) { .index-list { columns: 2; column-gap: 40px; } }
.index-list li { break-inside: avoid; display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1.5px dotted var(--rule); }
.index-list span { font: 500 .74rem/1.6 var(--mono); color: var(--pencil); text-transform: uppercase; white-space: nowrap; }
.index-group { font: 500 .78rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--hot); margin: 28px 0 8px; }
.seq { list-style: none; margin: 0 0 1.4em; padding: 0; display: grid; gap: 10px; }
.seq li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; background: var(--card); border: 1.5px solid var(--ink); border-radius: 8px; padding: 12px 14px; }
.seq b { font: 600 .82rem/1.6 var(--mono); color: var(--hot); }
.seq .in { color: var(--link); } .seq .out { color: var(--hot); }

/* search */
.find { padding: 56px 0 64px; border-top: 1.5px solid var(--ink); }
.find .wrap { display: grid; gap: 18px; }
@media (min-width: 820px) { .find .wrap { grid-template-columns: 1fr 1.4fr; align-items: start; } }
#site-search {
  --pagefind-ui-scale: .9;
  --pagefind-ui-primary: var(--hot);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--card);
  --pagefind-ui-border: var(--ink);
  --pagefind-ui-tag: var(--paper-2);
  --pagefind-ui-border-width: 1.5px;
  --pagefind-ui-border-radius: 8px;
  --pagefind-ui-font: var(--body);
}
#site-search .pagefind-ui__result-link { color: var(--link); }
#site-search .pagefind-ui__search-input { font-family: var(--display); }

/* ---------- footer ---------- */
.foot { border-top: 1.5px solid var(--ink); padding: 34px 0 44px; font-size: .9rem; color: var(--pencil); background: var(--paper-2); }
.foot .wrap { display: grid; gap: 24px; }
@media (min-width: 820px) { .foot .wrap { grid-template-columns: 1.4fr 1fr; gap: 56px; } }
.foot p { margin: 0 0 .7em; max-width: 46em; }
.foot nav { display: grid; gap: 6px; align-content: start; font: 500 .85rem/1.4 var(--display); }
.foot nav a { color: var(--ink); text-decoration: none; }
.foot nav a:hover { color: var(--hot); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.screen b { font: 700 1.15rem/1 var(--hand); }
.flow a.node text { fill: var(--ink); }
.flow a.node:hover rect { stroke: var(--hot); fill: var(--note); }
.flow .edge.back { stroke: var(--pencil); }
.slide-frame .cap { opacity: .55; }
.demo .flow .node text { font-size: 20px; }
.demo .flow { max-width: 300px; margin: 0 auto; width: 100%; }
.phone { aspect-ratio: 9 / 15.5; }
.page-body .wrap { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .page-body .wrap { grid-template-columns: minmax(0, 1fr) 280px; } }
.prose code, .archival code { overflow-wrap: anywhere; font-family: var(--mono); font-size: .88em; }
@media (max-width: 600px) { .note, .phone { transform: none; } }
.slide-frame .hs { font-size: clamp(.5rem, 2.2vw, 1.2rem); overflow: hidden; }
