/* ==========================================================================
   SHAR: Definitive Edition — donut & sky theme
   Loaded only on the SHAR: DE page, on top of style.css. Always light.
   Palette: Simpsons yellow, donut pink, sky blue, Marge blue, Bart red.
   ========================================================================== */

/* Self-hosted fonts (both SIL Open Font License / Apache 2.0) */
@font-face {
  font-family: "Luckiest Guy";
  src: url("/assets/fonts/luckiest-guy.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-variable.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

.theme-shar {
  --ink: #1c120a;
  --yellow: #ffd90f;
  --yellow-soft: #fff3b0;
  --pink: #ff6fb1;
  --pink-soft: #ffd6e9;
  --sky: #4fb3ff;
  --sky-deep: #2f8fe0;
  --sky-soft: #e2f3ff;
  --marge: #2f64d6;
  --bart: #f14e28;
  --mint: #6fe3a5;
  --cream: #fffaf0;

  --bg: var(--cream);
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-hover: #ffffff;
  --border: var(--ink);
  --border-strong: var(--ink);
  --text: var(--ink);
  --text-muted: #4b4038;
  --text-faint: #7a6c60;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --shadow: 5px 5px 0 var(--ink);

  --accent: var(--yellow);
  --accent-2: var(--sky);
  --accent-ink: var(--ink);
  --glow: transparent;

  --font-sans: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Nunito", ui-rounded, system-ui, sans-serif;
  --font-display: "Luckiest Guy", "Nunito", system-ui, sans-serif;

  --radius: 22px;
  --radius-sm: 16px;

  color-scheme: light;
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
}

html:has(body.theme-shar) {
  background: var(--cream, #fffaf0);
  color-scheme: light;
}

/* Cartoon surface: white card, thick ink outline, hard offset shadow */
.theme-shar :is(.stat, .feature, .download, .steps li, .faq details, .fact, .shot, .callout) {
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}

.theme-shar :is(.feature, .download, .fact):hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
  background: #fff;
}

.theme-shar .divider {
  display: none;
}

.theme-shar ::selection {
  background: var(--pink);
  color: #fff;
}

.theme-shar :focus-visible {
  outline: 3px solid var(--marge);
}

/* ---------- Type ---------- */

.theme-shar :is(h1, h2, h3, h4) {
  letter-spacing: 0;
}

.theme-shar .section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--yellow);
}

.theme-shar .section-lede,
.theme-shar .prose {
  color: var(--text-muted);
}

.theme-shar .prose strong,
.theme-shar .section-lede strong {
  color: var(--ink);
  font-weight: 800;
}

.theme-shar p a,
.theme-shar li a:not(nav a),
.theme-shar .prose a {
  color: var(--marge);
  font-weight: 800;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 3px;
}

.theme-shar .eyebrow {
  width: fit-content;
  padding: 6px 14px 3px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-shadow: 1.5px 1.5px 0 var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg);
}

.theme-shar .eyebrow::before {
  display: none;
}

/* ---------- Nav (floats over the sky, solid once scrolled) ---------- */

.theme-shar .nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.theme-shar .nav__actions {
  justify-self: end;
}

.theme-shar .logo {
  color: var(--ink);
}

.theme-shar .logo__text .hl {
  color: var(--bart);
}

.theme-shar .nav__links a {
  color: var(--ink);
  font-weight: 800;
}

.theme-shar .nav__links a:hover,
.theme-shar .nav__links a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.7);
}

.theme-shar .nav.is-scrolled,
.theme-shar .nav.is-open {
  background: var(--nav-bg);
  border-bottom: 3px solid var(--ink);
}

.theme-shar .icon-btn {
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
}

@media (max-width: 760px) {
  .theme-shar .nav__inner {
    display: flex;
  }

  .theme-shar .nav__links {
    border: 3px solid var(--ink);
    box-shadow: 5px 5px 0 var(--ink);
  }
}

/* ---------- Hero: centred logo in the sky ---------- */

.shar-hero {
  position: relative;
  margin-top: -72px;
  padding: calc(72px + clamp(40px, 7vw, 80px)) 0 clamp(110px, 12vw, 150px);
  overflow: hidden;
  background: linear-gradient(180deg, #2f8fe0 0%, #5fb4f2 45%, #a5dbff 100%);
  text-align: center;
}

/* Bumpy cloud edge into the cream page below */
.shar-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 56px;
  background:
    radial-gradient(circle 46px at 50px 70px, var(--cream) 98%, transparent 100%) 0 0 / 100px 56px repeat-x,
    radial-gradient(circle 34px at 30px 60px, var(--cream) 98%, transparent 100%) 50px 8px / 100px 56px repeat-x;
}

.shar-hero__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  height: auto;
  animation: drift 26s ease-in-out infinite alternate;
}

.cloud--1 { width: 300px; top: 70px; left: -60px; }
.cloud--2 { width: 240px; top: 110px; right: -40px; animation-duration: 32s; animation-delay: -8s; }
.cloud--3 { width: 200px; top: 46%; left: 6%; opacity: 0.9; animation-duration: 22s; }
.cloud--4 { width: 340px; bottom: 30px; right: 4%; animation-duration: 30s; animation-delay: -14s; }
.cloud--5 { width: 160px; top: 64%; right: 7%; opacity: 0.75; animation-duration: 20s; animation-delay: -4s; }

@keyframes drift {
  from { transform: translateX(-24px); }
  to { transform: translateX(24px); }
}

.float-donut {
  position: absolute;
  height: auto;
  filter: drop-shadow(6px 8px 0 rgba(28, 18, 10, 0.25));
  animation: bob 6s ease-in-out infinite;
}

.float-donut--1 { width: 150px; top: 22%; left: 9%; --r: -18deg; }
.float-donut--2 { width: 110px; top: 30%; right: 10%; --r: 22deg; animation-delay: -3s; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(var(--r)); }
  50% { transform: translateY(-16px) rotate(calc(var(--r) + 8deg)); }
}

@media (max-width: 900px) {
  .float-donut--1 { width: 90px; top: 12%; left: 4%; }
  .float-donut--2 { width: 70px; top: 16%; right: 5%; }
  .cloud--3, .cloud--5 { display: none; }
}

.shar-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.theme-shar .breadcrumb {
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-weight: 800;
}

.theme-shar .breadcrumb a:hover {
  color: var(--marge);
}

.shar-hero__logo {
  width: min(100%, 760px);
  margin: 0;
}

.shar-hero__logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(20, 60, 120, 0.25));
}

.shar-hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 32px);
  color: #fff;
  letter-spacing: 0.05em;
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
    4px 5px 0 var(--ink);
  margin-top: -8px;
}

.shar-hero__lede {
  max-width: 600px;
  color: #10305c;
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 700;
}

.shar-hero .btn-row,
.shar-hero .card__meta {
  justify-content: center;
}

/* ---------- Chips & buttons ---------- */

.theme-shar .chip {
  border: 2.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.theme-shar .chip--wip { --chip-dot: #ff9f1c; }

.theme-shar .btn {
  height: 54px;
  padding: 2px 26px 0;
  border: 3px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.04em;
  box-shadow: 4px 4px 0 var(--ink);
}

.theme-shar .btn:hover {
  background: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.theme-shar .btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}

.theme-shar .btn--primary {
  background: var(--yellow);
}

.theme-shar .btn--primary:hover {
  background: #ffe34a;
}

.theme-shar .btn svg {
  margin-top: -3px;
}

.theme-shar .btn[aria-disabled="true"] {
  opacity: 1;
  background: #eee6d8;
  color: #8a7d70;
  border-style: dashed;
  box-shadow: none;
}

/* ---------- Sub-navigation ---------- */

.theme-shar .subnav {
  border-block: 3px solid var(--ink);
  background: rgba(255, 255, 255, 0.95);
}

.theme-shar .subnav__list {
  justify-content: safe center;
}

.theme-shar .subnav__list a {
  border: 2.5px solid transparent;
  color: var(--ink);
  font-weight: 800;
}

.theme-shar .subnav__list a:hover {
  background: var(--sky-soft);
}

.theme-shar .subnav__list a.is-active {
  border-color: var(--ink);
  background: var(--yellow);
}

/* ---------- Sections: alternate cream and pale sky ---------- */

.theme-shar main > section:nth-of-type(odd):not(.shar-hero) {
  background: var(--sky-soft);
}

/* ---------- Overview stats ---------- */

.theme-shar .stat {
  box-shadow: 4px 4px 0 var(--ink);
}

.theme-shar .stat__label {
  color: var(--text-muted);
  font-weight: 700;
}

.theme-shar .stat__value {
  font-weight: 800;
}

/* ---------- Facts ---------- */

.theme-shar .fact__label {
  color: var(--marge);
  font-weight: 900;
}

.theme-shar .fact:nth-child(3n + 1) { background: var(--yellow-soft); }
.theme-shar .fact:nth-child(3n + 2) { background: var(--pink-soft); }
.theme-shar .fact:nth-child(3n + 3) { background: #fff; }

/* ---------- Features ---------- */

.theme-shar .feature h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.02em;
}

.theme-shar .feature p {
  color: var(--text-muted);
}

.theme-shar .feature__icon {
  width: 54px;
  height: 54px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.theme-shar .feature:nth-child(6n + 1) .feature__icon { background: var(--yellow); }
.theme-shar .feature:nth-child(6n + 2) .feature__icon { background: var(--pink); }
.theme-shar .feature:nth-child(6n + 3) .feature__icon { background: var(--sky); }
.theme-shar .feature:nth-child(6n + 4) .feature__icon { background: #ff9f1c; }
.theme-shar .feature:nth-child(6n + 5) .feature__icon { background: var(--mint); }
.theme-shar .feature:nth-child(6n + 6) .feature__icon { background: #c9a2ff; }

/* ---------- Screenshots (sky placeholders) ---------- */

.theme-shar .shot {
  border-radius: var(--radius-sm);
}

.theme-shar .shot .art {
  background: linear-gradient(180deg, #2f8fe0, #a5dbff) !important;
}

.theme-shar .shot .art::after {
  display: none;
}

.theme-shar .shot__cloud {
  position: absolute;
  width: 46%;
  height: auto;
  left: 8%;
  bottom: 8%;
  opacity: 0.95;
}

.theme-shar .shot .art__label {
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
    3px 4px 0 var(--ink);
}

/* ---------- Downloads ---------- */

.theme-shar .download__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.02em;
}

.theme-shar .download__desc {
  color: var(--text-muted);
}

.theme-shar .callout {
  background: var(--yellow-soft);
  color: var(--ink);
}

.theme-shar .callout svg {
  color: var(--ink);
}

/* ---------- Install steps ---------- */

.theme-shar .steps li::before {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding-top: 4px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  text-shadow: 1.5px 1.5px 0 var(--ink);
}

.theme-shar .steps h3 {
  font-weight: 900;
}

/* ---------- Changelog ---------- */

.theme-shar .timeline::before {
  width: 4px;
  left: 4px;
  border-radius: 4px;
  background: repeating-linear-gradient(var(--ink) 0 10px, transparent 10px 18px);
}

.theme-shar .timeline li::before {
  top: 4px;
  left: -32px;
  width: 20px;
  height: 20px;
  border: 3px solid var(--ink);
  background: var(--pink);
}

.theme-shar .timeline__version {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
}

.theme-shar .timeline ul {
  color: var(--text-muted);
}

/* ---------- FAQ ---------- */

.theme-shar .faq details[open] {
  background: #fff;
}

.theme-shar .faq summary {
  font-weight: 900;
}

.theme-shar .faq summary::after {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  padding-top: 3px;
}

.theme-shar .faq details > p {
  color: var(--text-muted);
}

/* ---------- Credits ---------- */

.theme-shar .credits li {
  border-bottom: 2.5px dashed var(--ink);
  font-weight: 800;
}

.theme-shar .credits li span:last-child {
  color: var(--marge);
}

/* ---------- Footer: Marge-blue band with a cloud edge ---------- */

.theme-shar .footer {
  position: relative;
  margin-top: 56px;
  padding-top: 56px;
  border-top: 0;
  background: var(--marge);
  color: #dfe8ff;
}

.theme-shar .footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -55px;
  height: 56px;
  background:
    radial-gradient(circle 46px at 50px 70px, var(--marge) 98%, transparent 100%) 0 0 / 100px 56px repeat-x,
    radial-gradient(circle 34px at 30px 60px, var(--marge) 98%, transparent 100%) 50px 8px / 100px 56px repeat-x;
}

.theme-shar .footer__links a:hover {
  color: var(--yellow);
}

.theme-shar .footer__note {
  color: #b9c9f5;
}

/* The last section and the footer share a colour edge */
.theme-shar main > section:last-of-type {
  padding-bottom: clamp(96px, 12vw, 140px);
}

@media (prefers-reduced-motion: reduce) {
  .cloud,
  .float-donut {
    animation: none;
  }
}

/* ---------- Fixes ---------- */

/* Keep section heads compact inside two-column (.split) layouts */
.theme-shar .section-head {
  align-content: start;
}

/* Stronger 0ptim1zed mark on sky and white */
.theme-shar .logo {
  --accent: var(--bart);
  --accent-2: var(--marge);
}

/* Luckiest Guy's lowercase is quirky — set it in caps everywhere */
.theme-shar :is(.section-title, .feature h3, .btn, .eyebrow, .shar-hero__tagline, .download__title,
  .timeline__version, .shot .art__label) {
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .float-donut--1 { width: 72px; top: auto; bottom: 150px; left: -14px; }
  .float-donut--2 { width: 58px; top: 150px; right: -12px; }
  .cloud--1 { width: 200px; top: 60px; left: -90px; }
  .cloud--2 { width: 170px; top: 90px; right: -90px; }
  .cloud--4 { width: 260px; bottom: 10px; right: -60px; }
}
