/* ============================================================
   justlexx.com — public site
   Light is the base palette; dark redefines the same tokens.
   ============================================================ */

:root {
  --paper:     #FBF2FF;
  --surface:   #FFFFFF;
  --ink:       #2B0B4D;
  --ink-soft:  #6E5A8C;
  --edge:      #2B0B4D;

  --grape:     #7C3AED;
  --taffy:     #FF3D95;
  --tangerine: #FF922B;
  --mint:      #12BE8C;
  --sky:       #2FA8DC;

  --dot:  rgba(124, 58, 237, .17);
  --tape: rgba(255, 146, 43, .34);

  --edge-w: 3px;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 12px;

  --step-0: 1.0625rem;
  --step-1: 1.35rem;
  --step-2: 1.85rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.7rem, 8vw, 4.6rem);

  --bounce: cubic-bezier(.34, 1.56, .64, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:     #170A2B;
    --surface:   #24103F;
    --ink:       #F7ECFF;
    --ink-soft:  #B7A2D6;
    --edge:      #EFE0FF;
    --grape:     #B794FF;
    --taffy:     #FF74B4;
    --tangerine: #FFB65C;
    --mint:      #3FE8B4;
    --sky:       #5CC8F0;
    --dot:       rgba(183, 148, 255, .18);
    --tape:      rgba(255, 182, 92, .26);
  }
}

:root[data-theme="dark"] {
  --paper:     #170A2B;
  --surface:   #24103F;
  --ink:       #F7ECFF;
  --ink-soft:  #B7A2D6;
  --edge:      #EFE0FF;
  --grape:     #B794FF;
  --taffy:     #FF74B4;
  --tangerine: #FFB65C;
  --mint:      #3FE8B4;
  --sky:       #5CC8F0;
  --dot:       rgba(183, 148, 255, .18);
  --tape:      rgba(255, 182, 92, .26);
}

/* ============================================================
   BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.6px, transparent 1.6px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem) 4rem;
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: "Baloo 2", ui-rounded, "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.05;
  text-wrap: balance;
  margin: 0;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 3px solid var(--taffy);
  outline-offset: 3px;
  border-radius: 6px;
}

/* A sticker: thick outline plus a hard, unblurred offset shadow. */
.sticker {
  border: var(--edge-w) solid var(--edge);
  background: var(--surface);
  box-shadow: 7px 7px 0 var(--shade, var(--grape));
}

.paw { fill: var(--grape); width: 24px; height: 24px; }

/* ============================================================
   TOP BAR
   ============================================================ */

.topbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding-bottom: 2.2rem;
}

.tab {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  padding: .3rem .95rem .4rem;
  border: 2.5px solid var(--edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform .22s var(--bounce), background-color .22s ease;
}
.tab:hover { transform: translateY(-3px) rotate(-3deg); background: var(--tangerine); }
.tab[aria-current="page"] { background: var(--taffy); color: #FFF; }
.tab-admin { background: var(--mint); }

.spacer { flex: 1; }

.themebtn {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
  padding: .45rem .85rem;
  border: 2.5px solid var(--edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  transition: transform .22s var(--bounce);
}
.themebtn:hover { transform: rotate(4deg) scale(1.05); }

/* ============================================================
   BADGE HERO
   ============================================================ */

.badge-wrap { position: relative; }

.badge {
  --shade: var(--taffy);
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 3.5vw, 2.3rem);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.3rem, 4vw, 2.4rem);
  align-items: center;
  transform: rotate(-1deg);
  animation: drop-in .7s var(--bounce) both;
}

@keyframes drop-in {
  from { opacity: 0; transform: rotate(-6deg) translateY(-26px) scale(.94); }
  to   { opacity: 1; transform: rotate(-1deg) translateY(0) scale(1); }
}

/* The punched lanyard hole on a real convention badge. */
.badge-hole {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 58px;
  height: 26px;
  transform: translateX(-50%);
  border: var(--edge-w) solid var(--edge);
  border-radius: 999px;
  background: var(--paper);
}

/* Portrait panel, sized for a full character illustration. */
.portrait {
  position: relative;
  width: clamp(150px, 30vw, 235px);
  aspect-ratio: 3 / 4;
  padding: 0;
  border: var(--edge-w) solid var(--edge);
  border-radius: var(--r-md);
  background: linear-gradient(170deg, var(--tangerine) 0%, var(--taffy) 100%);
  cursor: pointer;
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: transform .3s var(--bounce);
  /* Mashing the button shouldn't start selecting text or fire a zoom. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; user-select: none; }
.portrait:hover { transform: rotate(2deg) scale(1.03); }
.portrait-static { cursor: default; }
.portrait-static:hover { transform: none; }

.portrait.booped { animation: squish .45s var(--bounce); }
@keyframes squish {
  0%   { transform: scale(1) rotate(0); }
  35%  { transform: scale(1.09, .9) rotate(-5deg); }
  70%  { transform: scale(.96, 1.04) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

.boopme {
  position: absolute;
  top: .6rem;
  right: .6rem;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: .72rem;
  background: var(--surface);
  color: var(--ink);
  border: 2.5px solid var(--edge);
  border-radius: 999px;
  padding: .12rem .6rem .2rem;
  transform: rotate(7deg);
  pointer-events: none;
  z-index: 2;
}

.badge-body { min-width: 0; }

.name {
  font-size: var(--step-4);
  letter-spacing: -.02em;
  margin-bottom: .1em;
}
.name em {
  font-style: normal;
  color: var(--taffy);
  -webkit-text-stroke: 2px var(--edge);
  paint-order: stroke fill;
}

.tagline {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 1.15rem;
  max-width: 30ch;
}

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.specs li {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .72rem;
  font-weight: 700;
  padding: .28rem .7rem;
  border: 2px solid var(--edge);
  border-radius: 999px;
}
.specs b { color: var(--ink-soft); }
.specs li:nth-child(5n+1) { background: color-mix(in srgb, var(--mint) 26%, var(--surface)); }
.specs li:nth-child(5n+2) { background: color-mix(in srgb, var(--tangerine) 26%, var(--surface)); }
.specs li:nth-child(5n+3) { background: color-mix(in srgb, var(--grape) 22%, var(--surface)); }
.specs li:nth-child(5n+4) { background: color-mix(in srgb, var(--taffy) 22%, var(--surface)); }
.specs li:nth-child(5n+5) { background: color-mix(in srgb, var(--sky) 22%, var(--surface)); }

.boopline {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .78rem;
  color: var(--ink-soft);
  margin: 0;
}
.boopline .paw { width: 18px; height: 18px; }
.boopline strong { color: var(--taffy); font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ============================================================
   SECTIONS
   ============================================================ */

.section { padding-top: clamp(3.2rem, 8vw, 5rem); }

.section-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.section-head h2 { font-size: var(--step-3); }
.section-head .paw { width: 30px; height: 30px; flex: none; }

.rule { flex: 1; height: 3px; background: var(--edge); border-radius: 3px; }

.more {
  display: inline-block;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
  padding: .25rem .9rem .35rem;
  border: 2.5px solid var(--edge);
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  cursor: pointer;
  transition: transform .22s var(--bounce);
}
.more:hover { transform: translateY(-3px) rotate(-3deg); }
.more-sky { background: var(--sky); }

/* --- about: a speech bubble --- */
.bubble {
  --shade: var(--mint);
  position: relative;
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 4vw, 2.1rem) clamp(1.5rem, 4vw, 2.3rem);
  max-width: 60ch;
  transform: rotate(.5deg);
}
.bubble p { margin: 0 0 1em; }
.bubble p:last-child { margin-bottom: 0; }

.bubble-tail {
  position: absolute;
  left: 3.5rem;
  bottom: calc(var(--edge-w) * -1 - 25px);
  width: 46px;
  height: 28px;
}
.bubble-tail .fill { fill: var(--surface); }
.bubble-tail .line { fill: none; stroke: var(--edge); stroke-width: var(--edge-w); stroke-linecap: round; }

.empty { margin-top: 1rem; }
.empty .bubble-tail { display: none; }

.notfound { text-align: center; margin-inline: auto; }
.notfound .name { margin-bottom: .3em; }

/* ============================================================
   SKYCAM
   ============================================================ */

.skycam {
  --shade: var(--sky);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  transform: rotate(-.5deg);
}
@media (min-width: 760px) { .skycam { grid-template-columns: 1.15fr 1fr; } }

.skycam-view {
  position: relative;
  min-height: 220px;
  background:
    radial-gradient(circle at 74% 22%, rgba(255,255,255,.9) 0 8%, transparent 42%),
    linear-gradient(178deg, #2FA8DC 0%, #7FD0EE 46%, #FFD8A8 82%, #FFB07C 100%);
  border-bottom: var(--edge-w) solid var(--edge);
  overflow: hidden;
}
@media (min-width: 760px) {
  .skycam-view { border-bottom: 0; border-right: var(--edge-w) solid var(--edge); }
}

.skycam-frame { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.cloud { position: absolute; fill: rgba(255,255,255,.82); }
.cloud.a { width: 34%; top: 26%; left: 8%;  animation: drift 26s linear infinite alternate; }
.cloud.b { width: 24%; top: 52%; left: 52%; animation: drift 38s linear infinite alternate-reverse; }
@keyframes drift {
  from { transform: translateX(-14%); }
  to   { transform: translateX(14%); }
}

.live {
  position: absolute;
  top: .8rem;
  left: .8rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  background: #2B0B4D;
  color: #FFF;
  border-radius: 999px;
  padding: .22rem .65rem .25rem;
}
/* The dot only pulses for a genuinely live feed — a throbbing red light over
   a photo uploaded last week would be a lie. */
.live-pulse::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF3D95;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.skycam-body {
  padding: clamp(1.3rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: flex-start;
}
.skycam-body h2 { font-size: var(--step-2); }
.skycam-body p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ============================================================
   BLOG
   ============================================================ */

.pagehead { margin-bottom: 2rem; }
.blog-title { font-size: var(--step-4); margin-bottom: .3rem; }
.blog-title em {
  font-style: normal;
  color: var(--grape);
  -webkit-text-stroke: 2px var(--edge);
  paint-order: stroke fill;
}
.blog-intro { max-width: 54ch; margin: 0; color: var(--ink-soft); }

.postlist {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: .4rem .3rem 1rem;
}

.post {
  --shade: var(--grape);
  border-radius: var(--r-md);
  padding: 1.1rem 1.25rem 1.25rem;
  display: block;
  text-decoration: none;
  transition: transform .28s var(--bounce), box-shadow .28s var(--bounce);
}
.post:nth-child(3n+1) { --shade: var(--taffy);     transform: rotate(-.7deg); }
.post:nth-child(3n+2) { --shade: var(--mint);      transform: rotate(.6deg); }
.post:nth-child(3n+3) { --shade: var(--tangerine); transform: rotate(-.4deg); }
.post:hover { transform: rotate(0) translateY(-5px); box-shadow: 11px 11px 0 var(--shade); }

.post-cover {
  display: block;
  margin: -.3rem 0 .8rem;
  border: 2.5px solid var(--edge);
  border-radius: var(--r-sm);
  overflow: hidden;
  max-height: 260px;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.post-date {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}
.post h3 { font-size: var(--step-1); margin: .2rem 0 .35rem; }
.post p { margin: 0; font-size: .93rem; color: var(--ink-soft); line-height: 1.55; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  list-style: none;
  padding: 0;
  margin: .7rem 0 0;
}
.tags li {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 2px solid var(--edge);
}

/* --- single post --- */
.article { max-width: 44rem; }

.backlink {
  display: inline-block;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}
.backlink:hover { color: var(--taffy); }

.draftflag {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .72rem;
  letter-spacing: .08em;
  background: var(--tangerine);
  color: #2B0B4D;
  border: 2.5px solid var(--edge);
  border-radius: 999px;
  padding: .3rem .9rem;
  display: inline-block;
  margin: 0 0 1.2rem;
}

.article-head { margin-bottom: 1.6rem; }
.article-head h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin: .3rem 0 .5rem; }

.article-cover {
  margin: 0 0 1.8rem;
  --shade: var(--taffy);
  border-radius: var(--r-md);
  overflow: hidden;
}
.article-cover img { width: 100%; }

.article-body { font-size: 1.08rem; }
.article-body p { margin: 0 0 1.15em; max-width: 65ch; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
  margin: 2rem .3rem 0;
}
.shot { --shade: var(--mint); margin: 0; border-radius: var(--r-md); overflow: hidden; }
.shot:nth-child(even) { --shade: var(--sky); }
.shot img { width: 100%; }

.editbar { margin-top: 2.5rem; }

/* ============================================================
   SOCIALS
   ============================================================ */

.socials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: .3rem .3rem 1rem;
  margin: 0;
}

.social {
  --shade: var(--grape);
  display: flex;
  align-items: center;
  gap: .7rem;
  border-radius: var(--r-md);
  padding: .8rem .9rem;
  text-decoration: none;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  transition: transform .24s var(--bounce), box-shadow .24s var(--bounce);
}
.socials li:nth-child(5n+1) .social { --shade: var(--taffy); }
.socials li:nth-child(5n+2) .social { --shade: var(--tangerine); }
.socials li:nth-child(5n+3) .social { --shade: var(--sky); }
.socials li:nth-child(5n+4) .social { --shade: var(--mint); }
.socials li:nth-child(5n+5) .social { --shade: var(--grape); }
.social:hover { transform: translateY(-5px) rotate(-2deg); box-shadow: 11px 11px 0 var(--shade); }

.social-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  border: 2.5px solid var(--edge);
  background: var(--shade);
  display: grid;
  place-items: center;
}
.social-icon svg { width: 60%; height: 60%; fill: #FFFFFF; }

.social small {
  display: block;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  margin-top: clamp(3.5rem, 9vw, 5rem);
  border: var(--edge-w) solid var(--edge);
  border-radius: var(--r-lg);
  background: var(--tape);
  padding: 1.4rem clamp(1.2rem, 4vw, 2rem);
  transform: rotate(-.5deg);
  text-align: center;
}
.colophon {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .68rem;
  letter-spacing: .06em;
  margin: 0;
  opacity: .78;
}

/* ============================================================
   BOOP BURST
   ============================================================ */

.burst {
  position: fixed;
  pointer-events: none;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--taffy);
  -webkit-text-stroke: 2px var(--edge);
  paint-order: stroke fill;
  z-index: 50;
  animation: fly .85s ease-out forwards;
}
@keyframes fly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(.5); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.25); }
}

/* ============================================================
   RESPONSIVE + MOTION
   ============================================================ */

@media (max-width: 640px) {
  .badge { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tagline { margin-inline: auto; }
  .specs, .boopline { justify-content: center; }
  .bubble-tail { left: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .post:hover, .social:hover, .tab:hover, .more:hover, .portrait:hover { transform: none; }
}
