/* CPG Basecamp: black, grey, off-white. Clean, quiet, lots of room. */
:root {
  --bg: #F5F5F3;
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --ink: #111111;
  --ink-2: #1D1D1F;
  --grey: #6E6E73;
  --grey-2: #86868B;
  --line: #E3E3E0;
  --line-2: #D2D2D0;
  --field: #F5F5F3;
  --soft: #EDEDEA;
  --danger: #C4382B;
  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 2px 6px rgba(0,0,0,.04), 0 16px 40px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img { max-width: 100%; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245, 245, 243, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 22px; height: 56px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand .mtn { width: 30px; height: 30px; flex: none; }
.brand .wm { height: 17px; width: auto; display: block; }
.brand .bc { font-size: 10.5px; font-weight: 500; letter-spacing: .32em; color: var(--grey); padding-left: 12px; border-left: 1px solid var(--line-2); line-height: 15px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  color: var(--grey); text-decoration: none; font-weight: 400; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; transition: color .2s;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 600; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 3px 3px 3px 12px;
  border: 0; border-radius: 999px; font-size: 13px; color: var(--grey);
  background: transparent; cursor: pointer;
}
.user-chip:hover { background: rgba(0,0,0,.04); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink);
  color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 11.5px;
}

/* ---------- Layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 40px 22px 96px; }
.narrow { max-width: 720px; margin: 0 auto; }
.eyebrow { color: var(--grey); font-weight: 600; font-size: 13px; margin: 0 0 6px; }
h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.06; margin: 0 0 14px; font-weight: 700; letter-spacing: -0.028em; }
h2 { font-size: 21px; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 17px; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.015em; }
.lede { color: var(--grey); font-size: 19px; line-height: 1.45; margin: 0 0 36px; max-width: 620px; letter-spacing: -0.015em; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--grey); text-decoration: none; font-size: 14px; margin-bottom: 26px; }
.back:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 28px; padding: 64px 56px 72px; margin-bottom: 20px;
  background: #0B0B0B; color: #F5F5F3;
}
.hero svg.ridge { position: absolute; right: 0; bottom: 0; width: 520px; max-width: 75%; pointer-events: none; }
.hero h1, .hero .lede, .hero .eyebrow { position: relative; }
.hero .eyebrow { color: #86868B; }
.hero .lede { color: #A1A1A6; margin-bottom: 0; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink);
  background: var(--surface); border-radius: var(--radius);
  padding: 30px 28px; min-height: 220px; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.tile:hover { transform: scale(1.012); box-shadow: var(--shadow); }
.tile .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; color: var(--ink); margin-bottom: 10px; }
.tile .ico svg { width: 21px; height: 21px; }
.tile h3 { font-size: 21px; letter-spacing: -0.02em; }
.tile p { margin: 0; color: var(--grey); font-size: 15px; line-height: 1.45; }
.tile .go { margin-top: auto; padding-top: 14px; font-size: 15px; font-weight: 500; color: var(--ink); }
.tile.feature { background: var(--ink); color: #F5F5F3; }
.tile.feature p { color: #A1A1A6; }
.tile.feature .go { color: #F5F5F3; }
.tile.feature .ico { background: rgba(255,255,255,.1); color: #F5F5F3; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 64px 0 18px; }
.section-head h2 { font-size: 28px; letter-spacing: -0.025em; }
.section-head a { font-size: 15px; color: var(--grey); text-decoration: none; }
.section-head a:hover { color: var(--ink); }

/* ---------- Cards / forms ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 32px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; }
.span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.req { color: var(--grey-2); font-weight: 400; }
.hint { color: var(--grey); font-size: 13px; margin: 0; line-height: 1.45; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; background: var(--field); border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 13px 14px; outline: none; transition: border-color .2s, background .2s, box-shadow .2s;
  font-size: 16px; color: var(--ink); -webkit-appearance: none; appearance: none; min-height: 48px;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236E6E73' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input::placeholder, textarea::placeholder { color: #A1A1A6; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17,17,17,.06); }
.invalid { border-color: var(--danger) !important; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px;
  padding: 9px 17px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 8px; user-select: none; transition: background .2s, border-color .2s, color .2s;
}
.chip:hover { border-color: var(--grey-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips.big .chip { padding: 12px 20px; font-size: 15px; }
.chips.invalid { width: fit-content; max-width: 100%; outline: 1px solid var(--danger); outline-offset: 6px; border-radius: 14px; }

/* ---------- Dropzone ---------- */
.drop {
  border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 28px 20px;
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s; background: var(--surface-2);
}
.drop:hover, .drop.over { border-color: var(--ink); background: var(--field); }
.drop strong { display: block; font-size: 15px; font-weight: 600; }
.drop span { color: var(--grey); font-size: 13px; }
.drop input { display: none; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 12px; }
.files:empty { display: none; }
.file { position: relative; border-radius: 12px; overflow: hidden; background: var(--soft); aspect-ratio: 1; display: flex; align-items: end; }
.file img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file .meta { position: relative; width: 100%; padding: 6px 8px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .vid { position: absolute; inset: 0; display: grid; place-items: center; color: var(--grey); }
.file .vid + .meta, .file .vid ~ .meta { color: var(--ink); background: none; }
.file .x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.92); border: 0; color: var(--ink); cursor: pointer; font-size: 14px; line-height: 1; }
.file .num { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.file[draggable=true] { cursor: grab; }
.file.target { outline: 2px solid var(--ink); outline-offset: 2px; }
.files-total { font-size: 12.5px; color: var(--grey); }
.files-total:empty { display: none; }
.drop.invalid { border-color: var(--danger); }
.field.spacer { min-height: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  padding: 14px 26px; font-weight: 500; font-size: 16px; cursor: pointer; text-decoration: none;
  transition: background .2s, transform .1s;
}
.btn:hover { background: #2C2C2E; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: rgba(0,0,0,.04); border-color: var(--grey-2); }
.btn.small { padding: 8px 15px; font-size: 13.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.submit-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-top: 28px; }
.submit-bar .hint { max-width: 420px; }

/* ---------- Requests ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters:empty { display: none; }
.req-list { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.req-item { padding: 20px 26px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; border-top: 1px solid var(--line); }
.req-item:first-child { border-top: 0; }
.req-item .t { font-weight: 600; font-size: 17px; letter-spacing: -0.015em; }
.req-item .s { color: var(--grey); font-size: 13.5px; }
.req-item .note { grid-column: 1 / -1; background: var(--field); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-top: 4px; }
.req-item .right { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 4px 11px; border-radius: 999px; white-space: nowrap; background: var(--soft); color: var(--ink-2); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.New { background: var(--ink); color: #fff; }
.pill.In-Progress { background: var(--soft); color: var(--ink); }
.pill.Waiting-on-Agent, .pill.Change-Requested { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pill.Done { background: transparent; color: var(--grey-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.pill.Uploading { background: #FBEDEB; color: var(--danger); }

/* ---------- Library ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.lib-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
.lib-card:hover { transform: scale(1.012); box-shadow: var(--shadow); }
.lib-thumb { aspect-ratio: 16 / 10; background: var(--soft) center / cover no-repeat; display: grid; place-items: center; color: var(--grey-2); }
.lib-thumb svg { width: 32px; height: 32px; }
.lib-body { padding: 18px 22px 22px; }
.lib-body p { margin: 4px 0 0; color: var(--grey); font-size: 14px; }
.lib-cat { font-size: 12px; color: var(--grey); font-weight: 500; margin-bottom: 4px; }

/* ---------- States ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--grey); background: var(--surface); border-radius: var(--radius); }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--grey); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.success { text-align: center; padding: 56px 28px; }
.success .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; margin: 0 auto 22px; }
.success .check svg { width: 30px; height: 30px; color: #fff; }
.success .actions { justify-content: center; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--field); padding: 2px 8px; border-radius: 6px; font-size: 13px; }

/* ---------- Modal / overlay ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.32); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: 24px; padding: 32px; box-shadow: 0 30px 80px rgba(0,0,0,.25); max-height: 90vh; overflow: auto; }
.progress-row { margin: 12px 0; }
.progress-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--grey); }
.progress-row .top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 4px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }
.bar.fail i { background: var(--danger); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 500; font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: calc(100% - 32px); text-align: center; }

.demo-banner { background: var(--ink); color: #D2D2D0; text-align: center; font-size: 12px; padding: 7px 12px; }

footer { color: var(--grey-2); font-size: 12px; text-align: center; padding: 28px 16px 36px; border-top: 1px solid var(--line); max-width: 1080px; margin: 0 auto; }
footer .wm { height: 12px; width: auto; color: var(--grey); display: block; margin: 0 auto 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) {
  .nav { display: none; }
  .user-chip { margin-left: auto; }
  .mobile-nav { display: flex !important; }
  main { padding-bottom: 120px; }
  footer { padding-bottom: 100px; }
}
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: rgba(245,245,243,.86); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(0,0,0,.06); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.mobile-nav a { color: var(--grey-2); text-decoration: none; font-size: 10.5px; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; }
.mobile-nav a svg { width: 22px; height: 22px; }
.mobile-nav a.active { color: var(--ink); }

@media (max-width: 620px) {
  main { padding: 24px 16px 120px; }
  .topbar-inner { padding: 0 16px; }
  .brand .bc { display: none; }
  .hero { padding: 40px 24px 56px; border-radius: 24px; }
  .tiles { grid-template-columns: 1fr; gap: 14px; }
  .tile { min-height: 0; padding: 24px; }
  .card { padding: 22px 18px; border-radius: 20px; }
  .grid { grid-template-columns: 1fr; }
  .field.spacer { display: none; }
  .req-item { grid-template-columns: 1fr; padding: 18px; }
  .req-item .right { justify-content: flex-start; }
  .user-chip .nm { display: none; }
  .submit-bar .btn { width: 100%; }
  .lede { font-size: 17px; }
}
