/* Casken Travaux — vision demo. Tokens mirror platform/portal/src/core/design/tokens.css exactly. */
@import url("https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@400,500,700,800&display=swap");

:root, :root[data-theme="dark"] {
  --bg:          #15161A;
  --surface:     #1C1D22;
  --surface-deep:#21232A;
  --fg:          #F4F1EA;
  --fg-dim:      rgba(244, 241, 234, 0.70);
  --fg-more:     rgba(244, 241, 234, 0.50);
  --fg-ghost:    rgba(244, 241, 234, 0.16);
  --border:      rgba(244, 241, 234, 0.12);
  --border-soft: rgba(244, 241, 234, 0.06);
  --brass:       #C8A372;
  --brass-pale:  rgba(200, 163, 114, 0.18);
  --green:       #7FB58F;
  --red:         #D87968;
  --brass-text:  #C8A372;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
}
:root[data-theme="light"] {
  --bg:          #F4F1EA;
  --surface:     #ECE7DA;
  --surface-deep:#E0DBC9;
  --fg:          #15161A;
  --fg-dim:      rgba(21, 22, 26, 0.66);
  --fg-more:     rgba(21, 22, 26, 0.56);
  --fg-ghost:    rgba(21, 22, 26, 0.18);
  --border:      rgba(21, 22, 26, 0.16);
  --border-soft: rgba(21, 22, 26, 0.08);
  --brass:       #A88558;
  --brass-pale:  rgba(168, 133, 88, 0.18);
  --green:       #3D7A4A;
  --red:         #9B3A2E;
  --brass-text:  #7A5C38;
  --shadow: 0 18px 50px rgba(21,22,26,.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}
.ff-display { font-family: "Cabinet Grotesk", system-ui, sans-serif; }
.mono { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--surface-deep);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--brass); outline-offset: 2px;
}
::placeholder { color: var(--fg-more); }

/* atmosphere: faint grain + brass glow */
.grain::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .05; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}
.glow { position: fixed; width: 60vmax; height: 60vmax; border-radius: 50%;
  background: radial-gradient(circle, var(--brass-pale), transparent 60%);
  top: -30vmax; right: -20vmax; pointer-events: none; z-index: 0; filter: blur(20px); }

.app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }

/* ─ shared chrome ─ */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); z-index: 40;
}
.logo { height: 26px; display: block; }
.logo img { height: 100%; display: block; }
.topbar .spacer { flex: 1; }
.pill {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--fg-dim); font-size: 13.5px; letter-spacing: .02em; white-space: nowrap;
  transition: all .2s ease;
}
.pill:hover { border-color: var(--brass); color: var(--fg); }
.pill.active { background: var(--brass); border-color: var(--brass); color: #15161A; font-weight: 600; }
.pill.ghost { border-style: dashed; opacity: .65; cursor: default; }
.demo-badge {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brass-text); border: 1px solid var(--brass-pale);
  background: var(--brass-pale); padding: 4px 10px; border-radius: 6px; white-space: nowrap;
}
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 16px; transition: all .2s ease; }
.iconbtn:hover { border-color: var(--brass); }
.nav-links { display: flex; gap: 6px; }
@media (max-width: 899px) { .nav-links { display: none; } .topbar { padding: 12px 14px; gap: 8px; } }
.demo-badge .bs { display: none; }
@media (max-width: 640px) {
  .demo-badge .bl { display: none; }
  .demo-badge .bs { display: inline; }
  .topbar { gap: 6px; }
  .pill { padding: 9px 12px; font-size: 12.5px; min-height: 40px; display: inline-flex; align-items: center; }
  .iconbtn { width: 40px; height: 40px; }
  .logo { height: 22px; }
}

/* ─ landing / vision ─ */
.vision { max-width: 1080px; margin: 0 auto; padding: 8vh 24px 80px; }
.kicker { color: var(--brass-text); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; margin: 0 0 18px; }
.vision h1 { font-family: "Cabinet Grotesk", sans-serif; font-weight: 800;
  font-size: clamp(40px, 7.5vw, 84px); line-height: .98; letter-spacing: -.02em; margin: 0 0 20px; }
.vision .sub { color: var(--fg-dim); font-size: clamp(16px, 2.2vw, 20px); max-width: 640px; margin: 0 0 48px; }
.personas { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 56px; }
.persona {
  text-align: left; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 18px; padding: 26px 24px 22px; position: relative; overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.persona:hover { transform: translateY(-4px); border-color: var(--brass); box-shadow: var(--shadow); }
.persona .num { font-family: "Cabinet Grotesk", sans-serif; font-weight: 800; font-size: 54px;
  color: var(--brass-pale); position: absolute; top: 6px; right: 16px; line-height: 1; -webkit-text-stroke: 1px var(--brass); }
.persona h3 { font-family: "Cabinet Grotesk", sans-serif; font-weight: 700; font-size: 24px; margin: 0 0 6px; }
.persona p { color: var(--fg-dim); font-size: 14.5px; margin: 0 0 18px; min-height: 44px; }
.persona .go { color: var(--brass-text); font-weight: 600; font-size: 14px; letter-spacing: .04em; }
.flowmap { border-left: 2px solid var(--brass-pale); margin-left: 8px; padding-left: 26px; display: grid; gap: 18px; }
.flowstep { position: relative; color: var(--fg-dim); font-size: 15px; max-width: 560px; }
.flowstep::before { content: ""; position: absolute; left: -33px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--brass); }
.reveal { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ─ client view ─ */
.client-wrap { max-width: 1280px; width: 100%; margin: 0 auto; padding: 22px 20px 90px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 22px; }
.controls .search { flex: 1 1 240px; min-width: 200px; }
.controls select { width: auto; min-width: 120px; }
.btn-primary {
  background: var(--brass); color: #15161A; font-weight: 700; border-radius: 12px;
  padding: 11px 18px; letter-spacing: .01em; box-shadow: 0 6px 18px var(--brass-pale);
  transition: transform .15s ease, filter .2s ease;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-quiet { border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; color: var(--fg-dim); }
.btn-quiet:hover { border-color: var(--brass); color: var(--fg); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.seg button { padding: 9px 16px; font-size: 14px; color: var(--fg-dim); }
.seg button.on { background: var(--brass-pale); color: var(--fg); font-weight: 600; }

.group-h { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.group-h h2 { font-family: "Cabinet Grotesk", sans-serif; font-size: 15px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--fg-dim); margin: 0; }
.group-h .count { font-size: 13px; color: var(--brass-text); font-weight: 700; }
.rows { display: grid; gap: 8px; }
.row {
  width: 100%; text-align: left; display: grid; gap: 4px 14px; align-items: center;
  grid-template-columns: auto 1fr auto; grid-template-areas: "chip title meta" "chip sub meta";
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 14px 16px; transition: border-color .2s ease, transform .15s ease;
}
.row:hover { border-color: var(--brass); transform: translateX(3px); }
.row .title { grid-area: title; font-weight: 600; font-size: 15.5px; }
.row .sub { grid-area: sub; color: var(--fg-more); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.row .meta { grid-area: meta; text-align: right; color: var(--fg-more); font-size: 12.5px; display: grid; gap: 4px; justify-items: end; }
.chip { grid-area: chip; width: 10px; height: 44px; border-radius: 6px; }
.chip.emergency { background: var(--red); box-shadow: 0 0 12px var(--red); animation: pulse 1.6s infinite; }
.chip.urgent { background: var(--brass); }
.chip.routine { background: var(--fg-ghost); }
@keyframes pulse { 50% { opacity: .55; } }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--fg-dim); }
.tag.u-emergency { color: var(--red); border-color: var(--red); font-weight: 700; }
.tag.u-urgent { color: var(--brass-text); border-color: var(--brass); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brass-pale);
  color: var(--brass-text); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.mediadot { font-size: 12px; color: var(--fg-more); }

/* board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(228px, 1fr);
  gap: 14px; overflow-x: auto; padding-bottom: 20px; }
.col { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px; padding: 12px; min-height: 300px; }
.col h3 { font-family: "Cabinet Grotesk", sans-serif; font-size: 13px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-dim); margin: 4px 6px 12px; display: flex; justify-content: space-between; }
.card { width: 100%; text-align: left; background: var(--surface-deep); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 12px; margin-bottom: 8px; transition: border-color .2s ease; }
.card:hover { border-color: var(--brass); }
.card .t { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.card .s { color: var(--fg-more); font-size: 12.5px; }

/* detail drawer */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; opacity: 0; animation: fade .25s forwards; }
@keyframes fade { to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg); border-left: 1px solid var(--border); z-index: 61;
  overflow-y: auto; padding: 24px 26px 60px;
  transform: translateX(30px); opacity: 0; animation: slide .3s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes slide { to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .drawer { top: auto; height: 92%; width: 100%; border-left: 0; border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0; transform: translateY(40px); }
}
.drawer .close { position: sticky; top: 0; float: right; z-index: 5; }
.drawer h2 { font-family: "Cabinet Grotesk", sans-serif; font-weight: 700; font-size: 26px; line-height: 1.1; margin: 8px 0 8px; }
.drawer .idline { color: var(--fg-more); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.sect { margin: 26px 0 0; }
.sect h4 { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-text); margin: 0 0 10px; }
.sect p { margin: 0; color: var(--fg-dim); }

/* 4-stage timeline */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 10px 0 6px; }
.tstep { position: relative; text-align: center; padding-top: 26px; font-size: 12px; color: var(--fg-more); }
.tstep::before { content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--fg-ghost); background: var(--bg); z-index: 2; }
.tstep::after { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--fg-ghost); z-index: 1; }
.tstep:first-child::after { display: none; }
.tstep.done { color: var(--fg-dim); }
.tstep.done::before { border-color: var(--brass); background: var(--brass); }
.tstep.done::after { background: var(--brass); }
.tstep.now { color: var(--fg); font-weight: 700; }
.tstep.now::before { border-color: var(--brass); background: var(--bg); box-shadow: 0 0 0 4px var(--brass-pale); animation: pulse 1.8s infinite; }
.tstep.now::after { background: var(--brass); }
.timeline.cancelled .tstep.now::before { border-color: var(--red); box-shadow: 0 0 0 4px rgba(216,121,104,.2); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb { aspect-ratio: 4/3; border-radius: 10px; display: grid; place-items: center; font-size: 26px;
  border: 1px solid var(--border-soft); position: relative; overflow: hidden; }
.thumb small { position: absolute; bottom: 4px; right: 6px; font-size: 9px; color: rgba(255,255,255,.8);
  background: rgba(0,0,0,.4); padding: 1px 5px; border-radius: 4px; }
.feed { display: grid; gap: 0; }
.fitem { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--border-soft); margin-left: 6px; }
.fitem:last-child { padding-bottom: 2px; }
.fitem::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--brass); }
.fitem .when { font-size: 11.5px; color: var(--fg-more); }
.fitem .what { font-size: 14px; color: var(--fg-dim); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px; }
.modal .box { position: relative; z-index: 71; width: min(520px, 100%); background: var(--bg);
  border: 1px solid var(--border); border-radius: 18px; padding: 26px; max-height: 90vh; overflow-y: auto;
  animation: rise .3s cubic-bezier(.2,.7,.2,1); }
.modal h3 { font-family: "Cabinet Grotesk", sans-serif; font-size: 24px; margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--fg-dim); margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ─ tenant flow (light, paper) ─ */
.tenant-shell { min-height: 100%; display: flex; flex-direction: column; align-items: center;
  padding: 0 18px 60px; }
.tbrand { width: 100%; max-width: 560px; padding: 26px 4px 10px; display: flex; align-items: center; gap: 14px; }
.tbrand .mark { width: 44px; height: 44px; border-radius: 12px; background: var(--brass);
  display: grid; place-items: center; font-family: "Cabinet Grotesk", sans-serif; font-weight: 800;
  color: #fff; font-size: 20px; }
.tbrand h1 { font-family: "Cabinet Grotesk", sans-serif; font-size: 19px; margin: 0; line-height: 1.15; }
.tbrand p { margin: 0; color: var(--fg-more); font-size: 13px; }
.tcard { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 22px; padding: 30px 26px; box-shadow: var(--shadow); }
.progress { height: 4px; border-radius: 4px; background: var(--fg-ghost); margin-bottom: 26px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brass); border-radius: 4px; transition: width .4s cubic-bezier(.2,.7,.2,1); }
.tq { font-family: "Cabinet Grotesk", sans-serif; font-weight: 700; font-size: clamp(24px, 5vw, 30px);
  line-height: 1.12; margin: 0 0 8px; }
.thint { color: var(--fg-dim); font-size: 14.5px; margin: 0 0 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { border: 1.5px solid var(--border); border-radius: 14px; padding: 16px 12px; text-align: center;
  display: grid; gap: 6px; justify-items: center; transition: all .18s ease; background: var(--surface-deep); }
.tile:hover { border-color: var(--brass); transform: translateY(-2px); }
.tile.on { border-color: var(--brass); background: var(--brass-pale); font-weight: 600; }
.tile .ic { font-size: 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1.5px solid var(--border); border-radius: 999px; padding: 9px 16px;
  background: var(--surface-deep); transition: all .18s ease; font-size: 14.5px; }
.chips button.on { border-color: var(--brass); background: var(--brass-pale); font-weight: 600; }
.tnav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; gap: 12px; }
.tnav .btn-primary { flex: 1; max-width: 260px; text-align: center; padding: 14px 18px; font-size: 16px; }
.safety { border: 1px solid var(--red); background: color-mix(in srgb, var(--red) 8%, transparent);
  color: var(--fg-dim); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin-top: 14px; }
.upl { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.upl .add { aspect-ratio: 4/3; border: 1.5px dashed var(--border); border-radius: 12px;
  display: grid; place-items: center; gap: 2px; color: var(--fg-dim); font-size: 12.5px; text-align: center;
  transition: all .18s ease; background: var(--surface-deep); }
.upl .add:hover { border-color: var(--brass); color: var(--fg); }
.upl .add .plus { font-size: 22px; color: var(--brass); }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--border);
  border-radius: 14px; background: var(--surface-deep); cursor: pointer; transition: border-color .18s; }
.consent.on { border-color: var(--brass); background: var(--brass-pale); }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brass); flex: none; }
.recap dl { margin: 0; display: grid; gap: 10px; }
.recap dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass-text); }
.recap dd { margin: 2px 0 0; color: var(--fg-dim); font-size: 14.5px; }
.privacy { font-size: 12px; color: var(--fg-more); margin-top: 18px; line-height: 1.5; }
.done-check { width: 84px; height: 84px; margin: 6px auto 18px; border-radius: 50%;
  background: var(--brass); display: grid; place-items: center; animation: pop .5s cubic-bezier(.2,1.4,.3,1); }
.done-check svg { width: 40px; }
.done-check path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .6s .25s ease forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.code-big { font-family: ui-monospace, monospace; font-size: 22px; letter-spacing: .08em;
  background: var(--surface-deep); border: 1px dashed var(--brass); border-radius: 12px;
  padding: 12px 18px; display: inline-block; margin: 8px 0 4px; }
.center { text-align: center; }

/* status page */
.status-updated { color: var(--fg-more); font-size: 13px; margin-bottom: 20px; }
.nextbox { border-left: 3px solid var(--brass); background: var(--brass-pale);
  padding: 12px 16px; border-radius: 0 12px 12px 0; font-size: 14.5px; color: var(--fg-dim); margin: 22px 0; }
.stars { display: flex; gap: 8px; font-size: 30px; }
.stars button { filter: grayscale(1) opacity(.4); transition: all .15s ease; }
.stars button.on, .stars button:hover { filter: none; transform: scale(1.12); }

/* worker */
.worker-shell { max-width: 480px; margin: 0 auto; padding: 24px 18px 70px; }
.wjob { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.wjob .code { color: var(--brass-text); font-family: ui-monospace, monospace; font-size: 13px; letter-spacing: .1em; }
.wjob h2 { font-family: "Cabinet Grotesk", sans-serif; font-size: 26px; margin: 6px 0 4px; line-height: 1.1; }
.wjob .addr { color: var(--fg-dim); margin-bottom: 16px; }
.bigbtn { width: 100%; padding: 16px; border-radius: 14px; font-size: 17px; font-weight: 700;
  border: 1.5px solid var(--border); margin-top: 12px; transition: all .18s ease; background: var(--surface-deep); }
.bigbtn:hover { border-color: var(--brass); }
.bigbtn.yes { background: var(--green); color: #10130f; border-color: transparent; }
.bigbtn.no { }
.bigbtn.ok { background: var(--brass-pale); border-color: var(--brass); color: var(--fg); }
.wnote { text-align: center; color: var(--fg-more); font-size: 13px; margin-top: 16px; }

/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--fg); color: var(--bg); font-weight: 600; font-size: 14.5px;
  padding: 12px 22px; border-radius: 999px; z-index: 90; box-shadow: var(--shadow);
  animation: rise .3s ease, fade-out .4s 2.6s forwards; }
@keyframes fade-out { to { opacity: 0; transform: translate(-50%, 8px); } }

.footer-note { text-align: center; color: var(--fg-more); font-size: 12px; padding: 30px 20px 40px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
