/* Clend. Warm paper, clay accents, serif headlines, mono labels, and the pixel Claude Code mascot. */

@font-face {
  font-family: "Silkscreen";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/silkscreen-400.woff2") format("woff2");
}
@font-face {
  font-family: "Silkscreen";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/silkscreen-700.woff2") format("woff2");
}

:root {
  --paper: #faf9f5;
  --paper-2: #f5f4ee;
  --card: #ffffff;
  --ink: #1f1e1c;
  --ink-2: #3d3b37;
  --muted: #73726b;
  --faint: #a6a49b;
  --line: #e9e7de;
  --line-2: #dedcd2;
  --clay: #d97757;
  --clay-deep: #bd5d3e;
  --clay-soft: #f3e3db;
  --clay-tint: #fbf1ec;
  --usage-blue: #2f7bef;
  --usage-track: #e4ebfa;
  --sess-track: #ecebe4;
  --ok: #1f9d6b;
  --warn: #d64f3f;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
  --pixel: "Silkscreen", "SF Mono", ui-monospace, monospace;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(40, 35, 25, .04), 0 12px 40px rgba(40, 35, 25, .07);
  --shadow-lg: 0 2px 4px rgba(40, 35, 25, .05), 0 30px 80px rgba(40, 35, 25, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--paper-2); }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% -10%, #fdfcf8 0%, var(--paper) 45%, var(--paper-2) 100%) fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--clay-deep); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- shared pieces ---------- */

.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--clay-deep); display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--clay); display: inline-block; }

h1.display {
  font-family: var(--serif); font-weight: 500; font-size: clamp(46px, 7vw, 84px);
  line-height: 1.02; letter-spacing: -.02em;
}
h2.title {
  font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.08; letter-spacing: -.015em;
}
.lead { font-size: clamp(15px, 1.5vw, 18px); line-height: 1.55; color: var(--ink-2); max-width: 62ch; }
.serif-accent { font-family: var(--serif); font-style: italic; color: var(--clay-deep); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Claude Code spinner: a rotating glyph and a verb with animated dots. */
.spinner {
  font-family: var(--mono); display: inline-flex; align-items: center; gap: 9px; color: var(--ink-2); line-height: 1.4;
}
.spinner .glyph {
  color: var(--clay); font-size: 1.15em; display: inline-flex; align-items: center; justify-content: center;
  width: 1.1em; height: 1em; line-height: 1; overflow: hidden; font-variant-emoji: text;
}
.spinner .word { color: var(--muted); white-space: nowrap; }
.spinner .dots-el { display: inline-block; width: 1.5em; text-align: left; }
.spinner-chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 11px 18px; font-size: 15px;
}

/* The mascot, breathing inside a warm glow. */
.cmark { position: relative; display: grid; place-items: center; }
.cmark::before {
  content: ""; position: absolute; inset: -22%;
  background: radial-gradient(circle, rgba(217, 119, 87, .22), transparent 68%);
  animation: cmark-glow 3.6s ease-in-out infinite; z-index: 0;
}
.cmark-img { position: relative; z-index: 1; display: block; animation: cmark-breathe 3.6s ease-in-out infinite; }
@keyframes cmark-breathe { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.05) rotate(4deg); } }
@keyframes cmark-glow { 0%, 100% { opacity: .4; transform: scale(.9); } 50% { opacity: .9; transform: scale(1.1); } }

.pixel-caption { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.pixel-caption b { font-family: var(--pixel); font-weight: 700; color: var(--ink); letter-spacing: .04em; margin-left: 4px; }

/* ---------- buttons, fields ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink); text-decoration: none;
  padding: 9px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--paper-2); border-color: #cfccc0; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--clay); border-color: var(--clay); color: #fff; box-shadow: 0 2px 10px rgba(217, 119, 87, .28); }
.btn.primary:hover { background: var(--clay-deep); border-color: var(--clay-deep); }
.btn.danger { color: var(--warn); }
.btn.danger:hover { background: #fbeceb; border-color: #efc9c4; }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; color: var(--clay-deep); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, label.field { font-size: 12.5px; font-family: var(--mono); color: var(--muted); letter-spacing: .02em; }
input[type="text"], input[type="email"], select {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card); min-height: 42px; font-size: 14.5px;
}
input[type="text"]:focus, input[type="email"]:focus, select:focus {
  outline: 0; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-tint);
}
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--line-2); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--clay); border: 3px solid #fff; box-shadow: 0 1px 4px #28231940; cursor: pointer;
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--clay); border: 3px solid #fff; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.pick {
  font-size: 14px; padding: 8px 16px; border-radius: 22px; cursor: pointer; font-weight: 600;
  background: var(--paper-2); border: 1px solid var(--line-2); color: var(--ink-2);
  transition: background .15s, border-color .15s, color .15s;
}
.pick:hover { background: var(--card); }
.pick[aria-pressed="true"] { background: var(--clay-tint); border-color: var(--clay); color: var(--clay-deep); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 11px; border-radius: 20px;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-2);
}
.chip.ok { background: #e7f5ee; border-color: #cbe9da; color: var(--ok); font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em; }
.chip.bad { background: #fbeceb; border-color: #f2d0cc; color: var(--warn); font-family: var(--mono); font-size: 11.5px; }
.chip.clay { background: var(--clay-tint); border-color: var(--clay-soft); color: var(--clay-deep); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .box { width: 46px; height: 27px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch .box::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.switch input:checked + .box { background: var(--clay); }
.switch input:checked + .box::after { transform: translateX(19px); }
.switch input:focus-visible + .box { outline: 2px solid var(--clay); outline-offset: 2px; }
.switch input:disabled + .box { opacity: .5; }

.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); background: var(--card); }

/* ---------- app shell ---------- */

.shell { max-width: 1100px; margin: 0 auto; padding: 0 28px 90px; }
.topbar { display: flex; align-items: center; gap: 28px; height: 68px; margin-bottom: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; transition: transform .3s; }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.wordmark { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -.02em; line-height: 1; }
.wordmark::after { content: "_"; color: var(--clay); margin-left: 1px; animation: caret 1.1s steps(1) infinite; font-family: var(--mono); }
@keyframes caret { 50% { opacity: 0; } }

.tabs { display: flex; gap: 4px; height: 100%; align-items: stretch; }
.tab {
  border: 0; border-bottom: 2px solid transparent; background: none; padding: 0 14px; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 14.5px; transition: color .15s, background .15s;
}
.tab:hover { color: var(--ink); background: rgba(31, 30, 28, .03); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--clay); }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--clay-soft); color: var(--clay-deep); font-weight: 700; font-size: 13px;
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

.page-head { padding: 22px 0 22px; display: grid; gap: 14px; }
.foot { margin-top: 64px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ---------- critters ---------- */

.critters {
  position: relative; height: 150px; border-radius: var(--radius); overflow: hidden; margin-bottom: 26px;
  background: linear-gradient(180deg, var(--clay-tint), var(--paper-2)); border: 1px solid var(--line);
}
.critters .ground { position: absolute; left: 2%; right: 2%; bottom: 26px; border-top: 2px dotted var(--line-2); }
.critters .actor { position: absolute; bottom: 28px; display: flex; flex-direction: column; align-items: center; }
.critters .host { left: 8%; }
.critters .walker { left: 82%; animation: walk 16s ease-in-out infinite; }
.critters img.crit { width: 56px; height: 56px; display: block; image-rendering: pixelated; }
.critters .walker img.crit { animation: bob .5s steps(2) infinite; }
.critters .host img.crit { animation: cmark-breathe 3.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes walk {
  0%, 4% { left: 82%; }
  32%, 48% { left: 24%; }
  80%, 100% { left: 82%; }
}
.bubble {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-42%); white-space: nowrap;
  font-family: var(--pixel); font-size: 11px; line-height: 1.5; letter-spacing: .02em; color: var(--ink-2);
  background: var(--card); border: 2px solid var(--ink); padding: 5px 9px; box-shadow: 3px 3px #1f1e1c24; opacity: 0;
}
.bubble::after {
  content: ""; position: absolute; left: 30px; bottom: -7px; width: 10px; height: 10px; background: var(--card);
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg);
}
.bubble b { color: var(--clay-deep); font-weight: 700; }
.host .say-a { animation: say-a 16s infinite; }
.host .say-b { animation: say-b 16s infinite; }
.walker .say-a { animation: say-c 16s infinite; }
.walker .say-b { animation: say-d 16s infinite; }
@keyframes say-a { 0%, 3% { opacity: 0; } 6%, 26% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes say-b { 0%, 36% { opacity: 0; } 39%, 50% { opacity: 1; } 54%, 100% { opacity: 0; } }
@keyframes say-c { 0%, 8% { opacity: 0; } 12%, 28% { opacity: 1; } 31%, 100% { opacity: 0; } }
@keyframes say-d { 0%, 56% { opacity: 0; } 60%, 76% { opacity: 1; } 80%, 100% { opacity: 0; } }
.critters .grant {
  position: absolute; left: 14%; bottom: 96px; opacity: 0; animation: handoff 16s infinite;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--card); border: 2px solid var(--ink);
  padding: 6px 10px; box-shadow: 3px 3px #1f1e1c24; white-space: nowrap;
}
.critters .grant b { color: var(--clay-deep); font-weight: 600; }
@keyframes handoff {
  0%, 33% { opacity: 0; left: 14%; }
  36% { opacity: 1; left: 14%; }
  46% { opacity: 1; left: 22%; }
  50%, 100% { opacity: 0; left: 24%; }
}
.critters .tag { position: absolute; right: 16px; top: 14px; }

/* ---------- lender cards, bars ---------- */

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.lender { padding: 22px; display: grid; gap: 18px; align-content: start; transition: transform .2s, box-shadow .2s; }
.lender:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.lender h3, .item h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; letter-spacing: -.01em; line-height: 1.2; }
.who-row { display: flex; align-items: center; gap: 13px; }
.who-row .meta { display: grid; gap: 4px; justify-items: start; }

.bar-block { display: grid; gap: 7px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); align-items: baseline; }
.bar-label b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 8px; border-radius: 6px; background: var(--sess-track); overflow: hidden; }
.bar.weekly { background: var(--usage-track); }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--usage-blue); border-radius: 6px; transition: width .7s cubic-bezier(.22, 1, .36, 1); }
.bar .fill.warn { background: var(--warn); }
.bar .lent {
  position: absolute; top: 0; bottom: 0; opacity: .92;
  background: repeating-linear-gradient(45deg, var(--clay) 0, var(--clay) 6px, var(--clay-deep) 6px, var(--clay-deep) 12px);
  transition: width .7s cubic-bezier(.22, 1, .36, 1), left .7s cubic-bezier(.22, 1, .36, 1);
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l-use { background: var(--usage-blue); }
.legend .l-lent { background: repeating-linear-gradient(45deg, var(--clay) 0, var(--clay) 3px, var(--clay-deep) 3px, var(--clay-deep) 6px); }

/* ---------- panels ---------- */

.stack { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.panel { padding: 26px 30px; display: grid; gap: 22px; }
.panel h3, .section-title { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.panel-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.rule { border: 0; border-top: 1px solid var(--line); }
.controls { display: grid; gap: 22px; }
.pctbig { font-family: var(--serif); font-size: 34px; color: var(--clay-deep); font-variant-numeric: tabular-nums; line-height: 1; }
.slider-row { display: grid; gap: 12px; }
.slider-row .top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.note { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.list { display: grid; gap: 16px; }
.item { padding: 22px 24px; display: grid; gap: 18px; }
.meters { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.empty { padding: 44px 24px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.empty img { width: 52px; height: 52px; opacity: .45; filter: grayscale(.35); image-rendering: pixelated; }
.empty h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.empty p { color: var(--muted); max-width: 46ch; }

.notice { padding: 13px 16px; border-radius: 14px; background: var(--clay-tint); border: 1px solid var(--clay-soft); color: #7a3d27; font-size: 14px; }
.notice.ok { background: #e7f5ee; border-color: #cbe9da; color: #17613f; }
.error { padding: 12px 15px; border-radius: 12px; background: #fbeceb; border: 1px solid #f2d0cc; color: #9a3226; font-size: 14px; }

/* connect steps */
.connect { display: grid; grid-template-columns: 1fr auto; gap: 34px; align-items: center; padding: 34px 36px; }
.connect .steps { display: grid; gap: 22px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--clay-tint); color: var(--clay-deep); font-family: var(--mono); font-weight: 600; font-size: 13px; border: 1px solid var(--clay-soft); }
.step b { font-size: 16px; }
.manual { padding: 18px 20px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); display: grid; gap: 12px; }

/* ---------- terminal ---------- */

.term { background: #1c1b19; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); font-family: var(--mono); border: 1px solid #2c2a26; }
.term .tbar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: #24221f; border-bottom: 1px solid #302d29; }
.term .tbar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.term .tbar .t-title { margin-left: 8px; color: #8f8b83; font-size: 12px; }
.term .tbody { padding: 16px 18px; font-size: 13px; line-height: 1.75; color: #e9e6df; white-space: pre-wrap; word-break: break-all; user-select: all; }
.term .p { color: var(--clay); user-select: none; }
.term .dim { color: #8f8b83; }

/* ---------- modal, toast ---------- */

.overlay {
  position: fixed; inset: 0; background: rgba(31, 30, 28, .42); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px; z-index: 30; overflow-y: auto; animation: fade .18s ease-out;
}
.modal {
  background: var(--card); border-radius: 20px; width: min(580px, 100%); padding: 28px; display: grid; gap: 20px;
  max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: rise .22s cubic-bezier(.22, 1, .36, 1);
}
.modal h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -.01em; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
ol.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 5px; color: var(--ink-2); font-size: 14.5px; }

#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #faf9f5; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14.5px; animation: rise .22s ease-out; }
.toast.bad { background: var(--warn); }

/* ---------- sign-in page ---------- */

.landing { min-height: 100vh; display: grid; place-items: center; padding: 40px 28px; }
.landing .wrap { width: min(1080px, 100%); display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.landing .copy { display: grid; gap: 22px; justify-items: start; }
.landing .art { display: grid; justify-items: center; gap: 18px; }
.landing .signin { padding: 24px; display: grid; gap: 16px; width: min(440px, 100%); }
.landing .foot-note { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ---------- small screens, reduced motion ---------- */

@media (max-width: 860px) {
  .landing .wrap { grid-template-columns: 1fr; gap: 28px; }
  .landing .art { order: -1; }
  .connect { grid-template-columns: 1fr; padding: 26px 22px; }
  .connect .cmark { justify-self: center; order: -1; }
}
@media (max-width: 640px) {
  .shell { padding: 0 16px 70px; }
  .topbar { height: auto; padding: 14px 0 0; gap: 10px 20px; }
  .tabs { order: 3; width: 100%; height: 44px; }
  .tab { flex: 1; padding: 0 6px; }
  .who .email { display: none; }
  .panel { padding: 22px 20px; }
  .critters { height: 130px; }
  .critters .tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .critters .bubble { opacity: 1; }
  .critters .host .say-b, .critters .walker .say-b, .critters .grant { display: none; }
  .critters .walker { left: 24%; }
}
