/* ==========================================================
   Round 2: project viewer, new secrets, unlocks, extras.
   Same tokens as site.css; loaded after it.
   ========================================================== */

/* ---------- intro: now line ---------- */
.now-line { margin: 22px 0 0; font-size: 15px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.now-line .dot { width: 8px; height: 8px; border-radius: 50%; background: #29c46a; box-shadow: 0 0 0 0 rgba(41, 196, 106, .5); animation: ping 2s infinite; }

/* ---------- hidden in plain sight: the typo ---------- */
.typo { text-decoration: underline wavy #e2504f; text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: pointer; border-radius: 3px; }
.typo:hover { background: rgba(226, 80, 79, .1); }
.typo.fixed { text-decoration: none; cursor: default; background: none; color: var(--accent); }

/* ---------- the critic mini-game ---------- */
.critic { margin-top: 26px; max-width: 34em; padding: 16px 18px; border: 1.5px dashed var(--ink); border-radius: 14px; background: var(--paper); }
.critic label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.critic-row { display: flex; gap: 8px; }
.critic input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.critic .btn { padding: 10px 16px; font-size: 15px; }
.critic-out { margin: 10px 0 0; font-family: var(--hand); font-size: 23px; line-height: 1.15; color: var(--accent); min-height: 0; }
.critic-out .score { font-family: var(--font); font-weight: 700; font-size: 18px; color: var(--ink); margin-right: 6px; }

/* ---------- director's cut (unlocked at 10 secrets) ---------- */
.dc { display: none; margin: 18px 0 0; max-width: 34em; font-family: var(--hand); font-size: 22px; line-height: 1.15; color: var(--accent); transform: rotate(-.6deg); }
.dc::before { content: "director's cut · "; font-weight: 700; }
body.dc-on .dc { display: block; animation: dc-in .7s var(--spring); }
.center .dc { margin-left: auto; margin-right: auto; }
@keyframes dc-in { from { opacity: 0; transform: translateY(8px) rotate(-3deg); } }

/* ---------- project viewer ---------- */
.viewer { margin-top: 10px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs [role="tab"] { font: inherit; font-size: 15px; font-weight: 500; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s, background-color .2s, transform .3s var(--spring); }
.tabs [role="tab"] span { font-size: 12px; opacity: .6; margin-left: 4px; }
.tabs [role="tab"]:hover { color: var(--ink); transform: translateY(-2px); }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(18px, 3vw, 40px); align-items: center; min-height: 380px; padding: clamp(18px, 3vw, 32px); border: 1.5px solid var(--ink); border-radius: 22px; background: var(--card); }
.panel[hidden] { display: none; }
.panel h3 { font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -.03em; margin: 0 0 12px; }
.panel .k { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.panel .lede { font-size: clamp(18px, 1.9vw, 23px); }
.panel .more { margin-bottom: 18px; }
.panel .tags { margin-bottom: 18px; }

/* each project enters its own way */
.panel.enter[data-anim="grid"] { animation: in-grid .7s var(--ease); }
.panel.enter[data-anim="code"] { animation: in-code .6s var(--ease); }
.panel.enter[data-anim="swipe"] { animation: in-swipe .7s var(--spring); }
.panel.enter[data-anim="roll"] { animation: in-roll .8s var(--spring); }
.panel.enter[data-anim="subs"] { animation: in-subs .8s var(--ease); }
@keyframes in-grid { from { clip-path: inset(0 100% 100% 0 round 22px); } to { clip-path: inset(0 0 0 0 round 22px); } }
@keyframes in-code { from { clip-path: inset(0 0 0 100% round 22px); opacity: .4; } to { clip-path: inset(0 0 0 0 round 22px); opacity: 1; } }
@keyframes in-swipe { from { transform: translateY(60px); opacity: 0; } }
@keyframes in-roll { from { transform: translateX(-80px) rotate(-4deg); opacity: 0; } }
@keyframes in-subs { from { filter: brightness(0); opacity: .3; } }

/* ---------- cinema: credits ---------- */
.credits-btn { position: absolute; right: 7%; bottom: calc(11vh + 18px); z-index: 5; font: inherit; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.credits-btn:hover { color: var(--ink); border-color: var(--ink); }
.credits { position: absolute; inset: 0; z-index: 6; background: #000; overflow: hidden; text-align: center; color: #f3f1ea; }
.credits .roll { position: absolute; left: 0; right: 0; top: 100%; }
.credits .roll p { margin: 0 0 46px; font-size: 16px; letter-spacing: .08em; color: #a9a59c; }
.credits .roll b { display: block; margin-top: 4px; font-size: 24px; letter-spacing: 0; color: #f3f1ea; }
.credits .roll .t { font-size: 30px; font-weight: 700; letter-spacing: .3em; color: #f3f1ea; }
.credit-you { margin-top: 6px; font: inherit; font-size: 24px; font-weight: 700; color: #ffd166; background: none; border: 0; border-bottom: 2px dashed #ffd166; cursor: pointer; }
@keyframes roll { to { transform: translateY(calc(-100% - 100vh + 30vh)); } }

/* ---------- graveyard puzzle ---------- */
.engrave { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font-weight: 700; font-size: 22px; letter-spacing: .1em; color: rgba(255, 255, 255, .1); text-shadow: 0 1px 0 rgba(0, 0, 0, .35); pointer-events: none; }
.stones.solved .engrave { color: #ffd166; transition: color 1s; }
.stones-hint { margin: 18px 0 0; font-family: var(--hand); font-size: 21px; color: var(--muted); }

/* ---------- socials ---------- */
.socials { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.socials:empty { display: none; }
.socials a { font-size: 15px; color: var(--muted); text-decoration: none; border-bottom: 1.5px solid var(--line); padding-bottom: 2px; }
.socials a:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- drawing with fading ink ---------- */
#draw { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 45; pointer-events: none; }
body.drawing, body.drawing * { cursor: crosshair !important; user-select: none; }

/* ---------- the doodle hiding in Pro mode ---------- */
.pro-doodle { display: none; position: fixed; right: 14px; bottom: 12px; z-index: 60; width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .45; transition: opacity .2s; }
.pro-doodle svg { width: 100%; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; }
.pro-doodle svg circle:nth-of-type(n+2) { fill: var(--muted); stroke: none; }
.pro-doodle:hover { opacity: 1; }
body.pro .pro-doodle { display: block; }
body.pro .pro-doodle, body.pro .pro-doodle * { animation: none; }
body.pro .viewer .panel[hidden] { display: grid !important; margin-bottom: 14px; }
body.pro .tabs, body.pro .preview, body.pro .critic, body.pro .credits-btn, body.pro .credits, body.pro .stones-hint, body.pro .engrave, body.pro .now-line .dot, body.pro .dc { display: none !important; }
body.pro .panel { grid-template-columns: 1fr; min-height: 0; }
body.pro .typo { text-decoration: none; cursor: text; }

/* ---------- right-click doodle menu ---------- */
#ctx { position: fixed; z-index: 95; min-width: 230px; padding: 8px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: 6px 6px 0 var(--accent-soft); transform-origin: top left; animation: ctx-in .25s var(--spring); }
#ctx[hidden] { display: none; }
#ctx .ctx-title { margin: 2px 8px 6px; font-family: var(--hand); font-size: 20px; color: var(--accent); }
#ctx button { display: block; width: 100%; text-align: left; font: inherit; font-size: 15px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
#ctx button:hover, #ctx button:focus-visible { background: var(--accent-soft); }
@keyframes ctx-in { from { transform: scale(.85); opacity: 0; } }

/* ---------- play Pixel Publisher here ---------- */
#play-modal { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
#play-modal[hidden] { display: none; }
.play-frame { width: min(1200px, 100%); height: min(800px, 100%); display: flex; flex-direction: column; background: #000; border: 1.5px solid #333; border-radius: 16px; overflow: hidden; animation: dc-in .5s var(--spring); }
.play-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #111; color: #cfcac0; font-size: 14px; }
.play-bar .btn { color: #f1efe8; border-color: #f1efe8; padding: 7px 14px; font-size: 14px; }
.play-frame iframe { flex: 1; width: 100%; border: 0; background: #000; }

/* ---------- secrets panel: tiers, hints, unlocks ---------- */
#egg-list { width: 320px; max-height: min(70vh, 560px); overflow: auto; }
#egg-tiers h4 { margin: 12px 0 6px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
#egg-tiers h4:first-child { margin-top: 0; }
#egg-tiers ul { list-style: none; margin: 0; padding: 0; }
#egg-tiers li { display: flex; gap: 8px; padding: 5px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
#egg-tiers li .m { flex: none; width: 18px; }
#egg-tiers li.found { color: var(--ink); }
#egg-tiers li.hint { color: var(--muted); font-style: italic; }
#egg-tiers li.locked { color: var(--muted); opacity: .6; }
#unlocks { margin-top: 14px; padding-top: 12px; border-top: 1.5px solid var(--ink); }
#unlocks p { margin: 0 0 6px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
#unlocks .opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
#unlocks button { font: inherit; font-size: 13px; padding: 5px 10px; border: 1.5px solid var(--line); border-radius: 999px; background: none; color: var(--ink); cursor: pointer; }
#unlocks button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
#unlocks button:disabled { opacity: .4; cursor: not-allowed; }
#unlocks .next { font-size: 13px; color: var(--muted); margin: 0; }

/* ink colours (unlock at 3) */
body[data-ink="red"] { --accent: #d33a2c; --accent-soft: rgba(211, 58, 44, .14); }
body[data-ink="green"] { --accent: #1f9d55; --accent-soft: rgba(31, 157, 85, .14); }
body[data-ink="gold"] { --accent: #c9960c; --accent-soft: rgba(201, 150, 12, .16); }

/* cursor skins (unlock at 6) */
@media (pointer: fine) {
  body[data-cursor="quill"], body[data-cursor="quill"] .scene { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M4 28 C 10 18, 18 8, 29 3 C 26 12, 18 20, 7 26 Z' fill='white' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M4 28 L 14 18' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") 4 28, auto !important; }
  body[data-cursor="pixel"], body[data-cursor="pixel"] .scene { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' shape-rendering='crispEdges'%3E%3Cpath d='M2 2h4v2h2v2h2v2h2v2h2v2h2v2h2v2h-4v4h-2v2h-2v-2h-2v-4h-2v2h-2v-4h-2v-2h-2z' fill='white' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E") 2 2, auto !important; }
}

@media (max-width: 820px) {
  .panel { grid-template-columns: 1fr; min-height: 0; }
  .preview { height: 220px; }
  .credits-btn { right: 16px; }
  #egg-list { width: calc(100vw - 36px); }
}
@media (prefers-reduced-motion: reduce) {
  .feed, .pv-box .box, .panel .tt-grid i { animation: none !important; }
  .tt-grid i { opacity: 1; transform: none; background: var(--c); }

}

/* ================= round 3 ================= */

/* sticky note: a different kind of secret than blue ink */
.sticky { display: inline-block; margin: 6px auto 0; padding: 14px 18px 12px; background: #ffe98a; color: #3a3000; font-family: var(--hand); font-size: 24px; line-height: 1.1; transform: rotate(-3deg); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .45); clip-path: polygon(0 0, 100% 0, 100% 86%, 90% 100%, 0 100%); }
.sticky small { display: block; font-size: 16px; opacity: .7; }
.in .sticky.reveal { transform: rotate(-3deg); }

/* project studio: the goal */
.goal { display: inline-flex; align-items: center; gap: 12px; margin: 4px auto 18px; padding: 10px 18px 10px 12px; border-radius: 999px; background: #0f1a10; border: 1.5px solid #3fbf5f; color: #d8f5dd; font-size: 15px; text-align: left; }
.goal .trophy { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #3fbf5f; font-size: 17px; }
.goal b { color: #7fe39a; }

/* off the clock: elsewhere links */
.elsewhere-label { margin: 22px 0 8px; font-family: var(--px); font-size: 11px; color: var(--muted); }
.elsewhere { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.elsewhere a { display: inline-block; padding: 6px 12px; font-family: var(--px); font-size: 11px; color: #7cff6b; text-decoration: none; background: #000; border: 2px solid #7cff6b; box-shadow: 3px 3px 0 #0b0704; }
.elsewhere a:hover { background: #7cff6b; color: #000; }

/* secrets panel: whisper box */
#whisper { margin: 0 0 12px; }
#whisper label { display: block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
#whisper input { width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border: 1.5px dashed var(--ink); border-radius: 10px; background: var(--card); color: var(--ink); }

/* phones: drawing mode, touch-only menu items, the soaked doodle is tappable */
.touch-only { display: none !important; }
@media (pointer: coarse) {
  .touch-only { display: block !important; }
  body[data-weather="rain"] #soaked, body[data-weather="storm"] #soaked { display: block !important; pointer-events: auto; }
}
body.ink-mode { touch-action: none; overscroll-behavior: none; }
.ink-done { position: fixed; left: 50%; bottom: 18px; z-index: 97; transform: translateX(-50%); display: none; }
body.ink-mode .ink-done { display: inline-flex; }

/* 20/20: the fake 1996 crash */
#crash { position: fixed; inset: 0; z-index: 99; background: #c0c0c0; color: #000; overflow: hidden; font-family: "Times New Roman", Times, serif; }
#crash[hidden] { display: none; }
#crash .c96 { max-width: 760px; margin: 0 auto; padding: 40px 20px; text-align: center; }
#crash h1 { font-size: 40px; color: #0000cc; text-shadow: 2px 2px 0 #ff00ff; margin: 0 0 16px; }
#crash .marq { overflow: hidden; white-space: nowrap; background: #000080; color: #ffff00; padding: 4px 0; }
#crash .marq span { display: inline-block; padding-left: 100%; animation: marq 7s linear infinite; }
@keyframes marq { to { transform: translateX(-100%); } }
#crash .uc { font-size: 26px; font-weight: 700; background: repeating-linear-gradient(45deg, #ffcc00 0 16px, #000 16px 32px); color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; padding: 10px; }
#crash ul { list-style: square; display: inline-block; text-align: left; font-size: 20px; }
#crash a { color: #0000ee; text-decoration: underline; cursor: pointer; }
#crash .ctr { font-family: "Courier New", monospace; background: #000; color: #0f0; padding: 2px 6px; letter-spacing: 3px; }
#crash .gotyou { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg) scale(3); opacity: 0; font-family: var(--hand); font-size: clamp(56px, 12vw, 140px); color: #2346ff; background: #f6f4ee; padding: 0 30px; border: 4px solid #2346ff; border-radius: 16px; box-shadow: 10px 10px 0 rgba(0, 0, 0, .25); transition: transform .5s var(--spring), opacity .2s; }
#crash.caught .gotyou { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
#crash .pen-wipe { position: absolute; top: 0; bottom: 0; left: -10%; width: 0; background: var(--paper); box-shadow: 0 0 0 6px #2346ff; }
#crash.rebuild .pen-wipe { animation: wipe 1.1s var(--ease) forwards; }
@keyframes wipe { to { left: -10%; width: 120%; } }

/* the sideways door */
.sideways { position: absolute; right: 6%; top: 50%; z-index: 4; transform: translateY(-50%) scale(.6); font-size: 64px; color: var(--accent); opacity: 0; pointer-events: none; transition: opacity .5s, transform .5s var(--spring); cursor: pointer; }
body.sideways-on .sideways { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { margin-right: -14px; } }

/* sliding into Majd OS */
main, .bar, #ink { transition: transform .9s var(--ease); }
body.slide-out main, body.slide-out .bar, body.slide-out #ink { transform: translateX(-100vw); }
body.slide-out #counter, body.slide-out #egg-list, body.slide-out #toast, body.slide-out #weather, body.slide-out #umbrella, body.slide-out #soaked, body.slide-out .torch-glow { visibility: hidden; }
#retro { position: fixed; inset: 0; z-index: 98; transform: translateX(100vw); transition: transform .9s var(--ease); background: #1a1714; }
#retro[hidden] { display: none; }
#retro.enter { transform: none; }

/* ================= round 4: the 12 clickable doodles ================= */
.dd { position: absolute; z-index: 6; width: 48px; height: 48px; padding: 2px; border: 0; background: none; color: var(--accent); cursor: pointer; transition: transform .3s var(--spring), opacity .3s; }
.dd svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dd:hover { transform: scale(1.15) rotate(-6deg); }
.dd:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.dd-top { top: 64px; right: clamp(12px, 4vw, 56px); }
.dd-bottom { bottom: 22px; left: clamp(12px, 4vw, 56px); }
.dd.got::after { content: "✓"; position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--paper); font: 700 10px/16px var(--font); text-align: center; }
.cinema .dd, .graveyard .dd, .library .dd { color: #ffd166; }
.cinema .dd-bottom { bottom: calc(11vh + 10px); }
/* each doodle's own reaction */
.dd .steam { opacity: 0; }
.dd.steamy .steam { animation: steam 1.6s ease-out; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
.dd.spill::before { content: ""; position: absolute; left: -20px; bottom: -6px; width: 70px; height: 12px; border-radius: 50%; background: var(--accent); opacity: .7; animation: spill 1.6s ease-out forwards; }
@keyframes spill { from { transform: scaleX(0); } 40% { transform: scaleX(1); } to { transform: scaleX(0); opacity: 0; } }
.dd.flash svg circle { animation: blinkfill .15s steps(1) 6; }
@keyframes blinkfill { 50% { fill: currentColor; } }
.dd .flame { transform-origin: 22px 16px; animation: flicker 1.2s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scale(.85, 1.1) rotate(4deg); } }
.dd.out .flame { animation: blowout 2.2s ease-in-out; }
@keyframes blowout { 0% { transform: scale(1); } 15%, 60% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.dd .waves { opacity: .2; }
.dd.beaming .waves { animation: beam .4s steps(2) 5; }
@keyframes beam { 50% { opacity: 1; } }
.dd .flag { transform-origin: 34px 26px; transform: rotate(90deg); transition: transform .4s var(--spring); }
.dd.flagged .flag { transform: none; }
.dd .tail { transform-origin: 34px 36px; }
.dd.swish .tail { animation: swish .5s ease-in-out 4; }
@keyframes swish { 50% { transform: rotate(-25deg); } }
.kernel { position: fixed; z-index: 70; width: 9px; height: 9px; border-radius: 50% 40% 55% 45%; background: #fff6d8; box-shadow: inset -2px -2px 0 #ffd166; pointer-events: none; }
body.pro .dd, body.slide-out .dd { display: none; }

/* toolbox: honest groups */
.chips-label { margin: 18px 0 8px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.chips + .chips-label { margin-top: 6px; }
.chip.main { background: var(--ink); color: var(--paper); }
.chips { margin-bottom: 10px; }

/* the badge has a real face now */
.card-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
.card-photo { overflow: hidden; padding: 0; }

/* games shelf: cartridges, or cover art from Steam */
.book.cart { writing-mode: horizontal-tb; display: grid; place-items: center; padding: 6px; font-size: 8px; line-height: 1.2; text-align: center; white-space: normal; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .3), inset 0 10px 0 rgba(255, 255, 255, .12), 3px 3px 0 #0b0704; }
.book.cart.has-cover { width: 110px; height: 52px; background-size: cover; background-position: center; }
.row[hidden] { display: none; }

/* the dream note: glowing, pinned in the margin, subject to gravity */
.goal-note { position: absolute; z-index: 5; max-width: 220px; margin: 0; font-family: var(--hand); font-size: 22px; line-height: 1.1; text-align: left; color: #8ff0a8; text-shadow: 0 0 10px rgba(63, 191, 95, .8), 0 0 26px rgba(63, 191, 95, .45); transform: rotate(3deg); cursor: pointer; animation: sway 4s ease-in-out infinite; transform-origin: 20px 0; }
.goal-note b { font-weight: 700; color: #b8ffc8; }
.goal-note .pin { position: absolute; left: -6px; top: -18px; font-size: 20px; text-shadow: none; }
.goal-note.inline { position: relative; display: block; margin: 8px auto 26px; left: auto; top: auto; text-align: center; }
.goal-note.inline .pin { left: 50%; margin-left: -10px; }
.goal-note:focus-visible { outline: 2px dashed #8ff0a8; outline-offset: 6px; }
body.pro .goal-note { position: static; animation: none; transform: none; text-shadow: none; color: var(--ink); font-family: var(--font); font-size: 16px; max-width: none; }
.goal-note .xorb { display: block; width: 46px; height: 46px; margin: 0 0 6px; fill: none; stroke: #8ff0a8; stroke-width: 3.2; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(63, 191, 95, .9)); }
.goal-note.inline .xorb { margin: 0 auto 6px; }
body.pro .goal-note .xorb { display: none; }

/* dream note: a real-looking pushpin and a shaded orb */
.goal-note .pushpin { position: absolute; left: -18px; top: -44px; width: 38px; height: 50px; filter: none; transform: rotate(-14deg); }
.goal-note .xorb { width: 54px; height: 54px; margin: 4px 0 8px; stroke: none; filter: drop-shadow(0 0 10px rgba(63, 191, 95, .7)); }
.goal-note small { font-size: 17px; opacity: .75; }
.goal-note.inline .pushpin { left: 50%; margin-left: -15px; }

/* on repeat: real album covers, not pixel art. Records leaning on the shelf, a vinyl peeking out. */
.book.sleeve { position: relative; width: 84px; height: 84px; border-radius: 3px; image-rendering: auto; background-color: #1b1b1b; background-size: cover; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .08); transform: rotate(calc((var(--i, 0) - 2.5) * 1.2deg)); transition: transform .35s var(--spring); overflow: visible; }
.book.sleeve::after { content: ""; position: absolute; top: 6px; right: -14px; width: 72px; height: 72px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, #e2504f 0 9%, #111 10% 13%, #1a1a1a 14% 100%); box-shadow: inset 0 0 0 1px #333; transition: right .45s var(--spring); }
.book.sleeve:hover { transform: translateY(-10px) rotate(0); }
.book.sleeve:hover::after { right: -34px; animation: spinrec 1.6s linear infinite; }
@keyframes spinrec { to { rotate: 360deg; } }
#row-music { gap: 22px; padding-left: 16px; }

/* ================= round 5: living doodles instead of corner icons ================= */
.dd { display: none !important; }
button.moon { border: 0; padding: 0; cursor: pointer; z-index: 3; transition: transform .4s var(--spring); }
button.moon:hover { transform: scale(1.06); }
button.moon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #10141a; transform: translateX(-110%); opacity: 0; }
button.moon.eclipse::after { animation: eclipse 2.4s ease-in-out; }
@keyframes eclipse { 0% { transform: translateX(-110%); opacity: 1; } 45%, 55% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(110%); opacity: 1; } }
button.moon.eclipse { box-shadow: 0 0 120px 30px rgba(244, 241, 228, .55); }
button.moon { overflow: hidden; }
button.eye { border: 0; padding: 0; cursor: pointer; }
.eye.blink { animation: eyeblink .9s ease-in-out !important; }
@keyframes eyeblink { 0%, 100% { transform: scale(1); } 30% { transform: scale(2.4); background: #7cff6b; } 50% { transform: scale(2.4, .2); } 70% { transform: scale(2.4); } }
.sticky, .signature, .panel .preview { cursor: pointer; }
.clapper { cursor: pointer; }
@media (max-width: 820px) {
  .clapper { display: block !important; top: 64px; left: 14px; width: 74px; margin-top: 0; }
}
.goal-note .xorb { width: 50px; height: 50px; fill: #107c10; stroke: none; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 12px rgba(63, 191, 95, .9)); }
.goal-note .xorb path { fill: #107c10; }
.pill-pen { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* ================= round 6: calmer portfolio ================= */
/* the game stays hidden until you find the first living thing */
#counter:not(.active) { display: none; }
.modes .locked { display: none; }
.modes .locked + * { border-left: 0; }

/* ink annotations: a hand-drawn underline and a small note, written as the section arrives */
.ink-mark { background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: 0 92%; background-size: 0 .09em; transition: background-size 1.1s var(--ease) .7s; padding-bottom: .04em; }
.in .ink-mark, .in.ink-mark { background-size: 100% .09em; }
.ink-note { display: inline-block; margin: 0 .2em 0 .35em; font-family: var(--hand); font-size: .82em; font-weight: 700; line-height: 1; color: var(--accent); white-space: nowrap; opacity: 0; transform: translateY(6px) rotate(-4deg); transition: opacity .6s ease 1.6s, transform .7s var(--spring) 1.6s; }
.in .ink-note { opacity: 1; transform: rotate(-4deg); }
.cinema .ink-note, .graveyard .ink-note { color: #ffd166; }
.cinema .ink-mark, .graveyard .ink-mark { background-image: linear-gradient(#ffd166, #ffd166); }
body.pro .ink-mark { background-image: none; }
body.pro .ink-note { display: none; }
@media (prefers-reduced-motion: reduce) { .ink-mark { background-size: 100% .09em; } .ink-note { opacity: 1; transform: rotate(-4deg); } }

/* first-click moments */
.spotlight { position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: 3; pointer-events: none; background: radial-gradient(ellipse at 50% 0%, rgba(255, 244, 214, .28), transparent 65%); mix-blend-mode: screen; }
.star { position: absolute; z-index: 1; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px 2px rgba(255, 255, 255, .6); pointer-events: none; }
button.moon.eclipse-long::after { animation: eclipse 3.6s ease-in-out; }
button.moon.eclipse-long { box-shadow: 0 0 160px 50px rgba(244, 241, 228, .5); transition: box-shadow 1.2s; }
.seen { position: relative; overflow: hidden; }
.seen.scanning::after { content: ""; position: absolute; left: 0; right: 0; height: 40px; top: -40px; background: linear-gradient(transparent, rgba(41, 196, 106, .25), transparent); animation: scan 2.2s ease-in-out; pointer-events: none; }
@keyframes scan { to { top: 100%; } }
.plane-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.book.fav { box-shadow: inset 0 0 0 3px #ffd166, 0 0 16px rgba(255, 209, 102, .45) !important; color: #fff; }
.family { margin: 22px 0 0; font-size: 15px; color: var(--muted); }
.family a { color: var(--ink); text-underline-offset: 3px; }

/* living doodles beckon: a small, polite wiggle, never on text, never in a loop */
.beckon { animation: beckon 1.3s var(--ease) !important; }
@keyframes beckon { 0%, 100% { transform: none; } 20% { transform: rotate(-5deg) scale(1.04); } 40% { transform: rotate(4deg) scale(1.04); } 60% { transform: rotate(-2deg); } }
#name.beckon { animation: beckon-name 1.3s var(--ease) !important; }
@keyframes beckon-name { 0%, 100% { transform: none; } 30% { transform: translateY(-4px); } 60% { transform: translateY(1px); } }
circle.beckon { animation: beckon-nib 1.3s ease-in-out !important; transform-box: fill-box; transform-origin: center; }
@keyframes beckon-nib { 50% { transform: scale(2.2); } }

/* ================= the site builds itself (after the 1996 page) ================= */
#crash .build { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--paper); opacity: 0; pointer-events: none; transition: opacity .4s; }
#crash.glitch .c96 { animation: glitch96 .5s steps(5) forwards; }
@keyframes glitch96 { 20% { transform: translate(-8px, 2px); filter: hue-rotate(90deg); } 40% { transform: translate(6px, -3px); clip-path: inset(10% 0 40% 0); } 60% { transform: translate(-3px, 4px); clip-path: inset(50% 0 5% 0); } 100% { opacity: 0; clip-path: inset(50% 0 50% 0); } }
#crash.building .build { opacity: 1; }
#crash.done .build { opacity: 0; transition: opacity .9s; }
.build svg { width: min(1100px, 100%); height: auto; overflow: visible; }
.build .d { fill: none; stroke: #9aa7c7; stroke-width: 2; stroke-dasharray: 3000; stroke-dashoffset: 3000; }
#crash.building .build .d { animation: bdraw var(--dur) var(--ease) var(--t) forwards; }
@keyframes bdraw { to { stroke-dashoffset: 0; } }
.build .d.ink { stroke: #2346ff; stroke-width: 4; stroke-linecap: round; }
.build .d.btn { stroke: #121212; }
.build .f, .build .w, .build .tag { opacity: 0; }
#crash.building .build .f, #crash.building .build .tag { animation: bfade var(--dur) ease var(--t) forwards; }
@keyframes bfade { to { opacity: 1; } }
.build .f.primary { fill: #121212; }
.build .w.name { font: 700 118px "Space Grotesk", sans-serif; letter-spacing: -6px; fill: #121212; clip-path: inset(0 100% 0 0); }
#crash.building .build .w.name { opacity: 1; animation: bwrite var(--dur) var(--ease) var(--t) forwards; }
@keyframes bwrite { to { clip-path: inset(0 0 0 0); } }
.build .tag { font: 500 18px ui-monospace, Consolas, monospace; fill: #2346ff; }
.progress-build { position: absolute; left: 50%; bottom: 7%; width: min(420px, 80%); transform: translateX(-50%); text-align: center; }
.progress-build span { display: block; height: 4px; border-radius: 2px; background: linear-gradient(#2346ff, #2346ff) 0 0 / 0 100% no-repeat, #dcd8cd; }
#crash.building .progress-build span { animation: bprog 4.1s var(--ease) forwards; }
@keyframes bprog { to { background-size: 100% 100%; } }
.progress-build em { display: block; margin-top: 8px; font: 500 13px ui-monospace, Consolas, monospace; font-style: normal; color: #67645d; }

/* ================= talk to AI-me ================= */
.chat { margin-top: 26px; max-width: 34em; border: 1.5px solid var(--ink); border-radius: 18px; background: var(--card); overflow: hidden; }
.chat[hidden] { display: none; }
.chat-title { margin: 0; padding: 12px 16px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.chat-log { max-height: 280px; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { margin: 0; max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: 16px; line-height: 1.4; }
.msg.bot { align-self: flex-start; background: var(--accent-soft); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg.typing { animation: typing 1s ease-in-out infinite; }
@keyframes typing { 50% { opacity: .4; } }
#chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
#chat-in { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
#chat-form .btn { padding: 10px 16px; font-size: 15px; }
.chat-note { margin: 0; padding: 0 16px 12px; font-size: 12px; color: var(--muted); }
body.pro .chat { display: none; }

/* real covers: games and films stand like boxes and posters on the shelf */
.book.has-cover { width: 70px !important; height: 104px !important; padding: 0; background-color: #111; background-size: cover; background-position: center; image-rendering: auto; border-radius: 3px; box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .1); }
.book.has-cover.fav { width: 80px !important; height: 118px !important; }
.book.has-cover.logo { background-color: #3a2b1f; background-size: 88%; background-repeat: no-repeat; }
.book.has-cover:hover { transform: translateY(-12px) scale(1.04); }
#row-games, #row-films { height: 150px; gap: 10px; }
.os-return { position: fixed; left: 18px; bottom: 18px; z-index: 61; display: none; background: #008080; color: #fff; border-color: #004d4d; font-size: 14px; padding: 10px 16px; }
body.os-open .os-return { display: inline-flex; }
body.slide-out .os-return, body.pro .os-return { display: none; }

/* ================= off the clock: shelf builds itself ================= */
.shelf-wrap.constructing .shelf { filter: grayscale(1) brightness(.35) sepia(1) hue-rotate(180deg); transition: filter 1s ease; }
.shelf-wrap.constructing.painted .shelf { filter: none; }
.shelf-wrap.constructing .book:not(.deco) { opacity: 0; }
.shelf-blueprint { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; transition: opacity .7s; }
.shelf-blueprint rect { fill: none; stroke: #9fc3ff; stroke-width: 2; stroke-dasharray: 4000; stroke-dashoffset: 4000; animation: bdraw 1s var(--ease) var(--t) forwards; }
.shelf-wrap.painted .shelf-blueprint { opacity: 0; }
/* surprise me */
.surprise { margin: 14px 0 6px; }
.surprise[hidden] { display: none; }
.surprise-card { margin-top: 12px; max-width: 34em; padding: 16px 18px; background: #0d2a5c; color: #e8f0ff; border: 1.5px solid #9fc3ff; border-radius: 14px; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 20px 20px; }
.surprise-card.show { animation: cardbuild .6s var(--ease); }
@keyframes cardbuild { from { clip-path: inset(0 100% 0 0 round 14px); } to { clip-path: inset(0 0 0 0 round 14px); } }
.surprise-card .k { display: block; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #ffd166; margin-bottom: 6px; }
.surprise-card p { margin: 0; font-size: 17px; line-height: 1.5; min-height: 1.5em; }
body.pro .surprise { display: none; }

/* ================= dates ================= */
/* real moon phase: a sky-coloured disc slides over the moon */
button.moon::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; background: #121824; transform: translateX(var(--shadow, -100%)); transition: transform 1s; }
body.ramadan button.moon { box-shadow: 0 0 50px rgba(255, 214, 120, .5); background: #ffe7a3; }
body.independence .bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: linear-gradient(90deg, #e70013 0 45%, #fff 45% 55%, #e70013 55%); }

/* ================= phone fixes ================= */
.scene-inner { min-width: 0; }               /* never let wide content push a scene past the screen */
.nav a { white-space: nowrap; }
@media (max-width: 820px) {
  .bar { gap: 10px; padding: 10px 14px; }
  .logo { font-size: 15px; }
  .nav a { font-size: 11px; letter-spacing: .1em; }
  /* cinema: clapper to the right, credits in the flow, pin clear of the tags */
  .clapper { left: auto !important; right: 14px; top: 70px !important; width: 64px !important; }
  .credits-btn { position: static; display: block; margin: 18px auto 0; grid-row: 2; }
  .goal-note.inline { margin-top: 48px; }
  /* graveyard: a small moon in the corner, away from the text */
  .moon { width: 46px; height: 46px; top: 70px; right: 16px; }
}
@media (max-width: 600px) {
  /* shelf rows wrap instead of overflowing */
  .shelf-wrap { width: 100%; }
  .shelf { padding: 10px; }
  .row { height: auto; min-height: 104px; flex-wrap: wrap; align-items: flex-end; row-gap: 12px; padding: 30px 10px 8px; }
  #row-games, #row-films { height: auto; }
  .book.has-cover { width: 54px !important; height: 80px !important; }
  .book.has-cover.fav { width: 62px !important; height: 92px !important; }
  .book.sleeve { width: 64px; height: 64px; }
  .row-label { top: 8px; left: 10px; right: auto; }
  .library h2 { font-size: 38px; }
}
@media (max-width: 420px) {
  .nav { display: none; }                    /* no room: Ask AI stays one tap away in the page itself */
}
.shelf-blueprint text { font: 500 13px ui-monospace, Consolas, monospace; fill: #ffd166; opacity: 0; animation: bfade .4s ease .2s forwards; }
.more.why b { color: var(--ink); font-weight: 500; }

/* on repeat: Spotify's own player, live */
#row-music[data-embed] { height: auto; padding: 30px 10px 10px; display: block; }
.spotify-embed { display: block; width: 100%; height: 352px; border: 0; border-radius: 12px; background: #121212; }
@media (max-width: 600px) { .spotify-embed { height: 300px; } }
