/* Landing page: a white page, big rounded colour blocks, and Takumi in 3D standing in each one.
   Colours, radii and fonts come from tokens.css. */
* { box-sizing: border-box; }
html { color-scheme: light; background: var(--white); }
body { margin: 0; background: var(--white); color: var(--text); font: 17px/1.6 var(--font-ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; border-radius: var(--r-m); }
h1, h2, h3, p, ul { margin: 0; }
img { max-width: 100%; }

/* ---------- Takumi: a picture in each block, with a slow bob and a little lean when you point at him ---------- */
.slot { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: min(62vh, 520px); min-height: 280px; }
.slot img { display: block; width: auto; height: 100%; max-width: 100%; object-fit: contain; transform-origin: 50% 100%; animation: bob 3.8s ease-in-out infinite alternate; transition: transform .3s ease; }
.slot:hover img { animation-play-state: paused; transform: rotate(-3deg) scale(1.03); }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* ---------- skip link, language link, questions ---------- */
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--ink-block); color: var(--white); font-weight: 700; text-decoration: none; }
.skip:focus { left: 12px; }
.top nav .lang { padding: 4px 11px; border: 2px solid var(--ink-block); border-radius: 999px; color: var(--ink-block); font-size: 13px; font-weight: 800; }
.top nav .lang:hover { background: var(--brand-soft); }
.faq-list { display: grid; gap: 12px; max-width: 820px; margin-top: 36px; }
.faq details { border: 2px solid var(--ink-block); border-radius: var(--r-xl); background: var(--white); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; font-size: 18px; font-weight: 800; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 800; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { max-width: 64ch; padding: 0 22px 20px; color: var(--muted-2); }
.faq summary:focus-visible { outline: 3px solid var(--ink-block); outline-offset: -3px; border-radius: var(--r-xl); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(20px, 4vw); background: color-mix(in srgb, var(--white) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.top nav { display: flex; align-items: center; gap: 22px; font-size: 15px; font-weight: 500; }
.top nav a:not(.pill) { color: var(--muted-2); text-decoration: none; }
.top nav a:not(.pill):hover { color: var(--text); }

.pill { display: inline-block; padding: 14px 28px; border: 2px solid var(--ink-block); border-radius: 999px; font-size: 15px; font-weight: 800; text-decoration: none; transition: background .15s, color .15s; }
.pill.solid { background: var(--brand); color: var(--ink-block); }
.pill.solid:hover { background: var(--brand-strong); }
.pill.line { background: transparent; color: var(--ink-block); }
.pill.line:hover { background: var(--brand-soft); }
.pill.line.light { border-color: var(--white); color: var(--white); }
.pill.line.light:hover { background: var(--brand); border-color: var(--brand); color: var(--ink-block); }
.pill.small { padding: 8px 18px; font-size: 14px; }

.card { border-radius: var(--r-xl); background: var(--white); color: var(--ink-block); }
.card.hard { border: 2px solid var(--ink-block); box-shadow: 10px 10px 0 0 var(--ink-block); }
.card.flat { border: 2px solid var(--ink-block); padding: 14px; }

/* ---------- hero ---------- */
.hero { padding: clamp(28px, 4.4vw, 60px) max(20px, 4vw) clamp(56px, 8vw, 96px); text-align: center; }
h1, h2 { text-transform: uppercase; font-weight: 800; letter-spacing: -.035em; }
h1 { max-width: 19ch; margin-inline: auto; font-size: clamp(2.4rem, 6.4vw, 5.4rem); line-height: .94; text-wrap: balance; }
.lede { max-width: 44ch; margin: 18px auto 0; color: var(--muted-2); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.actions.left { justify-content: flex-start; }
.block.teal .pill.line:hover { background: var(--white); }
.phone-note { display: none; max-width: 34ch; margin: 28px auto 0; padding: 14px 16px; border: 2px solid var(--ink-block); border-radius: var(--r-l); background: var(--brand-soft); text-align: left; }

.peek { position: relative; max-width: 960px; margin: clamp(16px, 3vw, 36px) auto 0; }
.slot-hero { width: min(340px, 64%); margin: 0 auto -6px; height: clamp(240px, 40vh, 360px); }
.cap-card { overflow: hidden; text-align: left; }
.cap { width: 100%; border-collapse: collapse; font: 13px/1.4 var(--font-mono); }
.cap th { padding: 9px 14px; border-bottom: 2px solid var(--ink-block); background: var(--bg); color: var(--muted-2); font-weight: 700; text-align: left; }
.cap td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.cap td:last-child { white-space: normal; color: var(--text-2); }
.cap .now td { background: var(--warn-bg); font-weight: 700; }
.t-arp, .t-dns { font-weight: 800; }
.t-arp { color: var(--warn-ink); }
.t-icmp { color: var(--packet); font-weight: 800; }
.t-dns { color: var(--accent-ink); }
.t-http { color: var(--ok); font-weight: 800; }

/* ---------- colour blocks ---------- */
.block { margin: 10px max(10px, 1.4vw); padding: 0 max(24px, 5vw); border-radius: 2.4rem; }
.block.ink { background: var(--ink-block); color: var(--white); }
.block.teal { background: var(--brand); color: var(--ink-block); }
.block.grey { background: var(--bg); color: var(--ink-block); }
.block-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: end; max-width: 1180px; min-height: 74vh; margin-inline: auto; }
.block .slot { margin-bottom: 22px; }
.say { align-self: center; padding: clamp(56px, 8vw, 104px) 0; }
h2 { font-size: clamp(2.3rem, 6vw, 5.4rem); line-height: .92; }
.say p { max-width: 40ch; margin-top: 24px; font-size: clamp(16px, 1.4vw, 19px); }
.block.ink .say > p { color: color-mix(in srgb, var(--white) 72%, transparent); }
.block.teal .say > p { color: var(--ink-block); }
.block.grey .say > p { color: var(--muted-2); }
.say .card { margin-top: 30px; max-width: 460px; }
.block.free .say > p { max-width: 46ch; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs .tab { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); font-size: 13px; background: transparent; cursor: pointer; }
.tabs .tab:hover { border-color: var(--ink-block); }
.tabs .tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tabs .tab[aria-selected="true"] { border-color: var(--ink-block); background: var(--brand-soft); font-weight: 700; }
.tilerow { display: flex; gap: 8px; margin-top: 12px; }
.tilerow .tile { display: grid; justify-items: center; gap: 2px; flex: 1; padding: 8px 4px; border: 1px solid var(--line-soft); border-radius: var(--r-m); background: var(--bg); font-size: 12px; cursor: pointer; }
.tilerow .tile:hover { border-color: var(--brand); background: var(--brand-soft); }
.tilerow .tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini th { padding: 6px 10px; border-bottom: 2px solid var(--ink-block); color: var(--muted-2); font-weight: 700; text-align: left; }
.mini td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.mini .now td { background: var(--warn-bg); font-weight: 700; }

.checks { display: grid; gap: 8px; padding: 14px; list-style: none; }
.checks li { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--r-m); font-size: 15px; }
.checks small { grid-column: 2; margin-top: -2px; color: var(--muted); font-size: 13px; }
.checks span { width: 18px; height: 18px; margin-top: 2px; border: 2px solid var(--faint); border-radius: 50%; }
.checks .pass { background: var(--brand-soft); border-color: var(--brand); }
.checks .pass span { border-color: var(--brand-strong); background: var(--brand-strong); box-shadow: inset 0 0 0 3px var(--brand-soft); }

/* ---------- examples and lessons ---------- */
.start { max-width: 1180px; margin: 0 auto; padding: clamp(64px, 9vw, 120px) max(24px, 5vw); }
.start h2 { max-width: 14ch; }
.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; margin-top: 44px; }
.lists .card { padding: 26px 28px; }
.lists .card > p { margin-top: 10px; color: var(--muted-2); }
.lists h3 { font-size: 21px; font-weight: 800; letter-spacing: -.015em; }
.lists ul { margin-top: 14px; padding: 0; list-style: none; }
.lists li { border-top: 1px solid var(--line-soft); }
.lists a { display: grid; gap: 2px; padding: 14px 2px; text-decoration: none; }
.lists strong { font-weight: 750; }
.lists a:hover strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.lists span { color: var(--muted-2); font-size: 15px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding: 28px max(24px, 5vw) 44px; color: var(--muted-2); font-size: 14px; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .block-grid, .lists { grid-template-columns: minmax(0, 1fr); }
  .block-grid { min-height: 0; gap: 0; }
  .block-grid.flip .slot { order: 2; }
  .say { padding-bottom: 8px; }
  .slot { height: 300px; min-height: 0; }
  .block { border-radius: 1.6rem; }
}
/* Phones cannot use the workspace (keep in step with PHONE_QUERY in js/phone.js). */
@media (max-width: 599px), (max-height: 500px) and (pointer: coarse) {
  .only-computer { display: none !important; }
  .phone-note { display: block; }
  .lists a { pointer-events: none; }
  .cap th:nth-child(3), .cap td:nth-child(3), .cap th:nth-child(5), .cap td:nth-child(5) { display: none; }
}

/* People who ask for less motion get a still Takumi. */
@media (prefers-reduced-motion: reduce) {
  .slot img, .slot:hover img { animation: none; transform: none; transition: none; }
  .pill { transition: none; }
}
