/* Gwei Gazette (gweigazette.site): the world computer seen through a prism.
   Facets, gem-cut corners, thin rainbow refraction rays, lavender shadows.
   Loaded only on this title's pages. Every class and keyframe is prefixed gweigazette-. */

#site-root[data-site='gweigazette'] {
  --gg-ink: #4a5fd0;            /* periwinkle dark enough for small text on the pale ground */
  --gg-lilac: #a58bf0;
  --gg-peach: #f2b27e;
  --gg-mint: #8fd6c1;
  --gg-rainbow: linear-gradient(90deg, #627eea 0%, #a58bf0 30%, #f2a7d0 58%, #f2b27e 82%, #8fd6c1 100%);
  --gg-shadow: 0 12px 40px rgba(98, 126, 234, .14);
  --gg-cut: 12px;
}
#site-root[data-site='gweigazette'] ::selection { background: rgba(242, 167, 208, .55); color: #15142a; }

/* ---------- refraction rays ---------- */
.gweigazette-ray { background: linear-gradient(90deg, var(--accent) 0%, #a58bf0 32%, #f2a7d0 62%, #f2b27e 86%, rgba(242, 178, 126, 0) 100%); }
.gweigazette-rainbow { background: var(--gg-rainbow); }
.gweigazette-hairline { height: 1px; background: var(--gg-rainbow); }
/* A single 1px ray crossing a block on a diagonal, behind its content. */
.gweigazette-diag { position: relative; isolation: isolate; }
.gweigazette-diag::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: -10%; right: -10%; top: 50%; height: 1px;
  background: linear-gradient(90deg, rgba(98, 126, 234, 0), #627eea 25%, #a58bf0 45%, #f2a7d0 65%, rgba(242, 178, 126, 0));
  transform: rotate(-9deg); opacity: .85;
}

/* ---------- facets (clip shapes) ---------- */
.gweigazette-rhombus { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
/* Elongated hexagon, pointed at the left and right ends. */
.gweigazette-hexl { clip-path: polygon(14% 0, 86% 0, 100% 50%, 86% 100%, 14% 100%, 0 50%); }
/* Thumbnail hexagon, pointed left and right. */
.gweigazette-hex { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
/* Avatar hexagon, pointed top and bottom. */
.gweigazette-hexv { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
/* Crystal: a wide stone with cut shoulders, for phone heroes where a rhombus would lose too much photo. */
.gweigazette-crystal { clip-path: polygon(10% 0, 90% 0, 100% 22%, 100% 78%, 90% 100%, 10% 100%, 0 78%, 0 22%); }
/* Gem cut: small 45° cuts at the top-left and bottom-right corners only. */
.gweigazette-gem { clip-path: polygon(var(--gg-cut) 0, 100% 0, 100% calc(100% - var(--gg-cut)), calc(100% - var(--gg-cut)) 100%, 0 100%, 0 var(--gg-cut)); }
.gweigazette-gem-sm { --gg-cut: 8px; }
.gweigazette-lift { filter: drop-shadow(0 12px 28px rgba(98, 126, 234, .14)); }
/* A gem-cut card with a 1px border that follows the cuts: an outer facet in the border colour, an inner one in surface. */
.gweigazette-card { --gg-cut: 14px; padding: 1px; background: var(--line); }
.gweigazette-card-prism { background: var(--gg-rainbow); }
.gweigazette-card > .gweigazette-gem { --gg-cut: 13.6px; background: var(--surface); }

/* ---------- kickers: lowercase mono, a tiny rainbow diamond with a slow sheen ---------- */
.gweigazette-gemdot {
  display: inline-block; width: .62em; height: .62em; flex-shrink: 0;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(120deg, #627eea, #a58bf0, #f2a7d0, #f2b27e, #8fd6c1, #627eea);
  background-size: 300% 300%;
  animation: gweigazette-sheen 6s ease-in-out infinite;
}
@keyframes gweigazette-sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Hollow diamond bullet. */
.gweigazette-hollow { display: inline-block; width: 8px; height: 8px; flex-shrink: 0; border: 1.5px solid var(--accent); transform: rotate(45deg); }
.gweigazette-solid { display: inline-block; width: 9px; height: 9px; flex-shrink: 0; transform: rotate(45deg); background: var(--gg-rainbow); }

/* ---------- links: a 1px periwinkle-to-pink underline ---------- */
.gweigazette-u {
  background-image: linear-gradient(90deg, var(--accent), var(--accent2));
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .45s cubic-bezier(.2, .7, .2, 1);
  padding-bottom: 1px;
}
.group:hover .gweigazette-u, .group:focus-visible .gweigazette-u, a.gweigazette-u:hover { background-size: 100% 1px; }
.gweigazette-link {
  background-image: linear-gradient(90deg, var(--accent), var(--accent2));
  background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 1px;
}
.gweigazette-link:hover { background-size: 100% 2px; color: var(--gg-ink); }

/* ---------- buttons: gem-cut periwinkle, dark text, a light sheen sweeps across on hover ---------- */
.gweigazette-btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.5rem; background: var(--accent); color: var(--on-accent);
  font-family: var(--font-head), system-ui, sans-serif; font-weight: 600; letter-spacing: .01em;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.gweigazette-btn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 48%, transparent 66%);
  transform: translateX(-110%); transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.gweigazette-btn:hover::after, .gweigazette-btn:focus-visible::after { transform: translateX(110%); }
.gweigazette-btn-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--accent); }

/* EIP references and tags: small outlined mono tags with clipped ends. */
.gweigazette-tag {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 .85rem;
  font-family: var(--f-mono), ui-monospace, monospace; font-size: 13px; color: var(--fg);
  background: linear-gradient(var(--bg), var(--bg)) padding-box, linear-gradient(90deg, var(--line), var(--line)) border-box;
  border: 1px solid transparent;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
}
.gweigazette-tag-eip { background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--gg-rainbow) border-box; color: var(--gg-ink); font-weight: 600; }

/* ---------- live badge: wireframe octahedron (three perpendicular squares turned 45°) ---------- */
.gweigazette-octa { position: relative; display: inline-block; flex-shrink: 0; width: 15px; height: 15px; perspective: 120px; vertical-align: middle; }
.gweigazette-octa-spin { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-22deg) rotateY(30deg); animation: gweigazette-spin 9s linear infinite; }
.gweigazette-octa-spin > i {
  position: absolute; left: 14.645%; top: 14.645%; width: 70.71%; height: 70.71%; box-sizing: border-box;
  border: var(--gg-ow, 1.25px) solid; border-color: #627eea #f2a7d0 #f2b27e #a58bf0;
}
.gweigazette-octa-spin > i:nth-child(1) { transform: rotateZ(45deg); }
.gweigazette-octa-spin > i:nth-child(2) { transform: rotateY(90deg) rotateZ(45deg); }
.gweigazette-octa-spin > i:nth-child(3) { transform: rotateX(90deg) rotateZ(45deg); }
.gweigazette-octa-lg { width: 100%; height: 100%; perspective: 900px; --gg-ow: 1.5px; }
.gweigazette-octa-lg .gweigazette-octa-spin { animation-duration: 28s; }
@keyframes gweigazette-spin { from { transform: rotateX(-22deg) rotateY(0deg); } to { transform: rotateX(-22deg) rotateY(360deg); } }

/* Label frame: an elongated hexagon with a 1px rainbow border. */
.gweigazette-hexframe {
  display: inline-flex; padding: 1px; background: var(--gg-rainbow);
  clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0 50%);
}
.gweigazette-hexframe-in {
  min-height: 26px; padding: 0 16px;
  clip-path: polygon(10.6px 0, calc(100% - 10.6px) 0, 100% 50%, calc(100% - 10.6px) 100%, 10.6px 100%, 0 50%);
}

/* ---------- article prose: 18px Piazzolla ---------- */
.gweigazette-prose { font-size: 18px; line-height: 1.72; color: var(--fg); }
.gweigazette-prose > * + * { margin-top: 1.15em; }
.gweigazette-prose h2 {
  font-family: var(--font-head), system-ui, sans-serif; font-weight: 700; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.005em;
  margin-top: 2.1em; scroll-margin-top: 6rem; display: flex; gap: .6em; align-items: baseline;
}
.gweigazette-prose h2::before {
  content: ''; flex-shrink: 0; width: .42em; height: .42em; transform: translateY(-.12em) rotate(45deg);
  border: 1.5px solid var(--accent);
}
.gweigazette-prose h3 { font-family: var(--font-head), system-ui, sans-serif; font-weight: 600; font-size: 1.2rem; margin-top: 1.8em; }
.gweigazette-prose a { color: inherit; background-image: linear-gradient(90deg, var(--accent), var(--accent2)); background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat; padding-bottom: 1px; }
.gweigazette-prose a:hover { background-size: 100% 2px; color: var(--gg-ink); }
.gweigazette-prose strong { font-weight: 700; }
.gweigazette-prose ul { list-style: none; padding-left: 1.4em; }
.gweigazette-prose ul > li { position: relative; }
.gweigazette-prose ul > li::before {
  content: ''; position: absolute; left: -1.3em; top: .62em; width: 7px; height: 7px; border: 1.5px solid var(--accent); transform: rotate(45deg);
}
.gweigazette-prose ol { list-style: none; counter-reset: gg; padding-left: 2.2em; }
.gweigazette-prose ol > li { counter-increment: gg; position: relative; }
.gweigazette-prose ol > li::before {
  content: counter(gg, decimal-leading-zero); position: absolute; left: -2.2em; top: .28em;
  font-family: var(--f-mono), ui-monospace, monospace; font-size: 13px; color: var(--gg-ink);
}
.gweigazette-prose li + li { margin-top: .45em; }
/* Pull quotes: 30px Piazzolla italic under a thin rainbow line. */
.gweigazette-prose blockquote { position: relative; margin: 2.2em 0; padding-top: 1.1em; font-style: italic; font-size: 1.5rem; line-height: 1.32; font-weight: 500; }
.gweigazette-prose blockquote::before { content: ''; position: absolute; left: 0; top: 0; width: 7.5rem; height: 1px; background: var(--gg-rainbow); }
.gweigazette-prose blockquote p + p { margin-top: .6em; }
@media (min-width: 768px) { .gweigazette-prose blockquote { font-size: 30px; } }
.gweigazette-prose code { font-family: var(--f-mono), ui-monospace, monospace; font-size: .86em; padding: .08em .35em; background: rgba(98, 126, 234, .1); }
.gweigazette-prose hr { border: 0; height: 1px; background: var(--gg-rainbow); width: 6rem; margin: 2.5em 0; }
.gweigazette-prose img { max-width: 100%; height: auto; }

/* Drop cap: an outlined wide-sans capital with a rainbow stroke and no fill, floated left (SVG). */
.gweigazette-dc { float: left; height: calc(1.72em * 4 - .3em); width: auto; margin: .32em .45em 0 -.08em; overflow: visible; }
@media (min-width: 768px) { .gweigazette-dc { height: calc(1.72em * 8 - .35em); margin: .34em .55em 0 -.12em; } }
.gweigazette-sronly { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Captions: 12px mono. */
.gweigazette-cap { font-family: var(--f-mono), ui-monospace, monospace; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ---------- newsletter: rainbow-border input, gem-cut button ---------- */
.gweigazette-nl input {
  border: 1px solid transparent !important; border-radius: 0 !important;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--gg-rainbow) border-box !important;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  font-family: var(--f-mono), ui-monospace, monospace; font-size: 16px;
}
.gweigazette-nl input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.gweigazette-nl button {
  border-radius: 0 !important; font-family: var(--font-head), system-ui, sans-serif;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.gweigazette-nl form > div { border-radius: 0 !important; }

/* Comments: collapsed by default in a <details>. */
.gweigazette-fold > summary { list-style: none; cursor: pointer; }
.gweigazette-fold > summary::-webkit-details-marker { display: none; }
.gweigazette-fold .gweigazette-chev { transition: transform .3s; }
.gweigazette-fold[open] .gweigazette-chev { transform: rotate(180deg); }

/* ---------- epoch timeline: 32 slots ---------- */
.gweigazette-slot { height: 30px; flex: 1 1 0; min-width: 0; background: var(--line); clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); }
.gweigazette-slot-done { background: linear-gradient(180deg, #627eea, #a58bf0); }
.gweigazette-slot-now { background: var(--gg-rainbow); animation: gweigazette-blink 1.6s ease-in-out infinite; }
@keyframes gweigazette-blink { 50% { opacity: .45; } }

/* ---------- phone menu: a sheet sliding in from the right ---------- */
.gweigazette-sheet { animation: gweigazette-slide .38s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes gweigazette-slide { from { transform: translateX(28px); } to { transform: none; } }
.gweigazette-fade { animation: gweigazette-in .3s ease both; }
@keyframes gweigazette-in { from { opacity: .2; } to { opacity: 1; } }

/* Soft prism glow behind heroes. */
.gweigazette-glow {
  background:
    radial-gradient(40% 50% at 70% 40%, rgba(98, 126, 234, .16), transparent 70%),
    radial-gradient(30% 40% at 85% 70%, rgba(242, 167, 208, .2), transparent 70%),
    var(--bg);
}

/* Image hover: a slow lift inside the facet. */
.gweigazette-zoom img { transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.group:hover .gweigazette-zoom img { transform: scale(1.045); }

@media (prefers-reduced-motion: reduce) {
  .gweigazette-gemdot, .gweigazette-slot-now, .gweigazette-sheet, .gweigazette-fade { animation: none; }
  .gweigazette-octa-spin { animation: none; }
  .gweigazette-btn::after, .gweigazette-u, .gweigazette-zoom img { transition: none; }
}

/* ---------- facet field fade (the low-poly prism backdrop dissolves at its edges) ---------- */
.gweigazette-fieldfade {
  -webkit-mask-image: radial-gradient(120% 90% at 65% 35%, #000 35%, transparent 80%);
  mask-image: radial-gradient(120% 90% at 65% 35%, #000 35%, transparent 80%);
}

/* ---------- shared widgets recut as facets (share, poll, comments, sign-up): no pills ---------- */
#site-root[data-site='gweigazette'] .gweigazette-facets .rounded-full,
#site-root[data-site='gweigazette'] .gweigazette-facets .rounded-lg,
#site-root[data-site='gweigazette'] .gweigazette-facets .rounded-2xl { border-radius: 0 !important; }
#site-root[data-site='gweigazette'] .gweigazette-facets a[aria-label^='Share'],
#site-root[data-site='gweigazette'] .gweigazette-facets button[aria-label='Copy link'] {
  width: 46px; border: 0; background: var(--surface); color: var(--fg);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  box-shadow: inset 0 0 0 1px var(--line);
}
#site-root[data-site='gweigazette'] .gweigazette-facets a[aria-label^='Share']:hover,
#site-root[data-site='gweigazette'] .gweigazette-facets button[aria-label='Copy link']:hover { background: var(--accent); color: var(--on-accent); }
#site-root[data-site='gweigazette'] .gweigazette-facets form button,
#site-root[data-site='gweigazette'] .gweigazette-facets .border.bg-surface > .space-y-2 > button {
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
#site-root[data-site='gweigazette'] .gweigazette-facets form input,
#site-root[data-site='gweigazette'] .gweigazette-facets form textarea { border-radius: 0; }
#site-root[data-site='gweigazette'] .gweigazette-facets li > span:first-child { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
/* The poll and comment boxes get the gem cut too. */
#site-root[data-site='gweigazette'] .gweigazette-facets > .border.bg-surface,
#site-root[data-site='gweigazette'] .gweigazette-facets form.border {
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
