/* Bekito — /tools/ hub page: every service and product on one page.
 * Built on css/worlds.css (nav, footer, world backgrounds, type, badges) and
 * css/family.css (the seven drawings). Both languages are in the HTML as
 * lang="ja" / lang="en" pairs, like the /security/ pages, so the page reads
 * with JavaScript off; the inactive language is hidden from <html lang>.
 *
 * Layout rules (owner's review, 21 Nov 2026):
 * - The page is the only thing that scrolls. Nothing is clipped, nothing has
 *   its own scrollbar, nothing is sized with 100vw.
 * - Names, badges, buttons and labels stay on one line. Japanese sentences
 *   carry <wbr> between phrases and use word-break: keep-all, so no browser
 *   (Safari included) breaks inside a word; English breaks between words.
 * - A badge has its own line. Columns line up from row to row; cards in one
 *   row share their inner rows (subgrid). */

html[lang="ja"] body [lang="en"]:not(.keep),
html[lang="en"] body [lang="ja"]:not(.keep) { display: none !important; }
html[lang="ja"] .tl-orig { display: none; }

.tl :lang(ja) { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
.tl a:focus-visible, .tl button:focus-visible { outline: 3px solid var(--ak); outline-offset: 3px; border-radius: 8px; }
.tl [data-tone="dark"] a:focus-visible { outline-color: #F0A868; }
.tl-skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 12px 18px; background: #1E2A37; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; border-radius: 0 0 12px 0; }
.tl-skip:focus { left: 0; }
.tl .nav-links a[aria-current="page"] { opacity: 1; text-decoration: underline; text-decoration-color: var(--ak); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.tl .lang-btn { min-height: 32px; }
.tl .logo-kana { opacity: .74; } /* 4.5:1 on this page's solid bar */
/* no particle field here to switch the bar's tone per world, so it is solid paper over every section */
.tl .nav.scrolled, html[data-tone="light"] .tl .nav.scrolled { background: #F7F2EA; border-color: rgba(30,42,55,.1); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- top ---------- */
.tl-hero { padding: calc(var(--nav-h) + clamp(36px, 8vh, 84px)) 0 clamp(44px, 9vh, 96px); }
.tl-crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font: 500 12px/1.4 var(--f-mono); letter-spacing: .1em; color: var(--fg-3); white-space: nowrap; }
.tl-crumb a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.tl-crumb a:hover { color: var(--fg); }
.tl-hero h1 { font: 900 clamp(34px, 4.4vw, 66px)/1.18 var(--f-sans); letter-spacing: .01em; }
html[lang="en"] .tl-hero h1 { line-height: 1.08; letter-spacing: -.015em; }
.tl-lead { margin-top: 20px; max-width: 34em; font-size: clamp(15px, 1.2vw, 17.5px); line-height: 2; color: var(--fg-2); }
html[lang="en"] .tl-lead { line-height: 1.75; }
.tl-jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.tl-jump a { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 20px 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(255,255,255,.5); color: var(--fg); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; transition: border-color .25s, background-color .25s; }
.tl-jump a:hover { border-color: var(--acc); background: #fff; }
.tl-jump b { font: 500 13px/1 var(--f-mono); color: var(--acc); }

/* ---------- sections ---------- */
.tl-sec { padding: clamp(56px, 11vh, 120px) 0 clamp(68px, 13vh, 140px); }
.tl-sec-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: clamp(22px, 4.5vh, 44px); }
.tl-sec-head h2 { font: 900 clamp(26px, 3vw, 44px)/1.25 var(--f-sans); letter-spacing: .01em; }
html[lang="en"] .tl-sec-head h2 { line-height: 1.14; letter-spacing: -.01em; }
.tl-sec-head p { max-width: 40em; font-size: 14px; line-height: 1.85; color: var(--fg-3); }

/* ---------- the seven demos: one row each; drawing, name with its button, then the facts, in columns that line up from row to row ---------- */
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-rows: 1fr; gap: 14px; }
.tl-item {
  display: grid; grid-template-columns: 204px minmax(0, .74fr) minmax(0, 1.26fr); grid-template-rows: auto auto; align-content: center;
  grid-template-areas: "v main facts" "v go facts";
  background: rgba(255,255,255,.74); border: 1px solid var(--card-line); border-radius: 18px; overflow: hidden;
  scroll-margin-top: calc(var(--nav-h) + 16px);
  transition: border-color .3s, box-shadow .3s;
}
.tl-item:hover, .tl-item:focus-within { border-color: rgba(180,95,47,.55); box-shadow: 0 22px 44px -32px rgba(30,42,55,.5); }
.tl-v { grid-area: v; align-self: stretch; display: flex; align-items: center; min-height: 150px; background: #FBF8F3; border-right: 1px solid var(--card-line); }
.tl-v .fam-art { height: auto; aspect-ratio: 3 / 2; }
.tl-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; padding: 22px 16px 0 26px; }
.tl-name { display: flex; flex-direction: column; min-width: 0; }
.tl-nm { align-self: flex-start; font-size: 21px; font-weight: 900; line-height: 1.4; white-space: nowrap; }
html[lang="en"] .tl-nm { font-weight: 800; letter-spacing: -.01em; }
.tl-orig { align-self: flex-start; font: 500 12px/1.5 var(--f-sans); letter-spacing: .04em; color: var(--fg-3); white-space: nowrap; }
.tl-line { margin-top: 8px; font-size: 14.5px; line-height: 1.8; color: var(--fg-2); }
html[lang="en"] .tl-line { line-height: 1.6; }
.tl-facts { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tl-item > .tl-facts { grid-area: facts; align-self: center; padding: 22px 26px 22px 14px; }
.tl-facts > div { display: grid; grid-template-columns: 6.4em minmax(0, 1fr); gap: 12px; font-size: 13.5px; line-height: 1.75; }
html[lang="en"] .tl-facts > div { grid-template-columns: 4.4em minmax(0, 1fr); line-height: 1.6; }
.tl-facts dt { font-weight: 700; color: var(--fg-3); white-space: nowrap; }
.tl-facts dd { margin: 0; min-width: 0; color: var(--fg); }
.tl-line, .tl-facts dd, .tl-cons span, .tl-lead, .tl-sec-head p { text-wrap: pretty; }
.tl-go {
  grid-area: go; justify-self: start; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin: 16px 16px 24px 26px; padding: 10px 22px;
  border-radius: 999px; background: #1E2A37; color: #F5EFE6; text-decoration: none; font-size: 14px; font-weight: 700; line-height: 1.3; white-space: nowrap;
  transition: background-color .25s, transform .25s var(--ease);
}
.tl-go:hover { background: var(--ak); transform: translateY(-2px); }
.tl-go i { font: 600 13px Inter, sans-serif; font-style: normal; }

/* ---------- products: cards in a row share their inner rows; the badge has its own line ---------- */
.tl-pgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tl-pcard { display: grid; grid-row: span 6; grid-template-rows: subgrid; row-gap: 0; min-width: 0; padding: 24px 26px 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-line); scroll-margin-top: calc(var(--nav-h) + 16px); }
.tl-pname { font-size: 19px; font-weight: 700; line-height: 1.45; white-space: nowrap; }
.tl-pbadge { margin-top: 10px; }
.tl-pcard .tl-line { margin-top: 14px; }
.tl-facts--p { grid-row: span 2; display: grid; grid-template-rows: subgrid; row-gap: 0; margin-top: 16px; padding: 0; border-top: 1px solid var(--line); }
.tl-facts--p > div, html[lang="en"] .tl-facts--p > div { grid-template-columns: minmax(0, 1fr); gap: 1px; padding-top: 12px; align-content: start; }
.tl-facts--p dt { font-size: 12px; letter-spacing: .04em; }
.tl-facts--p dd { color: var(--fg-2); }
.tl-pfoot { align-self: start; margin-top: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tl-pfoot .w-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; white-space: nowrap; }
.tl-by { font-size: 12px; color: var(--fg-3); text-decoration: none; white-space: nowrap; border-bottom: 1px dotted var(--line); }
.tl-by:hover { color: var(--fg); }

/* ---------- starts with a conversation ---------- */
.tl-clist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tl-cons { display: grid; grid-template-columns: 15.5em minmax(0, 1fr) auto; align-items: baseline; gap: 6px 28px; min-height: 56px; padding: 20px 4px; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; transition: background-color .25s; }
.tl-cons:hover { background: rgba(255,255,255,.5); }
.tl-cons strong { font-size: 18px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.tl-cons span { min-width: 0; font-size: 14.5px; line-height: 1.8; color: var(--fg-2); }
.tl-cons i { font-style: normal; color: var(--acc); transition: transform .3s var(--ease); }
.tl-cons:hover i { transform: translateX(4px); }
.tl-close { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(28px, 5vh, 46px); }

@media (min-width: 1800px) {
  .tl-item { grid-template-columns: 264px minmax(0, .74fr) minmax(0, 1.26fr); }
  .tl-nm { font-size: 26px; }
  .tl-orig { font-size: 13px; }
  .tl-line, .tl-cons span { font-size: clamp(15px, .85vw, 18px); }
  .tl-facts > div { font-size: clamp(14px, .78vw, 16.5px); }
  .tl-go { font-size: 15.5px; min-height: 52px; padding: 12px 26px; }
  .tl-pname, .tl-cons strong { font-size: clamp(19px, 1.05vw, 24px); }
  .tl-sec-head h2 { font-size: clamp(44px, 2.5vw, 60px); }
  .tl-hero h1 { font-size: clamp(66px, 3.6vw, 92px); }
}

/* below 1200px the row no longer has room for four columns: drawing and name on top, facts and the
   button underneath, each at full width */
@media (max-width: 1199px) {
  .tl-list { grid-auto-rows: auto; }
  .tl-item { grid-template-columns: 190px minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "v main" "v go" "facts facts"; }
  .tl-main { padding: 20px 22px 0 24px; }
  .tl-go { margin: 14px 22px 20px 24px; }
  .tl-item > .tl-facts { padding: 18px 24px 20px; border-top: 1px solid var(--card-line); }
}
@media (max-width: 999px) {
  .tl-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* touch sizes: everything that can be tapped is at least 44px tall */
@media (max-width: 859px) {
  .tl .nav-logo, .tl .nav-cta, .tl .lang-btn { min-height: 44px; }
  .tl .nav-cta { display: inline-flex; align-items: center; }
  .tl-crumb a { display: inline-flex; align-items: center; min-height: 44px; border-bottom: 0; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; }
  .tl-crumb { margin-bottom: 8px; }
  .tl-pfoot .w-link, .tl-by { display: inline-flex; align-items: center; min-height: 44px; }
  .tl-pfoot { gap: 0; margin-top: 8px; }
}
/* phone */
@media (max-width: 639px) {
  .tl-hero { padding-bottom: 40px; }
  .tl-sec { padding-top: 56px; }
  .tl-item { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "v" "main" "facts" "go"; }
  .tl-v { min-height: 0; height: 132px; justify-content: center; border-right: 0; border-bottom: 1px solid var(--card-line); }
  .tl-v .fam-art { width: auto; height: 100%; }
  .tl-main { padding: 16px 20px 2px; }
  .tl-nm { font-size: 20px; }
  .tl-item > .tl-facts { border-top: 0; gap: 0; padding: 12px 20px 8px; }
  .tl-item > .tl-facts > div, html[lang="en"] .tl-item > .tl-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 9px 0; border-top: 1px solid var(--card-line); }
  .tl-facts dt { font-size: 12px; letter-spacing: .04em; }
  .tl-go { justify-self: stretch; margin: 6px 20px 20px; }
  .tl-pgrid { grid-template-columns: minmax(0, 1fr); }
  .tl-pcard { padding: 22px 20px 20px; }
  .tl-cons { grid-template-columns: minmax(0, 1fr) auto; }
  .tl-cons span { grid-column: 1 / -1; grid-row: 2; }
  .tl-close .btn { flex: 1 1 100%; }
  .tl-jump a { flex: 1 1 auto; }
}
@media (max-width: 359px) {
  .tl-pname { font-size: 17.5px; }
  .tl-cons strong { font-size: 17px; }
}
/* ---------- footer: same look as the homepage's on wide screens; a tidy list of 44px links on phones ---------- */
.tl-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; min-width: 0; }
.tl-foot-copy { white-space: nowrap; }
.tl-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; min-width: 0; }
.tl-foot li { display: flex; align-items: baseline; white-space: nowrap; }
.tl-foot li::before { content: '·'; margin: 0 .45em; }
@media (max-width: 859px) {
  .tl .footer-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .tl .footer-brand { flex-wrap: wrap; gap: 8px 12px; }
  .tl-foot { flex-direction: column; align-items: stretch; gap: 6px; }
  .tl-foot ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .tl-foot li { min-width: 0; }
  .tl-foot li::before { content: none; }
  .tl-foot li:last-child { grid-column: 1 / -1; }
  .tl-foot .footer-llm { display: flex; align-items: center; min-height: 44px; border-bottom: 0; text-decoration: underline dotted rgba(245,239,230,.3); text-underline-offset: 5px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-go, .tl-cons i { transition: none; }
}
