/* Pip's app frame, cream edition. Ink on paper, one accent, hard offset
   shadows and no soft blur — the same language as the landing, now wrapped in
   a single bordered card that holds every page.

   Versioned in the filename on purpose. /app-assets/* is cached for a year and
   marked immutable, so changing this file means bumping it to dash.v5.css and
   updating the link tag. */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --bg:      #dedcd3;   /* the desk the card sits on */
  --shell:   #eceae2;   /* the card itself */
  --paper:   #f3f2ea;   /* pickers, hovers */
  --surface: #faf9f2;   /* panels, menus */
  --ink:     #1a1a1a;
  --body:    #3a3846;
  --muted:   #8a8894;
  --faint:   #a09eaa;
  --blush:   #d6d6ef;   /* the one accent */
  --hair:    rgba(26, 26, 26, .13);
  --edge:    rgba(26, 26, 26, .2);

  /* The mascot template reads these three, so they have to keep their names. */
  --m-ink:   #1a1a1a;
  --m-fill:  #faf9f2;
  --m-blush: #d6d6ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 2px solid #4b4b8f; outline-offset: 2px; }
::selection { background: var(--blush); color: var(--ink); }
[hidden] { display: none !important; }

.serif { font-family: 'Instrument Serif', serif; font-weight: 400; letter-spacing: -.025em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- the character ---------------------------------------------------- */
.pip { display: block; flex: none; }
.pip .eye { transform-box: fill-box; transform-origin: center; animation: pip-blink 7s infinite; }
.pip.asleep { opacity: .55; }
.pip.asleep .eye { animation: none; transform: scaleY(.12); }
@keyframes pip-blink { 0%, 93%, 100% { transform: scaleY(1) } 96% { transform: scaleY(.1) } }

/* --- the shell -------------------------------------------------------- */
/* The design is a 1280px card floating on the desk. Below that width the card
   gives up its margins and border radius and simply becomes the page, because
   most people arrive here from a text message on a phone. */
.desk {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 44px 40px;
}
.shell {
  width: 1280px;
  max-width: 100%;
  border: 1.5px solid var(--ink);
  background: var(--shell);
  border-radius: 14px;
  overflow: hidden;
  min-height: 760px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* --- top bar ---------------------------------------------------------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 26px;
  min-height: 38px;
}
.icon {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1.5px solid var(--edge);
  border-radius: 999px;
  padding: 8px 18px 8px 14px;
  font-size: 13.5px;
  transition: background .16s ease, border-color .16s ease;
}
.icon:hover { background: var(--surface); border-color: rgba(26, 26, 26, .45); }
.icon.sq { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; gap: 0; }
.icon svg { width: 15px; height: 15px; }
.icon.sq svg { width: 17px; height: 17px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: 46px;
  right: 0;
  width: 238px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  padding: 8px;
  z-index: 5;
  box-shadow: 0 5px 0 rgba(26, 26, 26, .9);
  animation: pagein .14s ease both;
}
.menu button, .menu a {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 11px 13px;
  text-align: left;
  font-size: 14.5px;
}
.menu button:hover, .menu a:hover { background: var(--paper); }
.menu .hint { font-size: 12.5px; color: var(--muted); }

/* --- pages ------------------------------------------------------------ */
@keyframes pagein { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.page { animation: pagein .22s ease both; flex: 1; padding: 22px 60px 70px; }
@media (prefers-reduced-motion: reduce) {
  .page, .menu { animation: none; }
  .pip .eye { animation: none; }
}

.page h1 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 46px; letter-spacing: -.025em; margin: 0 0 6px; line-height: 1.05; }
.page .lede { margin: 0 0 34px; font-size: 14.5px; color: var(--muted); }

/* Home centres itself in the card instead of starting at the top. */
.page.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 34px 74px;
  text-align: center;
}
.page.home h1 { font-size: 52px; line-height: 1; margin: 0 0 10px; }
.page.home .lede { margin: 0 0 50px; font-size: 15px; }
.hero-mark { margin-bottom: 32px; }

/* --- home tiles ------------------------------------------------------- */
.picks { display: grid; grid-template-columns: repeat(3, 220px); gap: 14px; }
.pk {
  box-sizing: border-box;
  background: var(--paper);
  border: 1.5px solid var(--hair);
  border-radius: 22px;
  padding: 26px 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.pk:hover { transform: translateY(-3px); background: #fff; }
.pk .nm { display: block; font-size: 16px; font-weight: 600; }
.pk .mt { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.pk svg { width: 22px; height: 22px; flex: none; }

.tail { display: flex; gap: 14px; margin-top: 14px; width: 688px; max-width: 100%; }
.ref {
  flex: none;
  width: 454px;
  background: var(--blush);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  padding: 26px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ref:hover { transform: translateY(-3px); box-shadow: 0 6px 0 var(--ink); }
.ref svg { width: 30px; height: 30px; flex: none; }
.ref .t { display: block; font-family: 'Instrument Serif', serif; font-size: 29px; line-height: 1.1; }
.ref .d { display: block; font-size: 13.5px; color: var(--body); margin-top: 6px; line-height: 1.45; }

.pk.dark {
  flex: none;
  width: 220px;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
.pk.dark:hover { background: var(--ink); }
.pk.dark .mt { color: rgba(250, 249, 242, .6); }
.pk.dark .push { margin-top: auto; }

/* --- goals ------------------------------------------------------------ */
.stack { display: flex; flex-direction: column; gap: 12px; }
.goal {
  background: var(--surface);
  border: 1.5px solid rgba(26, 26, 26, .14);
  border-radius: 22px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 34px;
  align-items: center;
}
.kicker { display: block; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.goal .nm { display: block; font-family: 'Instrument Serif', serif; font-size: 31px; line-height: 1.15; margin-top: 8px; }
.goal .note { display: block; font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.meter { height: 5px; background: var(--hair); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); }
.meter-row { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--muted); }

.dashed {
  background: transparent;
  border: 1.5px dashed rgba(26, 26, 26, .3);
  border-radius: 22px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
}
.dashed .t { display: block; font-family: 'Instrument Serif', serif; font-size: 29px; color: var(--muted); }
.dashed .d { display: block; font-size: 13.5px; color: var(--faint); margin-top: 5px; }

.section-lbl { margin: 44px 0 14px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.done-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 4px;
  border-top: 1px solid var(--hair);
}
.done-row .nm { font-family: 'Instrument Serif', serif; font-size: 22px; color: var(--muted); }
.done-row .when { font-size: 13px; color: var(--faint); }

/* --- pipkins ---------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card {
  background: var(--surface);
  border: 1.5px solid var(--hair);
  border-radius: 22px;
  padding: 22px 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 150px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); }
.card.on { border-color: var(--ink); }
.card.off { background: transparent; }
.card .top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px; }
.card .val { font-family: 'Instrument Serif', serif; font-size: 26px; line-height: 1; }
.card .state { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card .push { margin-top: auto; }
.card .nm { display: block; font-size: 15.5px; font-weight: 600; }
.card .mt { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.card.new { border-style: dashed; border-color: rgba(26, 26, 26, .3); background: transparent; justify-content: flex-end; }
.card.new:hover { transform: none; }

/* --- rows (integrations, settings) ------------------------------------ */
.panel { background: var(--surface); border: 1.5px solid rgba(26, 26, 26, .14); border-radius: 22px; overflow: hidden; }
.row {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 20px 26px;
  border-top: 1px solid var(--hair);
  transition: background .16s ease;
}
.row:first-child { border-top: none; }
.row:hover { background: var(--paper); }
.row-ints { grid-template-columns: 210px 1fr 150px; }
.row-set { grid-template-columns: 230px 1fr auto; }
.row .nm { font-size: 16px; font-weight: 600; }
.row-set .nm { font-size: 15.5px; }
.row .note { font-size: 13.5px; color: var(--muted); }
.row .end { justify-self: end; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* --- controls --------------------------------------------------------- */
.chip {
  background: transparent;
  border: 1.5px solid rgba(26, 26, 26, .16);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13.5px;
  color: var(--body);
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.chip:hover:not(:disabled) { border-color: rgba(26, 26, 26, .4); background: var(--paper); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip:disabled { opacity: .45; cursor: default; }

.solid {
  display: inline-flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
  background: var(--ink);
  color: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform .16s ease;
}
.solid:hover { transform: translateY(-2px); }
.solid:disabled { opacity: .5; transform: none; cursor: default; }

.ghost {
  display: inline-flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
  background: transparent;
  border: 1.5px solid rgba(26, 26, 26, .22);
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 14.5px;
  transition: background .16s ease, border-color .16s ease;
}
.ghost:hover { border-color: var(--ink); background: var(--paper); }

.linkbtn {
  background: none;
  border: none;
  padding: .375rem 0;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linkbtn:hover { color: var(--ink); }

.mono {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 14.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- referrals -------------------------------------------------------- */
.hero {
  background: var(--blush);
  border: 1.5px solid var(--ink);
  border-radius: 26px;
  padding: 46px 48px;
  box-shadow: 0 5px 0 var(--ink);
}
.hero .eyebrow { margin: 0 0 14px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--body); }
.hero h1 { font-size: 60px; line-height: 1.02; margin: 0 0 18px; max-width: 20ch; }
.hero p { margin: 0 0 30px; font-size: 15.5px; color: var(--body); line-height: 1.55; max-width: 56ch; }
.hero .acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.stat { background: var(--surface); border: 1.5px solid rgba(26, 26, 26, .14); border-radius: 22px; padding: 24px 26px; }
.stat b { display: block; font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 42px; line-height: 1; }
.stat span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* --- states ----------------------------------------------------------- */
/* Empty is a sentence, not a spinner and not a fake row. Every page that has
   no data yet says why in Pip's voice and points at the thread. */
.empty {
  border: 1.5px dashed rgba(26, 26, 26, .28);
  border-radius: 22px;
  padding: 34px 30px;
  text-align: center;
  color: var(--muted);
}
.empty .t { display: block; font-family: 'Instrument Serif', serif; font-size: 26px; color: var(--body); line-height: 1.2; }
.empty .d { display: block; font-size: 13.5px; margin-top: 8px; max-width: 46ch; margin-inline: auto; line-height: 1.5; }
.empty .acts { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

.soon { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

.status { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 120px 26px; color: var(--muted); }
.msg { min-height: 20px; margin: 20px 0 0; font-size: 13.5px; color: var(--body); }

/* --- skeleton (login → dashboard) ------------------------------------ */
.skel-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--hair);
}
.skel {
  flex: 1;
  min-height: 0;
}
.skel .page.home { animation: none; pointer-events: none; }
.skel-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--hair);
  margin-bottom: 32px;
}
.skel-line {
  display: block;
  border-radius: 8px;
  background: var(--hair);
}
.skel-title { width: min(22ch, 72%); height: 42px; margin: 0 auto 14px; }
.skel-lede { width: min(36ch, 88%); height: 14px; margin: 0 auto 50px; }
.skel-tile, .skel-ref {
  background: var(--paper);
  border: 1.5px solid var(--hair);
  border-radius: 22px;
}
.skel-tile { min-height: 132px; }
.skel-ref { flex: none; width: 454px; min-height: 108px; background: rgba(214, 214, 239, .45); }
.skel-msg { width: 220px; background: rgba(26, 26, 26, .08); }
.skel-icon, .skel-mark, .skel-line, .skel-tile, .skel-ref {
  background-image: linear-gradient(90deg, transparent 0%, rgba(250, 249, 242, .7) 50%, transparent 100%);
  background-size: 220px 100%;
  background-repeat: no-repeat;
  animation: skel-shimmer 1.15s ease-in-out infinite;
}
@keyframes skel-shimmer {
  from { background-position: -220px 0; }
  to { background-position: calc(100% + 220px) 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skel-icon, .skel-mark, .skel-line, .skel-tile, .skel-ref { animation: none; }
}

/* Mid-onboarding and unpaid: a banner on the real home, never a full-page gate. */
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 688px;
  max-width: 100%;
  margin: -18px 0 28px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--hair);
  border-radius: 18px;
  text-align: left;
}
.notice .copy { min-width: 0; }
.notice .t { display: block; font-size: 14.5px; font-weight: 600; }
.notice .d { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.notice .acts { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1.5px solid rgba(26, 26, 26, .16);
  flex-wrap: wrap;
}
.foot .note { font-size: 13.5px; color: var(--muted); }
.fine { margin: 22px 0 0; font-size: 12.5px; color: var(--muted); }
.fine a { text-decoration: underline; text-underline-offset: 2px; }

/* --- opted out -------------------------------------------------------- */
.bye { max-width: 34rem; margin: 0 auto; padding: 80px 0; text-align: center; }
.bye h1 { font-size: 44px; margin: 18px 0 12px; }
.bye p { color: var(--body); font-size: 15px; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* --- narrow ----------------------------------------------------------- */
/* The card stops floating and becomes the page. Grids collapse in the order
   that keeps each row readable rather than all at once. */
@media (max-width: 1360px) {
  .desk { padding: 24px; }
}
@media (max-width: 1080px) {
  .page { padding: 20px 34px 60px; }
  .picks { grid-template-columns: repeat(3, 1fr); width: 100%; }
  .tail, .notice { width: 100%; }
  .ref, .skel-ref { flex: 1 1 auto; width: auto; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 48px; }
}
@media (max-width: 860px) {
  .desk { padding: 0; align-items: stretch; }
  .shell { border: none; border-radius: 0; min-height: 100vh; }
  .bar { padding: 14px 18px; }
  .page { padding: 18px 22px 56px; }
  .page.home { padding: 12px 22px 56px; justify-content: flex-start; }
  .page h1 { font-size: 38px; }
  .page.home h1 { font-size: 40px; }
  .goal { grid-template-columns: 1fr; gap: 20px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; }
  .hero { padding: 32px 26px; }
  .hero h1 { font-size: 38px; }
  .row-ints, .row-set { grid-template-columns: 1fr; gap: 10px; }
  .row .end { justify-self: start; justify-content: flex-start; }
  .tail { flex-direction: column; }
  .pk.dark { width: auto; }
  .skel-ref, .skel-msg { width: auto; }
  .notice { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 620px) {
  .picks { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .page.home h1 { font-size: 34px; }
  .hero h1 { font-size: 32px; }
  .foot { flex-direction: column; align-items: flex-start; }
}
