/*
 * Vertex Pakistan entrypoint.
 * Graphite neutrals and one indigo accent in the chrome; color lives only inside the tool previews.
 * Each card takes a tint class (tint-indigo, tint-green, tint-amber, tint-rose, tint-slate) from tools.json.
 */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --raised: #f4f4f5;
  --paper: #ffffff;
  --ink: #171717;
  --ink-2: #525252;
  --ink-3: #737373;
  --line: rgba(23, 23, 23, 0.08);
  --line-strong: rgba(23, 23, 23, 0.14);
  --brand: #3b4a9f;
  --good: #1f7a4d;
  --bad: #b3362c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
  --sheet-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 20px rgba(0, 0, 0, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --indigo-bg: #eef0f8;
  --indigo-ink: #3b4a9f;
  --green-bg: #eaf4ee;
  --green-ink: #1f7a4d;
  --amber-bg: #fbf3e4;
  --amber-ink: #9a5b0b;
  --rose-bg: #faedeb;
  --rose-ink: #b3362c;
  --slate-bg: #f0f2f4;
  --slate-ink: #475569;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #181818;
    --raised: #202020;
    --paper: #232323;
    --ink: #ededed;
    --ink-2: #a3a3a3;
    --ink-3: #85858b;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --brand: #8f9be0;
    --good: #5bb487;
    --bad: #e0776d;
    --shadow: none;
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.4);
    --sheet-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.25);

    --indigo-bg: #1c1f2e;
    --indigo-ink: #9aa5e6;
    --green-bg: #16241d;
    --green-ink: #6cc497;
    --amber-bg: #2a2216;
    --amber-ink: #e0ad5f;
    --rose-bg: #2b1a18;
    --rose-ink: #e88b82;
    --slate-bg: #1d2127;
    --slate-ink: #a3b1c4;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-3);
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
}

/* header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
}

.mark {
  width: 24px;
  height: 24px;
  color: var(--ink);
}

.mark-dot {
  fill: var(--brand);
}

.clocks {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.clock time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.clock-city,
.clock-short {
  color: var(--ink-3);
}

.clock-short {
  display: none;
}

/* intro */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 64px;
}

.intro {
  max-width: 720px;
  margin-bottom: 40px;
}

h1 {
  margin: 0 0 12px;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.intro p {
  margin: 0;
  font-size: 16px;
  color: var(--ink-2);
}

/* tool cards */
.apps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.apps-1 {
  grid-template-columns: minmax(0, 420px);
}

.apps-2,
.apps-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app {
  --t-bg: var(--slate-bg);
  --t-ink: var(--slate-ink);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 220ms var(--ease), transform 220ms var(--ease);
}

.tint-indigo {
  --t-bg: var(--indigo-bg);
  --t-ink: var(--indigo-ink);
}

.tint-green {
  --t-bg: var(--green-bg);
  --t-ink: var(--green-ink);
}

.tint-amber {
  --t-bg: var(--amber-bg);
  --t-ink: var(--amber-ink);
}

.tint-rose {
  --t-bg: var(--rose-bg);
  --t-ink: var(--rose-ink);
}

.app:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.app:focus-visible,
.logo:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.app.pressed {
  transform: scale(0.99);
}

.app-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  flex: 1;
}

.app-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.app-title .mono {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.app-body p {
  margin: 0;
  color: var(--ink-2);
}

.app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
}

/* live status: the signature */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  opacity: 0.5;
}

.status.up .dot {
  background: var(--good);
  opacity: 1;
}

.status.up .dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--good);
  opacity: 0;
  animation: beat 2.4s ease-out infinite;
}

.status.down {
  color: var(--bad);
}

.status.down .dot {
  background: var(--bad);
  opacity: 1;
}

@keyframes beat {
  0% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  70%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
}

.go svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms var(--ease);
}

.app:hover .go {
  color: var(--ink);
}

.app:hover .go svg {
  transform: translateX(2px);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace;
  color: var(--ink-2);
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
}

/* previews: the only place with color */
.preview {
  height: 220px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  background: var(--t-bg);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  overflow: hidden;
}

.accent {
  color: var(--t-ink);
}

.sheet {
  background: var(--paper);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--sheet-shadow);
}

.sheet-head,
.slip-row,
.slip-total,
.call-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sheet-head {
  font-weight: 500;
  margin-bottom: 6px;
}

/* payslip */
.slip {
  transform: rotate(-1.5deg);
}

.slip-row {
  color: var(--ink-2);
  line-height: 20px;
}

.slip-total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line-strong);
  font-weight: 500;
}

.meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.meter-bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

.meter-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--t-ink);
  opacity: 0.18;
}

.meter-bar span {
  position: relative;
  display: block;
  height: 100%;
  background: var(--t-ink);
  border-radius: 2px;
}

/* call */
.score {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--t-ink);
  color: var(--t-ink);
  font-size: 11px;
}

.wave {
  display: block;
  width: 100%;
  height: 40px;
}

.wave rect {
  fill: var(--ink-3);
  opacity: 0.35;
}

.wave rect.played,
.wave rect.head {
  fill: var(--t-ink);
  opacity: 1;
}

.call-meta {
  margin-top: 6px;
  font-size: 11px;
}

.checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 11px;
}

.check::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.check.ok::before {
  background: var(--t-ink);
}

.check.miss::before {
  background: var(--bad);
}

/* pipeline */
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lane-head {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  padding: 0 2px 2px;
}

.deal {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}

.deal > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal.ghost {
  background: transparent;
  box-shadow: none;
  border: 1px dashed var(--line-strong);
}

.deal.won {
  box-shadow: inset 0 0 0 1px var(--t-ink), var(--sheet-shadow);
}

/* window: the generic preview for new tools */
.window {
  padding: 0 0 16px;
  overflow: hidden;
}

.window-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.window-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.window-title {
  padding: 12px 16px 8px;
  font-weight: 500;
}

.window-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.window-lines span {
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
}

.window-lines .accent-line {
  background: var(--t-ink);
}

/* footer */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
}

.foot kbd {
  margin: 0 2px;
}

/* tablet */
@media (max-width: 960px) {
  .apps,
  .apps-2,
  .apps-4 {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }

  .preview {
    height: 200px;
  }
}

/* phone */
@media (max-width: 600px) {
  .page {
    padding: 0 16px;
  }

  .top {
    height: 64px;
  }

  .clocks {
    gap: 12px;
    font-size: 12px;
  }

  .clock-city {
    display: none;
  }

  .clock-short {
    display: inline;
  }

  main {
    justify-content: flex-start;
    padding: 24px 0 40px;
  }

  h1 {
    font-size: 30px;
  }

  .intro {
    margin-bottom: 24px;
  }

  .intro p {
    font-size: 15px;
  }

  .apps {
    gap: 16px;
  }

  .preview {
    height: auto;
    min-height: 180px;
    padding: 20px;
  }

  .app-body {
    padding: 16px 20px;
  }

  .foot .muted {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.mark .mark-dot {
  stroke: var(--bg);
  stroke-width: 1.5;
}
