/* ==========================================================================
   WorkSim — standalone product stylesheet
   Own identity, recognisably TCC: Instrument Serif / Inter / DM Mono.
   Does not load or modify the global theme.
   ========================================================================== */

:root {
  --canvas: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #fbfbfa;
  --ink: #0a0a0a;
  --muted: #4f4f4f;
  --muted-2: #6b6b6b;
  --line: rgba(0, 0, 0, 0.14);
  --line-soft: rgba(0, 0, 0, 0.07);
  --accent: #0057de;
  --accent-ink: #ffffff;
  --good: #0f7b4f;
  --warn: #a35a00;
  --bad: #b42318;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b0b0c;
    --surface: #141416;
    --surface-2: #18181b;
    --ink: #f4f4f2;
    --muted: #b9b9b4;
    --muted-2: #8e8e88;
    --line: rgba(255, 255, 255, 0.15);
    --line-soft: rgba(255, 255, 255, 0.08);
    --accent: #6f9dff;
    --accent-ink: #08122b;
    --good: #4ad19a;
    --warn: #e0a34a;
    --bad: #ff7a6e;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; }

.brand-mark {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.01em;
}

.brand-div {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.brand-product {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.topnav { display: flex; align-items: center; gap: 20px; }

.topnav-link {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .18s ease;
}
.topnav-link:hover { color: var(--ink); }

/* ---------- layout ---------- */

.app {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 22px 72px;
}

.app.narrow { max-width: 760px; }

.foot {
  border-top: 1px solid var(--line-soft);
  padding: 22px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.foot-sep { opacity: .5; }

/* ---------- typography ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 14px;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.03;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}

.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
  margin: 0;
}

.section-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- hero ---------- */

.hero { padding: 12px 0 44px; }

.hero-rule {
  height: 1px;
  background: var(--line-soft);
  margin: 44px 0 40px;
}

/* ---------- shift cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card.live:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.card.soon { opacity: .55; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.pill.accent { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }

.card-role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0;
}

.card-title {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.12;
  margin: 0;
}

.card-desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  flex: 1;
}

.card-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.card-shift {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.16;
  margin: 0;
}

/* ---------- featured shift ---------- */

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 34px;
  padding: 32px;
  margin-bottom: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.featured-main .eyebrow { margin-bottom: 12px; }

.featured-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 8px 0 14px;
}

.featured-desc {
  font-size: 15.5px;
  color: var(--muted);
  max-width: 54ch;
  margin: 0 0 20px;
}

.featured-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  padding-left: 30px;
  border-left: 1px solid var(--line-soft);
}

.featured-stats { display: flex; flex-direction: column; gap: 14px; }

.stat { display: flex; align-items: baseline; gap: 12px; }

.stat-num {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  min-width: 48px;
}

.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- catalogue + filters ---------- */

.catalog-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.catalog-head .section-title { flex: 1; margin-bottom: 14px; }

.count-note {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  margin: 0 0 14px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.search,
.filter-select {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 42px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.search { flex: 1 1 240px; min-width: 0; }

.search::placeholder { color: var(--muted-2); }

.filter-select {
  flex: 0 1 auto;
  max-width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted-2) 50%),
    linear-gradient(135deg, var(--muted-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.search:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.filter-reset { flex: 0 0 auto; }

.catalog { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

.catalog .card { padding: 18px; gap: 10px; border-radius: var(--r-md); }

.catalog .card-title { font-size: 21px; }

.catalog .card-desc {
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog .empty { grid-column: 1 / -1; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .12s ease, opacity .18s ease;
}

.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.985); }

.btn.primary {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}
.btn.primary:hover { opacity: .88; }

.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.accent:hover { opacity: .9; }

.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line); }

.btn.block { width: 100%; }

.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- shift runner ---------- */

.runner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.runner-title {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}

.runner-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  padding-top: 6px;
}

.progress {
  height: 2px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
  margin: 18px 0 34px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .35s cubic-bezier(.4,0,.2,1);
}

.moment-skill {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.moment-text {
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.5;
  margin: 0 0 32px;
  max-width: 62ch;
}

.options { display: flex; flex-direction: column; gap: 10px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
}

.option:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.option:active { transform: scale(.995); }

.option-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  padding-top: 3px;
  min-width: 14px;
}

.option.picked {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.option:disabled { cursor: default; }
.option:disabled:not(.picked) { opacity: .45; }

/* ---------- feedback ---------- */

.feedback {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  animation: rise .28s ease both;
}

.feedback.good { border-left: 3px solid var(--good); }
.feedback.mid  { border-left: 3px solid var(--warn); }
.feedback.bad  { border-left: 3px solid var(--bad); }

.feedback-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 6px;
}

.feedback-text { margin: 0; font-size: 14.5px; color: var(--ink); }

.runner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- result ---------- */

.result-head {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.ring { position: relative; width: 168px; height: 168px; flex: 0 0 auto; }

.ring svg { transform: rotate(-90deg); display: block; }

.ring-track { stroke: var(--line-soft); }
.ring-fill  { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1); }

.ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-score {
  font-family: var(--serif);
  font-size: 52px;
  line-height: 1;
}

.ring-of {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 4px;
}

.result-copy { flex: 1; min-width: 240px; }

.result-band {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.band-high { color: var(--good); }
.band-mid  { color: var(--warn); }
.band-low  { color: var(--bad); }

.result-title {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.06;
  margin: 0 0 10px;
}

.result-sub { margin: 0; color: var(--muted); font-size: 15px; max-width: 48ch; }

/* skill bars */

.skills { display: flex; flex-direction: column; gap: 16px; }

.skill-row { display: flex; flex-direction: column; gap: 7px; }

.skill-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.skill-name { font-size: 14px; font-weight: 500; }

.skill-val {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
}

.skill-bar {
  height: 5px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

.skill-fill.low { background: var(--bad); }
.skill-fill.mid { background: var(--warn); }

/* timeline */

.timeline { display: flex; flex-direction: column; gap: 0; }

.tl-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: start;
}

.tl-item:last-child { border-bottom: 0; }

.tl-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  padding-top: 2px;
}

.tl-skill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 5px;
}

.tl-choice { font-size: 14.5px; margin: 0 0 5px; }

.tl-note { font-size: 13px; color: var(--muted); margin: 0; }

.tl-pts {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  padding-top: 2px;
}

.pts-hi { color: var(--good); }
.pts-mid { color: var(--warn); }
.pts-lo { color: var(--bad); }

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- states ---------- */

.empty {
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  color: var(--muted);
}

.loading {
  padding: 80px 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.error {
  padding: 22px;
  border: 1px solid var(--bad);
  border-radius: var(--r-md);
  color: var(--bad);
  font-size: 14px;
}

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

@media (max-width: 820px) {
  .featured { grid-template-columns: 1fr; gap: 26px; padding: 26px; }
  .featured-side { padding-left: 0; padding-top: 24px; border-left: 0; border-top: 1px solid var(--line-soft); flex-direction: row; align-items: center; flex-wrap: wrap; }
  .featured-stats { flex-direction: row; gap: 26px; }
}

@media (max-width: 640px) {
  .app { padding: 32px 18px 56px; }
  .topbar { padding: 12px 18px; }
  .topnav { gap: 14px; }
  .topnav-link:first-child { display: none; }
  .result-head { gap: 24px; }
  .ring { width: 132px; height: 132px; }
  .ring svg { width: 132px; height: 132px; }
  .ring-score { font-size: 40px; }
  .tl-item { grid-template-columns: 30px 1fr; }
  .tl-pts { grid-column: 2; padding-top: 0; }
  .option { font-size: 14.5px; padding: 15px 16px; }
  .foot { font-size: 9.5px; }
  .featured { padding: 22px; }
  .featured-stats { gap: 20px; }
  .stat-num { font-size: 26px; min-width: 40px; }
  .filters { gap: 8px; }
  .search { flex: 1 1 100%; }
  .filter-select { flex: 1 1 0; min-width: 0; }
  .filter-reset { flex: 0 0 auto; }
  .catalog { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* iOS Safari zooms the page when a control under 16px is focused. */
@media (max-width: 1024px) {
  .search,
  .filter-select {
    font-size: 16px;
  }
}

/* Touch targets: top bar and every button reach 44px on touch screens. */
@media (max-width: 1024px) {
  .brand,
  .topnav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  button,
  .btn {
    min-height: 44px;
  }
}

/* iPhone notch: keep the top bar inside the safe area in landscape. */
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

@media (max-width: 1024px) {
  .topbar {
    padding-left: max(18px, env(safe-area-inset-left)) !important;
    padding-right: max(18px, env(safe-area-inset-right)) !important;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-wrap: break-word;
}
