/* Industry tabs and the workweek demo. Uses the tokens defined in site.css. */

/* ---------- industry tabs (second row of the header) ---------- */
.ind-bar { border-top: 1px solid var(--line); }
.ind-inner { display: flex; align-items: center; gap: 14px; padding-block: 6px; }
.ind-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  flex: none;
}
.ind-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ind-tabs::-webkit-scrollbar { display: none; }
.ind-tabs a {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color .2s, background-color .2s, border-color .2s;
}
.ind-tabs a:hover { color: var(--accent); }
.ind-tabs a.on { color: var(--fg); background: var(--surface); border-color: var(--line-strong); }

[data-swap] { transition: opacity .17s ease, transform .17s ease; }
.ind-out { opacity: 0; transform: translateY(4px); }

.creds-note { flex-basis: 100%; font-size: 15px; color: var(--fg-muted); max-width: var(--measure); margin-top: 4px; }

/* ---------- workweek demo ---------- */
#automation { scroll-margin-top: 90px; }
.ww-head { padding-bottom: clamp(16px, 3vw, 28px); }
.ww-scroll { position: relative; height: 330vh; }
.ww-stage {
  position: sticky;
  top: var(--ww-hh, 90px);
  height: calc(100vh - var(--ww-hh, 90px));
  display: flex;
  align-items: center;
}
@supports (height: 100svh) {
  .ww-stage { height: calc(100svh - var(--ww-hh, 90px)); }
}
.ww-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 52px);
  align-items: center;
  padding-block: 18px 24px;
}
.ww-copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ww-role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.ww-rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ww-rail li {
  position: relative;
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color .3s;
}
.ww-rail li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 2px; background: var(--line); }
.ww-rail i { position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.ww-rail li:nth-child(3) i { background: var(--ok); }
.ww-rail li.on, .ww-rail li.done { color: var(--fg); }

.ww-steps { display: grid; }
.ww-step {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}
.ww-step.on { opacity: 1; transform: none; pointer-events: auto; }
.ww-step h3 { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.15; letter-spacing: -.012em; margin-bottom: 8px; }
.ww-step p { font-size: 15.5px; line-height: 1.55; color: var(--fg-muted); }
.ww-year { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 14px; }
.ww-year .v {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}
.ww-year .l, .ww-stat .l {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.ww-step .btn { margin-top: 16px; }

.ww-stats { display: flex; flex-wrap: wrap; gap: 14px 30px; padding-top: 16px; border-top: 1px solid var(--line); }
.ww-stat .v {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ww-stat.hot .v { color: var(--accent); }
.ww-stat .l { display: block; margin-top: 4px; }

.ww-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--fg-muted); }
.ww-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.ww-legend .m { background: var(--surface-alt); border: 1px solid var(--line-strong); }
.ww-legend .k { background: var(--fg); }
.ww-legend .a { background: var(--accent); }
.ww-legend .f { background: color-mix(in srgb, var(--ok) 25%, transparent); border: 1px dashed var(--ok); }

/* odometer digits */
.od { display: inline-block; height: 1.1em; overflow: hidden; vertical-align: top; }
.od-s { display: block; transition: transform .6s cubic-bezier(.2, .9, .3, 1.12); }
.od-s span { display: block; height: 1.1em; line-height: 1.1em; }
.ww-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* calendar */
.ww-fig { position: relative; height: 100%; min-height: 300px; max-height: 660px; }
.ww-cal {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 30px repeat(5, minmax(0, 1fr));
  grid-template-rows: 24px minmax(0, 1fr);
  gap: 0 6px;
  transition: opacity .17s ease;
}
.ww-cal.leave { opacity: 0; }
.ww-dh { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); text-align: center; align-self: center; }
.ww-gut { position: relative; }
.ww-gut span { position: absolute; right: 4px; font-family: var(--mono); font-size: 10px; color: var(--fg-muted); transform: translateY(-50%); }
.ww-gut span:first-child { transform: none; }
.ww-gut span:last-child { transform: translateY(-100%); }
.ww-col {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--surface);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(100% / 9 - 1px), var(--line) calc(100% / 9 - 1px) calc(100% / 9));
}
.ww-tk {
  position: absolute;
  left: 3px; right: 3px; top: 0;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: var(--surface-alt);
  color: var(--fg);
  padding: 5px 7px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transform-origin: top;
  transition: background-color .25s, border-color .25s, box-shadow .25s;
  will-change: transform, height;
}
.ww-tk .n { font-size: 12.5px; line-height: 1.2; font-weight: 600; }
.ww-tk .h { font-family: var(--mono); font-size: 10px; color: var(--fg-muted); }
.ww-tk.keep { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.ww-tk.keep .h { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.ww-tk.auto { background: var(--accent); border-color: var(--accent); padding: 0; box-shadow: 0 0 14px -3px var(--accent); }
.ww-tk.auto .n, .ww-tk.auto .h { opacity: 0; }
.ww-tk.zap { animation: ww-zap .7s ease-out; }
@keyframes ww-zap {
  0%   { filter: brightness(1.8); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 80%, transparent), 0 0 22px 2px var(--accent); }
  100% { filter: none; box-shadow: 0 0 0 10px transparent, 0 0 14px -3px var(--accent); }
}
.ww-free {
  position: absolute;
  left: 3px; right: 3px; top: 0;
  border-radius: 3px;
  border: 1px dashed var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s;
}
.ww-free.on { opacity: 1; }
.ww-free::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--ok) 28%, transparent) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: ww-shine 2.6s linear infinite;
}
@keyframes ww-shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.ww-free span { position: relative; font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ok); white-space: nowrap; }
.ww-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.ww-cal.enter .ww-tk { animation: ww-in .5s cubic-bezier(.2, .9, .3, 1.2) backwards; animation-delay: calc(var(--i) * 18ms); }
@keyframes ww-in { from { opacity: 0; scale: 1 .4; } }

@media (max-width: 760px) {
  .ind-label { display: none; }
  #automation { scroll-margin-top: 100px; }
  .ww-scroll { height: 300vh; }
  .ww-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; gap: 12px; padding-block: 12px 14px; }
  .ww-copy { gap: 10px; }
  .ww-legend, .ww-step .btn { display: none; }
  .ww-step h3 { font-size: 18px; margin-bottom: 4px; }
  .ww-step p { font-size: 14px; line-height: 1.45; }
  .ww-year { margin-top: 6px; }
  .ww-year .v { font-size: 26px; }
  .ww-stats { padding-top: 10px; gap: 8px 22px; }
  .ww-stat .v { font-size: 26px; }
  .ww-fig { min-height: 220px; }
  .ww-cal { grid-template-columns: 22px repeat(5, minmax(0, 1fr)); gap: 0 4px; }
  .ww-gut span { font-size: 9px; right: 2px; }
  .ww-tk { padding: 3px 4px; }
  .ww-tk .n { font-size: 10.5px; }
  .ww-tk .h { display: none; }
  .ww-free span { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ww-free::before, .ww-cal.enter .ww-tk, .ww-tk.zap { animation: none; }
  .od-s, .ww-step, [data-swap] { transition: none; }
}
