/* Intern story pages (/interns/<slug>/) that retell a member's own talk,
 * chapter by chapter, instead of a Q&A interview.
 *
 * Loaded after /works/case.css and /interns/intern.css and reuses their
 * tokens (--ink, --ink-soft, --muted, --line, --bg-soft, --accent,
 * --accent-soft, --ease) plus the .itn-* scaffolding. Everything new is
 * prefixed .sty* so intern.css and the interview template stay untouched.
 */

:root {
  --paper: #f7f6f2;
  --paper-line: #e7e4dc;
}

/* =======================================================================
 * Table of contents — the talk's menu card, one column per chapter
 * ======================================================================= */

.sty-toc {
  padding: clamp(28px, 3.5vw, 44px) 0 clamp(8px, 1.5vw, 16px);
}

.sty-menu {
  max-width: 44rem;
  border-radius: 22px;
  padding: clamp(20px, 2.6vw, 30px) clamp(14px, 2vw, 26px);
  background: var(--paper);
  border: 1px solid var(--paper-line);
}

.sty-menu__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.sty-menu__title small {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sty-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.sty-menu__list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: 100%;
  min-height: 13rem;
  padding: 14px 2px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--paper-line);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.sty-menu__list a:hover,
.sty-menu__list a:focus-visible {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: 0 18px 34px -22px rgba(0, 0, 0, 0.45);
}

.sty-menu__course {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  white-space: nowrap;
}

.sty-menu__dish {
  writing-mode: vertical-rl;
  font-size: clamp(1.1rem, 0.85rem + 0.8vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
}

.sty-menu__no {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

/* The closing dish is printed in reverse, as on the original slide. */
.sty-menu__list li:last-child a {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.sty-menu__list li:last-child .sty-menu__course {
  color: #c7d2fe;
}

.sty-menu__list li:last-child .sty-menu__no {
  color: #a1a1aa;
}

/* =======================================================================
 * Chapter heading — course label, dish, message, numeral watermark
 * ======================================================================= */

.sty-chapter {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  scroll-margin-top: 64px;
}

.sty-ch {
  margin: 0 0 clamp(26px, 3vw, 38px);
}

.sty-ch__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.sty-ch__meta span + span::before {
  content: "／";
  margin-right: 10px;
  color: #c7c7cc;
}

.sty-ch__dish {
  margin: 10px 0 0;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.sty-ch__title {
  margin: 20px 0 0;
  max-width: 40rem;
  font-size: clamp(1.25rem, 1rem + 1.25vw, 1.8rem);
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.025em;
  text-wrap: balance;
  /* Break Japanese at phrase boundaries where supported (Chromium). */
  word-break: auto-phrase;
}

/* Short display lines from intern.css / case.css get the same phrase breaks. */
.itn-standout p,
.itn-hero__quote p,
.sty-lesson p,
.sty-lesson li,
.cta-box h2 {
  word-break: auto-phrase;
}

/* Positioned against the section, then pulled in to the .wrap edge. */
.sty-ch__mark {
  position: absolute;
  z-index: -1;
  top: clamp(20px, 3vw, 44px);
  right: max(12px, calc((100% - var(--maxw)) / 2 + 24px));
  font-size: clamp(7rem, 3rem + 14vw, 13rem);
  font-weight: 800;
  line-height: 1;
  color: #f2f2f4;
  pointer-events: none;
  user-select: none;
}

/* A real photo inside a chapter, wider than the text column. */
.sty-photo {
  margin: clamp(26px, 3vw, 38px) 0;
}

.sty-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #f4f4f5;
}

.sty-photo figcaption {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* A sub-heading inside a chapter. */
.sty-sub {
  margin: clamp(40px, 4.5vw, 58px) 0 18px;
  font-size: clamp(1.08rem, 1rem + 0.45vw, 1.28rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.55;
}

.sty-sub small {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
}

/* =======================================================================
 * "学び" callout — the takeaway each chapter of the talk ended on
 * ======================================================================= */

.sty-lesson {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 44rem;
  margin: clamp(28px, 3vw, 40px) 0 0;
  padding: 22px 26px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
}

.sty-lesson__label {
  flex: none;
  margin-top: 0.15em;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.sty-lesson p,
.sty-lesson li {
  margin: 0;
  font-size: clamp(1.02rem, 0.96rem + 0.35vw, 1.16rem);
  font-weight: 700;
  line-height: 1.7;
}

.sty-lesson ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sty-lesson li {
  position: relative;
  padding-left: 20px;
}

.sty-lesson li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.82em;
  width: 10px;
  height: 2px;
  background: #a5b4fc;
}

.sty-lesson small {
  display: block;
  margin-top: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #d4d4d8;
}

/* =======================================================================
 * Step flow — boxes joined by arrows; .is-key is the step that mattered
 * ======================================================================= */

.sty-flow {
  list-style: none;
  margin: clamp(26px, 3vw, 36px) 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
  gap: 14px;
}

.sty-flow li {
  position: relative;
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}

/* Arrow drawn as an inline SVG so it never depends on the font's glyph. */
.sty-flow li + li::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: -7px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12h12M13 7l5 5-5 5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.sty-flow strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sty-flow span {
  display: block;
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.sty-flow .is-key {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.sty-flow .is-key span {
  color: #d4d4d8;
}

/* =======================================================================
 * Side-by-side comparison cards
 * ======================================================================= */

.sty-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 30px;
}

.sty-compare__card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
  background: var(--bg-soft);
}

.sty-compare__card h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sty-compare__card dl {
  margin: 0;
}

.sty-compare__card dt {
  margin: 16px 0 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.sty-compare__card dd {
  margin: 4px 0 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.sty-stars {
  display: inline-flex;
  gap: 2px;
  font-size: 1.1rem;
  line-height: 1;
  color: #d4d4d8;
}

.sty-stars .on {
  color: var(--ink);
}

/* =======================================================================
 * Model versions V1-V9, each scored on a different yardstick
 * ======================================================================= */

.sty-versions {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

.sty-versions li {
  padding: 12px 2px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
}

/* Deliberately uneven: the point of this figure is that nothing lines up. */
.sty-versions li:nth-child(odd) {
  transform: rotate(-2deg);
}

.sty-versions li:nth-child(3n) {
  transform: rotate(1.5deg) translateY(3px);
}

.sty-versions b {
  display: block;
  font-size: 1rem;
  font-weight: 800;
}

.sty-versions span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.sty-versions__note {
  margin: 14px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.sty-fix {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 2.5vw, 30px);
  align-items: center;
  margin: 30px 0;
  padding: clamp(20px, 2.4vw, 28px) clamp(20px, 2.6vw, 32px);
  border: 2px solid var(--ink);
  border-radius: 18px;
}

.sty-fix__ver {
  font-size: clamp(2.6rem, 1.8rem + 3vw, 3.8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.sty-fix h4 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.sty-fix p {
  margin: 8px 0 0;
  font-size: 0.93rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* =======================================================================
 * "Toilet first" house diagram and the 100 x 10 formula
 * ======================================================================= */

.sty-house {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0;
}

.sty-house figure {
  margin: 0;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.sty-house__tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #e4e4e7;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.sty-house figure:last-child .sty-house__tag {
  background: var(--accent);
  color: #fff;
}

.sty-house svg {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 12px auto 4px;
}

.sty-house figcaption {
  margin: 0;
  text-align: center;
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.6;
}

.sty-house figure:last-child figcaption {
  color: var(--accent);
}

.sty-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em;
  margin: 26px 0 0;
  padding: 18px 24px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: clamp(1.35rem, 1rem + 1.6vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.sty-formula span {
  color: var(--muted);
  font-weight: 600;
}

.sty-formula strong {
  color: var(--accent);
}

/* =======================================================================
 * Small step chart (poster, stamp, poster, ... habit)
 * ======================================================================= */

.sty-stairs {
  list-style: none;
  margin: 26px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 168px;
  max-width: 40rem;
}

.sty-stairs li {
  height: var(--h);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 4px 0;
  border-radius: 4px 4px 0 0;
  background: #ececef;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: var(--ink-soft);
}

.sty-stairs li:last-child {
  background: var(--accent);
  color: #fff;
}

/* A light aside inside a chapter. */
.sty-aside {
  max-width: 44rem;
  margin: 30px 0 0;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px dashed #c7c7cc;
}

.sty-aside__label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.sty-aside p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink-soft);
}

/* =======================================================================
 * Three moves
 * ======================================================================= */

.sty-moves {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sty-moves li {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 24px;
  background: var(--bg);
  transition: border-color 0.45s var(--ease), transform 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}

.sty-moves li:hover {
  border-color: #c8c8cd;
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -32px rgba(0, 0, 0, 0.34);
}

.sty-moves__no {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.sty-moves h4 {
  margin: 10px 0 0;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.sty-moves p {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.sty-moves .sty-vs {
  display: block;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}

/* =======================================================================
 * Result — headline number plus a target vs actual bar pair
 * ======================================================================= */

.sty-result {
  margin: 34px 0 0;
  padding: clamp(24px, 3vw, 36px);
  border-radius: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.sty-result__label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.sty-result__num {
  margin: 6px 0 0;
  font-size: clamp(3rem, 2rem + 4.5vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.sty-result__num span {
  margin-left: 0.08em;
  font-size: 0.42em;
  letter-spacing: 0;
}

.sty-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0 0;
  max-width: 40rem;
}

.sty-bar {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) 5.6rem;
  gap: 12px;
  align-items: center;
  font-size: 0.9rem;
}

.sty-bar__name {
  font-weight: 700;
  color: var(--ink-soft);
}

.sty-bar__track {
  display: block;
}

/* Square at the baseline, 4px round at the data end. */
.sty-bar__fill {
  display: block;
  width: var(--w);
  height: 14px;
  border-radius: 0 4px 4px 0;
  background: #a1a1aa;
}

.sty-bar--actual .sty-bar__fill {
  background: var(--accent);
}

.sty-bar__val {
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sty-result figcaption {
  margin: 18px 0 0;
  font-size: 0.93rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* =======================================================================
 * The bill — every takeaway on one receipt
 * ======================================================================= */

.sty-billwrap {
  padding: clamp(48px, 6vw, 88px) 0;
  background: var(--paper);
  border-bottom: 1px solid var(--paper-line);
}

.sty-bill {
  position: relative;
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) clamp(22px, 4vw, 44px) clamp(34px, 4vw, 48px);
  background: #fff;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.35);
}

/* Torn-paper bottom edge. */
.sty-bill::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 10px;
  background: linear-gradient(-45deg, transparent 7px, #fff 0) 0 0 / 14px 10px repeat-x,
    linear-gradient(45deg, transparent 7px, #fff 0) 0 0 / 14px 10px repeat-x;
}

.sty-bill__head {
  margin: 0;
  text-align: center;
  font-size: clamp(1.3rem, 1rem + 1.2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.2em;
}

.sty-bill__sub {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.sty-bill__list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  border-top: 2px dashed #d4d4d8;
}

.sty-bill__list li {
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 1fr);
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px dashed #e4e4e7;
}

.sty-bill__dish {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-top: 0.3em;
}

.sty-bill__lesson {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.7;
}

.sty-bill__foot {
  margin: 22px 0 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

/* =======================================================================
 * Responsive
 * ======================================================================= */

@media (max-width: 860px) {
  .sty-flow,
  .sty-compare,
  .sty-house,
  .sty-moves {
    grid-template-columns: 1fr;
  }
  .sty-flow li + li::before {
    left: 50%;
    top: -7px;
    transform: translate(-50%, -50%) rotate(90deg);
  }
  .sty-versions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    row-gap: 12px;
  }
}

@media (max-width: 600px) {
  .sty-menu {
    border-radius: 16px;
  }
  .sty-menu__list {
    gap: 5px;
  }
  .sty-menu__list a {
    min-height: 11.5rem;
  }
  .sty-photo img {
    border-radius: 12px;
  }
  .sty-menu__course {
    font-size: 9px;
    letter-spacing: 0;
  }
  .sty-lesson {
    flex-direction: column;
    gap: 12px;
    padding: 20px 20px;
  }
  .sty-fix {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .sty-stairs li {
    font-size: 0.72rem;
  }
  .sty-bar {
    grid-template-columns: 2.6rem minmax(0, 1fr) 4.8rem;
    gap: 8px;
  }
  .sty-bill__list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sty-menu__list a,
  .sty-moves li {
    transition: none;
  }
}
