/* Purpose map, inspired by ikigai (/ikigai). The page reuses the wheel of life's classes in styles.css
   (wheel-quiz, wheel-orb, wheel-q, wheel-stage, wheel-now, wheel-step, wheel-send …); this file adds only what's new:
   the list-and-chips steps, the "connect the circles" cards, the four-circle map and its labels. */

.ik-paper { margin-top: 22px; color: var(--sage-dark); text-align: left; }
.ik-paper:hover { color: var(--dark); }

/* ---------- the orb: the four-circle map in the wheel's glow ---------- */
.ik-orb { width: 210px; transition: width 0.45s var(--ease); }
.ik-quiz.is-connect .ik-orb { width: 176px; }
/* while connecting the circles, the orb stays in view as the cards scroll beneath it */
@media (min-height: 620px) {
  .ik-quiz.is-connect .ik-orb-wrap {
    position: sticky; top: var(--nav-h); z-index: 4;
    margin: 0 -12px; padding: 6px 12px 18px;
    background: linear-gradient(to bottom, var(--off) 80%, rgba(250, 250, 250, 0));
  }
  /* tabbing through the cards never leaves a toggle hidden under the orb */
  .ik-quiz.is-connect .ik-toggle { scroll-margin-top: calc(var(--nav-h) + 230px); scroll-margin-bottom: 24px; }
}

/* ---------- steps 1–4: type a few things, or tap an idea ---------- */
.ik-add { display: flex; align-items: flex-end; gap: 14px; max-width: 520px; margin: 30px auto 0; text-align: left; }
.ik-add .field { flex: 1; min-width: 0; }
.ik-add .field input { height: 44px; font-size: 17px; }
.ik-add .btn { flex-shrink: 0; }
.ik-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 580px; margin: 22px auto 0; padding: 0; list-style: none; }
.ik-chips:empty { margin-top: 0; }
.ik-chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
  padding: 5px 5px 5px 16px; border-radius: 999px; background: var(--white);
  box-shadow: inset 0 0 0 1px rgba(127, 166, 155, 0.55), 0 12px 26px -20px rgba(46, 50, 49, 0.4);
  font-size: 15px; line-height: 1.35; color: var(--dark); text-align: left;
}
.ik-chip span { overflow-wrap: anywhere; }
.ik-chip.is-new { animation: ik-pop 0.5s var(--spring); }
.ik-chip-x { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); transition: background-color 0.25s, color 0.25s; }
.ik-chip-x:hover { background: var(--sage-20); color: var(--dark); }
.ik-chip-x:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }
.ik-chip-x svg { display: block; width: 11px; height: 11px; }
@keyframes ik-pop { from { opacity: 0; transform: scale(0.82); } }

.ik-ideas { max-width: 580px; margin: 26px auto 0; }
.ik-ideas-label { font-size: 13px; color: var(--muted); }
.ik-ideas-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.ik-idea, .ik-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; border: 1px dashed rgba(46, 50, 49, 0.28);
  color: var(--text); line-height: 1.2;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.ik-idea { padding: 8px 14px 7px 12px; font-size: 14px; }
/* a small plus, drawn rather than typed, that turns into a tick once it's chosen */
.ik-idea::before, .ik-toggle::before {
  content: ''; flex-shrink: 0; width: 8px; height: 8px; color: var(--sage);
  background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
}
.ik-idea:hover:not(:disabled), .ik-toggle:hover { border-color: var(--sage); color: var(--dark); }
.ik-idea[aria-pressed="true"] { border-style: solid; border-color: var(--sage); background: var(--sage-20); color: var(--dark); }
.ik-idea[aria-pressed="true"]::before, .ik-toggle[aria-pressed="true"]::before {
  width: 4px; height: 8px; margin: -2px 2px 0; background: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.ik-idea:disabled { opacity: 0.4; cursor: default; }
.ik-idea:focus-visible, .ik-toggle:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.ik-status { max-width: 520px; margin: 18px auto 0; min-height: 1.6em; font-size: 14px; line-height: 1.6; color: var(--sage-dark); }

/* ---------- step 5: connect the circles ---------- */
.ik-cards { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; text-align: left; }
.ik-card {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px 14px;
  padding: 14px 16px 14px 14px; border-radius: 16px; background: var(--white);
  box-shadow: 0 20px 44px -34px rgba(46, 50, 49, 0.35), inset 0 0 0 1px rgba(46, 50, 49, 0.04);
  transition: background-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.ik-card[data-n="2"], .ik-card[data-n="3"] { box-shadow: 0 20px 44px -34px rgba(46, 50, 49, 0.35), inset 0 0 0 1px rgba(127, 166, 155, 0.45); }
.ik-card[data-n="4"] {
  background: linear-gradient(140deg, #FFFDF6, #FFF4DA);
  box-shadow: 0 22px 46px -30px rgba(176, 140, 40, 0.45), inset 0 0 0 1px rgba(216, 188, 106, 0.6);
}
.ik-card.is-moved { animation: ik-glow 0.9s var(--ease-out); }
@keyframes ik-glow { 30% { box-shadow: 0 0 0 4px rgba(243, 226, 179, 0.75), 0 20px 44px -30px rgba(176, 140, 40, 0.5); } }
.ik-glyph { display: block; align-self: start; width: 34px; height: 34px; margin-top: 2px; overflow: visible; }
.ik-glyph circle { fill: none; stroke: rgba(46, 50, 49, 0.2); stroke-width: 1.2; transition: fill 0.35s, stroke 0.35s; }
.ik-glyph circle.on { fill: rgba(127, 166, 155, 0.24); stroke: var(--sage); }
.ik-glyph circle.home { fill: rgba(127, 166, 155, 0.5); stroke: var(--sage-dark); }
.ik-card[data-n="4"] .ik-glyph circle { fill: rgba(216, 188, 106, 0.3); stroke: #C9A949; }
.ik-card-text { font-weight: 500; font-size: 16px; line-height: 1.4; color: var(--dark); overflow-wrap: anywhere; }
.ik-card-home { margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.ik-card-tag {
  display: inline-block; margin-left: 4px; padding: 3px 8px 2px; border-radius: 999px; vertical-align: 1px;
  font-weight: 600; font-size: 10px; line-height: 1.3; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(46, 50, 49, 0.12);
}
.ik-card[data-n="2"] .ik-card-tag, .ik-card[data-n="3"] .ik-card-tag { color: var(--sage-dark); background: var(--sage-20); box-shadow: none; }
.ik-card[data-n="4"] .ik-card-tag { color: #7A611A; background: rgba(243, 226, 179, 0.8); box-shadow: none; }
.ik-card.is-moved .ik-card-tag { animation: ik-pop 0.5s var(--spring); }
.ik-also { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
@media (max-width: 639px) {
  .ik-card { grid-template-columns: 34px minmax(0, 1fr); }
  .ik-also { grid-column: 2; justify-content: flex-start; }
}
.ik-also-label { margin-right: 2px; font-size: 13px; color: var(--muted); }
.ik-toggle { padding: 7px 11px 6px 10px; font-size: 13px; }
.ik-toggle[aria-pressed="true"] { border-style: solid; border-color: var(--sage); background: var(--sage); color: var(--white); }
.ik-toggle[aria-pressed="true"]::before { color: var(--white); }
.ik-toggle[aria-pressed="true"]:hover { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--white); }

/* ---------- the map (the orb and the finished map share these) ---------- */
.ik-fill { fill-opacity: 0.85; transition: fill-opacity 0.6s var(--ease); }
.ik-has-active .ik-c:not(.on) .ik-fill { fill-opacity: 0.6; }
.ik-c.on .ik-fill { fill-opacity: 1; }
.ik-ring { fill: none; stroke: rgba(255, 255, 255, 0.5); transition: stroke 0.5s var(--ease); }
.ik-glow { fill: none; stroke: rgba(246, 231, 186, 0.34); opacity: 0; transition: opacity 0.6s var(--ease); }
.ik-c.on .ik-ring { stroke: rgba(255, 255, 255, 0.95); }
.ik-c.on .ik-glow { opacity: 1; }
.ik-big .ik-glow { opacity: 0.6; }
.ik-core { transition: opacity 0.8s var(--ease); }
.ik-dot .a-halo { transition: fill 0.4s; }
.ik-dot.lit .a-halo, .ik-dot.mid .a-halo { fill: rgba(255, 240, 200, 0.6); }
.ik-dot .a-dot { stroke: rgba(62, 84, 80, 0.28); stroke-width: 0.6; }
.ik-dot.hot .a-halo, .ik-dot.chosen .a-halo { fill: rgba(255, 236, 170, 0.85); }
.ik-hit { fill: transparent; cursor: pointer; }
.ik-lbl { pointer-events: none; }
.ik-name { font-family: var(--sans); font-weight: 500; fill: rgba(255, 255, 255, 0.96); }
.ik-pair { font-family: var(--serif); font-style: italic; fill: #F3E2B3; transition: fill 0.3s; }
.ik-mid { font-family: var(--serif); fill: var(--white); letter-spacing: 0.01em; transition: fill 0.3s; }
.ik-pair.on, .ik-mid.on { fill: #FFF3CF; font-weight: 600; }
.ik-tip { pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.ik-tip.show { opacity: 1; }
.ik-tip rect { fill: rgba(46, 50, 49, 0.88); }
.ik-tip text { font-family: var(--sans); font-weight: 500; fill: var(--white); }
/* the finished map draws itself in: each ring from its outer edge, one after another */
.ik-draw .ik-ring, .ik-draw .ik-glow { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: ik-draw 1.4s var(--ease-out) var(--d, 0s) forwards; }
.ik-draw .ik-fill { opacity: 0; animation: ik-fade 1.3s ease var(--d, 0s) forwards; }
.ik-draw .ik-core-g { opacity: 0; animation: ik-fade 1.2s ease 1.4s forwards; }
.ik-draw .ik-labels { opacity: 0; animation: ik-fade 1s ease 1.2s forwards; }
@keyframes ik-draw { to { stroke-dashoffset: 0; } }
@keyframes ik-fade { to { opacity: 1; } }

/* ---------- the finished map ---------- */
.ik-art { max-width: 640px; }
@media (min-width: 810px) {
  .ik-art { max-width: min(640px, max(340px, calc(100vh - 380px))); }
  @supports (height: 100svh) { .ik-art { max-width: min(640px, max(340px, calc(100svh - 380px))); } }
}
.ik-summary { text-align: center; }
.ik-item { border-radius: 4px; transition: color 0.25s, background-color 0.25s; }
.ik-item.on, .ik-item:hover { color: #FFF3CF; background: rgba(255, 255, 255, 0.12); }
.ik-note { max-width: 560px; margin: 26px auto 0; font-size: 13.5px; line-height: 1.75; color: rgba(255, 255, 255, 0.78); }

/* ---------- so, now what? ---------- */
.ik-morning { max-width: 560px; margin: 34px auto 0; }
.ik-morning label { display: block; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.6vw, 27px); line-height: 1.3; color: var(--dark); }
.ik-morning textarea { height: 80px; margin-top: 12px; text-align: center; }
.ik-choose { max-width: 520px; margin: 40px auto 0; font-size: 16px; line-height: 1.7; }
.ik-focus .pill span { max-width: 100%; min-height: 44px; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.ik-focus .pill.is-mid span { border-color: #D8BC6A; box-shadow: 0 0 0 3px rgba(243, 226, 179, 0.45); }
.ik-focus .pill.is-mid input:checked + span { border-color: var(--sage); box-shadow: none; }
.ik-questions .field { margin-top: 10px; }
.ik-questions textarea { height: 76px; }

@media (max-width: 809px) {
  .ik-orb { width: 168px; }
  .ik-quiz.is-connect .ik-orb { width: 128px; }
  .ik-add { gap: 10px; }
  .ik-add .btn { padding-left: 16px; padding-right: 40px; }
  .ik-add .btn .dot { right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ik-chip.is-new, .ik-card.is-moved, .ik-card.is-moved .ik-card-tag { animation: none; }
  .ik-draw .ik-core-g, .ik-draw .ik-labels { animation-delay: 0s; }
}
/* the "Prefer paper?" link wraps on phones: give its two lines room */
.ik-paper { line-height: 1.5; text-align: left; }
