/* destiny.wiki — Destiny-styled theme. Thin lines, corner brackets, diamond markers, rarity bands.
   All motion is transform/opacity so it stays on the compositor; prefers-reduced-motion turns it off. */
:root {
  --bg: #05070c; --panel: rgba(12, 16, 26, .86); --panel2: rgba(22, 29, 44, .72); --panel3: rgba(32, 41, 60, .6);
  --line: rgba(160, 180, 210, .14); --line2: rgba(200, 215, 240, .26);
  --text: #e6e4dc; --muted: #8d97a8; --link: #9ccbff; --new: #ff8a7a;
  --gold: #f2c94c; --exotic: #ceae33; --legend: #a67fe0; --legend-band: #522f65; --rare: #5076a3; --common: #366f42;
  --arc: #7ad1f5; --solar: #f2721b; --void: #b185df; --stasis: #4d88ff; --strand: #35e366; --kinetic: #d8d8d8;
  --accent: #f0e6cc; --glow: 0 0 24px rgba(242, 201, 76, .25);
  --head: Rajdhani, "Barlow Condensed", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: rgba(242, 201, 76, .35); color: #fff; }
a { color: var(--link); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color .2s, background-size .3s var(--ease); }
a:hover { background-size: 100% 1px; color: #cfe6ff; }
a.new { color: var(--new); }
img { max-width: 100%; }

/* ---------- animated backdrop ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 70% 0%, #14203a 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 0% 100%, #1d1230 0%, transparent 60%), var(--bg); }
.layer { position: absolute; inset: 0; transform: translate3d(calc(var(--mx, 0) * var(--d, 0) * -1px), calc(var(--my, 0) * var(--d, 0) * -1px), 0);
  will-change: transform; }
.stars { inset: -50% 0 0; height: 200%; opacity: .8;
  background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 120px 80px, #cfe0ff, transparent),
    radial-gradient(1.5px 1.5px at 200px 150px, #fff, transparent), radial-gradient(1px 1px at 80px 190px, #ffe9b0, transparent),
    radial-gradient(1px 1px at 260px 40px, #fff, transparent), radial-gradient(1px 1px at 330px 220px, #b9d4ff, transparent);
  background-size: 360px 260px; animation: starfall 160s linear infinite; }
.stars.s2 { background-size: 520px 380px; opacity: .45; animation-duration: 260s; filter: blur(.4px); }
@keyframes starfall { to { transform: translate3d(0, 50%, 0); } }
.nebula { position: absolute; inset: -20%; opacity: .55;
  background: radial-gradient(circle at 30% 40%, rgba(122, 90, 220, .16), transparent 40%),
              radial-gradient(circle at 75% 65%, rgba(60, 140, 220, .12), transparent 45%),
              radial-gradient(circle at 60% 20%, rgba(242, 201, 76, .08), transparent 35%);
  animation: nebula 70s ease-in-out infinite alternate; }
@keyframes nebula { to { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.08); } }

.traveler { inset: auto; top: -170px; right: -170px; width: 640px; height: 640px; }
.orb { position: absolute; inset: 190px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #ffffff 0%, #e9ecf2 22%, #b7bfcd 48%, #5c6476 74%, #232836 100%);
  box-shadow: 0 0 80px 20px rgba(220, 230, 255, .18), 0 0 220px 60px rgba(242, 201, 76, .08);
  animation: breathe 9s ease-in-out infinite; }
.orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; /* the Traveler's shattered scar */
  background: conic-gradient(from 200deg, transparent 0 30deg, rgba(10, 12, 20, .55) 32deg 36deg, transparent 38deg 360deg); mix-blend-mode: multiply; }
@keyframes breathe { 50% { transform: scale(1.035); opacity: .92; } }
.rings { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; }
.rings circle, .rings path { stroke: rgba(240, 230, 204, .22); stroke-width: 1; transform-origin: 300px 300px; }
.rings .r1 { stroke-dasharray: 2 10; animation: spin 80s linear infinite; }
.rings .r2 { stroke-dasharray: 140 30 4 30; stroke: rgba(242, 201, 76, .3); animation: spin 120s linear infinite reverse; }
.rings .r3 { stroke-dasharray: 1 6; stroke: rgba(156, 203, 255, .2); animation: spin 200s linear infinite; }
.rings .r4 { transform-origin: 300px 300px; animation: spin 60s linear infinite reverse; }
.rings .r4 path { stroke: rgba(242, 201, 76, .45); stroke-width: 2; }
@keyframes spin { to { transform: rotate(360deg); } }

.shape { position: absolute; fill: none; stroke-width: 1.6; stroke-linejoin: round; opacity: 0;
  animation: drift var(--dur) ease-in-out var(--del) infinite alternate, fadein 2.4s var(--ease) .3s forwards; will-change: transform; }
.shape .fill { fill: currentColor; stroke: none; opacity: .5; }
.shape { stroke: currentColor; color: var(--gold); }
.t-arc { color: var(--arc); } .t-void { color: var(--void); } .t-solar { color: var(--solar); } .t-strand { color: var(--strand); } .t-stasis { color: var(--stasis); }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(30px, -40px, 0) rotate(60deg); }
  100% { transform: translate3d(-24px, 28px, 0) rotate(130deg); }
}
@keyframes fadein { to { opacity: .4; } }
.hexgrid { position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0 32V66' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(ellipse at 60% 30%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 60% 30%, #000 0%, transparent 70%); }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .6) 100%); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 2rem; padding: .7rem 1.5rem; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(5, 7, 12, .96), rgba(5, 7, 12, .82)); border-bottom: 1px solid var(--line); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .5; transform-origin: center;
  animation: scan 6s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: scaleX(.2); opacity: .2; } 50% { transform: scaleX(1); opacity: .6; } }
.logo { display: flex; align-items: center; gap: .6rem; color: var(--accent); font: 700 1.35rem/1 var(--head); letter-spacing: .2em; text-transform: uppercase; background: none; }
.logo:hover { background: none; color: #fff; }
.logo b { color: var(--gold); font-weight: 700; }
.glyph { width: 34px; height: 34px; fill: none; stroke: var(--gold); stroke-width: 4; transition: transform .8s var(--ease); filter: drop-shadow(0 0 6px rgba(242, 201, 76, .5)); }
.glyph .in { stroke: var(--accent); stroke-width: 3; transform-origin: 50px 50px; animation: spin 14s linear infinite; }
.glyph circle { fill: var(--gold); stroke: none; animation: pulse 2.6s ease-in-out infinite; transform-origin: 50px 50px; }
.logo:hover .glyph { transform: rotate(45deg) scale(1.08); }
@keyframes pulse { 50% { transform: scale(.6); opacity: .6; } }
.search { flex: 1; max-width: 600px; position: relative; }
.search input, .hero-search input { width: 100%; padding: .6rem 1rem .6rem 2.4rem; border: 1px solid var(--line2); border-radius: 2px;
  background: rgba(14, 19, 30, .9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23f2c94c' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E") .8rem 50% no-repeat;
  color: var(--text); transition: border-color .25s, box-shadow .25s; }
.search input:focus, .hero-search input:focus { outline: none; border-color: var(--gold); box-shadow: var(--glow), inset 0 0 0 1px rgba(242, 201, 76, .3); }

/* ---------- frame ---------- */
.wrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.4rem; max-width: 1380px; margin: 1.4rem auto 0; padding: 0 1.2rem; }
.side { font-size: .9rem; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; scrollbar-width: none; }
.side h4 { margin: 1.3rem 0 .4rem; color: var(--gold); font: 600 .78rem var(--head); letter-spacing: .28em; text-transform: uppercase; display: flex; align-items: center; gap: .5rem; }
.side h4::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.side h4:first-child { margin-top: 0; }
.side a { display: flex; align-items: center; gap: .55rem; padding: .28rem .5rem; color: #c3cad6; background: none; border-left: 2px solid transparent;
  transition: color .2s, background-color .25s, border-color .25s, transform .3s var(--ease); }
.side a::before { content: ""; width: 5px; height: 5px; transform: rotate(45deg); border: 1px solid var(--muted); transition: background-color .2s, border-color .2s; flex: none; }
.side a:hover { color: #fff; background: linear-gradient(90deg, rgba(242, 201, 76, .12), transparent); border-left-color: var(--gold); transform: translateX(3px); }
.side a:hover::before { background: var(--gold); border-color: var(--gold); }

main { position: relative; padding: 1.6rem 2.2rem 3rem; background: var(--panel); border: 1px solid var(--line); min-height: 80vh;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45); animation: rise .7s var(--ease) both; }
main::before, main::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold); pointer-events: none; opacity: .8; }
main::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
main::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } }

.kicker { margin: 0 0 .2rem; font: 600 .82rem var(--head); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: center; }
.kicker i { font-style: normal; font-size: .55rem; color: var(--gold); opacity: .8; }
.kicker .tier-exotic { color: var(--exotic); } .kicker .tier-legendary { color: var(--legend); }
h1.title { font: 700 clamp(2rem, 3.6vw, 3rem)/1.05 var(--head); text-transform: uppercase; letter-spacing: .06em; margin: .1rem 0 1.4rem; padding-bottom: .7rem;
  position: relative; background: linear-gradient(100deg, #fff 0%, var(--accent) 40%, #fff 50%, var(--accent) 60%, #fff 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 9s ease-in-out infinite; }
h1.title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; transform-origin: left;
  background: linear-gradient(90deg, var(--gold), rgba(242, 201, 76, .25) 30%, transparent); animation: draw 1.1s var(--ease) .2s both; }
@keyframes sheen { 50% { background-position: 100% 0; } }
@keyframes draw { from { transform: scaleX(0); } }
main:has(.hero) > h1.title { display: none; }
h2 { font: 700 1.45rem var(--head); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 2.4rem 0 .8rem;
  display: flex; align-items: center; gap: .7rem; }
h2::before { content: ""; width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 10px var(--gold); flex: none; }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
h3 { font: 600 1.15rem var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 1.6rem 0 .5rem; }
h4, h5 { font-family: var(--head); letter-spacing: .08em; color: var(--accent); }
.body p, .body li { color: #d7d9de; }
.body ul, .body ol { padding-left: 1.3rem; }
.body ul li::marker { color: var(--gold); } .body ol li::marker { color: var(--gold); font-family: var(--head); font-weight: 700; }
.body b { color: #fff; }
.tabs { display: flex; gap: .3rem; justify-content: flex-end; font: 600 .82rem var(--head); letter-spacing: .18em; text-transform: uppercase; margin: -.6rem 0 .6rem; }
.tabs a { padding: .3rem .9rem; border: 1px solid var(--line); color: var(--muted); background: none; transition: color .2s, border-color .2s, background-color .2s; }
.tabs a:hover { color: #fff; border-color: var(--line2); }
.tabs a.on { color: #111; background: var(--gold); border-color: var(--gold); }
.muted { color: var(--muted); font-size: .9em; }
.lead { font-size: 1.08rem; color: #eceae4; border-left: 2px solid var(--gold); padding: .2rem 0 .2rem 1rem; background: linear-gradient(90deg, rgba(242, 201, 76, .07), transparent 60%); }
code { background: var(--panel3); padding: .05rem .35rem; border: 1px solid var(--line); font-size: .86em; color: var(--accent); }

/* ---------- infobox: Destiny item-inspect card ---------- */
.infobox { float: right; width: 320px; margin: 0 0 1.4rem 1.8rem; background: rgba(10, 13, 21, .92); border: 1px solid var(--line2); font-size: .88rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5); position: relative; overflow: hidden; animation: rise .8s var(--ease) .15s both; }
.ib-head { display: flex; gap: .8rem; align-items: center; padding: .8rem .9rem; font: 700 1.2rem/1.1 var(--head); text-transform: uppercase; letter-spacing: .08em; color: #fff;
  background: linear-gradient(120deg, #2b3446, #1a2030); position: relative; overflow: hidden; }
.ib-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%);
  transform: translateX(-120%); animation: glint 7s ease-in-out 1s infinite; }
@keyframes glint { 18%, 100% { transform: translateX(120%); } }
.tier-exotic .ib-head { background: linear-gradient(120deg, #c9a52c, #7a6214); color: #fffbe8; }
.tier-legendary .ib-head { background: linear-gradient(120deg, #6a3d86, #3a2152); }
.tier-rare .ib-head { background: linear-gradient(120deg, #5076a3, #2d4562); }
.infobox.tier-exotic { border-color: rgba(206, 174, 51, .6); box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 40px rgba(206, 174, 51, .12); }
.infobox.tier-legendary { border-color: rgba(166, 127, 224, .45); }
.ib-head img { border: 1px solid rgba(255, 255, 255, .35); background: #000; flex: none; }
.ib-shot { width: 100%; display: block; transition: transform 1.2s var(--ease); }
.infobox:hover .ib-shot { transform: scale(1.04); }
.infobox table { width: 100%; border-collapse: collapse; position: relative; background: rgba(10, 13, 21, .96); }
.infobox th, .infobox td { padding: .42rem .9rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.infobox th { color: var(--muted); font: 600 .78rem var(--head); letter-spacing: .16em; text-transform: uppercase; width: 40%; padding-top: .55rem; }
.flavor { font-style: italic; color: #b9b3a2; padding: .4rem 1rem .9rem; margin: 0; border-top: 1px solid var(--line); background: rgba(10, 13, 21, .96); }
.tier-exotic > a, span.tier-exotic { color: var(--exotic); } .tier-legendary > a, span.tier-legendary { color: var(--legend); }
.el { font-weight: 600; } .el::before { content: "◆ "; font-size: .7em; }
.el-arc { color: var(--arc); } .el-solar { color: var(--solar); } .el-void { color: var(--void); } .el-stasis { color: var(--stasis); }
.el-strand { color: var(--strand); } .el-kinetic { color: var(--kinetic); }

/* ---------- details tables, perks, set bonuses ---------- */
table.details { border-collapse: collapse; width: calc(100% - 350px); min-width: 320px; margin: 1.2rem 0; background: var(--panel2); border: 1px solid var(--line); }
table.details caption { text-align: left; padding: .5rem .9rem; font: 700 1rem var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  background: linear-gradient(90deg, rgba(242, 201, 76, .16), transparent 70%); border: 1px solid var(--line); border-bottom: 0; }
table.details caption .muted { letter-spacing: .05em; text-transform: none; font-family: Inter, sans-serif; font-weight: 400; }
table.details th { width: 150px; text-align: left; color: var(--muted); font: 600 .8rem var(--head); letter-spacing: .16em; text-transform: uppercase; }
table.details th, table.details td { border-top: 1px solid var(--line); padding: .6rem .9rem; vertical-align: top; }
table.details tr { transition: background-color .25s; } table.details tr:hover { background: rgba(255, 255, 255, .025); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
table.perks td a { font-size: .84rem; display: inline-flex; align-items: center; gap: .45rem; padding: .22rem .75rem .22rem .3rem; border: 1px solid var(--line2);
  border-radius: 999px; background: rgba(14, 19, 30, .85); color: #dfe6f2; transition: border-color .25s, box-shadow .25s, transform .3s var(--ease), color .2s; }
table.perks td a::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line2);
  background: radial-gradient(circle, var(--link) 0 3px, transparent 4px), rgba(80, 118, 163, .35); flex: none; transition: background-color .25s; }
table.perks td a:hover { border-color: var(--gold); box-shadow: 0 0 16px rgba(242, 201, 76, .25); transform: translateY(-2px); color: #fff; background-size: 0; }
table.perks td a:hover::before { background: radial-gradient(circle, var(--gold) 0 4px, transparent 5px), rgba(242, 201, 76, .25); }
.reward { display: inline-flex; align-items: center; gap: .35rem; margin: 0 .7rem .35rem 0; padding: .15rem .5rem .15rem .2rem; border: 1px solid var(--line); background: rgba(14, 19, 30, .7); }
.reward img { border: 1px solid var(--line2); }

ul.tree, ul.tree ul { list-style: none; padding-left: 1.3rem; margin: .25rem 0; }
ul.tree { padding-left: 0; }
ul.tree ul { border-left: 1px solid rgba(242, 201, 76, .25); margin-left: .5rem; }
ul.tree li { position: relative; }
ul.tree ul > li::before { content: ""; position: absolute; left: -1.3rem; top: .85rem; width: 1rem; height: 1px; background: rgba(242, 201, 76, .25); }
ul.tree label, ol.steps label { cursor: pointer; }
input[type=checkbox] { appearance: none; width: 15px; height: 15px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .4); vertical-align: -2px; margin: 0 .35rem 0 0;
  transform: rotate(45deg) scale(.85); transition: background-color .2s, border-color .2s, box-shadow .2s; cursor: pointer; padding: 0; border-radius: 0; }
input[type=checkbox]:checked { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px rgba(242, 201, 76, .6); }
ul.tree input:checked ~ a, ul.tree input:checked + * { opacity: .5; }
.via { font: 600 .7rem var(--head); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); margin-right: .45rem; }
.pill { font: 600 .68rem var(--head); text-transform: uppercase; letter-spacing: .16em; padding: .05rem .5rem; border: 1px solid var(--line2); color: var(--muted); }
.pill.quest { border-color: rgba(242, 201, 76, .5); color: var(--gold); } .pill.item { border-color: rgba(166, 127, 224, .5); color: var(--legend); }
.pill.triumph { border-color: rgba(122, 209, 245, .45); color: var(--arc); } .pill.activity { border-color: rgba(53, 227, 102, .4); color: var(--strand); }
.pill.perk { border-color: rgba(156, 203, 255, .45); color: var(--link); } .pill.armorset { border-color: rgba(242, 114, 27, .45); color: var(--solar); }
.pill.destination { border-color: rgba(77, 136, 255, .45); color: var(--stasis); }
.source-line { background: var(--panel2); border-left: 2px solid var(--gold); padding: .6rem .9rem; }
ol.steps { counter-reset: s; list-style: none; padding-left: 0; }
ol.steps > li { counter-increment: s; position: relative; margin-bottom: .7rem; padding: .7rem .9rem .7rem 3.2rem; background: var(--panel2); border: 1px solid var(--line);
  transition: border-color .25s, transform .3s var(--ease); }
ol.steps > li::before { content: counter(s, decimal-leading-zero); position: absolute; left: .8rem; top: .55rem; font: 700 1.3rem var(--head); color: var(--gold); opacity: .85; }
ol.steps > li:hover { border-color: var(--line2); transform: translateX(3px); }
ol.steps input:checked + b { text-decoration: line-through; opacity: .55; }

/* ---------- cards: sources, news ---------- */
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.src-card, .news-card { position: relative; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; color: var(--text);
  transition: border-color .3s, transform .4s var(--ease), box-shadow .4s var(--ease); }
.src-card { display: flex; flex-direction: column; }
.src-card:hover, .news-card:hover { border-color: rgba(242, 201, 76, .7); transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, .5), 0 0 30px rgba(242, 201, 76, .12); background-size: 0; color: var(--text); }
.src-card img, .news-card img { width: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.src-card img { aspect-ratio: 16/9; }
.src-card:hover img, .news-card:hover img { transform: scale(1.06); }
.src-card div { padding: .55rem .8rem; } .src-card span { display: block; color: var(--muted); font-size: .8rem; }
.src-plat { aspect-ratio: 16/9; display: grid; place-items: center; font: 700 1.5rem var(--head); letter-spacing: .2em; text-transform: uppercase;
  background: radial-gradient(circle at 30% 30%, #2b3550, #121826); color: var(--accent); }
.add-src { margin-top: .9rem; } .add-src summary { cursor: pointer; color: var(--muted); } .add-src form { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

input, textarea, select, button { font: inherit; color: var(--text); background: rgba(5, 7, 12, .8); border: 1px solid var(--line2); border-radius: 2px; padding: .5rem .7rem; }
textarea:focus, select:focus, input:focus { outline: none; border-color: var(--gold); }
button { background: var(--gold); color: #120f04; font: 700 .9rem var(--head); letter-spacing: .2em; text-transform: uppercase; border: 0; cursor: pointer; padding: .6rem 1.4rem;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: filter .2s, transform .2s var(--ease); }
button:hover { filter: brightness(1.15) drop-shadow(0 0 8px rgba(242, 201, 76, .6)); transform: translateY(-1px); }
form.edit label { display: block; margin-bottom: .9rem; } form.edit small { color: var(--muted); margin-left: .5rem; }
form.edit textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .88rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .9rem; }

/* ---------- home ---------- */
.hero { position: relative; padding: 2.6rem 2.4rem 2.2rem; margin: -.4rem 0 1rem; border: 1px solid var(--line2); overflow: hidden;
  background: linear-gradient(120deg, rgba(20, 28, 46, .9), rgba(12, 16, 26, .7) 60%, rgba(60, 46, 10, .45)); }
.hero::before { content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%;
  border: 1px dashed rgba(242, 201, 76, .35); animation: spin 50s linear infinite; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, #c9cfdb 30%, #59617a 70%, transparent 72%); opacity: .5; animation: breathe 9s ease-in-out infinite; }
.hero > * { position: relative; z-index: 1; }
.hero p { max-width: 640px; color: #cfd3db; }
.hero .kicker { color: var(--gold); }
.hero-title { display: block; font: 700 clamp(2.2rem, 5vw, 3.9rem)/1 var(--head); letter-spacing: .04em; margin: .4rem 0 1rem; color: #fff; }
.hero-title::before, .hero-title::after { display: none; }
.hero-title span { background: linear-gradient(90deg, var(--gold), #fff3c4, var(--gold)) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s ease-in-out infinite; }
.hero-search { display: flex; gap: .5rem; max-width: 620px; margin: 1.2rem 0 1.4rem; }
.hero-search input { padding-top: .8rem; padding-bottom: .8rem; font-size: 1.02rem; }
.hero-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.hero-cats a { display: flex; flex-direction: column; padding: .7rem .9rem; background: rgba(5, 7, 12, .65); border: 1px solid var(--line); color: var(--text);
  position: relative; overflow: hidden; transition: border-color .3s, transform .4s var(--ease), box-shadow .4s; }
.hero-cats a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.hero-cats a:hover { border-color: var(--line2); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); background-size: 0; color: #fff; }
.hero-cats a:hover::after { transform: scaleX(1); }
.hero-cats b { color: var(--gold); font: 700 1.7rem/1 var(--head); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.hero-cats span { font: 600 .75rem var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
/* featured This Week in Destiny */
.featured { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); margin: 1.4rem 0 .4rem; border: 1px solid rgba(242, 201, 76, .55);
  background: linear-gradient(120deg, rgba(40, 32, 8, .85), rgba(12, 16, 26, .9)); color: var(--text); overflow: hidden; position: relative;
  box-shadow: 0 0 40px rgba(242, 201, 76, .1); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.featured:hover { transform: translateY(-3px); box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 50px rgba(242, 201, 76, .2); background-size: auto; color: var(--text); }
.featured img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.featured:hover img { transform: scale(1.05); }
.featured-art { min-height: 200px; background: radial-gradient(circle at 40% 40%, #fff 0, #c9cfdb 12%, #59617a 30%, transparent 32%), linear-gradient(120deg, #1b2335, #0b0f18); }
.featured > div { padding: 1.4rem 1.6rem; display: flex; flex-direction: column; justify-content: center; }
.featured .kicker { color: var(--gold); }
.featured b { font: 700 clamp(1.4rem, 2.6vw, 2rem)/1.1 var(--head); letter-spacing: .04em; text-transform: uppercase; color: #fff; margin: .3rem 0 .5rem; }
.featured p { margin: 0 0 .8rem; color: #cfd3db; }
.featured .go { font: 700 .82rem var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
/* From Bungie strip */
.official { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
@media (max-width: 1100px) { .official { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.official a { display: flex; flex-direction: column; gap: .3rem; background: var(--panel2); border: 1px solid var(--line); color: var(--text); overflow: hidden;
  transition: border-color .3s, transform .4s var(--ease); }
.official a:hover { border-color: rgba(242, 201, 76, .7); transform: translateY(-3px); background-size: 0; color: #fff; }
.official img { width: 100%; aspect-ratio: 16/7; object-fit: cover; }
.official .news-src, .official b { padding: 0 .7rem; } .official b { font: 600 1rem/1.25 var(--head); letter-spacing: .03em; padding-bottom: .7rem; }
/* Official on X */
.xfeed { border: 1px solid var(--line); background: var(--panel2); padding: .8rem .9rem; }
.xaccts { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .6rem; }
.xaccts a { font: 600 .8rem var(--head); letter-spacing: .08em; padding: .2rem .6rem; border: 1px solid var(--line2); color: var(--text); background: rgba(5, 7, 12, .6); }
.xaccts a:hover { border-color: var(--gold); background-size: 0; }
.xpost { display: block; padding: .55rem 0; border-top: 1px solid var(--line); color: #dfe3ea; font-size: .92rem; }
.xpost:hover { color: #fff; background-size: 0; }
.home { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; }
.news { display: grid; gap: .9rem; }
.news-card { display: grid; grid-template-columns: 170px 1fr; gap: 1rem; }
.news-card:not(:has(img)) { grid-template-columns: 1fr; padding-left: 1rem; }
.news-card img { height: 100%; }
.news-card > div { padding: .7rem .9rem .7rem 0; } .news-card b { font: 700 1.08rem/1.25 var(--head); letter-spacing: .03em; display: block; }
.news-card p { margin: .25rem 0; font-size: .9rem; color: #b8c1cd; }
.news-src { display: block; font: 600 .72rem var(--head); text-transform: uppercase; letter-spacing: .2em; color: var(--gold); }

/* ---------- lists, categories ---------- */
ul.cols { columns: 3 220px; column-gap: 1.6rem; padding-left: 1.1rem; } ul.cols li::marker, ul.cols1 li::marker { color: var(--gold); }
ul.cols1 { padding-left: 1.1rem; }
ul.grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .45rem; }
ul.grid li { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; border: 1px solid transparent; border-left: 2px solid var(--line2);
  background: rgba(14, 19, 30, .5); transition: border-color .25s, background-color .25s, transform .3s var(--ease); }
ul.grid li:hover { border-color: var(--line2); border-left-color: var(--gold); background: rgba(242, 201, 76, .06); transform: translateX(3px); }
ul.grid li.tier-exotic { border-left-color: var(--exotic); } ul.grid li.tier-legendary { border-left-color: var(--legend); }
ul.grid img { border: 1px solid var(--line2); background: #000; }
.filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.filters a { padding: .2rem .7rem; border: 1px solid var(--line); font: 600 .82rem var(--head); letter-spacing: .1em; text-transform: uppercase; color: #c3cad6; background: rgba(14, 19, 30, .6);
  transition: border-color .2s, color .2s, background-color .2s; }
.filters a:hover { border-color: var(--line2); color: #fff; }
.filters a.on { border-color: var(--gold); color: #120f04; background: var(--gold); }
.filters a.on .muted { color: #3b310d; }
.cat { clear: both; margin-top: 2.8rem; padding: .6rem .9rem; border: 1px solid var(--line); border-left: 2px solid var(--gold); background: var(--panel2); font-size: .84rem; color: var(--muted); }
.hist { list-style: none; padding: 0; } .hist li { padding: .35rem .2rem; border-bottom: 1px solid var(--line); }

footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2.4rem 1.5rem 2rem; position: relative; }
footer::before { content: "◆"; display: block; color: var(--gold); margin-bottom: .8rem; letter-spacing: 1rem; }
footer .made { font: 600 1rem var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--text); margin: 0 0 .4rem; }
footer .heart { color: #e0565b; display: inline-block; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 15% { transform: scale(1.25); } 30% { transform: scale(1); } }

/* scroll reveal (classes added by app.js, so no-JS pages stay fully visible) */
.rv { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--rd, 0s); }
.rv.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .wrap, .home, .two { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .4rem; }
  .side h4 { display: none; } .side a { white-space: nowrap; border: 1px solid var(--line); flex: none; }
  main { padding: 1.2rem 1rem 2rem; }
  .infobox { float: none; width: auto; margin: 0 0 1.2rem; } table.details { width: 100%; }
  .news-card { grid-template-columns: 100px 1fr; } .top { gap: 1rem; padding: .6rem .8rem; } .logo span { display: none; }
  .traveler { width: 420px; height: 420px; top: -140px; right: -160px; } .orb { inset: 125px; }
  .hero { padding: 1.6rem 1.2rem; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  main { overflow-wrap: anywhere; } /* long URLs / hashes never push the page sideways */
  .wrap { padding: 0 .6rem; margin-top: .8rem; gap: .8rem; }
  .side { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .side a { padding: .45rem .7rem; } /* finger-sized */
  main { padding: 1rem .85rem 1.6rem; }
  main::before, main::after { width: 14px; height: 14px; }
  .kicker { letter-spacing: .16em; font-size: .74rem; }
  h1.title { margin-bottom: 1rem; }
  h2 { font-size: 1.2rem; letter-spacing: .08em; margin-top: 1.8rem; }
  .tabs { justify-content: flex-start; flex-wrap: wrap; margin: 0 0 .7rem; }
  /* label-over-value rows: the 150px label column made perk chips stack one per line */
  table.details { min-width: 0; }
  table.details, table.details tbody, table.details tr, table.details th, table.details td { display: block; width: auto; }
  table.details th { border-top: 1px solid var(--line); padding: .55rem .8rem 0; }
  table.details td { border-top: 0; padding: .35rem .8rem .7rem; }
  table.perks td a { font-size: .82rem; padding: .3rem .7rem .3rem .3rem; }
  .ib-shot { max-height: 190px; object-fit: cover; }
  .infobox th { width: 42%; }
  ol.steps > li { padding: .7rem .8rem .7rem 2.7rem; } ol.steps > li::before { left: .6rem; font-size: 1.1rem; }
  ul.tree ul { padding-left: .9rem; } ul.tree ul > li::before { left: -.9rem; width: .7rem; }
  ul.cols { columns: 1; } ul.grid { grid-template-columns: 1fr; }
  .hero { margin-top: 0; } .hero::before { width: 240px; height: 240px; right: -90px; top: -90px; } .hero::after { width: 160px; height: 160px; right: -40px; top: -40px; }
  .hero-search { flex-wrap: wrap; } .hero-search button { width: 100%; clip-path: none; }
  .hero-cats { grid-template-columns: repeat(2, 1fr); } .hero-cats b { font-size: 1.4rem; }
  .news-card { grid-template-columns: 1fr; } .news-card > div { padding: .7rem .9rem; } .news-card img { aspect-ratio: 16/9; height: auto; }
  .featured { grid-template-columns: 1fr; } .featured img { aspect-ratio: 16/9; height: auto; }
  .src-grid { grid-template-columns: 1fr 1fr; gap: .5rem; } .src-card div { padding: .45rem .55rem; font-size: .85rem; }
  .two { gap: .6rem; } .add-src form input, .add-src form button { flex: 1 1 100%; }
  /* lighter backdrop on phones: fewer layers to composite */
  .stars.s2, .hexgrid, .nebula { display: none; }
  .search input { font-size: 16px; } /* ≥16px stops iOS zooming on focus */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  .shape { opacity: .2; } .rv { opacity: 1; transform: none; }
}
