:root {
  --void: #05060b;
  --ink: #eef0f6;
  --ink-2: #c9cdd8;
  --dim: #8a90a4;
  --line: rgba(255, 255, 255, 0.14);
  --lilac: #b8a6ff;
  --rose: #f0a9da;
  --ice: #a9dbff;
  --warm: #ffd29a;
  --mint: #9bf0c9;
  --glass: rgba(9, 11, 18, 0.46);
  --glass-2: rgba(9, 11, 18, 0.66);
  --chrome: linear-gradient(180deg, #ffffff 0%, #dcdfe8 30%, #8f95a8 50%, #eaedf5 63%, #bfb2f5 100%);
  --bezel: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1) 32%, rgba(184, 166, 255, 0.42) 62%, rgba(255, 255, 255, 0.6));
  --cx: 480px;
  --cy: 170px;
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font: 400 14px/1.45 Manrope, system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 6px; }

/* ---------- the globe, cropped so God's Eye's own chrome falls outside the viewport ---------- */
.globe { position: fixed; inset: 0; overflow: hidden; background: var(--void); }
.globe iframe {
  position: absolute;
  border: 0;
  width: calc(100vw + 2 * var(--cx));
  height: calc(100vh + 2 * var(--cy));
  left: calc(-1 * var(--cx));
  top: calc(-1 * var(--cy));
  opacity: 0;
  background: #000;
  pointer-events: none;
  transition: opacity 1.5s ease;
  transform-origin: 50% 50%;
  filter: brightness(0.58) contrast(1.1) saturate(0.82);
}
.globe iframe.on { opacity: 1; animation: drift 52s ease-in-out infinite alternate; }
.globe::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 92% at 50% 46%, rgba(5, 6, 11, 0.18) 30%, rgba(5, 6, 11, 0.58) 74%, rgba(5, 6, 11, 0.94) 100%),
    linear-gradient(180deg, rgba(5, 6, 11, 0.7), transparent 24%, transparent 66%, rgba(5, 6, 11, 0.82));
  transition: opacity 0.8s ease;
}
.flying .globe::after { opacity: 0.3; }
.flying .globe iframe { pointer-events: auto; animation: none; transform: none; filter: none; }
@keyframes drift {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.045) translate(-0.8%, 0.5%); }
}

/* ---------- bezel: a chrome edge around glass ---------- */
.bz {
  border: 1px solid transparent;
  background: linear-gradient(var(--glass), var(--glass)) padding-box, var(--bezel) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 22px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}
.chrome {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- shell ---------- */
.shell {
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  grid-template-columns: 368px minmax(0, 1fr) 396px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px 22px;
  padding: 26px 34px;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.shell > * { pointer-events: auto; min-width: 0; }
.flying .shell > :not(.stats) { opacity: 0.14; pointer-events: none; }
.flying .stats > :not(.fly) { opacity: 0.14; pointer-events: none; }

/* header */
.top { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.mark { display: flex; flex-direction: column; gap: 4px; }
.mark .word { font: 400 30px/1 'Bodoni Moda', 'Didot', serif; letter-spacing: 0.34em; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5)); }
.mark small { font: 500 11px/1.3 Manrope; letter-spacing: 0.08em; color: var(--dim); }
.nav { display: flex; gap: 2px; padding: 4px; border-radius: 999px; }
.nav button {
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 600 11px/1 Manrope;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease;
}
.nav button:hover { color: #fff; }
.nav button[aria-pressed='true'] {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 14px;
  border-radius: 999px;
  font: 600 11px/1 Manrope;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.status.busy i { background: var(--warm); box-shadow: 0 0 12px var(--warm); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* rail */
.rail { display: flex; flex-direction: column; min-height: 0; border-radius: var(--radius); padding: 16px 12px 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 10px;
  padding: 0 14px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.search svg { flex: none; opacity: 0.7; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 500 13px Manrope; }
.search input::placeholder { color: var(--dim); }
.list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: 2px 4px; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'name value' 'place stage';
  column-gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.row:hover { background: rgba(255, 255, 255, 0.05); }
.row[aria-pressed='true'] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.row .name { grid-area: name; font-weight: 600; font-size: 13.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .place { grid-area: place; font-size: 12px; color: var(--dim); }
.row .value { grid-area: value; font: 400 15px/1.2 'Bodoni Moda', serif; text-align: right; }
.row .st { grid-area: stage; display: inline-flex; align-items: center; gap: 6px; justify-self: end; font-size: 11px; color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--dim); }
.dot[data-stage='Discovery'] { background: var(--ice); }
.dot[data-stage='Scoping'] { background: var(--lilac); }
.dot[data-stage='Proposal'] { background: var(--rose); }
.dot[data-stage='Negotiation'] { background: var(--warm); }
.dot[data-stage='Won'] { background: var(--mint); }
.rail-foot { margin: 10px 8px 2px; font-size: 11px; color: var(--dim); }
.empty { padding: 30px 12px; color: var(--dim); font-size: 13px; text-align: center; }

/* stage (center) */
.stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.hero { position: relative; text-align: center; max-width: 100%; opacity: 0; }
.hero::before {
  content: '';
  position: absolute;
  inset: 10% -10%;
  z-index: -1;
  background: radial-gradient(60% 55% at 50% 50%, rgba(5, 6, 11, 0.62), transparent 100%);
  filter: blur(10px);
}
.hero.land { animation: land 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero.rest { transition: opacity 1.4s ease, transform 1.4s ease; opacity: 0.4; transform: scale(0.9); }
.hero.land.rest { animation: none; }
@keyframes land {
  from { opacity: 0; transform: scale(1.08) translateY(12px); filter: blur(14px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.hero-name {
  margin: 0;
  font: 400 clamp(40px, 6.2vw, 108px)/0.95 'Bodoni Moda', 'Didot', serif;
  letter-spacing: -0.01em;
  filter: drop-shadow(0 14px 40px rgba(0, 0, 0, 0.65));
}
.hero-city { margin: 16px 0 0; font: 600 12px/1 Manrope; letter-spacing: 0.34em; text-transform: uppercase; color: var(--ink-2); }
.view { display: none; width: 100%; height: 100%; min-height: 0; }
.view.on { display: block; }

/* pipeline board */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; height: 100%; min-height: 0; }
.col { display: flex; flex-direction: column; min-height: 0; border-radius: 18px; padding: 12px 10px 10px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.col-head b { display: inline-flex; align-items: center; gap: 7px; font: 600 11px/1 Manrope; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.col-head span { font: 400 15px/1 'Bodoni Moda', serif; }
.col-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.deal {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.deal:hover { background: rgba(255, 255, 255, 0.1); }
.deal[aria-pressed='true'] { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.12); }
.deal .d-name { display: block; font-weight: 600; font-size: 12.5px; color: #fff; }
.deal .d-acct { display: block; margin-top: 2px; font-size: 11.5px; color: var(--dim); }
.deal .d-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--ink-2); }
.deal .d-foot b { font: 400 14px/1 'Bodoni Moda', serif; color: #fff; }

/* people */
.people { width: min(900px, 100%); max-height: 100%; margin: 0 auto; overflow: auto; border-radius: var(--radius); padding: 8px; }
.person {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  text-align: left;
  border-radius: 10px;
}
.person:last-child { border-bottom: 0; }
.person:hover { background: rgba(255, 255, 255, 0.06); }
.person .p-name { font-weight: 600; color: #fff; }
.person .p-role { font-size: 12px; color: var(--dim); }
.person .p-acct { font-size: 13px; color: var(--ink-2); }
.person .p-acct small { display: block; color: var(--dim); font-size: 11.5px; }
.person .p-touch { font-size: 12px; color: var(--dim); white-space: nowrap; }

/* detail */
.detail { display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow: auto; border-radius: var(--radius); padding: 22px 20px; }
.detail h2 { margin: 0; font: 400 26px/1.1 'Bodoni Moda', serif; }
.detail .sub { margin: 6px 0 0; font-size: 12.5px; color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); font: 600 10.5px/1 Manrope; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); }
.sec h3 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font: 600 11px/1 Manrope; letter-spacing: 0.14em; color: var(--dim); }
.dl { display: flex; flex-direction: column; gap: 8px; }
.dl-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; }
.dl-item .t { font-weight: 600; font-size: 13px; color: #fff; }
.dl-item .v { font: 400 16px/1 'Bodoni Moda', serif; }
.dl-item .m { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--dim); }
.bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ice), var(--lilac), var(--rose)); }
.next { padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(184, 166, 255, 0.35); background: rgba(184, 166, 255, 0.08); font-size: 13px; color: #fff; }
.next small { display: block; margin-bottom: 4px; font: 600 10.5px/1 Manrope; letter-spacing: 0.2em; text-transform: uppercase; color: var(--lilac); }
.tl { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tl li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.tl time { color: var(--dim); font-variant-numeric: tabular-nums; }
.pp { display: flex; flex-direction: column; gap: 6px; }
.pp div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.pp b { font-weight: 600; color: #fff; }
.pp span { color: var(--dim); text-align: right; }

/* stats */
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 16px; align-items: stretch; }
.stat { padding: 18px 22px 16px; border-radius: 18px; text-align: center; }
.stat b { display: block; font: 400 clamp(34px, 3.2vw, 46px)/1 'Bodoni Moda', serif; }
.stat span { display: block; margin-top: 9px; font: 600 10.5px/1.3 Manrope; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-2); }
.fly {
  align-self: center;
  padding: 18px 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  color: #0b0c12;
  background: linear-gradient(180deg, #ffffff, #d2d6e2 46%, #b4a8ee);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 4px rgba(255, 255, 255, 0.08), 0 18px 40px rgba(0, 0, 0, 0.5);
  font: 700 11px/1 Manrope;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fly:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 #fff, 0 0 0 6px rgba(255, 255, 255, 0.12), 0 22px 44px rgba(0, 0, 0, 0.55); }
.flying .fly { background: linear-gradient(180deg, #ffe9c2, #ffd29a 50%, #f0a9da); }
.hint {
  position: fixed;
  left: 50%;
  bottom: 118px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  font: 600 11px/1 Manrope;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.flying .hint { opacity: 1; }

/* veil */
#veil { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; background: var(--void); transition: opacity 1.3s ease; }
#veil.off { opacity: 0; pointer-events: none; }
#veil .word { font: 400 42px/1 'Bodoni Moda', serif; letter-spacing: 0.4em; padding-left: 0.4em; }
#veil p { margin: 18px 0 0; font: 600 11px/1 Manrope; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); text-align: center; }
#veil .line { position: relative; width: 220px; height: 1px; margin: 26px auto 0; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
#veil .line::after { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, #fff, transparent); animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- phone ---------- */
@media (max-width: 1000px) {
  :root { --cx: 300px; --cy: 150px; }
  body { overflow: auto; }
  .shell { height: auto; min-height: 100%; grid-template-columns: 1fr; grid-template-rows: auto; gap: 12px; padding: 16px; }
  .top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .mark { flex: 1; }
  .mark .word { font-size: 22px; }
  .status { padding: 9px 12px 9px 10px; font-size: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; }
  .nav button { padding: 10px 14px; letter-spacing: 0.18em; }
  .rail { padding: 10px; }
  .list { flex-direction: row; align-items: flex-start; overflow-x: auto; overflow-y: hidden; gap: 6px; padding: 2px; }
  .row { flex: none; width: 210px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name name' 'place place' 'stage value'; align-content: start; row-gap: 3px; }
  .row .st { justify-self: start; }
  .stage { min-height: 150px; }
  .hero-name { font-size: clamp(30px, 9vw, 48px); }
  .board { grid-template-columns: 1fr; height: auto; }
  .col-list { max-height: 260px; }
  .people { max-height: 60vh; }
  .person { grid-template-columns: 1fr; }
  .detail { max-height: none; overflow: visible; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fly { grid-column: 1 / -1; justify-self: stretch; }
  .hint { bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .globe iframe { transition: none; }
  .globe iframe.on { animation: none; }
  .hero.land { animation: none; opacity: 1; }
  .hero.rest { transition: none; }
  #veil { transition: none; }
}
