:root {
  --ink: #33425d;
  --muted: #67758c;
  --blue: #397ce5;
  --pink: #ed739d;
  --yellow: #ffcf63;
  --line: #d6e2ef;
  --surface: #f5f9ff;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font:
    400 16px/1.9 Poppins,
    "Noto Sans JP",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
a {
  color: #235ab4;
  text-underline-offset: 4px;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 4px;
}
.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
}
.topbar {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar span,
.eyebrow {
  color: #3766a5;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.portal-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.86rem;
  border: 1px solid #91b7ef;
  border-radius: 999px;
  background: linear-gradient(145deg, #639cef, #3274d7);
  color: white;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow:
    inset 1px 1px #ffffff77,
    0 3px 0 #c9d9ed;
}
.hero {
  padding: 4rem 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 2rem;
}
h1 {
  margin: 0.5rem 0 1.2rem;
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.055em;
}
h1 em {
  font-style: normal;
  color: var(--blue);
}
h2 {
  margin: 0.6rem 0 1.4rem;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  line-height: 1.4;
  letter-spacing: -0.035em;
}
h3 {
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
}
p {
  color: var(--muted);
}
.lead {
  font-size: 1.1rem;
}
.hero-art {
  display: block;
  width: 100%;
  height: auto;
}
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.jump a {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}
section {
  padding: 4rem 0;
}
.tinted {
  background: #eaf1fc;
  border-block: 1px solid var(--line);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.8rem;
}
.card {
  min-width: 0;
  padding: 1.4rem;
  border: 1px solid #d5e0ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 9px 22px #344e7510;
}
.card p {
  margin: 0.5rem 0;
}
.cards .card:nth-child(2) {
  border-top: 4px solid var(--pink);
}
.cards .card:nth-child(1) {
  border-top: 4px solid var(--blue);
}
.cards .card:nth-child(3) {
  border-top: 4px solid var(--yellow);
}
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0;
}
.flow div {
  display: grid;
  gap: 0.4rem;
  padding: 1.2rem;
  border-radius: 16px;
  background: #e4edfc;
  text-align: center;
}
.flow span:not(.flow-arrow) {
  font-size: 0.83rem;
  color: var(--muted);
}
.flow-arrow {
  color: var(--pink);
  font-size: 1.7rem;
  font-weight: 800;
}
.experience-grid,
.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.experience-grid {
  margin-top: 1.5rem;
  align-items: stretch;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 1px solid #2566c4;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.secondary {
  color: #335783;
  background: #fff;
  border-color: #9cb9dd;
}
.button:hover {
  filter: brightness(0.95);
}
label {
  display: block;
  font-weight: 700;
}
select {
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}
.endpoint {
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.endpoint span {
  color: #2367be;
  font-weight: 800;
}
.post-card {
  border-top: 4px solid var(--pink);
}
.post-card h3 {
  margin-top: 1rem;
  overflow-wrap: anywhere;
}
.post-card p {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #3566aa;
  letter-spacing: 0.04em;
}
small {
  font-size: 0.82rem;
  color: var(--muted);
}
code,
pre,
kbd {
  font-family: Consolas, monospace;
}
code {
  padding: 0.1rem 0.25rem;
  color: #365986;
  background: #eaf0fb;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
pre {
  margin: 1rem 0;
  padding: 1.2rem;
  border: 1px solid #29405e;
  border-radius: 14px;
  color: #e2ecff;
  background: #182a43;
  font-size: 0.84rem;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  max-width: 100%;
}
.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  font-size: 0.82rem;
}
.legend span {
  padding: 0.5rem;
  background: #e9f0fb;
  border-radius: 8px;
}
.legend b {
  color: #3566aa;
}
.note {
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--yellow);
  border-radius: 0 12px 12px 0;
  background: #fff6de;
  color: #665734;
  font-size: 0.88rem;
}
.instructions {
  padding-left: 1.4rem;
}
.instructions li {
  margin: 0.7rem 0;
}
.environments code {
  display: block;
  font-size: 0.8rem;
}
.build-steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.6rem;
}
.build-steps > li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.build-steps > li > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e2edff;
  color: var(--blue);
  font-weight: 800;
}
.build-steps p {
  margin: 0.5rem 0;
}
.callout {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #e6eefe, #fce6ef);
  border: 1px solid #d5dded;
}
.text-link {
  font-weight: 700;
}
.sources {
  font-size: 0.85rem;
}
.sources h2 {
  font-size: 1.3rem;
}
.sources ul {
  padding-left: 1.4rem;
}
.guide-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  background: #dfe9f8;
}
.footer-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-pagination {
  display: flex;
  margin-left: auto;
}
.page-pagination a {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 1rem;
  border: 1px solid #afc7e7;
  border-radius: 14px;
  color: #335783;
  background: #f5f9ff;
  text-decoration: none;
  font-size: 0.83rem;
}
.api-lab-dock {
  position: sticky;
  bottom: 0;
  z-index: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5em;
  padding: 0.7rem 1rem;
  border-top: 1px solid #b1d0ff;
  background: #3269c5ee;
  backdrop-filter: blur(10px);
}
.api-lab-dock button {
  padding: 0.7rem 1.1rem;
  border: 1px solid #d7e4ff;
  border-radius: 99px;
  background: #fff;
  color: #2c5ca5;
  font-weight: 800;
}
.api-lab-dock span {
  margin-left: 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
}
#toTop {
  position: fixed;
  z-index: 900;
  right: 1.3rem;
  bottom: 6rem;
  width: 48px;
  height: 48px;
  border: 1px solid #b9d6ff;
  border-radius: 50%;
  background: #397ce5ed;
  color: white;
  opacity: 0;
  pointer-events: none;
  translate: 0 10px;
  transition:
    opacity 0.2s,
    translate 0.2s;
  cursor: pointer;
}
#toTop.is-visible {
  opacity: 1;
  pointer-events: auto;
  translate: 0 0;
}
dialog {
  width: min(820px, calc(100% - 24px));
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop {
  background: #0d1d38cc;
}
.lab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.lab-head h2 {
  margin: 0;
  font-size: 1.2rem;
}
.lab-head button {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}
.lab-content {
  padding: 1.4rem;
}
.lab-screen {
  padding: 1.2rem;
  border-radius: 14px;
  background: #182a43;
  color: white;
}
.lab-screen .badge {
  color: #98c7ff;
}
.lab-screen pre {
  padding: 0.7rem 0;
  border: 0;
  margin: 0.6rem 0;
}
.guided {
  outline: 3px solid #ff5454;
  outline-offset: 4px;
}
.guide-label {
  display: table;
  padding: 0.3rem 0.6rem;
  border: 2px solid #ff5454;
  border-radius: 6px;
  color: white;
  background: #322430;
  font-size: 0.8rem;
}
body.lab-open {
  overflow: hidden;
}
@media (max-width: 760px) {
  .wrap {
    width: calc(100% - 28px);
  }
  .hero {
    padding: 2.5rem 0;
  }
  .hero-grid,
  .cards,
  .two-columns,
  .experience-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-grid picture {
    order: -1;
    max-width: 400px;
    margin: auto;
  }
  .hero-art {
    max-height: 250px;
    object-fit: contain;
  }
  section {
    padding: 3rem 0;
  }
  .flow {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }
  .flow-arrow {
    rotate: 90deg;
  }
  .topbar span {
    font-size: 0.65rem;
  }
  .build-steps > li {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-pagination {
    width: 100%;
    margin-left: 0;
  }
  .site-copyright {
    align-self: center;
  }
  .api-lab-dock {
    min-height: 4.6em;
  }
  .api-lab-dock span {
    display: none;
  }
  #toTop {
    right: 1rem;
    bottom: 5.8rem;
  }
  .lab-content,
  .lab-head {
    padding: 1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  #toTop {
    transition: none;
  }
}

.fortune-api-demo {
  margin-top: 3.5rem;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  border: 1px solid #d9d2f2;
  border-radius: 24px;
  background: linear-gradient(135deg, #faf7ff, #eef5ff 56%, #fff5f8);
  box-shadow: 0 14px 34px #516b9920;
}
.fortune-api-demo__intro h3 {
  margin: 0.2rem 0 0.7rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.45;
}
.fortune-api-demo__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 1.1rem;
  align-items: stretch;
  margin-top: 1.3rem;
}
.fortune-request,
.fortune-result {
  min-width: 0;
  padding: 1.3rem;
}
.fortune-request label {
  display: block;
  margin: 1.1rem 0 0.45rem;
  font-weight: 800;
}
.fortune-request select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #bfcdea;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.fortune-request .button {
  width: 100%;
  margin-top: 0.7rem;
}
.fortune-request #fortune-status {
  min-height: 3em;
  font-size: 0.84rem;
}
.fortune-result {
  text-align: center;
  background: linear-gradient(150deg, #fffafa, #f6f3ff);
}
.fortune-result__head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 800;
  color: #7a689d;
}
.fortune-image-stage {
  width: min(100%, 270px);
  aspect-ratio: 1;
  margin: 0.35rem auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe6f0 0, #e7e2ff 57%, transparent 59%);
}
.fortune-image-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center bottom;
}
#fortune-image.is-arriving {
  animation: fortune-image-arrival 620ms cubic-bezier(0.22, 0.9, 0.32, 1.18)
    both;
}
@keyframes fortune-image-arrival {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  46% {
    opacity: 1;
    transform: scale(1.14);
  }
  67% {
    transform: scale(0.94);
  }
  84% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}
.fortune-result h4 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.15rem;
}
.fortune-result p {
  min-height: 3.8em;
  margin: 0.3rem auto 0.55rem;
  line-height: 1.8;
}
.fortune-result small {
  display: block;
  color: #9286a8;
  font-size: 0.67rem;
  letter-spacing: 0.08em;
}
.fortune-json {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: center;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid #ddd8ed;
}
.fortune-json p {
  margin: 0.2rem 0;
}
.fortune-json pre {
  max-height: 280px;
  margin: 0;
  background: #263653;
  color: #eaf2ff;
}
.fortune-json a {
  font-weight: 800;
}
@media (max-width: 760px) {
  .fortune-api-demo {
    margin-top: 2.5rem;
    padding: 1rem;
    border-radius: 18px;
  }
  .fortune-api-demo__grid,
  .fortune-json {
    grid-template-columns: minmax(0, 1fr);
  }
  .fortune-request,
  .fortune-result {
    padding: 1rem;
  }
  .fortune-image-stage {
    width: min(100%, 230px);
  }
  .fortune-json pre {
    max-height: 230px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #fortune-image.is-arriving {
    animation: none;
  }
}

/* API name breakdown and letter-delivery feedback */
#what h2 em {
  color: var(--blue);
  font-size: 0.7em;
  font-style: normal;
  letter-spacing: -0.045em;
}
.api-word-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.7rem 0 1.25rem;
}
.api-word-card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid #d5e0ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 9px 22px #344e7510;
}
.api-word-card span {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.api-word-card h3 {
  margin: 0 0 0.3rem;
  overflow-wrap: anywhere;
  font-size: 1.28rem;
}
.api-word-card p {
  margin: 0;
  font-size: 0.94rem;
}
.api-word-card.application {
  border-top: 4px solid var(--blue);
}
.api-word-card.application span {
  color: #397ce5;
}
.api-word-card.programming {
  border-top: 4px solid var(--pink);
}
.api-word-card.programming span {
  color: #cc4f7b;
}
.api-word-card.interface {
  border-top: 4px solid var(--yellow);
}
.api-word-card.interface span {
  color: #a87608;
}
.api-definition {
  display: inline-block;
  margin: 0.1rem 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #e4edfc;
  color: #405470;
  font-size: 1.02rem;
}
.api-definition strong {
  color: #235ab4;
}
.api-webapi-intro {
  margin-top: 0;
}
#fortune-delivery {
  width: min(560px, calc(100% - 30px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background: transparent;
  box-shadow: 0 24px 65px #10264d66;
}
#fortune-delivery::backdrop {
  background: #152a4d91;
  backdrop-filter: blur(4px);
}
.fortune-delivery__content {
  padding: 1rem 1rem 0.9rem;
  border: 1px solid #ffffffaa;
  border-radius: 26px;
  background: linear-gradient(145deg, #f8fbff, #e9f2ff);
  text-align: center;
}
.fortune-delivery__content img {
  display: block;
  width: min(100%, 470px);
  height: auto;
  margin: auto;
}
.fortune-delivery__content p {
  margin: -0.45rem 0 0;
  color: #305d9d;
  font-weight: 800;
}
@media (max-width: 760px) {
  .api-word-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
  }
  .api-word-card {
    padding: 1rem;
  }
  .api-word-card h3 {
    font-size: 1.15rem;
  }
  .api-definition {
    display: block;
    font-size: 0.94rem;
  }
  .fortune-delivery__content {
    padding: 0.7rem;
    border-radius: 20px;
  }
  .fortune-delivery__content p {
    margin: -0.25rem 0 0;
    font-size: 0.9rem;
  }
}
