/*
 * Synapse: Sigmoidal's internal portal.
 * Follows sigmoidal.io: cream page, square corners everywhere, 1px hairlines,
 * beige illustration panels, serif display type, teal-ruled eyebrows and
 * square arrow buttons. Typefaces are sigmoidal.io's own (see fonts/fonts.css).
 */
:root {
  --bg: #f7f2e8;
  --surface: #fcfbf4;
  --panel: #e1dcd2;
  --ink: #1d1d1d;
  --muted: rgba(29, 29, 29, 0.66);
  --primary: #0e3a34;
  --accent: #129b89;
  --accent-ink: #0b6b5f;
  --on-primary: #f7f2e8;
  --hairline: rgba(29, 29, 29, 0.1);
  --sans: "PP Fragment Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --serif: "PP Fragment Text", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --width: 1240px;
}

* { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.wrap { width: 100%; max-width: var(--width); margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .wrap { padding: 0 48px; } }

/* Header */
.bar { position: sticky; top: 0; z-index: 10; background: rgba(247, 242, 232, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--hairline); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark__mark { display: block; }
.wordmark__name { font: 400 1.4rem/1 var(--serif); letter-spacing: -0.01em; }
.wordmark__by { font-size: 0.85rem; color: var(--muted); align-self: flex-end; padding-bottom: 1px; }
.account { display: flex; align-items: center; gap: 16px; font-size: 0.875rem; min-width: 0; }
.account__email { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .account__email { display: none; } }
.link { color: var(--accent-ink); text-decoration: none; font-weight: 500; }
.link:hover { color: var(--accent); }

.main { flex: 1; padding: 96px 0 112px; }

/* Type */
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font: 500 0.75rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink); }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.title { margin: 0; max-width: 18ch; font: 400 clamp(2.4rem, 0.9rem + 3vw, 3.7rem)/1.06 var(--serif); letter-spacing: -0.01em; }
.title--small { max-width: 24ch; font-size: clamp(2rem, 1.2rem + 2.4vw, 3rem); }
.lead { max-width: 40rem; margin: 24px 0 0; font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.3rem); line-height: 1.6; color: var(--muted); }

/* Dashboard as a desktop: icons with a name, a tooltip on rest, free dragging (src/portal/client/desktop.ts) */
.page-desktop .main { padding-bottom: 48px; }
.desktop__hint { margin: 16px 0 0; font-size: 0.875rem; color: var(--muted); }
@media (hover: none), (pointer: coarse) { .desktop__hint { display: none; } }
.desktop { position: relative; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 120px); grid-auto-columns: 112px; align-content: start; gap: 8px; min-height: max(360px, calc(100vh - 420px)); margin-top: 40px; }
@media (max-width: 640px) { .desktop { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, 104px); grid-auto-rows: 120px; } }
.desk-icon { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 4px; text-decoration: none; cursor: default; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; outline: none; }
.desk-icon__image { display: block; width: 56px; height: 56px; pointer-events: none; transition: filter 0.15s; }
.desk-icon__name { max-width: 100%; padding: 1px 5px; font-size: 0.85rem; line-height: 1.3; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.desk-icon.is-selected .desk-icon__image { filter: brightness(0.82) saturate(1.2); }
.desk-icon.is-selected .desk-icon__name { background: var(--primary); color: var(--on-primary); }
/* The clicked (or keyboard-focused) icon gets a dotted frame, like the focus rectangle on a Windows desktop. */
.desk-icon.is-current, .desk-icon:focus-visible { outline: 1px dotted rgba(29, 29, 29, 0.7); outline-offset: -1px; }
.desk-icon.is-dragging { opacity: 0.75; }
.desktop { user-select: none; -webkit-user-select: none; }
.desk-menu { position: fixed; z-index: 30; display: grid; min-width: 180px; padding: 4px; background: var(--surface); border: 1px solid rgba(29, 29, 29, 0.18); box-shadow: 0 10px 32px rgba(29, 29, 29, 0.12); }
.desk-menu[hidden] { display: none; }
.desk-menu__item { padding: 7px 12px; border: 0; background: none; font: 400 0.85rem/1.3 var(--sans); color: var(--ink); text-align: left; cursor: default; }
.desk-menu__item:hover, .desk-menu__item:focus-visible { background: var(--primary); color: var(--on-primary); outline: none; }
.desk-lasso { position: absolute; z-index: 15; background: rgba(18, 155, 137, 0.1); border: 1px solid var(--accent); pointer-events: none; }
.desk-tip { position: fixed; z-index: 20; display: grid; gap: 4px; max-width: 280px; padding: 10px 12px; background: var(--surface); border: 1px solid rgba(29, 29, 29, 0.18); box-shadow: 0 6px 24px rgba(29, 29, 29, 0.08); pointer-events: none; }
.desk-tip[hidden] { display: none; }
.desk-tip__name { font: 400 0.85rem/1.3 var(--sans); color: var(--ink); }
.desk-tip__text { font-size: 0.85rem; line-height: 1.45; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Buttons: square, trailing arrow (sigmoidal.io) */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.button { display: inline-flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--primary); color: var(--on-primary); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: background 0.3s var(--ease); }
.button:hover { background: var(--accent); }
.button__arrow { transition: transform 0.3s var(--ease); }
.button:hover .button__arrow { transform: translateX(2px); }
.button svg { width: 18px; height: 18px; }
.button--quiet { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1px rgba(14, 58, 52, 0.3); }
.button--quiet:hover { background: rgba(18, 155, 137, 0.08); }
.notice { margin: 20px 0 0; color: #8a5a00; font-size: 0.9rem; }

/* Every portal page: a faint watermark of the Synapse mark, centred below the header */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url("/portal/brand/synapse-mark-watermark.svg") 50% calc(50% + 32px) / min(72vw, 560px) no-repeat; }

/* Sign-in: the mark on the left, the button on the right; stacked on phones */
.page-signin::before { display: none; }
.page-signin .main { display: grid; place-items: center; padding: 48px 0; }
.signin { display: grid; justify-items: center; align-items: center; gap: 40px; }
.signin__mark { width: min(56vw, 260px); height: auto; }
.signin__action { display: grid; justify-items: center; gap: 16px; }
@media (min-width: 900px) {
  .signin { grid-template-columns: auto auto; gap: 96px; }
  .signin__mark { width: min(36vw, 440px); }
  .signin__action { justify-items: start; }
}
