/* applao — shared styling for every public page.
   White ground, orange spot colour. Never cream, never brown. */

:root {
  --spot: #f28c1e; --spot-deep: #d97a10; --ink: #1d1b22; --muted: #6f6a78;
  --line: #e8e5ee; --line-soft: #f0eef5; --chip: #f6f4fa; --paper: #ffffff;
  --good: #2e9e5b; --bad: #b03a3a;
  --stage: #1c1624;
  --shadow-soft: 0 1px 2px rgba(29, 27, 34, 0.04), 0 8px 24px rgba(29, 27, 34, 0.06);
  --shadow-lift: 0 2px 4px rgba(29, 27, 34, 0.05), 0 14px 36px rgba(242, 140, 30, 0.14);
  --wrap: 1080px;
}

@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  background: var(--paper); color: var(--ink); min-height: 100vh;
  -webkit-font-smoothing: antialiased; line-height: 1.55;
}
a { color: inherit; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 13px 28px; background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.home { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; border-radius: 12px; padding: 2px; transition: opacity 0.15s ease; }
.home:hover { opacity: 0.78; }
.home:focus-visible { outline: 2px solid var(--spot); outline-offset: 3px; }
/* brand mark: orange tile, three white bars that draw themselves.
   Same implementation as the desktop app so the two never drift. */
.mark { display: flex; flex-direction: column; justify-content: center; background: var(--spot); overflow: hidden; flex: none; box-sizing: border-box; }
.mark i { display: block; width: 100%; background: #fff; transform-origin: left; }
.mark i:nth-child(2) { opacity: 0.72; }
.mark i:nth-child(3) { opacity: 0.45; width: 52%; }
.mark-56 { width: 56px; height: 56px; border-radius: 14px; padding: 0 11px; gap: 4.5px; box-shadow: 0 8px 20px rgba(242, 140, 30, 0.28); }
.mark-56 i { height: 5.5px; border-radius: 3px; }
.mark-34 { width: 34px; height: 34px; border-radius: 10px; padding: 0 7px; gap: 3px; box-shadow: 0 3px 10px rgba(242, 140, 30, 0.3); }
.mark-34 i { height: 3.6px; border-radius: 2px; }
.mark-28 { width: 28px; height: 28px; border-radius: 8px; padding: 0 6px; gap: 2.5px; }
.mark-28 i { height: 3px; border-radius: 2px; }
.mark-anim i { animation: draw 3.4s ease-in-out infinite; }
.mark-anim i:nth-child(2) { animation-delay: 0.22s; }
.mark-anim i:nth-child(3) { animation-delay: 0.44s; }
@keyframes draw {
  0% { transform: scaleX(0); }
  18% { transform: scaleX(1); }
  82% { transform: scaleX(1); }
  92% { transform: scaleX(0); }
  100% { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) { .mark-anim i { animation: none; } }
.brand { font-weight: 800; font-size: 1.22rem; letter-spacing: -0.03em; }
.brand em { color: var(--spot); font-style: normal; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 9px; transition: color 0.15s ease, background 0.15s ease; }
.nav a:hover { color: var(--ink); background: var(--chip); }
.nav a.cta { color: #fff; background: linear-gradient(135deg, #f6a34a, var(--spot)); font-weight: 600; box-shadow: 0 3px 12px rgba(242, 140, 30, 0.3); }
.nav a.cta:hover { filter: brightness(0.97); background: linear-gradient(135deg, #f6a34a, var(--spot)); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 0.84rem; color: var(--muted); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #f6a34a, var(--spot)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; }

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: 12px; padding: 13px 20px; font-size: 0.93rem; font-weight: 600;
  cursor: pointer; background: var(--chip); color: var(--ink); font-family: inherit;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--spot); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-spot { background: linear-gradient(135deg, #f6a34a, var(--spot)); color: #fff; box-shadow: 0 3px 12px rgba(242, 140, 30, 0.3); }
.btn-spot:hover { filter: brightness(0.97); box-shadow: 0 5px 18px rgba(242, 140, 30, 0.4); }
.btn-quiet { background: var(--paper); border: 1px solid var(--line); }
.btn-quiet:hover { border-color: var(--muted); background: var(--chip); }
.btn-block { width: 100%; }

/* ---------- typography ---------- */
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; text-wrap: balance; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.eyebrow { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--spot-deep); }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 56ch; }
.sub { color: var(--muted); font-size: 0.95rem; }
.fine { color: var(--muted); font-size: 0.8rem; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }
.card { border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: var(--paper); box-shadow: var(--shadow-soft); }

/* ---------- legal / document pages ---------- */
.doc { padding: 56px 0 90px; }
.doc h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 10px; }
.doc .updated { color: var(--muted); font-size: 0.84rem; margin-bottom: 34px; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.doc h2 { font-size: 1.15rem; margin: 34px 0 10px; letter-spacing: -0.02em; }
.doc p, .doc li { color: #3a3742; font-size: 0.95rem; }
.doc p { margin-bottom: 12px; }
.doc ul { margin: 0 0 14px 20px; }
.doc li { margin-bottom: 7px; }
.doc strong { color: var(--ink); }
.doc a { color: var(--spot-deep); }
/* a button is a button first: the link colour of the page must not bleed into
   it and leave dark orange text on an orange fill */
.doc a.btn { color: var(--ink); }
.doc a.btn.btn-spot, .doc a.btn.btn-spot:hover { color: #fff; }
.callout { background: var(--chip); border-left: 3px solid var(--spot); border-radius: 0 12px 12px 0; padding: 15px 18px; margin: 20px 0; }
.callout p:last-child { margin-bottom: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.toc a { font-size: 0.8rem; text-decoration: none; background: var(--chip); border-radius: 999px; padding: 6px 13px; color: var(--muted); transition: color 0.15s ease, background 0.15s ease; }
.toc a:hover { background: var(--line); color: var(--ink); }

/* ---------- footer ----------
   The page ends on the same white it began on. The old grey slab read as a
   separate, heavier thing bolted to the bottom; all this one needs is a
   hairline, some air, and type quiet enough to stay out of the way. */
.foot { border-top: 1px solid var(--line-soft); background: var(--paper); padding: 54px 0 28px; margin-top: 56px; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 40px 56px; justify-content: space-between; }
.foot-brand { max-width: 290px; }
.foot-brand .home { margin-bottom: 13px; }
.foot-brand p { color: var(--muted); font-size: 0.835rem; line-height: 1.6; }
.foot-links { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-col h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: #9a95a3; margin-bottom: 13px; font-weight: 700; }
.foot-col a { display: block; width: fit-content; text-decoration: none; color: var(--muted); font-size: 0.855rem; margin-bottom: 9px; transition: color 0.15s ease; }
.foot-col a:hover { color: var(--ink); }
.foot-legal {
  margin-top: 42px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  color: #9a95a3; font-size: 0.765rem; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between;
}
.foot-legal b { color: var(--muted); font-weight: 600; }
/* inside the app (the rail pages) the footer is one quiet line and nothing
   else — it should not reserve the height of a full sitemap */
.foot:has(> .wrap > .foot-legal:first-child) { padding: 20px 0; margin-top: 30px; }
.foot-legal:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.doc a.ext { color: var(--spot-deep); }

/* ---------- left rail ----------
   The shell for every signed-in page: who you are, and the apps you have made.
   Shared so the home page and the apps page can never drift apart. */
.rail {
  width: 260px; flex: none; background: #fcfcfd; border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; padding: 14px 12px 12px; position: sticky; top: 0; height: 100vh;
}
.rail .home { padding: 4px 8px 16px; }

.rail-new {
  display: flex; align-items: center; gap: 9px; width: 100%; cursor: pointer; font-family: inherit;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); font-weight: 600; font-size: 0.875rem;
  border-radius: 10px; padding: 9px 12px; box-shadow: 0 1px 2px rgba(29, 27, 34, 0.05); text-decoration: none;
  white-space: nowrap; transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.rail-new svg { color: var(--spot); flex: none; transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.rail-new:hover { border-color: #d9d5e2; box-shadow: 0 2px 6px rgba(29, 27, 34, 0.07); }
.rail-new:hover svg { transform: rotate(90deg); }
.rail-new:active { background: var(--chip); }
.rail-new:focus-visible { outline: 2px solid var(--spot); outline-offset: 2px; }

.rail-sec { margin-top: 20px; min-height: 0; display: flex; flex-direction: column; }
.rail-sec h4 {
  font-size: 0.7rem; letter-spacing: 0.04em; color: var(--muted); font-weight: 600;
  padding: 0 10px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px;
}
.rail-sec h4 .count { margin-left: auto; font-variant-numeric: tabular-nums; opacity: 0.7; }
.rail-list { overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.rail-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: none; background: none;
  font-family: inherit; font-size: 0.855rem; color: #3f3b48; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}
.rail-item > svg { flex: none; color: var(--muted); transition: color 0.13s ease; }
.rail-item:hover { background: rgba(29, 27, 34, 0.045); color: var(--ink); }
.rail-item:hover > svg { color: var(--spot); }
.rail-item:focus-visible { outline: 2px solid var(--spot); outline-offset: -2px; }
.rail-item.on { background: rgba(242, 140, 30, 0.1); color: var(--spot-deep); font-weight: 600; }
.rail-item.on > svg { color: var(--spot); }
.rail-item .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.rail-empty { font-size: 0.78rem; color: var(--muted); padding: 4px 10px 2px; line-height: 1.55; }
.rail-all {
  display: flex; align-items: center; gap: 6px; margin: 6px 4px 0; padding: 7px 6px; border: none; background: none;
  font-family: inherit; font-size: 0.78rem; font-weight: 600; color: var(--muted); cursor: pointer;
  border-radius: 8px; text-decoration: none; transition: color 0.14s ease, gap 0.14s ease;
}
.rail-all:hover { color: var(--spot-deep); gap: 9px; }
.rail-all:focus-visible { outline: 2px solid var(--spot); outline-offset: 2px; }

/* what an app is doing, in the smallest mark that can carry it */
.state { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.state.work { background: var(--spot); animation: throb 1.5s ease-in-out infinite; }
.state.wait { border: 1.5px solid #d9a72a; }
.state.bad { background: var(--bad); }
.state.done { background: none; }
@keyframes throb { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.rail-acct {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent; background: none;
  font-family: inherit; padding: 8px 9px; border-radius: 10px; cursor: pointer; text-decoration: none;
  text-align: left; transition: background 0.14s ease, border-color 0.14s ease;
}
.rail-acct:hover { background: var(--paper); border-color: var(--line); }
.rail-acct .lines { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rail-acct .lines b { font-size: 0.8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-acct .lines span { font-size: 0.72rem; color: var(--muted); }
.rail-acct .avatar { width: 26px; height: 26px; font-size: 0.72rem; }
.credit-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 0.76rem; font-variant-numeric: tabular-nums;
  color: var(--spot-deep); background: rgba(242, 140, 30, 0.1); border-radius: 999px; padding: 4px 10px;
}
.credit-pill b { font-weight: 700; }
/* The rail is for your work and your account. Marketing links belong in the
   footer, not beside the thing you signed in to use. */

/* ---------- tooltips ----------
   One floating panel, borrowed by anything with data-tip (see _tip.js). Dark
   so it reads as a layer above the page rather than another card in it, with
   an arrow that keeps pointing at whatever asked for it. */
.tip {
  position: fixed; top: 0; left: 0; z-index: 80; pointer-events: none; max-width: 248px;
  background: #24222b; color: #fff; border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.775rem; font-weight: 500; line-height: 1.4; letter-spacing: -0.002em;
  border-radius: 10px; padding: 8px 11px;
  box-shadow: 0 10px 30px rgba(29, 27, 34, 0.26), 0 2px 8px rgba(29, 27, 34, 0.16);
  opacity: 0; transform: scale(0.97); transform-origin: var(--ax, 50%) var(--ay, 50%);
  transition: opacity 0.12s ease, transform 0.12s cubic-bezier(0.2, 0, 0.13, 1);
}
.tip.show { opacity: 1; transform: none; }
.tip b { display: block; color: #fff; font-weight: 600; }
.tip small { display: block; color: rgba(255, 255, 255, 0.6); font-size: 0.715rem; margin-top: 2px; }
.tip .tip-keys { display: inline-flex; gap: 3px; margin-top: 6px; }
.tip kbd {
  display: inline-flex; align-items: center; justify-content: center; height: 18px; min-width: 18px; padding: 0 5px;
  font: inherit; font-size: 0.68rem; font-weight: 600; line-height: 1; color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.11); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 5px;
}
.tip-arrow { position: absolute; width: 8px; height: 8px; background: inherit; border: inherit; transform: rotate(45deg); }
.tip[data-side="top"] .tip-arrow { bottom: -5px; left: var(--ax); margin-left: -4px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.tip[data-side="bottom"] .tip-arrow { top: -5px; left: var(--ax); margin-left: -4px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.tip[data-side="left"] .tip-arrow { right: -5px; top: var(--ay); margin-top: -4px; clip-path: polygon(100% 0, 100% 100%, 0 0); }
.tip[data-side="right"] .tip-arrow { left: -5px; top: var(--ay); margin-top: -4px; clip-path: polygon(0 0, 100% 100%, 0 100%); }

/* ---------- status pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.01em; border-radius: 999px; padding: 3px 9px;
}
.pill.work { color: var(--spot-deep); background: rgba(242, 140, 30, 0.11); }
.pill.wait { color: #8a6717; background: rgba(217, 167, 42, 0.16); }
.pill.bad { color: var(--bad); background: rgba(176, 58, 58, 0.08); }
.pill.done { color: var(--good); background: rgba(46, 158, 91, 0.1); }

@media (max-width: 860px) {
  .rail {
    position: static; width: auto; height: auto; flex-direction: row; align-items: center; gap: 10px;
    border-right: none; border-bottom: 1px solid var(--line-soft); padding: 10px 16px;
  }
  .rail .home { padding: 0; }
  .rail-sec { display: none; }
  .rail-new { width: auto; margin-left: auto; }
  .rail-foot { margin: 0; padding: 0; border: none; min-width: 0; }
  .rail-acct { padding: 6px 8px; min-width: 0; }
  .rail-acct .lines { flex: 1; }
}
@media (max-width: 560px) {
  /* the avatar and the balance are the whole story on a phone */
  .rail-acct .lines { display: none; }
  .rail .brand { display: none; }
}

.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto; } }
