/*
 * journeys.growthstar.app: the sign-in page and the signed-in "Your journeys" home.
 * Deck's pattern and growthstar.app's tokens (bone paper, forest ink, cocoa, cream, Archivo),
 * with Journeys' own lake blue where Deck has its violet. Archivo is self-hosted like the canvas:
 * no font service sees a visitor.
 */
@font-face { font-family: 'Archivo'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../brand/fonts/archivo-600-latin.woff2') format('woff2'); }

:root {
  --paper: #f4f4f0;
  --paper-deep: #e7e9e1;
  --ink: #131714;
  --ink-soft: #414640;
  --ink-faint: #5c6158;
  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --cocoa: #221710;
  --cocoa-soft: #3f2c21;
  --cocoa-deep: #0e0906;
  --cream: #f3e8d6;
  --lake: #3a8fc0;        /* the Journeys mark */
  --lake-ink: #1d6a96;    /* lake blue dark enough for text on paper (5.4:1) */
  --lake-bright: #8cc8ea; /* lake blue on cocoa */
  --s1: #6fcf86; --s2: #e2b84c; --s3: #f0885a; /* the canvas's first stage colours */
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --display: 'Archivo', var(--sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; line-height: 1.55; }
a { color: inherit; }
[hidden] { display: none !important; }

.display { font-family: var(--display); letter-spacing: -0.03em; font-weight: 600; }
.accent { font-style: italic; color: var(--lake-ink); }
.on-dark .accent { color: var(--lake-bright); }
.eyebrow { font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; border-radius: 2px; padding: 1rem 1.75rem;
  font: 500 0.9375rem/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.btn-primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn-primary:hover { background: var(--lake-ink); border-color: var(--lake-ink); }
.btn-quiet { background: transparent; border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); color: var(--ink); }
.btn-quiet:hover { border-color: var(--lake-ink); color: var(--lake-ink); }
.btn-small { padding: 0.5rem 0.8rem; font-size: 0.85rem; }
:where(a, button, summary, input, select):focus-visible { outline: 3px solid var(--lake-ink); outline-offset: 3px; border-radius: 2px; }
.on-dark :where(a, button, summary):focus-visible { outline-color: var(--lake-bright); }
.link { color: var(--lake-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--lake-ink) 40%, transparent); text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--lake-ink); }
.mark { border-radius: 21.7%; display: block; }
.wordmark { height: 22px; width: auto; display: block; }

/* ---------- Sign-in page ---------- */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .signin { grid-template-columns: 1.1fr 1fr; } }
.signin-brand { background: var(--cocoa); color: var(--cream); padding: 32px 24px 40px; display: flex; flex-direction: column; gap: 40px;
  position: relative; overflow: hidden; isolation: isolate; }
@media (min-width: 960px) { .signin-brand { padding: 48px 56px; justify-content: space-between; } }
.signin-brand::after { content: ''; position: absolute; right: -160px; bottom: -200px; width: 520px; height: 520px; background: var(--lake);
  opacity: 0.18; filter: blur(90px); border-radius: 50%; z-index: -1; }
.signin-pitch h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); line-height: 1.1; margin: 0 0 16px; max-width: 18ch; }
.signin-pitch p { margin: 0; color: rgb(243 232 214 / 0.8); max-width: 44ch; font-size: 1.05rem; }

/* The live mini-map: three small cards and two arrows, drawn in CSS the way the canvas draws them. */
.mini-map { display: grid; grid-template-columns: 1fr 34px 1fr 34px 1fr; align-items: center; max-width: 520px; padding: 18px 16px;
  border-radius: 14px; background: var(--cocoa-deep); box-shadow: inset 0 0 0 1px rgb(243 232 214 / 0.08), 0 24px 48px -20px rgb(0 0 0 / 0.6);
  margin: 0; list-style: none; }
.mini-card { background: #1b1410; border: 1px solid #3a2c22; border-radius: 6px; overflow: hidden; min-width: 0; }
.mini-card b { display: block; padding: 5px 8px; font: 600 clamp(0.62rem, 1.2vw, 0.75rem)/1.3 var(--display); color: #fff;
  background: color-mix(in srgb, var(--band) 30%, #1b1410); border-bottom: 2px solid var(--band); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card span { display: block; padding: 8px 8px 4px; font-size: clamp(0.62rem, 1.1vw, 0.72rem); color: rgb(243 232 214 / 0.7); }
.mini-card strong { display: block; padding: 0 8px 9px; font: 600 clamp(0.8rem, 1.6vw, 1rem)/1.2 var(--display); color: var(--cream); }
.mini-arrow { height: 2px; background: var(--lake-bright); position: relative; margin: 0 3px; }
.mini-arrow::after { content: ''; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--lake-bright); border-right: 0; }
@media (prefers-reduced-motion: no-preference) {
  .mini-arrow { background: linear-gradient(90deg, var(--lake-bright) 40%, transparent 40%) 0 0 / 10px 2px repeat-x; animation: flow 1.2s linear infinite; }
  @keyframes flow { to { background-position: 10px 0; } }
}

.signin-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px 64px; }
.signin-card { width: 100%; max-width: 400px; }
.signin-card h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.05; margin: 24px 0 12px; }
.signin-card .lede { color: var(--ink-soft); margin: 0 0 32px; }
.signin-card .btn { width: 100%; }
.signin-note { margin: 20px 0 0; font-size: 0.875rem; color: var(--ink-faint); }
.signin-foot { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--ink-soft); display: grid; gap: 8px; }
@media (max-width: 959px) {
  .signin-panel { order: -1; padding-top: 32px; }
  .signin-brand .mini-map { max-width: 420px; }
}

/* ---------- Signed-in pages: the top bar ---------- */
.topbar { background: var(--cocoa); color: var(--cream); }
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.topbar-brand .sep { width: 1px; height: 24px; background: rgb(243 232 214 / 0.2); }
.topbar-brand span { font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--lake-bright); }
.who { display: flex; align-items: center; gap: 14px; font-size: 0.9rem; color: rgb(243 232 214 / 0.8); }
.who button { background: none; border: 1px solid rgb(243 232 214 / 0.35); color: var(--cream); border-radius: 2px; padding: 6px 12px; font: inherit; cursor: pointer; }
.who button:hover { border-color: var(--lake-bright); color: var(--lake-bright); }
@media (max-width: 640px) { .who-name, .topbar-brand .sep, .topbar-brand span { display: none; } }

/* The suite switcher: the other GROWTHSTAR apps, one click away (like Workspace). */
.apps { position: relative; }
.apps summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; color: var(--cream); }
.apps summary::-webkit-details-marker { display: none; }
.apps summary:hover { background: rgb(243 232 214 / 0.08); }
.apps-menu { position: absolute; right: 0; top: 42px; z-index: 50; width: 260px; background: var(--paper); color: var(--ink); border-radius: 8px;
  box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.45), 0 0 0 1px var(--line); padding: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.apps-menu a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 6px; text-decoration: none; font-size: 0.8rem; }
.apps-menu a:hover { background: var(--paper-deep); }
.apps-menu i { width: 34px; height: 34px; border-radius: 21.7%; display: grid; place-items: center; font: 600 0.9rem/1 var(--display); font-style: normal;
  color: #fff; background: linear-gradient(var(--cocoa-soft), var(--cocoa)); box-shadow: inset 0 0 0 1px rgb(243 232 214 / 0.09); border-bottom: 3px solid var(--c); }
.apps-menu a[aria-current] { background: var(--paper-deep); }

/* ---------- Your journeys ---------- */
.hero { background: var(--cocoa); color: var(--cream); }
.hero-inner { max-width: 1160px; margin: 0 auto; padding: 36px 20px 48px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.05; margin: 10px 0 12px; }
.hero p { margin: 0; max-width: 58ch; color: rgb(243 232 214 / 0.82); font-size: 1.02rem; }
.hero .btn-primary { background: var(--lake-bright); border-color: var(--lake-bright); color: var(--cocoa); }
.hero .btn-primary:hover { background: var(--cream); border-color: var(--cream); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 40px 20px 72px; }
.ws-section + .ws-section { margin-top: 48px; }
.ws-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ws-head h2 { font-size: 1.5rem; margin: 0; }
.ws-head .role { font-size: 0.85rem; color: var(--ink-faint); text-transform: capitalize; }
.ws-head .people { font-size: 0.85rem; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.journey { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.journey:hover { border-color: color-mix(in srgb, var(--lake-ink) 50%, transparent); }
.journey .thumb { display: block; aspect-ratio: 16 / 10; background: var(--cocoa); }
.journey .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.journey .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.journey h3 { margin: 0; font: 600 1.08rem/1.25 var(--display); letter-spacing: -0.02em; }
.journey h3 a { text-decoration: none; }
.journey h3 a:hover { color: var(--lake-ink); }
.journey .meta { font-size: 0.84rem; color: var(--ink-faint); }
.journey .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.journey .actions .btn { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
.empty { padding: 28px; border: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 8px; color: var(--ink-soft); }

/* New journey: a small sheet, no pop-up window. */
.new-sheet { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 28px; max-width: 620px; }
.new-sheet h2 { margin: 0 0 14px; font-size: 1.25rem; }
.new-sheet label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 12px; }
.new-sheet input, .new-sheet select { font: inherit; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 4px; background: var(--paper); color: var(--ink); }
.new-sheet fieldset { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.new-sheet legend { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 6px; }
.choice { display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px !important; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 6px; margin: 0 !important; cursor: pointer; color: var(--ink) !important; font-size: 0.95rem !important; }
.choice input { margin-top: 4px; }
.choice small { display: block; color: var(--ink-faint); font-size: 0.82rem; }
.new-sheet .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.note { font-size: 0.88rem; color: var(--ink-faint); min-height: 1.2em; margin: 10px 0 0; }
.note.bad { color: #a3262a; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 4px; font-size: 0.9rem; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.toast.show { opacity: 1; }

.foot { border-top: 1px solid var(--line); }
.foot-inner { max-width: 1160px; margin: 0 auto; padding: 24px 20px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: 0.875rem; color: var(--ink-faint); }

@media (prefers-reduced-motion: reduce) { .btn, .toast { transition: none; } }

/* 0.5.4: Remove (with a confirm on the card), Undo in the message, and Removed journeys with Restore. */
.btn-danger { background: #9c3b2a; border: 1px solid #9c3b2a; color: #fff; }
.btn-danger:hover { background: #82301f; }
.journey .confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.9rem; color: var(--ink-soft); }
.journey .confirm[hidden] { display: none; }
.journey .confirm span { flex: 1 1 100%; }
.toast:has(.toast-btn) { pointer-events: auto; }
.toast-btn { margin-left: 10px; background: none; border: 1px solid color-mix(in srgb, var(--paper) 45%, transparent); color: var(--paper); border-radius: 3px; padding: 3px 10px; font: inherit; cursor: pointer; }
.removed { margin-top: 28px; border-top: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); padding-top: 16px; }
.removed summary { cursor: pointer; color: var(--ink-soft); font-size: 0.95rem; }
.removed-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.removed-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); border-radius: 6px; }
.removed-list li > span:first-child { flex: 1 1 auto; font-weight: 600; }
.removed-list .meta { color: var(--ink-soft); font-size: 0.85rem; }
