/* "Kobo" (workshop): the recent-builds section on My Projects.
   Minimal Japanese accents on the site's own tokens: a faint seigaiha wave
   pattern, drifting sakura petals, a small anime mascot, and one vermilion
   hanko seal per project card. */
:root {
  --sumi: #2b2a28;
  --shu: var(--peach);
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Songti SC", serif;
}

.kobo {
  padding: 8px 0 56px;
}

.kobo .help-title {
  margin-bottom: 24px;
}

.kobo-ja {
  margin-left: 10px;
  color: var(--peach);
  font-family: var(--mincho);
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0.1em;
  vertical-align: middle;
}

.kobo-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.kobo-hero-text {
  min-width: 0;
}

/* Seigaiha (blue-sea waves) pattern behind the page hero. A radial mask fades
   it out on every side, so it has no edges and stays behind the mascot. */
.kobo-hero::before {
  position: absolute;
  inset: 40px 0 0 0;
  z-index: -2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cdefs%3E%3Cg id='s'%3E%3Ccircle r='20' fill='%23f5f5f7'/%3E%3Cg fill='none' stroke='%23c93400' stroke-width='1'%3E%3Ccircle r='19.5'/%3E%3Ccircle r='15'/%3E%3Ccircle r='10.5'/%3E%3Ccircle r='6'/%3E%3C/g%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23s' x='0' y='0'/%3E%3Cuse href='%23s' x='40' y='0'/%3E%3Cuse href='%23s' x='20' y='10'/%3E%3Cuse href='%23s' x='0' y='20'/%3E%3Cuse href='%23s' x='40' y='20'/%3E%3C/svg%3E");
  background-size: 48px 24px;
  opacity: 0.08;
  -webkit-mask-image: radial-gradient(ellipse 55% 75% at 85% 60%, #000 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 55% 75% at 85% 60%, #000 0%, transparent 100%);
  content: "";
  pointer-events: none;
}

/* A few sakura petals drifting behind the hero. */
.kobo-petals {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.kobo-petals span {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 7px;
  border-radius: 10px 0 10px 0;
  background: #f2c2cc;
  opacity: 0;
  animation: petal-fall 16s linear infinite;
}

.kobo-petals span:nth-child(1) { left: 12%; animation-delay: 0s; }
.kobo-petals span:nth-child(2) { left: 34%; animation-delay: 4s; animation-duration: 19s; }
.kobo-petals span:nth-child(3) { left: 58%; animation-delay: 9s; }
.kobo-petals span:nth-child(4) { left: 76%; animation-delay: 2s; animation-duration: 21s; }
.kobo-petals span:nth-child(5) { left: 90%; animation-delay: 12s; animation-duration: 18s; }

@keyframes petal-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg); }
  10% { opacity: 0.8; }
  50% { transform: translate(-40px, 160px) rotate(160deg); }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translate(10px, 340px) rotate(320deg); }
}

.kobo-mascot {
  flex: none;
  width: 170px;
  height: auto;
  max-width: 100%;
}

.kobo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.kobo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px 24px;
  background: var(--bg-elevated);
  transition: translate var(--dur-2) var(--ease-soft), box-shadow var(--dur-2) var(--ease-soft);
}

@media (hover: hover) {
  .kobo-card:hover {
    translate: 0 -3px;
    box-shadow: var(--shadow);
  }
}

.hanko {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--shu);
  border-radius: 6px;
  color: var(--shu);
  font-family: var(--mincho);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}

.kobo-meta {
  padding-right: 64px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kobo-meta span[lang="ja"] {
  margin-left: 6px;
  font-family: var(--mincho);
  letter-spacing: 0.1em;
  text-transform: none;
}

.kobo-card h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  letter-spacing: -0.04em;
}

.kobo-card > p {
  color: var(--muted);
  font-size: 0.95rem;
}

.kobo-media {
  overflow: hidden;
  border-radius: 14px;
  background: var(--ink);
  aspect-ratio: 16 / 9;
  max-width: 100%;
}

.kobo-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kobo-caption {
  margin-top: -6px;
  color: var(--faint);
  font-size: 0.78rem;
}

/* A real exchange from the recording, with the pipeline's decision under it. */
.kobo-chat {
  display: grid;
  gap: 8px;
  border-radius: 16px;
  padding: 14px;
  background: var(--bg);
}

.kobo-msg {
  max-width: 88%;
  margin: 0;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 0.86rem;
  line-height: 1.4;
}

.kobo-msg-you {
  justify-self: end;
  background: var(--ink);
  color: #fff;
}

.kobo-msg-bot {
  justify-self: start;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
}

.kobo-trace {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
}

.kobo-trace span {
  border-radius: 6px;
  padding: 2px 7px;
  background: var(--bg-elevated);
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
}

.kobo-trace span:nth-child(2),
.kobo-trace span:nth-child(3) {
  color: var(--peach);
}

.kobo-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.kobo-facts li {
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
}

.kobo-facts strong {
  display: block;
  color: var(--ink);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.kobo-card .tags {
  justify-content: flex-start;
}

.kobo-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.kobo-note {
  align-self: center;
  color: var(--faint);
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .kobo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .kobo-hero { align-items: flex-start; flex-direction: column-reverse; gap: 8px; }
  .kobo-mascot { width: 104px; }
  .kobo-card { padding: 24px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .kobo-card { transition: none; }
  .kobo-petals { display: none; }
}

/* Problem / decision / result labels in each card. */
.kobo-card > p strong {
  color: var(--ink);
  font-weight: 600;
}
