/*
 * Work-with-us page (/work/, /work/en/, ADR 0009). Layered on /notes/notes.css,
 * which gives the paper, the ink, dark mode, the kicker and the summary box.
 * This file adds the offer list, the case study, the FAQ and the contact
 * block. The accent marks things (numbers, rules, focus), never body text.
 */

.work { max-width: 46rem; }

.work h2 {
  font-family: 'Space Grotesk', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: 1.4rem;
  line-height: 1.35;
  margin: 2.6em 0 0.7em;
  padding-top: 0.9em;
  border-top: 1px solid var(--hair);
}
.work .summary h2 { border-top: 0; padding-top: 0; margin: 0 0 8px; font-size: 0.68rem; }
.work h3 {
  font-family: 'Space Grotesk', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: 1.08rem;
  line-height: 1.45;
  margin: 0 0 4px;
}
.work p, .work ul, .work ol { margin: 0 0 1.1em; text-wrap: pretty; }
.work ul { padding-left: 1.3em; }
.work li { margin-bottom: 0.45em; }
.work li::marker { color: var(--accent); }
.work .note { font-size: 0.88rem; color: var(--muted); }

.jump { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 32px; padding: 0; list-style: none; }
.jump li { margin: 0; }
.jump a {
  display: inline-block;
  padding: 10px 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Offers: a numbered, ruled list. The number is the only accent-coloured ink. */
.offers { list-style: none; padding: 0 !important; counter-reset: offer; margin: 0 0 1.2em; }
.offers > li {
  counter-increment: offer;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0 12px;
  padding: 16px 0 6px;
  margin: 0;
  border-top: 1px solid var(--hair);
  scroll-margin-top: 16px;
}
.offers > li:last-child { border-bottom: 1px solid var(--hair); }
.offers > li::before {
  content: counter(offer, decimal-leading-zero);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 0.3em;
}
.offers > li > * { grid-column: 2; }
.offers p { margin: 0 0 10px; }
.offers .more { font-size: 0.92rem; }
.offers .more a { display: inline-block; padding: 6px 0; }

/* Case study */
.work figure.wide { margin: 1.4em 0 1.8em; }
.work figure.wide img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--hair); }

.built { margin: 0 0 1.4em; }
.built > div {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 2px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--hair);
}
.built > div:last-child { border-bottom: 1px solid var(--hair); }
.built dt { font-weight: 600; font-size: 0.92rem; }
.built dd { margin: 0; font-size: 0.97rem; line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .built > div { grid-template-columns: 1fr; gap: 0; }
}

.numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 1em; }
.numbers > div { background: var(--paper); border: 1px solid var(--hair); border-radius: 6px; padding: 14px 16px; }
.numbers dt {
  font-family: 'Space Grotesk', 'Hiragino Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  line-height: 1.2;
}
.numbers dd { margin: 4px 0 0; font-size: 0.86rem; line-height: 1.55; color: var(--muted); }
@media (min-width: 720px) {
  .numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.links { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.links li { margin: 0; }
.links a { display: inline-block; padding: 8px 0; }

/* Posts: one ruled row per post, platform and date above the title. */
.posts { list-style: none; padding: 0 !important; margin: 0 0 1.2em; }
.posts li { margin: 0; border-top: 1px solid var(--hair); }
.posts li:last-child { border-bottom: 1px solid var(--hair); }
.posts a { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; text-decoration: none; }
.posts a:hover .t { text-decoration: underline; text-decoration-color: var(--accent); }
.posts .meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.posts .t { font-size: 1rem; line-height: 1.55; }

/* Money flow: three apps and the links between them. Runs wider than the text
   on desktop (like .shots in notes.css); stacks top to bottom on a phone, where
   the arrow glyphs turn from horizontal to vertical. */
.flow {
  width: min(var(--wide), calc(100vw - 32px));
  margin: 1.6em 0 1.4em 50%;
  transform: translateX(-50%);
}
.flow-grid { display: grid; grid-template-columns: 1fr; gap: 6px; align-items: stretch; }
.flow .node {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.flow .node.hub { border-color: var(--accent); }
.flow .node .k {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow .node strong { font-size: 1.05rem; line-height: 1.4; }
.flow .node .d { font-size: 0.88rem; line-height: 1.6; color: var(--muted); }
.flow .edge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.flow .edge .g { color: var(--accent); font-size: 1.1rem; line-height: 1; }
.flow .edge .g.h { display: none; }
.flow .edge .row { display: flex; align-items: center; gap: 6px; }
.flow figcaption { margin-top: 10px; }
@media (min-width: 760px) {
  .flow-grid { grid-template-columns: minmax(0, 1fr) 8.5rem minmax(0, 1.15fr) 8.5rem minmax(0, 1fr); align-items: center; }
  .flow .node { height: 100%; }
  .flow .edge .g.h { display: inline; }
  .flow .edge .g.v { display: none; }
  .flow .edge .row { flex-direction: column; gap: 0; }
}

/* Other products: ruled cards, two up when there is room. */
.cards { list-style: none; padding: 0 !important; display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 1.2em; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.cards > li {
  margin: 0;
  padding: 16px 18px 6px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 6px;
}
.cards h3 { margin: 0 0 6px; }
.cards h3 a { text-decoration-thickness: 1px; }
.cards p { margin: 0 0 10px; font-size: 0.95rem; }
.cards .repo { font-size: 0.84rem; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.cards .repo b { font-weight: 600; }
.cards .more { font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 0 16px; }
.cards .more a { display: inline-block; padding: 6px 0; }

/* FAQ: native disclosure, so it works with no script. */
.faq { border-top: 1px solid var(--hair); }
.faq:last-of-type { border-bottom: 1px solid var(--hair); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  min-height: 44px;
  font-weight: 600;
  line-height: 1.55;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--accent);
}
.faq[open] summary::after { content: "−"; }
.faq .a { padding: 0 0 12px; }
.faq .a p { margin: 0 0 0.8em; }

/* Contact: two quiet ways in, side by side when there is room. */
.ways { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 1.2em; }
@media (min-width: 600px) { .ways { grid-template-columns: 1fr 1fr; } }
.way {
  display: block;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 6px;
  text-decoration: none;
}
.way:hover { border-color: var(--accent); }
.way .k {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.way .v { display: block; margin-top: 4px; font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.way .h { display: block; margin-top: 4px; font-size: 0.86rem; color: var(--muted); line-height: 1.55; }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  .top, .skip, .jump { display: none; }
  .work { max-width: none; padding: 0; }
  .work h2 { font-size: 13pt; margin-top: 1.4em; break-after: avoid; }
  body { font-size: 9.5pt; line-height: 1.6; }
  .offers > li, .built > div, .numbers > div, .faq, .way { break-inside: avoid; }
  .faq summary::after { content: none; }
  .work figure.wide { max-width: 60%; }
  .flow { width: auto; margin-left: 0; transform: none; }
  .cards > li { break-inside: avoid; }
  .work a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; font-weight: 400; color: #444; overflow-wrap: anywhere; }
}
