/* ==========================================================================
   getkildaris.com: Hours Back, in the shared Kildaris system (system.css +
   lander.css). This file adds the site's light (cyan led), the calculator and
   office floor in the hero panel, the job and seat cards, and the CFO report.
   ========================================================================== */

:root {
  --accent-a: #67e8f9;
  --accent-b: #22d3ee;
  --accent-c: #a78bfa;
  --cy: #22d3ee;
  --cy-hi: #67e8f9;
  --vi: #a78bfa;
  --mg: #f0abfc;
}

/* --- hero panel: calculator beside the office floor ---------------------- */

.hb-panel { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(1rem, 3vw, 2.5rem); align-items: stretch; }
.hb-calc {
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(14px, 2vw, 22px);
  border-radius: 22px;
  background: rgba(5, 6, 10, 0.42);
  border: 1px solid var(--edge);
}
.hb-ptitle { font-family: var(--display); font-weight: var(--display-weight); font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1.1; }
.hb-field { display: flex; flex-direction: column; gap: 10px; }
.hb-field label, .hb-flabel { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.94rem; color: var(--ink); }
.hb-flabel { display: block; }
.hb-flabel span { color: var(--ink-3); }
.hb-field output { color: var(--cy-hi); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }

.hb-field input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
  --pct: 50%;
}
.hb-field input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--cy-hi), var(--vi) var(--pct), rgba(236, 238, 245, 0.14) var(--pct));
}
.hb-field input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(236, 238, 245, 0.14); }
.hb-field input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--cy); }
.hb-field input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, #fff, var(--cy-hi) 45%, var(--vi));
  border: 3px solid #05060a; box-shadow: 0 0 0 1px rgba(165, 243, 252, 0.6), 0 0 18px rgba(103, 232, 249, 0.6);
}
.hb-field input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--cy-hi); border: 3px solid #05060a;
  box-shadow: 0 0 0 1px var(--cy);
}

.hb-plats { display: flex; flex-wrap: wrap; gap: 8px; }
.plat {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font: 400 0.9rem var(--sans); color: var(--ink-2);
  background: rgba(236, 238, 245, 0.03); border: 1px solid var(--edge-2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s;
}
.plat:hover { border-color: rgba(165, 243, 252, 0.5); color: var(--ink); }
.plat[aria-pressed=true] {
  color: #05060a; border-color: transparent;
  background: linear-gradient(135deg, #cffafe, var(--cy-hi));
  box-shadow: 0 0 24px -6px rgba(103, 232, 249, 0.7);
}

.hb-out { display: flex; gap: 32px; padding-top: 16px; border-top: 1px solid var(--edge); flex-wrap: wrap; }
.hb-out > div { display: flex; flex-direction: column; gap: 4px; }
.hb-out .k { font-size: 0.8rem; color: var(--ink-3); }
.hb-out .v {
  font-family: var(--display); font-weight: var(--display-weight);
  font-size: clamp(2.6rem, 1.8rem + 2.4vw, 3.8rem); letter-spacing: -0.035em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hb-out .v.c { color: var(--cy-hi); text-shadow: 0 0 40px rgba(103, 232, 249, 0.35); }
.hb-out .v.m {
  background: linear-gradient(100deg, var(--vi), var(--mg));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-block: 0.2em; margin-block: -0.2em;
}
.hb-math { font-size: 0.78rem; line-height: 1.55; color: var(--ink-3); }
.hb-math a { color: var(--cy-hi); text-decoration: underline; text-underline-offset: 2px; }

/* --- the office floor ------------------------------------------------------ */

.hb-viz { position: relative; display: flex; flex-direction: column; min-height: 520px; }
.hb-stage { flex: 1; display: flex; align-items: center; justify-content: center; perspective: 1600px; }
.hb-floor {
  --cell: 40px; --gap: 12px;
  display: grid; grid-template-columns: repeat(10, var(--cell)); gap: var(--gap);
  transform: rotateX(56deg) rotateZ(-42deg);
  transform-style: preserve-3d;
}
.desk {
  position: relative; width: var(--cell); height: var(--cell); border-radius: 7px;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease), opacity 0.4s;
}
.desk.free { background: rgba(34, 211, 238, 0.14); border: 1px solid var(--cy-hi); animation: hum 3s ease-in-out infinite; }
.desk.busy { background: rgba(167, 139, 250, 0.12); border: 1px solid rgba(167, 139, 250, 0.45); }
.desk.seat { background: rgba(236, 238, 245, 0.02); border: 1px dashed rgba(240, 171, 252, 0.45); }
.desk.flash { animation: flash 0.7s ease-out; }
.desk .tag {
  position: absolute; left: 2px; top: -6px;
  font: 500 10px/1 var(--mono); white-space: nowrap; pointer-events: none;
  animation: rise 4.5s ease-out infinite;
}
.desk.free .tag { color: #cffafe; }
.desk.seat .tag { color: var(--mg); }
@keyframes hum {
  0%, 100% { box-shadow: 0 0 14px rgba(103, 232, 249, 0.5), inset 0 0 8px rgba(103, 232, 249, 0.5); }
  50%      { box-shadow: 0 0 26px rgba(103, 232, 249, 0.85), inset 0 0 12px rgba(103, 232, 249, 0.8); }
}
@keyframes rise {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-46px); opacity: 0; }
}
@keyframes flash { 0% { background: #cffafe; box-shadow: 0 0 40px rgba(165, 243, 252, 0.95); } }

.hb-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; font-size: 0.8rem; color: var(--ink-2); padding-bottom: 6px; }
.hb-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.free { background: rgba(34, 211, 238, 0.2); border: 1px solid var(--cy-hi); }
.sw.busy { background: rgba(167, 139, 250, 0.14); border: 1px solid rgba(167, 139, 250, 0.5); }
.sw.seat { border: 1px dashed rgba(240, 171, 252, 0.6); }

/* --- job and seat cards ------------------------------------------------------ */

.jobs, .seats { list-style: none; margin: 0; padding: 0; }
.seats { margin-top: 16px; }
.job-i, .seat-i { width: 34px; height: 34px; border-radius: 8px; margin-bottom: 0.4rem; flex: none; }
.job-i { background: rgba(34, 211, 238, 0.14); border: 1px solid var(--cy-hi); box-shadow: 0 0 18px rgba(103, 232, 249, 0.45), inset 0 0 8px rgba(103, 232, 249, 0.5); }
.seat-i { border: 1px dashed rgba(240, 171, 252, 0.6); background: rgba(240, 171, 252, 0.05); }
.job h3, .seatc h3 { font-size: clamp(1.3rem, 1.1rem + 0.5vw, 1.55rem); }
.hb-aside { margin: 26px auto 0; text-align: center; font-size: 0.95rem; color: var(--ink-3); }
.hb-aside::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: var(--cy-hi); box-shadow: 0 0 10px var(--cy-hi); vertical-align: 1px; }

.hb-src { margin-top: 16px; padding: 1.2rem 1.5rem; border-radius: 20px; font-size: 0.82rem; line-height: 1.6; color: var(--ink-3); scroll-margin-top: calc(var(--hdr-h) + 20px); }
.hb-src p { color: var(--ink-2); }
.hb-src ul { margin: 6px 0 0; padding-left: 18px; }
.hb-src li + li { margin-top: 4px; }

/* --- CFO report pop-up ------------------------------------------------------- */

.cfo-back {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px;
  background: rgba(3, 4, 7, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.cfo-back[hidden] { display: none; }
.cfo-back.open { opacity: 1; }
.cfo {
  position: relative; width: min(1060px, 100%); max-height: calc(100dvh - 48px); overflow: auto;
  display: flex; border-radius: 28px; background: var(--glass);
  border: 1px solid var(--edge-2);
  box-shadow: 0 50px 140px rgba(0, 0, 0, 0.7), 0 0 90px -30px rgba(103, 232, 249, 0.35);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  transform: translateY(18px) scale(0.97); filter: blur(6px);
  transition: transform 0.52s var(--ease-out), filter 0.52s var(--ease-out);
}
.cfo-back.open .cfo { transform: none; filter: none; }
.cfo-side { position: relative; width: 450px; flex: none; padding: 40px; display: flex; flex-direction: column; align-items: flex-start; }
.cfo-side h2 { margin-top: 16px; font-size: clamp(2rem, 1.6rem + 1.2vw, 2.6rem); line-height: 1.02; max-width: 14ch; }
.cfo-side > p { margin-top: 14px; font-size: 0.95rem; line-height: 1.6; color: var(--ink-2); font-weight: 300; }
.cfo-fields { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; width: 100%; }
.cfo-acts { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.cfo-acts #cfo-mail { flex: 1 1 100%; justify-content: center; }
.cfo-acts .ghost { flex: 1; justify-content: center; }
.cfo-note { margin-top: 14px; font-size: 0.82rem; color: var(--ink-3); }
.cfo-paper-wrap {
  flex: 1; padding: 34px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(500px 400px at 60% 40%, rgba(167, 139, 250, 0.18), transparent 70%), rgba(5, 6, 10, 0.5);
  border-left: 1px solid var(--edge);
}
.cfo-paper {
  width: 440px; max-width: 100%; min-height: 600px; padding: 34px 36px; border-radius: 8px;
  background: #fbfcff; color: #0b1220; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform: rotate(-1.5deg); display: flex; flex-direction: column; font-family: var(--sans);
}
.cfo-paper header, .cfo-paper footer { display: flex; justify-content: space-between; gap: 12px; font: 10px/1.4 var(--mono); color: #5b6577; }
.cfo-paper .pm { display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.32em; font-weight: 500; color: #0b1220; }
.cfo-paper .pm i { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 40% 38%, #67e8f9, #22d3ee 58%, #a855f7); }
.cfo-paper .pto { margin-top: 22px; font-size: 11px; color: #5b6577; }
.cfo-paper .phead { margin-top: 8px; font-family: var(--display); font-weight: var(--display-weight); font-size: 27px; line-height: 1.1; letter-spacing: -0.02em; }
.ptiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.ptiles > div { padding: 12px; border-radius: 8px; background: #eef9fc; display: flex; flex-direction: column; gap: 2px; }
.ptiles > div.m { background: #f7eefe; }
.ptiles b { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ptiles .m b { color: #9333ea; }
.ptiles span { font-size: 10px; color: #5b6577; }
.cfo-paper .psub { margin: 22px 0 8px; font-size: 12px; font-weight: 600; }
.cfo-paper ol { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.7; color: #2b3446; }
.cfo-paper footer { margin-top: auto; padding-top: 14px; border-top: 1px solid #e3e8f0; }
.cfo-toast {
  position: fixed; right: 32px; bottom: 32px; max-width: 360px; padding: 16px 20px 16px 44px;
  border-radius: 18px; background: var(--glass); border: 1px solid rgba(165, 243, 252, 0.35);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); font-size: 0.94rem; line-height: 1.5;
  opacity: 0; transform: translateY(24px); transition: opacity 0.3s, transform 0.4s var(--ease); pointer-events: none;
}
.cfo-toast::before { content: ""; position: absolute; left: 20px; top: 23px; width: 9px; height: 9px; border-radius: 50%; background: var(--cy-hi); box-shadow: 0 0 12px var(--cy-hi); }
.cfo-toast.show { opacity: 1; transform: none; }
body.cfo-open { overflow: hidden; }

/* --- responsive -------------------------------------------------------------- */

@media (max-width: 1100px) {
  .hb-floor { --cell: 32px; --gap: 10px; }
}
@media (max-width: 980px) {
  .hb-panel { grid-template-columns: minmax(0, 1fr); }
  .hb-viz { order: -1; min-height: 0; }
  .hb-stage { height: 300px; }
  .hb-floor { --cell: 26px; --gap: 8px; }
  .cfo { flex-direction: column; }
  .cfo-side { width: auto; }
  .cfo-paper-wrap { padding: 24px 20px 32px; border-left: 0; border-top: 1px solid var(--edge); }
}
@media (max-width: 640px) {
  .hb-stage { height: 210px; }
  .hb-floor { --cell: 19px; --gap: 6px; }
  .desk .tag { font-size: 8px; }
  .hb-legend { font-size: 0.72rem; gap: 6px 12px; }
  .sw { width: 10px; height: 10px; }
  .hb-out { gap: 22px; }
  .cfo-back { padding: 0; place-items: stretch; }
  .cfo { max-height: 100dvh; border-radius: 0; }
  .cfo-side { padding: 28px 22px; }
  .cfo-side h2 { padding-right: 52px; }
  .cfo-paper { min-height: 0; padding: 24px 22px; transform: none; }
  .cfo-paper .phead { font-size: 21px; }
  .ptiles b { font-size: 17px; }
  .cfo-toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* --- print: the report is the only thing on the page ----------------------- */

@media print {
  body.printing-report > *:not(.cfo-back) { display: none !important; }
  body.printing-report .cfo-back { position: static; display: block; background: none; padding: 0; backdrop-filter: none; opacity: 1; }
  body.printing-report .cfo { display: block; border: 0; box-shadow: none; background: none; max-height: none; overflow: visible; transform: none; filter: none; }
  body.printing-report .cfo-side, body.printing-report .cfo-toast { display: none; }
  body.printing-report .cfo-paper-wrap { padding: 0; background: none; display: block; border: 0; }
  body.printing-report .cfo-paper { width: auto; min-height: 0; transform: none; box-shadow: none; padding: 0.4in; }
  @page { margin: 0.5in; }
}
