
/* Quest log */
.quests { padding: clamp(70px, 9vw, 130px) 0 0; }
.qlog { display: grid; grid-template-columns: 1.35fr .9fr; gap: clamp(16px, 2.4vw, 28px); background: #101012; color: #f3f0e8; border-radius: 32px; padding: clamp(14px, 2.4vw, 28px); }
.qlist { display: flex; flex-direction: column; gap: 6px; }
.quest { display: grid; grid-template-columns: 52px 1fr 34px; gap: 16px; align-items: start; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; border-radius: 20px; padding: 16px; cursor: pointer; transition: background .25s; }
.quest:hover { background: rgba(255,255,255,.04); }
.quest.open { background: rgba(255,255,255,.06); }
.q-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; overflow: hidden; background: #0f6e56; }
.q-icon img { width: 100%; height: 100%; object-fit: contain; }
.q-dark { background: transparent; }
.q-white { background: #fff; }
.q-white img { width: 62%; height: 62%; }
.q-paper { background: #ece8de; }
.q-main { display: flex; flex-direction: column; min-width: 0; }
.q-type { font-weight: 600; font-size: 13px; color: #ff7a45; }
.q-name { font-weight: 800; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.1; letter-spacing: -.03em; }
.q-goal { color: #b7b2a7; font-size: 15.5px; margin-top: 2px; }
.obj { display: flex; flex-direction: column; gap: 8px; overflow: hidden; max-height: 0; margin-top: 0; transition: max-height .5s var(--ease), margin .4s var(--ease); }
.quest.open .obj { max-height: 160px; margin-top: 12px; }
.obj span { position: relative; padding-left: 30px; font-size: 15.5px; color: #d9d4c8; }
.obj span::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 6px; border: 2px solid #5b574f; }
.obj span.done { color: #8e897f; text-decoration: line-through; text-decoration-color: rgba(255,255,255,.25); }
.obj span.done::before { background: #ff5a1f; border-color: #ff5a1f; }
.obj span.done::after { content: ""; position: absolute; left: 6px; top: 5px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.qbar { display: block; height: 6px; border-radius: 9px; background: rgba(255,255,255,.1); margin-top: 14px; overflow: hidden; }
.qbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff5a1f, #ffb08a); border-radius: inherit; transition: width 1.2s var(--ease); }
.q-state { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.quest.complete .q-state { background: #ff5a1f; color: #fff; }
.quest.complete .q-state::after { content: "\2713"; }
.quest:not(.complete) .q-state { border: 2px solid #5b574f; }
.quest:not(.complete) .q-state::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #ff7a45; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,122,69,.6); } 100% { box-shadow: 0 0 0 10px rgba(255,122,69,0); } }
.qside { display: flex; flex-direction: column; gap: 16px; background: #f3f0e8; color: var(--ink); border-radius: 24px; padding: 22px; }
.morph { position: relative; aspect-ratio: 1; border-radius: 20px; background: #ece8de; overflow: hidden; }
.morph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: morph 9s infinite; }
.morph .m1 { padding: 20%; animation-delay: 0s; }
.morph .m2 { animation-delay: 3s; }
.morph .m3 { animation-delay: 6s; }
@keyframes morph { 0% { opacity: 0; transform: scale(.96); } 6% { opacity: 1; transform: none; } 30% { opacity: 1; transform: none; } 36% { opacity: 0; transform: scale(1.03); } 100% { opacity: 0; } }
.m-label { position: absolute; left: 14px; bottom: 14px; }
.m-label b { position: absolute; left: 0; bottom: 0; white-space: nowrap; background: #101012; color: #fff; font-weight: 700; font-size: 14px; padding: 7px 12px; border-radius: 10px; opacity: 0; animation: morph 9s infinite; }
.m-label .l2 { animation-delay: 3s; }
.m-label .l3 { animation-delay: 6s; }
.loot { font-weight: 700; font-size: 17px; }
.qstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qstats div { background: #fff; border-radius: 16px; padding: 12px; }
.qstats b { display: block; font-weight: 800; font-size: 30px; line-height: 1; color: var(--accent); }
.qstats span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
@media (max-width: 900px) { .qlog { grid-template-columns: 1fr; } .qside { order: -1; } .morph { max-width: 320px; width: 100%; margin: 0 auto; } }
@media (max-width: 760px) { .quest { grid-template-columns: 44px 1fr 30px; gap: 12px; padding: 14px 10px; } .q-icon { width: 44px; height: 44px; border-radius: 13px; } .q-state { width: 30px; height: 30px; } }

/* Personal note */
.note-sec { padding: clamp(70px, 9vw, 130px) 0 0; }
.note { max-width: 720px; margin: 0 auto; background: #fff; border-radius: 28px; padding: clamp(28px, 5vw, 60px); box-shadow: 0 0 0 1px var(--line), 0 40px 70px -50px rgba(14,14,15,.5); rotate: -1deg; transition: rotate .8s var(--ease); }
.note:hover { rotate: 0deg; }
.note-hi { font-weight: 800; font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -.045em; margin-bottom: 26px; }
.note p:not(.note-hi) { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; color: var(--ink-2); margin-bottom: 16px; }
.sign { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.sign img { width: 44px; height: 44px; }
.sign b { display: block; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.sign span { color: var(--mute); font-size: 15px; }

/* Diamond buddy */
.buddy { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 74px; height: 74px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.buddy-body { width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 12px 14px rgba(255,90,31,.35)); animation: hover 3.2s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-8px) rotate(4deg); } }
.buddy.twirl .buddy-body { animation: buddySpin .7s var(--ease), hover 3.2s ease-in-out .7s infinite; }
@keyframes buddySpin { from { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.15); } to { transform: rotate(360deg) scale(1); } }
.buddy .eye { transform-origin: 50px 56px; transition: transform .08s; }
.buddy.blink .eye { transform: scaleY(.1); }
.bubble { position: absolute; right: 84px; bottom: 26px; width: max-content; max-width: 220px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14.5px; line-height: 1.35; padding: 10px 14px; border-radius: 16px 16px 4px 16px; opacity: 0; transform: translateY(6px) scale(.96); transform-origin: bottom right; transition: opacity .25s, transform .35s var(--ease); pointer-events: none; }
.buddy.talking .bubble { opacity: 1; transform: none; }

.buddy-btn { z-index: 2; position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.buddy-menu { position: absolute; right: 0; bottom: 86px; display: flex; flex-direction: column; gap: 4px; min-width: 190px; padding: 8px; border-radius: 18px; background: #101012; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6); opacity: 0; transform: translateY(8px) scale(.96); transform-origin: bottom right; pointer-events: none; transition: opacity .2s, transform .3s var(--ease); }
.buddy.menu-open .buddy-menu { opacity: 1; transform: none; pointer-events: auto; }
.buddy-menu button { text-align: left; border: 0; background: transparent; color: #f3f0e8; font: 600 15px var(--font); padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.buddy-menu button:hover, .buddy-menu button:focus-visible { background: rgba(255,255,255,.08); color: #ff7a45; outline: none; }
.buddy.menu-open .bubble { opacity: 0; }

/* Achievement toasts: small and quick */
.toasts { position: fixed; left: 18px; bottom: 18px; z-index: 61; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px; background: rgba(16,16,18,.9); color: #fff; font-size: 14px; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .35s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast img { width: 24px; height: 24px; border-radius: 50%; background: #ece8de; }
.toast-name { font-weight: 600; }
.toast-g { font-weight: 800; color: #ff7a45; }
.score b { color: var(--ink); }

@media (max-width: 760px) {
  .note { rotate: 0deg; }
  .buddy { width: 56px; height: 56px; right: 14px; bottom: 14px; }
  .bubble { right: 64px; bottom: 18px; max-width: 200px; font-size: 13.5px; }
  .buddy-menu { bottom: 66px; }
  .toasts { left: 12px; bottom: 14px; }
  .end-base { flex-direction: column; gap: 10px; }
}


/* ---------- Background options (preview switcher) ---------- */

/* 1. Dark with drifting glow */
html.bg-dark { background: #0b0b0c; --paper: #0b0b0c; --card: #17171a; --ink: #f3f0e8; --ink-2: #c9c4b8; --mute: #8e897f; --line: rgba(255,255,255,.12); }
.bg-dark body { background: transparent; }
.bg-dark body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(38% 32% at 22% 24%, rgba(255,90,31,.28), transparent 62%), radial-gradient(40% 36% at 78% 68%, rgba(143,116,255,.24), transparent 62%), radial-gradient(30% 26% at 60% 20%, rgba(255,180,120,.10), transparent 60%);
  }
.bg-dark .top.scrolled { background: rgba(11,11,12,.8); }
.bg-dark .note { background: #17171a; box-shadow: 0 0 0 1px var(--line); }
.bg-dark .qlog { background: #17171a; box-shadow: 0 0 0 1px var(--line); }
.bg-dark .qside { background: #0b0b0c; color: var(--ink); }
.bg-dark .qstats div { background: #17171a; }
.bg-dark .morph { background: #ece8de; }
.bg-dark .icon-ink { background: #ece8de; }


.bg-dark .end-base, .bg-dark .end-grid { border-color: var(--line); }


/* Losh Shop (eBay) banner */
.lshop { padding: 0 0 clamp(20px, 3vw, 40px); }
.lshop-card { display: flex; align-items: center; gap: clamp(16px, 3vw, 32px); max-width: 980px; margin: 0 auto; padding: clamp(18px, 2.6vw, 28px); border-radius: 28px; text-decoration: none; color: #f3f0e8; background: #0f1a0b; box-shadow: 0 0 0 1px rgba(155,227,60,.25), 0 30px 60px -40px rgba(155,227,60,.35); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.lshop-card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(155,227,60,.5), 0 30px 60px -30px rgba(155,227,60,.45); }
.lshop-logo { width: clamp(76px, 9vw, 110px); height: auto; border-radius: 50%; flex: none; transition: transform .6s var(--ease); }
.lshop-card:hover .lshop-logo { transform: rotate(-8deg) scale(1.05); }
.lshop-title { font-weight: 800; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.03em; line-height: 1; color: #9be33c; margin-bottom: 8px; }
.lshop-text { color: #c9d6bd; font-size: 16.5px; }
.lshop-btn { margin-left: auto; flex: none; background: #9be33c; color: #0f1a0b; }
@media (max-width: 760px) { .lshop-card { flex-wrap: wrap; } .lshop-btn { margin-left: 0; width: 100%; } }

/* Work with me */
.hire { padding: clamp(70px, 9vw, 130px) 0 0; }
.offers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.offer { display: flex; flex-direction: column; padding: 26px 24px; border-radius: 26px; background: #17171a; box-shadow: 0 0 0 1px var(--line); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.offer:hover { transform: translateY(-6px); box-shadow: 0 0 0 1px rgba(255,90,31,.45), 0 30px 50px -30px rgba(255,90,31,.35); }
.offer-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,90,31,.12); margin-bottom: 18px; }
.offer-icon svg { width: 26px; height: 26px; fill: none; stroke: #ff7a45; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.offer h3 { font-weight: 800; font-size: 24px; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 8px; }
.offer-line { color: var(--ink-2); font-size: 15.5px; margin-bottom: 16px; }
.offer-gets { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.offer-gets li { position: relative; padding-left: 24px; font-size: 15px; color: var(--ink); }
.offer-gets li::before { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 5px; background: #ff5a1f; }
.offer-gets li::after { content: ""; position: absolute; left: 5px; top: 6px; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.offer-btn { margin-top: auto; align-self: flex-start; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.offer:hover .offer-btn { background: #ff5a1f; color: #fff; box-shadow: none; }
.how { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how li { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; border-radius: 22px; background: rgba(255,255,255,.03); box-shadow: 0 0 0 1px var(--line); }
.how b { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #ff5a1f; color: #fff; font-weight: 800; }
.how-t { font-weight: 700; font-size: 17px; }
.how p:not(.how-t) { color: var(--ink-2); font-size: 15px; }
@media (max-width: 1100px) { .offers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .offers, .how { grid-template-columns: 1fr; } }

/* Language switch */
.lang { display: inline-grid; place-items: center; height: 42px; min-width: 42px; padding: 0 12px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.lang:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
@media (max-width: 760px) { .lang { margin-left: auto; } }

/* Contrast: dark text on orange, clearer small labels */
.offer:hover .offer-btn { color: #0e0e0f; }
.how b { color: #0e0e0f; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Phone: toasts at the top so they never meet the buddy bubble */
@media (max-width: 760px) {
  .toasts { top: 74px; bottom: auto; left: 50%; transform: translateX(-50%); }
}

/* Preview-card mode (?og) used only to render img/og.jpg */
.og .top-nav, .og .top .btn, .og .lang, .og .buddy, .og .toasts, .og .hero-cta, .og .dock-sec { display: none !important; }
.og .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
.og .top { position: absolute; left: 0; right: 0; top: 18px; }
.og .wordmark { font-size: 28px; }
.og .wordmark img { width: 44px; height: 44px; }
.og .hero-grid { min-height: 630px; }

/* Contact sheet */
.cs-lock, .cs-lock body { overflow: hidden; }
.csheet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; }
.csheet[hidden] { display: none; }
.csheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s; }
.csheet.open .csheet-bg { opacity: 1; }
.csheet-card { position: relative; width: min(440px, calc(100vw - 32px)); padding: 26px 22px 22px; border-radius: 26px; background: #17171a; color: #f3f0e8; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 40px 80px -30px rgba(0,0,0,.8); transform: translateY(16px) scale(.98); opacity: 0; transition: transform .3s var(--ease), opacity .2s; }
.csheet.open .csheet-card { transform: none; opacity: 1; }
.cs-x { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #f3f0e8; font: 600 24px/1 var(--font); cursor: pointer; }
.cs-title { font-weight: 800; font-size: 28px; letter-spacing: -.03em; }
.cs-mail { margin: 6px 0 18px; color: #ff7a45; font-weight: 700; font-size: 17px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs-opt { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 14px 16px; border: 0; border-radius: 16px; background: rgba(255,255,255,.06); color: #f3f0e8; font: inherit; text-decoration: none; cursor: pointer; transition: background .2s; }
.cs-opt:hover, .cs-opt:focus-visible { background: rgba(255,90,31,.18); outline: none; }
.cs-opt b { font-weight: 700; font-size: 16px; }
.cs-opt span { font-size: 13px; color: #a8a39a; }
.cs-opt:first-child { grid-column: 1 / -1; background: #ff5a1f; color: #0e0e0f; }
.cs-opt:first-child span { color: rgba(14,14,15,.7); }
@media (max-width: 760px) {
  .csheet { place-items: end center; }
  .csheet-card { width: 100%; border-radius: 26px 26px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateY(40px); }
}

/* Phone: buddy waits until you scroll past the first screen, so it never covers the dock */
@media (max-width: 760px) {
  .lang { height: 38px; min-width: 38px; padding: 0 10px; font-size: 13px; }
  .buddy { opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease); }
  .buddy.shown { opacity: 1; transform: none; pointer-events: auto; }
}
