/* Work section. Layered on top of article.css: same tokens, same nav and
   footer, plus what a case study needs that an article does not: screenshots
   in frames, a stat strip, a meta rail and a comparison table. */

/* ---------------------------------------------------------------- index */

.w-list {
  list-style: none;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gut);
  border-top: 1px solid var(--line);
}
.w-card { border-bottom: 1px solid var(--line); }
.w-card-link {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  padding: clamp(2rem, 4vw, 3.5rem) 0;
  text-decoration: none;
  color: inherit;
}
.w-card-visual {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
}
.w-card-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.9s var(--e-out);
}
.w-card-link:hover .w-card-visual img { transform: scale(1.02); }
.w-card-meta {
  display: flex;
  gap: 1.25rem;
  margin: 0 0 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.w-card-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  transition: color 0.3s var(--e-out);
}
html[lang='ja'] .w-card-title { line-height: 1.4; letter-spacing: 0; }
.w-card-link:hover .w-card-title { color: var(--blue); }
.w-card-lede {
  margin: 0;
  max-width: 40rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.w-card-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line-soft);
}
.w-card-stats b {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.w-card-stats span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--ink-3);
}
@media (max-width: 860px) {
  .w-card-link { grid-template-columns: minmax(0, 1fr); }
  .w-card-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
  .w-card-stats b { font-size: 0.95rem; white-space: normal; }
}

/* ------------------------------------------------------------ case page */

.w-case {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--gut) 0;
}
.w-head { max-width: 58rem; }
.w-head h1 {
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
}
html[lang='ja'] .w-head h1 { line-height: 1.28; letter-spacing: -0.01em; font-size: clamp(1.75rem, 4vw, 3.1rem); }
.w-lede { max-width: 46rem; }

.w-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.25rem 2rem;
  margin: 2.5rem 0 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.w-meta div { min-width: 0; }
.w-meta dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.w-meta dd {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.w-meta dd a { color: var(--blue); text-decoration: underline; text-underline-offset: 0.15em; }

/* screenshots always sit in a hairline frame on the darker paper, so a dark
   site and a light site read as the same kind of object */
.w-shot-frame {
  background: var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.w-shot-frame img { display: block; width: 100%; height: auto; }

.w-cover { margin: clamp(2rem, 4vw, 3.5rem) 0 0; }
.w-cover figcaption,
.w-shot figcaption {
  margin-top: 0.6rem;
  font-size: 0.74rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.w-cover figcaption a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }
.w-cover figcaption a:hover { color: var(--blue); }

.w-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
  background: var(--line);
  border: 1px solid var(--line);
}
.w-stats li {
  background: var(--paper);
  padding: 1.35rem 1.25rem 1.25rem;
  min-width: 0;
}
.w-stats b {
  display: block;
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.w-stats span {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-2);
}
.w-stats i {
  display: block;
  margin-top: 0.55rem;
  font-style: normal;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
@media (max-width: 860px) {
  .w-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.w-cols {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 58rem) minmax(0, 1fr);
}
@media (max-width: 1100px) { .w-cols { grid-template-columns: minmax(0, 1fr); } }
.w-main { font-size: 1.06rem; line-height: 1.75; }
html[lang='ja'] .w-main { font-size: 1.02rem; line-height: 1.9; }

/* case study body: the measure column for text, images allowed wider */
.w-sec > * { margin: 0; }
.w-sec > * + * { margin-top: 1.4em; }
.w-sec + .w-sec { margin-top: 3.25em; }
.w-sec h2 {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.w-sec p { max-width: var(--measure); }
.w-sec a { color: var(--blue); }

.w-facts {
  max-width: var(--measure);
  padding-left: 0;
  list-style: none;
}
.w-facts li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.5rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.97rem;
  line-height: 1.6;
}
.w-facts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.45rem;
  width: 0.55rem;
  height: 1px;
  background: var(--blue);
}
.w-facts li:first-child { border-top: 1px solid var(--line-soft); }

.w-fig { margin-top: 2.25em; }
.w-fig-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-left: 0;
  margin-right: 0;
}
.w-fig-pair .is-tall .w-shot-frame {
  max-height: 32rem;
  overflow: hidden;
}
.w-fig-stack { display: grid; gap: 2rem; }
.w-fig-stack .w-shot { margin: 0; }
@media (max-width: 720px) {
  .w-fig-pair { grid-template-columns: minmax(0, 1fr); }
  .w-fig-pair .is-tall { max-width: 20rem; }
}

/* the sticky rail also carries the live link */
.w-toc { margin-top: 0; max-width: 19rem; }
@media (max-width: 1100px) { .w-toc { margin-top: 0; max-width: var(--measure); } }
.w-toc-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  width: 100%;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink) !important;
  text-decoration: none !important;
}
.w-toc-live:hover { color: var(--blue) !important; }

/* comparison table */
.w-compare .table-wrap { margin-top: 1.5rem; }
.w-compare table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.w-compare th,
.w-compare td { padding: 0.75rem 0.9rem 0.75rem 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.w-compare thead th {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom-color: var(--ink);
}
.w-compare tbody th { font-weight: 600; width: 30%; }
.w-compare td:nth-child(2) { color: var(--ink-2); }
.w-compare td:nth-child(3) { font-weight: 600; }
.w-note {
  margin-top: 1.25rem !important;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: var(--measure);
}

.w-take ol {
  max-width: var(--measure);
  padding-left: 0;
  list-style: none;
  counter-reset: take;
}
.w-take li {
  counter-increment: take;
  position: relative;
  padding: 1rem 0 1rem 3rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 1.02rem;
  line-height: 1.6;
  font-weight: 500;
}
.w-take li::before {
  content: counter(take, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--blue);
}
.w-take li:first-child { border-top: 1px solid var(--line-soft); }
