/* hooWorld design system, shared by index.html (profile) and hooworld.html.
   Cartoon sci-fi look: thick ink outlines, flat color, offset ink shadows. */

:root {
  --ink: #141414;
  --portal: #97e34a;
  --portal-hi: #d6ff7a;
  --portal-deep: #2f9e22;
  --screen: #1f2246;
  --screen-hi: #2c3166;
  --paper: #fff6dc;
  --paper-2: #f4e6bf;
  --text: #1d1b16;
  --muted: #5e5a4e;
  --violet: #6a3fc9;
  --pink: #ff6fae;
  --font-ui: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font-head: 'Bangers', Impact, 'Arial Black', sans-serif;
  --outline: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.head { font-family: var(--font-head); font-weight: 400; letter-spacing: .06em; }

/* ---------- primitives ---------- */
.toon {
  border: 4px solid var(--ink);
  border-radius: 16px 20px 15px 21px / 20px 15px 21px 16px;
  box-shadow: 6px 6px 0 var(--ink);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font: 600 15px/1.1 var(--font-ui); letter-spacing: .02em; text-decoration: none;
  color: var(--text); background: var(--paper);
  border: 3px solid var(--ink); border-radius: 12px 14px 11px 15px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 10px 14px; cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, background-color .1s ease;
}
.btn:hover { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--ink); background: #fffbe9; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--portal); }
.btn.primary:hover { background: var(--portal-hi); }
.tag {
  font: 600 13px/1 var(--font-ui); color: var(--text);
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink); padding: 7px 11px;
}

/* ---------- music toggle ---------- */
.bgm {
  position: fixed; top: 14px; right: 14px; z-index: 40;
  font: 600 13px/1 var(--font-ui); color: var(--portal);
  background: var(--screen); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink); padding: 9px 12px; cursor: pointer;
}
.bgm:hover { background: var(--screen-hi); }

/* ---------- portal ---------- */
.portal {
  display: inline-flex; flex-direction: column; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
}
.portal-swirl {
  /* four light spiral arms plus four dark ones between them */
  --arms: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cg stroke='%23f2ffd2' stroke-width='6.5' opacity='.9'%3E%3Cpath d='M0 0C8-12 24-8 30 6C35 18 26 34 10 40'/%3E%3Cpath transform='rotate(90)' d='M0 0C8-12 24-8 30 6C35 18 26 34 10 40'/%3E%3Cpath transform='rotate(180)' d='M0 0C8-12 24-8 30 6C35 18 26 34 10 40'/%3E%3Cpath transform='rotate(270)' d='M0 0C8-12 24-8 30 6C35 18 26 34 10 40'/%3E%3C/g%3E%3Cg stroke='%23176b12' stroke-width='3.2' opacity='.6'%3E%3Cpath transform='rotate(45)' d='M0 0C8-12 24-8 30 6C35 18 26 34 10 40'/%3E%3Cpath transform='rotate(135)' d='M0 0C8-12 24-8 30 6C35 18 26 34 10 40'/%3E%3Cpath transform='rotate(225)' d='M0 0C8-12 24-8 30 6C35 18 26 34 10 40'/%3E%3Cpath transform='rotate(315)' d='M0 0C8-12 24-8 30 6C35 18 26 34 10 40'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  position: relative; width: var(--size, 170px); aspect-ratio: 1; overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 49% 51% 47% 53% / 52% 47% 53% 48%;
  background: radial-gradient(circle, #f4ffd9 0 9%, #c9ff6e 24%, #6fd43a 52%, #2f9e22 80%, #1b6e16 100%);
  box-shadow: 0 0 0 4px #b9ff57aa, 0 0 34px 10px #97e34a99, 5px 5px 0 var(--ink);
  animation: spin 7s linear infinite;
  transition: transform .2s ease, box-shadow .2s ease;
}
.portal-swirl::before, .portal-swirl::after {
  content: ''; position: absolute; inset: 0;
  background: var(--arms) center / 100% 100% no-repeat;
  animation: spin 2.8s linear infinite;
}
.portal-swirl::after { inset: 24%; opacity: .75; animation-duration: 1.6s; }
.portal:hover .portal-swirl, .portal:focus-visible .portal-swirl {
  transform: scale(1.07);
  box-shadow: 0 0 0 6px #d6ff7acc, 0 0 56px 18px #97e34acc, 5px 5px 0 var(--ink);
}
.portal-label {
  font-family: var(--font-head); font-size: 34px; letter-spacing: .08em; line-height: 1;
  color: var(--portal); text-shadow: var(--outline), 5px 5px 0 var(--ink);
}
@keyframes spin { to { rotate: 360deg; } }

/* warp transition when stepping through a portal */
body.warping::after {
  content: ''; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: radial-gradient(circle at var(--wx, 50%) var(--wy, 80%),
    #f4ffd9 0 6%, var(--portal) 30%, var(--portal-deep) 65%, #0b3d0b 100%);
  animation: warp .6s ease-in forwards;
}
@keyframes warp {
  from { clip-path: circle(0% at var(--wx, 50%) var(--wy, 80%)); }
  to   { clip-path: circle(160% at var(--wx, 50%) var(--wy, 80%)); }
}

/* ---------- detail modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: #0d0f24cc; }
.modal-card {
  position: relative; width: min(760px, 100%); max-height: min(88vh, 940px); overflow: auto;
  background: var(--paper); padding: 24px 26px 22px;
  animation: pop .18s ease-out;
}
.modal-x {
  position: sticky; top: 0; float: right; margin: -6px -8px 0 12px; z-index: 2;
  width: 40px; height: 40px; font: 700 20px/1 var(--font-ui); color: var(--ink);
  background: var(--pink); border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
}
.modal-x:hover { background: #ff8fc0; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
body.modal-open { overflow: hidden; }

.m-kicker { margin: 0 0 2px; font-family: var(--font-head); font-size: 17px; letter-spacing: .1em; color: var(--violet); }
.m-title { margin: 0 0 6px; font-family: var(--font-head); font-weight: 400; font-size: clamp(30px, 4.4vw, 42px); letter-spacing: .04em; line-height: 1.02; }
.m-meta { margin: 0 0 12px; color: var(--muted); font-weight: 500; }
.m-section { margin: 16px 0 6px; font-family: var(--font-head); font-weight: 400; font-size: 20px; letter-spacing: .1em; color: var(--portal-deep); }
.modal-body p, .modal-body li { font-size: 16px; }
.modal-body p { margin: 0 0 8px; }
.modal-body ul { margin: 0 0 6px; padding-left: 1.2em; }
.modal-body li { margin: 0 0 7px; }
.modal-body a:not(.btn) { color: var(--violet); font-weight: 600; }
.m-fig { margin: 12px 0 6px; padding: 8px; background: #fff; border: 3px solid var(--ink); border-radius: 10px; }
.m-fig img { max-height: 340px; width: auto; margin: 0 auto; }
.m-fig figcaption { margin-top: 4px; font-size: 13px; color: var(--muted); }
.m-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.m-note { color: var(--muted); font-size: 14px !important; }
.redacted {
  display: inline-block; font-family: var(--font-head); letter-spacing: .08em; font-size: 20px !important;
  color: #fff; background: var(--ink); padding: 4px 10px; border-radius: 4px;
}
.m-entry { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 17px; }
.m-entry span { color: var(--muted); white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; }
.kv dt { font-family: var(--font-head); letter-spacing: .08em; font-size: 17px; color: var(--violet); }
.kv dd { margin: 0; font-size: 16px; }

/* ---------- credits footer ---------- */
.credits {
  text-align: center; font-size: 12.5px; line-height: 1.7; color: #fffbe9;
  text-shadow: 0 1px 3px #000c; padding: 26px 16px 28px;
}
.credits a { color: #e9ffc4; }

@media (prefers-reduced-motion: reduce) {
  .portal-swirl, .portal-swirl::before, .portal-swirl::after { animation: none; }
  body.warping::after { animation: none; }
}
