/* ============================================
   T S Agency · Claude Agent Work questionnaire
   Layout adapted from the SYZ discovery form.
   TS CI (locked, see ts-document skill): Off-Black
   #2E3537, Dark Grey #787C88, Divider #D0D0CD,
   white ground. Inter 400/500 (Roobert TS web
   fallback). Never pure #000000.
   ============================================ */

:root {
  --paper: #FFFFFF;
  --stroke: #2E3537;
  --mute: #787C88;
  --accent: #2E3537;
  --hairline: #D0D0CD;
  --hairline-strong: #B7B9B5;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 240ms;
  --dur-base: 500ms;
  --dur-slow: 700ms;
  --page-x: 48px;
  --content-max: 700px;
  --hero-max: 640px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

body {
  background: var(--paper);
  color: var(--stroke);
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Typography atoms
   ============================================ */

.mono {
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}

.num {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--stroke);
  font-weight: 500;
}

h1, h2 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--stroke);
}

h1 { font-size: clamp(32px, 4.4vw, 54px); }
h2 { font-size: clamp(27px, 3.2vw, 40px); }

h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }

.ox { color: var(--mute); }

.lede {
  margin-top: 20px;
  color: var(--mute);
  font-size: 17px;
  max-width: 54ch;
}

.small-note {
  margin-top: 28px;
  color: var(--mute);
  font-size: 14px;
  max-width: 54ch;
}

/* ============================================
   Site header + progress line
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px var(--page-x) 14px;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* The TS wordmark is literal text with exactly five spaces between
   T and S and five between S and agency - white-space: pre keeps them. */
.wordmark {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--stroke);
  white-space: pre;
}

.header-right {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.line-container {
  position: sticky;
  top: 55px;
  z-index: 9;
  background: var(--paper);
  padding: 12px var(--page-x) 6px;
  border-bottom: 1px solid var(--hairline);
}
.line-svg {
  width: 100%;
  height: 20px;
  display: block;
  overflow: visible;
}
.line-track {
  stroke: var(--stroke);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.9;
}
.line-token {
  fill: var(--accent);
  transition: cx var(--dur-slow) var(--ease);
}
.progress-meta {
  margin-top: 8px;
  text-align: right;
}

/* ============================================
   Main content
   ============================================ */

main {
  flex: 1;
  position: relative;
  padding: 64px var(--page-x) 96px;
}

.screen {
  display: none;
  animation: rise var(--dur-slow) var(--ease);
}
.screen.active { display: block; }

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

.screen-inner {
  max-width: var(--content-max);
}
.screen[data-screen="intro"] .screen-inner,
.screen[data-screen="thanks"] .screen-inner,
.screen[data-screen="error"] .screen-inner,
.screen[data-screen="notfound"] .screen-inner {
  max-width: var(--hero-max);
}

.q-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.question {
  margin-top: 4px;
}

.help {
  margin-top: 18px;
  color: var(--mute);
  font-size: 16px;
  max-width: 60ch;
  line-height: 1.55;
}

.legend {
  list-style: none;
  margin-top: 16px;
  padding: 0;
}
.legend li {
  color: var(--mute);
  font-size: 14px;
  padding: 4px 0;
  padding-left: 14px;
  position: relative;
}
.legend li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 6px;
  height: 1px;
  background: var(--hairline-strong);
}
.legend b { color: var(--stroke); font-weight: 500; }

/* ============================================
   Inputs
   ============================================ */

.input {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.5;
  color: var(--stroke);
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  outline: none;
  resize: vertical;
  transition: border-color var(--dur-fast) var(--ease);
}
.input:focus {
  border-color: var(--stroke);
}
.input::placeholder { color: var(--mute); opacity: 0.7; }

textarea.input { min-height: 120px; }

.field {
  display: block;
  margin-top: 16px;
}
.field .mono { display: block; margin-bottom: 6px; }
.field .input { margin-top: 0; }

/* ============================================
   Hours rows (Q2 structured rows)
   ============================================ */

.hours-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hours-row {
  display: grid;
  grid-template-columns: 1fr 130px 130px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--hairline);
  animation: rise var(--dur-fast) var(--ease);
}
.hours-row .field { margin-top: 0; }
.hours-row .input {
  margin-top: 0;
  padding: 10px 12px;
  font-size: 16px;
}

/* ============================================
   Tool list (Q3 repeating rows)
   ============================================ */

.tool-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tool-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  animation: rise var(--dur-fast) var(--ease);
}
.tool-row input.tool-name {
  border: none;
  padding: 8px 4px;
  font-size: 16px;
  font-family: inherit;
  color: var(--stroke);
  background: transparent;
  outline: none;
  width: 100%;
}
.tool-row input.tool-name::placeholder { color: var(--mute); opacity: 0.6; }

.tool-tags {
  display: flex;
  gap: 6px;
}
.tool-tag {
  font-family: inherit;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--hairline-strong);
  color: var(--mute);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  background: transparent;
  border-radius: 0;
}
.tool-tag:hover { color: var(--stroke); border-color: var(--stroke); }
.tool-tag.active {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent);
}

.tool-remove {
  background: transparent;
  border: none;
  color: var(--mute);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color var(--dur-fast) var(--ease);
}
.tool-remove:hover { color: var(--accent); }

/* ============================================
   Buttons
   ============================================ */

.actions {
  margin-top: 40px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
  color: var(--paper);
  background: var(--stroke);
  border: 1px solid var(--stroke);
  border-radius: 0;
  padding: 12px 24px;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: opacity var(--dur-fast) var(--ease);
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { background: var(--mute); border-color: var(--mute); cursor: default; opacity: 1; }

.btn-text {
  font-family: inherit;
  font-size: 15px;
  color: var(--mute);
  background: transparent;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}
.btn-text:hover { color: var(--stroke); }

.btn-ghost {
  font-family: inherit;
  font-size: 14px;
  color: var(--mute);
  background: transparent;
  border: 1px dashed var(--hairline-strong);
  padding: 10px 14px;
  cursor: pointer;
  margin-top: 12px;
  transition: all var(--dur-fast) var(--ease);
}
.btn-ghost:hover { color: var(--stroke); border-color: var(--stroke); }
.btn-ghost:disabled { color: var(--hairline); border-color: var(--hairline); cursor: default; }

/* ============================================
   Intro facts + review
   ============================================ */

.facts {
  margin-top: 40px;
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.fact .mono { display: block; margin-bottom: 4px; }
.fact-val {
  font-weight: 500;
  font-size: 20px;
  color: var(--stroke);
  letter-spacing: -0.01em;
}

.review-list {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.review-item {
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
}
.review-item .review-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}
.review-item .review-q {
  font-weight: 500;
  font-size: 16px;
  color: var(--stroke);
  letter-spacing: -0.01em;
}
.review-item .review-a {
  color: var(--mute);
  font-size: 15px;
  white-space: pre-wrap;
  line-height: 1.55;
}
.review-item .review-a.empty { color: var(--mute); font-style: italic; }
.review-item .review-edit {
  font-family: inherit;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stroke);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.review-item ul.rows-review {
  list-style: none;
  padding: 0;
  margin: 0;
}
.review-item ul.rows-review li {
  color: var(--mute);
  font-size: 15px;
  padding: 4px 0;
}
.review-item ul.rows-review li b { color: var(--stroke); font-weight: 500; }
.review-item ul.rows-review li .tag {
  font-family: inherit;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  margin-left: 8px;
}

.contact-block {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline-strong);
}
.contact-block h3 { margin-bottom: 4px; }
.contact-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 520px;
}

/* ============================================
   Site footer
   ============================================ */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 16px var(--page-x);
  text-align: center;
}
.colophon {
  color: var(--mute);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.8;
}

/* ============================================
   Error state
   ============================================ */

.error-mono { color: var(--accent); }

.mail {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.mail:hover { border-bottom-width: 2px; }

/* ============================================
   Motion respect
   ============================================ */

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

/* ============================================
   Small screens
   ============================================ */

@media (max-width: 720px) {
  :root { --page-x: 24px; }
  body { font-size: 16px; }
  .facts { gap: 24px; }
  main { padding-top: 40px; padding-bottom: 64px; }
  .hours-row { grid-template-columns: 1fr; gap: 8px; align-items: stretch; }
  .tool-row { grid-template-columns: 1fr; gap: 8px; }
  .tool-tags { justify-content: flex-start; }
  .site-header { padding: 14px var(--page-x) 10px; }
  .line-container { top: 47px; padding-top: 10px; }
}
