/* Chicago Builds Portal V5.1 — Certificate × Desk */
:root {
  --ink: #0d130f;
  --ink-raised: #141c16;
  --ink-rule: #26332b;
  --currency-green: #1c4a33;
  --seal: #10301f;
  --phosphor: #8fc9a8;
  --live: #52d68f;
  --paper: #f1ede0;
  --paper-raised: #f8f5ec;
  --paper-rule: #d8d1bd;
  --steel: #5e6a60;
  --brass: #8a6d2f;
  --brass-ink: #b99a52;
  --ledger-red: #8c3a2e;
  --dur-micro: 120ms;
  --dur-ui: 220ms;
  --dur-page: 320ms;
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --font-display: "Besley", Georgia, serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: var(--currency-green); text-decoration: none; }
a:hover { color: var(--seal); }

.hidden { display: none !important; }

/* ——— Motion ——— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.card-enter {
  animation: cardEnter var(--dur-page) var(--ease-enter) both;
}
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-enter {
  animation: pageEnter var(--dur-page) var(--ease-enter) both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.is-entering-row {
  animation: rowIn var(--dur-ui) var(--ease-enter) both;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-press { transform: scale(0.98); transition: transform var(--dur-micro) var(--ease-exit); }
.validation-draw::after {
  content: "";
  position: absolute;
  left: 0; top: 0; height: 2px;
  width: 100%;
  background: var(--phosphor);
  transform: scaleX(0);
  transform-origin: left;
  animation: drawLine 280ms var(--ease-enter) forwards;
}
@keyframes drawLine {
  to { transform: scaleX(1); }
}
.error-shake {
  animation: shake 200ms var(--ease-exit);
  border-color: var(--ledger-red) !important;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ——— Login ——— */
#view-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
#view-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(16, 48, 31, 0.03) 3px,
      rgba(16, 48, 31, 0.03) 4px
    );
  pointer-events: none;
}
.login-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
  position: relative;
  z-index: 1;
}
.login-card {
  width: min(420px, 100%);
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink-rule);
  border-radius: 2px;
  padding: 28px 28px 24px;
  position: relative;
  box-shadow: 0 18px 48px rgba(13, 19, 15, 0.22);
  overflow: hidden;
}
.login-card .skyline {
  position: absolute;
  right: -8%;
  top: 0;
  width: 58%;
  height: 42%;
  object-fit: cover;
  opacity: 0.28;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 20%, transparent 100%);
}
.login-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--steel);
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}
.login-top .private {
  color: var(--phosphor);
  display: flex;
  align-items: center;
  gap: 6px;
}
.login-top .private::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor);
}
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--ink-rule);
  color: var(--phosphor);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.login-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 7vw, 40px);
  line-height: 1.02;
  margin: 0 0 18px;
  position: relative;
  z-index: 1;
}
.login-title .line2 { color: var(--phosphor); }

.facts {
  border-top: 1px solid var(--ink-rule);
  border-bottom: 1px solid var(--ink-rule);
  margin: 0 0 20px;
  position: relative;
  z-index: 1;
}
.fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(38, 51, 43, 0.85);
  font-size: 12px;
}
.fact:last-child { border-bottom: 0; }
.fact .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--steel);
  text-transform: uppercase;
}
.fact .v {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--paper);
  text-align: right;
}
.fact .v.accent { color: var(--phosphor); }
.check-amt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--brass-ink);
  text-align: center;
  margin: 12px 0 18px;
  position: relative;
  z-index: 1;
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--steel);
  text-transform: uppercase;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.field {
  width: 100%;
  background: var(--ink-raised);
  border: 1px solid var(--ink-rule);
  border-radius: 2px;
  color: var(--paper);
  padding: 14px 14px;
  outline: none;
  transition: border-color var(--dur-micro) var(--ease-enter);
  position: relative;
  z-index: 1;
  letter-spacing: 0.2em;
}
.field:focus { border-color: var(--phosphor); }
.field-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #e08a7a;
  margin: 10px 0 0;
  min-height: 16px;
  position: relative;
  z-index: 1;
}

.btn-primary {
  width: 100%;
  margin-top: 16px;
  background: var(--phosphor);
  color: var(--ink);
  border: 0;
  border-radius: 2px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter var(--dur-micro) var(--ease-enter), transform var(--dur-micro) var(--ease-exit);
  position: relative;
  z-index: 1;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(0.98); }

.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--steel);
  position: relative;
  z-index: 1;
}
.login-foot a { color: var(--brass-ink); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; }
.sheet-foot {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(94, 106, 96, 0.75);
  text-align: center;
  padding: 0 16px 20px;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ——— App shell ——— */
#view-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.app-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid var(--ink-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  min-height: 56px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.brand b { color: var(--phosphor); font-weight: 600; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-links a {
  color: rgba(241, 237, 224, 0.62);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 18px 10px;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-micro), border-color var(--dur-ui) var(--ease-enter);
}
.nav-links a:hover { color: var(--paper); }
.nav-links a.nav-active {
  color: var(--paper);
  border-bottom-color: var(--phosphor);
}
.nav-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--steel);
  white-space: nowrap;
}
.nav-meta .conf { color: var(--brass-ink); margin-right: 10px; }

.app-main {
  flex: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 28px 20px 64px;
}
.page-foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--paper-rule);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--steel);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ——— Typography helpers ——— */
.kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 8px;
}
h1.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.02;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
h1.display .phos { color: var(--currency-green); }
.sub {
  color: var(--steel);
  max-width: 52ch;
  margin: 0 0 28px;
  font-size: 15px;
}
.section-rule {
  border: 0;
  border-top: 3px double var(--paper-rule);
  margin: 0 0 20px;
}

/* ——— Home ——— */
.home-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.85fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .mobile-nav { display: flex !important; }
}
.mobile-nav {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: var(--ink);
  border-top: 1px solid var(--ink-rule);
  justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.mobile-nav a {
  color: rgba(241, 237, 224, 0.55);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 4px;
  text-align: center;
}
.mobile-nav a.nav-active { color: var(--phosphor); }

.panel {
  background: var(--paper-raised);
  border: 1px solid var(--paper-rule);
  border-radius: 2px;
  padding: 16px;
}
.panel h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 12px;
  font-weight: 500;
}

.tape-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
}
.tape {
  border-top: 1px solid var(--paper-rule);
}
.tape-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 8px;
  border-bottom: 1px solid var(--paper-rule);
  font-size: 13px;
}
.tape-row .t {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--steel);
  white-space: nowrap;
}
.tape-row .title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.tape-row .short { color: var(--steel); font-size: 12px; margin-top: 2px; }
.tape-row.is-current {
  background: var(--ink);
  color: var(--paper);
  border-left: 3px solid var(--phosphor);
  margin: 0 -8px;
  padding-left: 13px;
  padding-right: 8px;
}
.tape-row.is-current .t,
.tape-row.is-current .short { color: rgba(241, 237, 224, 0.55); }
.tape-row.is-done { opacity: 0.55; }
.chip {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--paper-rule);
  color: var(--steel);
  padding: 4px 8px;
  border-radius: 2px;
  white-space: nowrap;
}
.tape-row.is-current .chip {
  background: var(--phosphor);
  color: var(--ink);
  border-color: var(--phosphor);
}
.chip.next {
  border-color: var(--currency-green);
  color: var(--currency-green);
}
.chip.evening {
  border-style: dashed;
  color: var(--brass);
  border-color: var(--brass);
}

.stage-card .time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--steel);
  letter-spacing: 0.08em;
}
.stage-card .stitle {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  margin: 8px 0;
  line-height: 1.15;
}
.stage-card .people { color: var(--steel); font-size: 13px; margin-bottom: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-ghost, .btn-fill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 10px 12px;
  cursor: pointer;
  border: 1px solid var(--paper-rule);
  background: transparent;
  color: var(--ink);
}
.btn-fill {
  background: var(--currency-green);
  border-color: var(--currency-green);
  color: var(--paper);
}
.btn-ghost:hover { border-color: var(--currency-green); }

.search-inline {
  width: 100%;
  margin-top: 14px;
  background: var(--paper);
  border: 1px solid var(--paper-rule);
  border-radius: 2px;
  padding: 12px 14px;
  outline: none;
}
.search-inline:focus { border-color: var(--currency-green); }

.interview-mini {
  list-style: none;
  margin: 0;
  padding: 0;
}
.interview-mini li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--paper-rule);
  font-size: 13px;
}
.interview-mini .who { font-family: var(--font-display); font-weight: 700; }
.interview-mini .blurb { color: var(--steel); font-size: 12px; text-align: right; }

.partner-strip {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--paper-rule);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--steel);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.partner-strip strong { color: var(--ink); font-weight: 600; }

/* ——— Who's going ——— */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.filter-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--paper-rule);
  background: transparent;
  color: var(--steel);
  padding: 8px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--dur-ui), color var(--dur-ui), border-color var(--dur-ui);
}
.filter-chip.chip-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--phosphor);
}
.filter-chip:active { transform: scale(0.98); }
.shown-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brass);
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.ledger {
  border-top: 1px solid var(--paper-rule);
}
.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--paper-rule);
  min-height: 44px;
}
.ledger-row:hover { background: rgba(248, 245, 236, 0.9); }
.ledger-row .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.ledger-row .co { color: var(--steel); font-weight: 400; }
.tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--paper-rule);
  color: var(--currency-green);
  padding: 4px 8px;
  border-radius: 2px;
}
.li-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--steel);
  text-transform: uppercase;
}
.li-link:hover { color: var(--currency-green); }
.empty {
  padding: 32px 8px;
  color: var(--steel);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* ——— Schedule ——— */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--paper-rule);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 18px;
}
.view-toggle button {
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--steel);
}
.view-toggle button.on {
  background: var(--ink);
  color: var(--phosphor);
}
.tl-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 16px;
  padding: 16px 8px;
  border-bottom: 1px solid var(--paper-rule);
}
.tl-row.is-current {
  background: var(--ink);
  color: var(--paper);
  border-left: 3px solid var(--phosphor);
}
.tl-row.is-current .meta,
.tl-row.is-current .desc { color: rgba(241, 237, 224, 0.6); }
.tl-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--steel);
}
.tl-row.is-current .tl-time { color: var(--phosphor); }
.tl-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  margin: 0 0 6px;
}
.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--steel);
  margin-bottom: 4px;
}
.desc { font-size: 13px; color: var(--steel); }
.phase {
  margin: 0 0 22px;
}
.phase-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 3px double var(--paper-rule);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.phase-h h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0;
}
.phase-h span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--steel);
}

/* ——— Partners / Interviews ——— */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.wall-cell {
  border: 1px solid var(--paper-rule);
  background: var(--paper-raised);
  padding: 18px 14px;
  border-radius: 2px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--dur-micro);
}
.wall-cell:hover { border-color: var(--currency-green); }
.wall-cell .pn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
}
.wall-cell .pw {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--steel);
  text-transform: uppercase;
  margin-top: 12px;
}
.iv-card {
  border-top: 3px double var(--paper-rule);
  border-left: 1px solid var(--paper-rule);
  border-right: 1px solid var(--paper-rule);
  border-bottom: 1px solid var(--paper-rule);
  padding: 18px 16px;
  margin-bottom: 12px;
  background: var(--paper-raised);
  transition: border-top-color var(--dur-ui);
}
.iv-card:hover { border-top-color: var(--currency-green); }
.iv-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--brass);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.iv-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  margin: 0 0 6px;
}
.iv-blurb { color: var(--steel); margin: 0 0 12px; }
.iv-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--currency-green);
  position: relative;
  display: inline-block;
}
.iv-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  height: 1px; width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms var(--ease-enter);
}
.iv-card:hover .iv-link::after { transform: scaleX(1); }

@media (max-width: 640px) {
  .tape-row { grid-template-columns: 72px 1fr; }
  .tape-row .chip { grid-column: 2; justify-self: start; }
  .tl-row { grid-template-columns: 1fr; gap: 6px; }
  .ledger-row { grid-template-columns: 1fr auto; }
  .ledger-row .li-link { grid-column: 2; grid-row: 1; }
  .ledger-row .tag { grid-column: 1; }
  .app-nav { padding: 10px 14px; min-height: auto; flex-wrap: wrap; }
  .nav-meta .conf { display: none; }
}
