/* Salesforce Hub LLC site.
   Token names follow /Users/Shared/reusable/PortableThemes/html-css/theme.css
   (--bg, --surface, --ink, --ink-muted, --rule, --accent …) so the shared
   theme kit can be dropped in later without renaming. The site itself stays
   quiet (chalk and basalt) so each app's own colours carry the page.
   No Salesforce blue: the company is not affiliated with Salesforce, Inc. */

:root {
  color-scheme: light dark;
  --font-body: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #edefea;          /* chalk */
  --surface: #f7f8f4;
  --surface-2: #ffffff;
  --ink: #1c2326;         /* basalt */
  --ink-muted: #4f5c62;
  --ink-faint: #6f7b80;
  --rule: #c9cfcb;
  --accent: #1c2326;
  --accent-ink: #f7f8f4;
  --mark: #c98f1a;        /* ochre: the one studio accent */
  --live: #047857;
  --focus: #2f6f8f;
  --xhibit: #2c55c7;      /* from xhibit/webui/static/css/tokens.css */
  --error: #b3261e;

  --radius-s: 4px;
  --radius-m: 12px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 3rem;
  --space-6: clamp(3rem, 6vw, 4.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141819;
    --surface: #1b2022;
    --surface-2: #20272a;
    --ink: #e3e7e2;
    --ink-muted: #a1acad;
    --ink-faint: #85908f;
    --rule: #2f383b;
    --accent: #e3e7e2;
    --accent-ink: #141819;
    --mark: #e2a93a;
    --live: #34d399;
    --focus: #7fb8d4;
    --xhibit: #6d8ff0;
    --error: #f2a19b;
  }
}

:root[data-theme="dark"] {
  --bg: #141819;
  --surface: #1b2022;
  --surface-2: #20272a;
  --ink: #e3e7e2;
  --ink-muted: #a1acad;
  --ink-faint: #85908f;
  --rule: #2f383b;
  --accent: #e3e7e2;
  --accent-ink: #141819;
  --mark: #e2a93a;
  --live: #34d399;
  --focus: #7fb8d4;
  --xhibit: #6d8ff0;
  --error: #f2a19b;
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.875rem, 3.4vw, 2.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.375rem, 2.2vw, 1.625rem); letter-spacing: -0.02em; }
h3 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0; }
code { font-family: var(--font-code); font-size: 0.875em; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  padding: var(--space-1) var(--space-2);
  background: var(--ink);
  color: var(--bg);
  z-index: 10;
}
.skip-link:focus { top: var(--space-2); }

/* ── Buttons and links ────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease;
}
.button:hover { background: color-mix(in srgb, var(--accent) 84%, var(--mark)); }
.button--small { min-height: 36px; padding: 0 0.9rem; font-size: 0.875rem; }

.text-link {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: var(--mark);
}

/* ── Header ───────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; align-items: center; gap: var(--space-3); min-height: 60px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark-mark { width: 20px; height: 20px; fill: var(--ink); }
.wordmark-mark .wordmark-dot { fill: var(--mark); }

.site-nav { display: flex; gap: var(--space-3); margin-left: auto; }
.site-nav a { color: var(--ink-muted); text-decoration: none; font-weight: 500; font-size: 0.875rem; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: 6px; }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .header-row .button { margin-left: auto; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero { padding-block: clamp(3rem, 7vw, 4.5rem) var(--space-4); }
.hero h1 { line-height: 1.15; text-wrap: balance; }
.lede { margin-top: var(--space-2); max-width: 54ch; font-size: 1.0625rem; color: var(--ink-muted); text-wrap: pretty; }

.hero-actions { margin-top: var(--space-3); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── App grid ─────────────────────────────────────────────────────────── */

/* Four apps, laid out like the wordmark's four squares: one frame, shared
   inner rules, and the ochre square appears on the tile you point at. */
.apps { padding-bottom: var(--space-5); }
.app-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.app-tile {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon name" "icon job" "icon site";
  align-content: start;
  column-gap: var(--space-2);
  padding: 1.5rem;
  background: var(--surface);
  transition: background-color 160ms ease;
}
.app-tile::after {
  content: "";
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--mark);
  transform: scale(0);
  transition: transform 180ms cubic-bezier(.2, .7, .2, 1);
}
.app-tile:hover, .app-tile:focus-within { background: var(--surface-2); }
.app-tile:hover::after, .app-tile:focus-within::after { transform: scale(1); }

.app-icon { grid-area: icon; width: 40px; height: 40px; border-radius: 9px; }
.app-icon--mono {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
  font-size: 1.125rem;
}
.app-icon--xhibit { background: var(--xhibit); color: #fff; }

.app-name { grid-area: name; align-self: center; min-height: 40px; display: flex; align-items: center; font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.app-name a { text-decoration: none; }
.app-name a:focus-visible { outline: none; }
.app-tile:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }
/* The whole tile is the link target; the name carries the accessible link. */
.app-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.app-job { grid-area: job; max-width: 40ch; font-size: 0.9375rem; color: var(--ink-muted); text-wrap: pretty; }

.app-site {
  grid-area: site;
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-faint);
}
.app-go { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms ease; }
.app-tile:hover .app-site { color: var(--ink); }
.app-tile:hover .app-go { transform: translate(2px, -2px); }

.apps .fine-print { margin-top: var(--space-2); max-width: 80ch; font-size: 0.75rem; line-height: 1.55; color: var(--ink-faint); }

@media (max-width: 760px) {
  .app-grid { grid-template-columns: 1fr; }
  .app-tile { padding: 1.25rem; }
}

/* The one orchestrated moment: the four tiles arrive in turn. */
@media (prefers-reduced-motion: no-preference) {
  .js .app-tile { animation: arrive 560ms cubic-bezier(.2, .7, .2, 1) both; }
  .js .app-tile:nth-child(2) { animation-delay: 80ms; }
  .js .app-tile:nth-child(3) { animation-delay: 160ms; }
  .js .app-tile:nth-child(4) { animation-delay: 240ms; }
  @keyframes arrive {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-tile, .app-tile::after, .app-go { transition: none; }
}

/* ── Split sections (About, Contact): heading left, body right ────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: var(--space-2) var(--space-5);
  padding-block: var(--space-6);
  /* Drawn as a background so the divider lines up with the content edge,
     not the gutter (a border would span the padding too). */
  background: linear-gradient(var(--rule), var(--rule)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.split-head p { margin-top: var(--space-1); max-width: 34ch; font-size: 0.9375rem; color: var(--ink-muted); }
.split-body { display: grid; gap: var(--space-2); max-width: 62ch; }
.split-body p { color: var(--ink-muted); }
.split-body .statement { color: var(--ink); font-size: 1.125rem; line-height: 1.55; text-wrap: pretty; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .signup-form { grid-template-columns: 1fr; } }

/* ── Contact form ─────────────────────────────────────────────────────── */

.signup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  max-width: 560px;
}
.field { display: grid; gap: 0.35rem; }
.field--wide { grid-column: 1 / -1; }
.signup-form label { font-weight: 600; font-size: 0.875rem; }
.signup-form .optional { font-weight: 400; color: var(--ink-faint); }
.signup-form input,
.signup-form select,
.signup-form textarea {
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  transition: border-color 140ms ease;
}
.signup-form select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 52%, calc(100% - 0.8rem) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.signup-form :is(input, select, textarea):hover { border-color: var(--ink-faint); }
.signup-form textarea { resize: vertical; }
.signup-form :is(input, select, textarea):focus-visible { outline-offset: 0; border-color: var(--focus); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.form-status { font-size: 0.875rem; }
.form-status.is-error { color: var(--error); }
.form-status.is-ok { font-weight: 700; }

/* ── Footer ───────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--rule); padding-block: var(--space-3); font-size: 0.8125rem; color: var(--ink-muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); }
.legal { max-width: 62ch; color: var(--ink-faint); }
