/* Wandangle home: the lobby, drawn in the coin's two ingredients.
   The coin (platform/mark.svg) is a soft aura gradient crossed by one bold, round-capped ink line.
   So: aura colours as fills, a thick ink line for every outline, and hard ink shadows that grow as things lift. */
:root {
  --paper: #f6f3ec;
  --ink: #1d1b18;
  --soft: #6f6a61;
  --line: rgba(29, 27, 24, 0.1);
  --peach: #ffb08a;
  --lav: #b9a6ff;
  --mint: #7fd6ae;
  --coin: linear-gradient(135deg, var(--peach) 0%, var(--lav) 55%, var(--mint) 100%);
  --stroke: 2.5px;
  --r: 28px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --boing: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gutter: clamp(16px, 5vw, 56px);
  --edge: max(var(--gutter), calc((100% - 1120px) / 2 + var(--gutter)));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper);
  font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: var(--lav); color: var(--ink); }
:focus-visible { outline: var(--stroke) solid var(--ink); outline-offset: 3px; }

/* ── drifting colour light (the coin's three colours, loose in the room) ── */
.aura { position: fixed; inset: -20vmax; z-index: 0; pointer-events: none; filter: blur(60px); opacity: 0.8; }
.aura span { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; mix-blend-mode: multiply; }
.aura span:nth-child(1) { background: radial-gradient(circle, #ffd2b6 0%, transparent 62%); left: 0; top: 0; animation: drift1 28s var(--ease) infinite alternate; }
.aura span:nth-child(2) { background: radial-gradient(circle, #ddd3ff 0%, transparent 62%); right: 0; top: 10%; animation: drift2 34s var(--ease) infinite alternate; }
.aura span:nth-child(3) { background: radial-gradient(circle, #c4efd9 0%, transparent 62%); left: 25%; bottom: 0; animation: drift3 31s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate(18vmax, 12vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vmax, 16vmax) scale(0.9); } }
@keyframes drift3 { to { transform: translate(10vmax, -18vmax) scale(1.1); } }

.top, .zig, main, .foot { position: relative; z-index: 1; }

/* ── header: coin + wordmark ── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 26px var(--edge) 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; perspective: 400px; }
.coin {
  flex: none; width: clamp(40px, 5vw, 52px); aspect-ratio: 1; border-radius: 50%;
  box-shadow: 3px 4px 0 var(--ink); transform-style: preserve-3d;
  transition: transform 0.35s var(--boing), box-shadow 0.35s var(--boing);
  animation: coin-in 1s var(--boing) both;
}
.coin img { display: block; width: 100%; height: 100%; }
/* pointed at, the coin lifts off the page (its shadow falls further away) and flips */
.brand:hover .coin, .brand:focus-visible .coin { transform: translateY(-4px); box-shadow: 5px 9px 0 var(--ink); animation: flip 0.9s var(--ease); }
.brand:active .coin { transform: translateY(2px); box-shadow: 1px 1px 0 var(--ink); transition-duration: 0.08s; }
@keyframes flip { from { transform: translateY(-4px) rotateY(0); } to { transform: translateY(-4px) rotateY(360deg); } }
@keyframes coin-in { from { transform: translateY(-30px) rotate(-200deg) scale(0.4); opacity: 0; } }
.wordmark {
  font-family: var(--serif); font-size: clamp(30px, 4.4vw, 44px); line-height: 1;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; font-weight: 500; letter-spacing: -0.02em; display: inline-flex;
}
.wordmark span { display: inline-block; transition: transform 0.5s var(--boing); animation: letter-in 0.7s var(--boing) both; animation-delay: calc(var(--i) * 45ms + 250ms); }
.brand:hover .wordmark span { transform: translateY(calc(var(--i) * -1px - 2px)) rotate(calc((var(--i) - 4) * 2deg)); }
@keyframes letter-in { from { transform: translateY(14px) rotate(-12deg); opacity: 0; } }

.me {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.42rem 0.95rem 0.42rem 0.42rem;
  border: var(--stroke) solid var(--ink); border-radius: 999px; background: #fff;
  font: 600 14px var(--sans); color: var(--ink); cursor: pointer;
  box-shadow: 3px 4px 0 var(--ink); transition: transform 0.25s var(--boing), box-shadow 0.25s var(--boing);
}
.me:hover { transform: translate(-1px, -2px) rotate(-2deg); box-shadow: 5px 6px 0 var(--ink); }
.me:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.me-dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 700 12px var(--sans); color: var(--ink); background: var(--coin); border: 2px solid var(--ink);
}

/* ── the W line: the coin's stroke, repeated, drawing itself in ── */
.zig {
  height: 14px; margin: 0 var(--edge);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 14'%3E%3Cpath d='M0 2.5 8 11.5 16 2.5 24 11.5 32 2.5' fill='none' stroke='%231d1b18' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") left center / 32px 14px repeat-x;
  animation: draw 1.6s 0.35s var(--ease) both;
}
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ── page ── */
main { max-width: 1120px; margin: 0 auto; padding: 5vh var(--gutter) 10vh; }
.notice {
  margin: 0 0 4vh; padding: 0.8rem 1.1rem; border-radius: 16px; background: #fff; border: var(--stroke) solid var(--ink);
  box-shadow: 4px 5px 0 var(--ink); width: fit-content; max-width: 100%; transform: rotate(-0.6deg); animation: rise 0.6s var(--boing) both;
}

/* ── tiles: ink-outlined cards that lift when you point at one ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(22px, 3vw, 36px); perspective: 1200px; }
.tile {
  --rx: 0deg; --ry: 0deg; --lift: 0px; --sh: 6px;
  position: relative; display: flex; flex-direction: column; min-height: 380px; border-radius: var(--r); overflow: hidden;
  text-decoration: none; color: var(--ink); background: var(--tile, #ece8df);
  border: var(--stroke) solid var(--ink);
  box-shadow: var(--sh) calc(var(--sh) + 1px) 0 var(--ink);
  transform: translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry));
  backface-visibility: hidden; will-change: transform;
  transition: transform 0.45s var(--boing), box-shadow 0.45s var(--boing);
  animation: drop-in 0.8s var(--boing) both; animation-delay: calc(var(--n) * 110ms + 450ms);
}
.tile:hover, .tile:focus-visible { --lift: -6px; --sh: 10px; outline: none; }
.tile:active { --lift: 2px; --sh: 2px; transition-duration: 0.12s; }
@keyframes drop-in { from { opacity: 0; transform: translateY(40px); } }
.tile-art { flex: 1; display: grid; place-items: center; padding: 28px 28px 0; min-height: 220px; border-bottom: var(--stroke) solid var(--ink); }
.tile-art img { max-width: 100%; max-height: 230px; transition: transform 0.6s var(--boing); filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.18)); }
.tile-art.cover { padding: 0; } .tile-art.cover img { width: 100%; height: 100%; max-height: none; object-fit: cover; filter: none; }
.tile:hover .tile-art img { transform: translateY(-6px) scale(1.04) rotate(-1.5deg); }
.tile-text { padding: 20px 22px 22px 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; background: rgba(255, 255, 255, 0.55); }
.tile h2 { margin: 0 0 0.3rem; font: 500 27px/1.1 var(--serif); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72; letter-spacing: -0.01em; }
.tile p { margin: 0; color: var(--soft); font-size: 14.5px; max-width: 32ch; }
/* the arrow rides on a little coin that rolls when the tile is pointed at */
.go {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--coin); color: var(--ink); border: var(--stroke) solid var(--ink); box-shadow: 2px 3px 0 var(--ink);
  font: 700 19px var(--sans); transition: transform 0.6s var(--boing);
}
.tile:hover .go, .tile:focus-visible .go { transform: translateX(4px) rotate(360deg); }
.tile.soon { background: transparent; border: var(--stroke) dashed rgba(29, 27, 24, 0.35); box-shadow: none; min-height: 200px; justify-content: center; align-items: center; pointer-events: none; }
.tile.soon p { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--soft); }

/* ── footer ── */
.foot { text-align: center; color: var(--soft); font-size: 13px; padding: 0 16px 40px; }

/* ── account sheet ── */
.sheet {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(420px, 100vw); max-width: 100vw;
  border: 0; border-left: var(--stroke) solid var(--ink); padding: 0; background: #fbfaf6; color: var(--ink);
  box-shadow: -8px 0 0 rgba(29, 27, 24, 0.08);
}
.sheet::before { content: ""; display: block; height: 10px; background: var(--coin); border-bottom: var(--stroke) solid var(--ink); }
.sheet[open] { animation: slide 0.5s var(--boing) both; }
.sheet::backdrop { background: rgba(246, 243, 236, 0.55); backdrop-filter: blur(6px); }
.sheet-close { position: absolute; top: 24px; right: 16px; }
.sheet-close button {
  width: 40px; height: 40px; border-radius: 50%; border: var(--stroke) solid var(--ink); background: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; color: var(--ink); box-shadow: 2px 3px 0 var(--ink); transition: transform 0.3s var(--boing);
}
.sheet-close button:hover { transform: rotate(90deg); }
.sheet-body { padding: 56px 28px 40px; display: flex; flex-direction: column; gap: 28px; }
.sheet h2 { margin: 0; font: 500 34px/1.05 var(--serif); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; letter-spacing: -0.02em; }
.group { display: flex; flex-direction: column; gap: 10px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); }
.row { display: flex; gap: 8px; }
.field { flex: 1; min-width: 0; padding: 12px 14px; border: var(--stroke) solid var(--ink); border-radius: 14px; font: 16px var(--sans); background: #fff; color: var(--ink); }
.field:focus { outline: none; box-shadow: 3px 4px 0 var(--lav); }
.btn {
  padding: 11px 18px; border-radius: 14px; border: var(--stroke) solid var(--ink); background: var(--ink); color: #fff; font: 600 15px var(--sans);
  cursor: pointer; box-shadow: 3px 4px 0 var(--lav); transition: transform 0.25s var(--boing), box-shadow 0.25s var(--boing), opacity 0.2s;
}
.btn:hover { transform: translate(-1px, -2px); box-shadow: 4px 6px 0 var(--lav); }
.btn:active { transform: translate(2px, 3px); box-shadow: 0 0 0 var(--lav); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 3px 4px 0 var(--ink); }
.btn.ghost:hover { box-shadow: 4px 6px 0 var(--ink); }
.btn.danger { background: #fff; color: #b3261e; border-color: #b3261e; box-shadow: 3px 4px 0 rgba(179, 38, 30, 0.35); }
.chip { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; background: #fff; border: 2px solid var(--ink); }
.chip.ok { background: #d6f3e3; }
.hint { margin: 0; color: var(--soft); font-size: 14px; }
.msg { margin: 0; font-size: 14px; min-height: 1.2em; }
.msg.err { color: #b3261e; }
.keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.keys li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; font-size: 14px; }
.keys small { color: var(--soft); display: block; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--soft); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.divider { height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 14'%3E%3Cpath d='M0 2.5 8 11.5 16 2.5 24 11.5 32 2.5' fill='none' stroke='%231d1b18' stroke-opacity='.25' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") left center / 32px 14px repeat-x; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes slide { from { transform: translateX(60px); } to { transform: none; } }

@media (max-width: 560px) {
  .tile { min-height: 320px; }
  .tile-art img { max-height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
