:root {
  --workbench-ink: #171b18;
  --workbench-paper: #f2efe7;
  --workbench-card: #fffdf7;
  --workbench-line: #c9c6bc;
  --workbench-soft-line: #dedbd2;
  --workbench-muted: #62645f;
  --workbench-orange: #f05b37;
  --workbench-green: #2d7650;
  --workbench-blue: #326b87;
}

body.workbench-mode {
  display: grid;
  color: var(--workbench-ink);
  background:
    linear-gradient(90deg, rgb(23 27 24 / 3%) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(rgb(23 27 24 / 3%) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--workbench-paper);
}

body.workbench-mode .site-header {
  position: relative;
  z-index: 20;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding-inline: clamp(18px, 4vw, 58px);
}

body.workbench-mode .wordmark {
  color: var(--workbench-ink);
}

body.workbench-mode .website-main {
  display: block;
  align-self: start;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 58px) clamp(28px, 5vw, 72px);
}

body.workbench-mode .website-main > :not(#workbench) {
  display: none !important;
}

body.workbench-mode .website-main > #workbench {
  display: block !important;
}

.workbench {
  min-width: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:not(.workbench-mode) .workbench {
  display: none !important;
}

.workbench-frame {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--workbench-ink);
  border-radius: 4px;
  background: rgb(255 253 247 / 88%);
  box-shadow: 10px 10px 0 rgb(23 27 24 / 10%);
}

.workbench-frame::before {
  position: absolute;
  z-index: 2;
  top: -1px;
  left: clamp(28px, 7vw, 96px);
  width: clamp(90px, 12vw, 160px);
  height: 8px;
  background: var(--workbench-orange);
  content: "";
}

.workbench-hero {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: clamp(44px, 7vw, 112px);
  align-items: end;
  padding: clamp(48px, 7vw, 104px) clamp(28px, 6vw, 86px) clamp(40px, 6vw, 78px);
}

.workbench-promise {
  min-width: 0;
}

.workbench-kicker {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 clamp(26px, 4vw, 52px);
  color: var(--workbench-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
}

.workbench-kicker span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--workbench-green);
  box-shadow: 0 0 0 5px rgb(45 118 80 / 12%);
}

.workbench-promise h1 {
  max-width: 890px;
  margin: 0;
  font-size: clamp(3.7rem, 7.5vw, 7.6rem);
  font-weight: 780;
  letter-spacing: -0.077em;
  line-height: 0.86;
  text-wrap: balance;
}

.workbench-intro {
  max-width: 680px;
  margin: clamp(30px, 4vw, 48px) 0 0;
  color: #3e423e;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  letter-spacing: -0.025em;
  line-height: 1.5;
  text-wrap: pretty;
}

.workbench-action-row {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: clamp(30px, 4vw, 48px);
}

.bring-problem-open {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 58px;
  padding: 8px 9px 8px 20px;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--workbench-ink);
  border-radius: 2px;
  color: #fff;
  background: var(--workbench-ink);
  box-shadow: 5px 5px 0 var(--workbench-orange);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 780;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.bring-problem-open > span:last-child {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--workbench-ink);
  background: var(--workbench-orange);
  font-size: 1.2rem;
  transition: transform 180ms ease;
}

.bring-problem-open:hover {
  color: var(--workbench-ink);
  background: #fff;
  box-shadow: 7px 7px 0 var(--workbench-orange);
  transform: translate(-2px, -2px);
}

.bring-problem-open[aria-expanded="true"] > span:last-child {
  transform: rotate(180deg);
}

.workbench-action-row > p {
  max-width: 210px;
  margin: 0;
  color: var(--workbench-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.workbench-loop {
  display: flex;
  max-width: 660px;
  margin: clamp(38px, 6vw, 72px) 0 0;
  padding: 0;
  border-top: 1px solid var(--workbench-line);
  list-style: none;
}

.workbench-loop li {
  position: relative;
  display: grid;
  flex: 1 1 0;
  gap: 7px;
  padding-top: 15px;
  color: #393d39;
  font-size: 0.79rem;
  font-weight: 750;
}

.workbench-loop li::before {
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--workbench-ink);
  content: "";
}

.workbench-loop li:last-child::before {
  background: var(--workbench-green);
}

.workbench-loop span {
  color: var(--workbench-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.57rem;
  letter-spacing: 0.08em;
}

.work-window {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--workbench-ink);
  border-radius: 2px;
  background: var(--workbench-card);
  box-shadow: 8px 8px 0 #d8d3c7;
  transform: rotate(0.35deg);
}

.work-window::before {
  position: absolute;
  top: -1px;
  right: 28px;
  width: 52px;
  height: 10px;
  background: var(--workbench-blue);
  content: "";
}

.work-window-header {
  display: flex;
  min-width: 0;
  min-height: 58px;
  padding: 18px 18px 13px;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--workbench-line);
  background: #f1eee5;
}

.work-window-header p {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--workbench-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.work-window-header p span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a9782a;
}

.work-window[data-record-state="published"] .work-window-header p span {
  background: var(--workbench-green);
}

.work-window-header strong {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #68521a;
  background: #f5e9bd;
  font-size: 0.62rem;
  line-height: 1.2;
}

.work-window[data-record-state="published"] .work-window-header strong {
  color: #1c5e3d;
  background: #dcefe2;
}

.work-window-body {
  min-height: 260px;
  padding: clamp(26px, 4vw, 42px) clamp(22px, 3vw, 34px);
}

.work-window-body time {
  color: var(--workbench-orange);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-window-body h2 {
  margin: 17px 0 14px;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  letter-spacing: -0.055em;
  line-height: 1;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.work-window-body p {
  margin: 0;
  color: #4d514d;
  font-size: 0.88rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.work-window-link {
  display: flex;
  min-height: 55px;
  padding: 13px 18px;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--workbench-ink);
  color: #fff;
  background: var(--workbench-ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.work-window-link[hidden] {
  display: none;
}

.work-window-link:hover {
  color: var(--workbench-ink);
  background: var(--workbench-orange);
}

.work-window-source {
  margin: 0;
  padding: 10px 18px;
  color: var(--workbench-muted);
  background: #f1eee5;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.54rem;
  line-height: 1.4;
}

.problem-brief-panel {
  position: relative;
  margin: 0 clamp(28px, 6vw, 86px) clamp(28px, 5vw, 60px);
  padding: clamp(24px, 4vw, 50px);
  border: 1px solid var(--workbench-ink);
  border-top: 7px solid var(--workbench-orange);
  background:
    linear-gradient(90deg, transparent 34px, rgb(240 91 55 / 10%) 35px, transparent 36px),
    repeating-linear-gradient(#fffdf7 0 31px, #e7e3d9 32px);
  box-shadow: 7px 7px 0 #d8d3c7;
  animation: workbench-panel-open 260ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.problem-brief-panel[hidden] {
  display: none;
}

.problem-brief-heading {
  display: flex;
  gap: 24px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: clamp(24px, 4vw, 44px);
  padding-left: 18px;
}

.problem-brief-heading p {
  margin: 0 0 6px;
  color: var(--workbench-orange);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.problem-brief-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.3rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

#problem-brief-close {
  flex: 0 0 auto;
  padding: 9px 11px;
  border: 1px solid var(--workbench-ink);
  color: var(--workbench-ink);
  background: var(--workbench-card);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
}

#problem-brief-form {
  display: grid;
  padding-left: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.problem-brief-field {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.problem-brief-field:nth-child(3) {
  grid-column: 1 / -1;
}

.problem-brief-field > span {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #373b37;
  font-size: 0.75rem;
  font-weight: 800;
}

.problem-brief-field b {
  color: var(--workbench-orange);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.58rem;
}

.problem-brief-field :is(textarea, input) {
  width: 100%;
  min-width: 0;
  border: 1px solid #aaa79e;
  border-radius: 2px;
  color: var(--workbench-ink);
  background: rgb(255 255 255 / 88%);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  resize: vertical;
}

.problem-brief-field textarea {
  min-height: 112px;
  padding: 14px;
}

.problem-brief-field input {
  min-height: 52px;
  padding: 10px 14px;
}

.problem-brief-field :is(textarea, input)::placeholder {
  color: #85867f;
  opacity: 1;
}

.problem-brief-field :is(textarea, input):focus {
  border-color: var(--workbench-blue);
  outline: 3px solid rgb(50 107 135 / 20%);
  outline-offset: 1px;
}

.problem-brief-finish {
  display: flex;
  grid-column: 1 / -1;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.problem-brief-finish p {
  margin: 0 0 4px;
  font-size: 0.84rem;
  font-weight: 800;
}

.problem-brief-finish small {
  display: block;
  max-width: 620px;
  color: var(--workbench-muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.problem-brief-finish button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 50px;
  padding: 10px 14px 10px 18px;
  gap: 25px;
  align-items: center;
  border: 1px solid var(--workbench-ink);
  color: #fff;
  background: var(--workbench-ink);
  box-shadow: 4px 4px 0 var(--workbench-orange);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.problem-brief-finish button:hover,
#problem-brief-close:hover {
  color: var(--workbench-ink);
  background: var(--workbench-orange);
}

.problem-brief-status {
  min-height: 1.4em;
  grid-column: 1 / -1;
  margin: 0;
  color: var(--workbench-green);
  font-size: 0.7rem;
  font-weight: 750;
}

.workbench-paths {
  display: grid;
  margin: 0 clamp(28px, 6vw, 86px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--workbench-ink);
  border-bottom: 1px solid var(--workbench-ink);
}

.workbench-path {
  display: flex;
  min-width: 0;
  min-height: 112px;
  padding: 22px 24px;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  color: var(--workbench-ink);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.workbench-path + .workbench-path {
  border-left: 1px solid var(--workbench-ink);
}

.workbench-path > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.workbench-path small {
  color: var(--workbench-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.56rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
}

.workbench-path strong {
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.workbench-path > span:last-child {
  font-size: 1.25rem;
}

.workbench-path:hover {
  color: #fff;
  background: var(--workbench-ink);
}

.workbench-path:hover small {
  color: #d8d7d0;
}

.workbench-footer {
  display: flex;
  padding: 22px clamp(28px, 6vw, 86px) 24px;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  color: var(--workbench-muted);
  font-size: 0.67rem;
}

.workbench-footer p {
  margin: 0;
}

.workbench-footer a {
  color: var(--workbench-ink);
  font-weight: 750;
  text-underline-offset: 3px;
}

.workbench :is(button, a):focus-visible {
  outline: 3px solid var(--workbench-blue);
  outline-offset: 4px;
}

.playground-entry {
  display: flex;
  width: min(100% - 28px, 1120px);
  margin: 10px auto 34px;
  padding: clamp(20px, 4vw, 38px);
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  border: 1px solid #172326;
  border-left: 9px solid #e95f49;
  color: #172326;
  background: #fffdf5;
  box-shadow: 7px 7px 0 #d9caa8;
}

body.workbench-mode .playground-entry {
  display: none !important;
}

.playground-entry > div {
  min-width: 0;
}

.playground-entry p:first-child {
  margin: 0 0 8px;
  color: #257185;
  font: 850 0.6rem/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.playground-entry h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
  text-wrap: balance;
}

.playground-entry p:last-child {
  max-width: 640px;
  margin: 12px 0 0;
  color: #465255;
  font-size: 0.8rem;
  line-height: 1.5;
}

.playground-entry > a {
  flex: 0 0 auto;
  padding: 11px 13px;
  border: 1px solid currentColor;
  color: #fff;
  background: #172326;
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.playground-entry:focus {
  outline: 3px solid #257185;
  outline-offset: 4px;
}

@keyframes workbench-panel-open {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .workbench-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 46px;
    align-items: start;
  }

  .workbench-promise h1 {
    max-width: 720px;
  }

  .work-window {
    width: min(100%, 580px);
    transform: none;
  }

  .work-window-body {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  body.workbench-mode .site-header {
    min-height: 70px;
    padding: 13px 15px;
    align-items: flex-start;
  }

  body.workbench-mode .website-main {
    padding: 0 12px 28px;
  }

  .workbench-frame {
    box-shadow: 6px 6px 0 rgb(23 27 24 / 10%);
  }

  .workbench-frame::before {
    left: 28px;
    width: 92px;
  }

  .workbench-hero {
    padding: 48px 18px 30px;
    gap: 36px;
  }

  .workbench-kicker {
    margin-bottom: 28px;
    font-size: 0.6rem;
  }

  .workbench-promise h1 {
    font-size: clamp(3.2rem, 16vw, 4.8rem);
    line-height: 0.88;
  }

  .workbench-intro {
    margin-top: 28px;
    font-size: 1rem;
  }

  .workbench-action-row {
    display: grid;
    gap: 13px;
    margin-top: 28px;
  }

  .bring-problem-open {
    width: 100%;
  }

  .workbench-action-row > p {
    max-width: none;
  }

  .workbench-loop {
    margin-top: 42px;
  }

  .workbench-loop li {
    font-size: 0.7rem;
  }

  .work-window {
    width: 100%;
    box-shadow: 5px 5px 0 #d8d3c7;
  }

  .work-window-body {
    padding: 28px 20px;
  }

  .problem-brief-panel {
    margin: 0 18px 30px;
    padding: 24px 17px;
    box-shadow: 5px 5px 0 #d8d3c7;
  }

  .problem-brief-heading,
  #problem-brief-form {
    padding-left: 0;
  }

  .problem-brief-heading h2 {
    font-size: 2.4rem;
  }

  #problem-brief-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .problem-brief-field:nth-child(3),
  .problem-brief-finish,
  .problem-brief-status {
    grid-column: auto;
  }

  .problem-brief-finish {
    display: grid;
  }

  .problem-brief-finish button {
    width: 100%;
    justify-content: space-between;
  }

  .workbench-paths {
    margin: 0 18px;
    grid-template-columns: minmax(0, 1fr);
  }

  .workbench-path {
    min-height: 92px;
    padding: 18px 4px;
  }

  .workbench-path + .workbench-path {
    border-top: 1px solid var(--workbench-ink);
    border-left: 0;
  }

  .workbench-footer {
    padding: 20px 18px;
  }

  .playground-entry {
    width: min(100% - 24px, 1120px);
    margin-top: 2px;
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .workbench-promise h1 {
    font-size: 3rem;
  }

  .workbench-loop li {
    font-size: 0.64rem;
  }

  .workbench-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .problem-brief-panel {
    animation: none;
  }

  .bring-problem-open,
  .bring-problem-open > span:last-child,
  .workbench-path {
    transition: none;
  }
}
