/* "La tela": portfolio laid out as a design canvas. Desktop = pannable/zoomable world; phone = swipeable frames. */
:root {
  --ink: #17171a;
  --ink-2: #55555c;
  --ink-3: #8c8c94;
  --line: #e4e3df;
  --panel: #ffffff;
  --canvas: #ecebe6;
  --dot: #cfcdc6;
  --acc: #7c5cff;
  --acc-ink: #4b31c9;
  --acc-bg: #efeaff;
  --hot: #ff5c39;
  --top: 48px;
  --lay: 224px;
  --insp: 248px;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--canvas); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ---------- chrome ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.top-l, .top-c, .top-r { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 12px var(--sans); text-decoration: none; flex: none; }
.file { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-dim { color: var(--ink-3); font-weight: 400; }
.ib { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; display: grid; place-items: center; font-size: 16px; }
.ib:hover { background: #f2f1ee; }
.zv { border: 0; background: transparent; font-size: 12px; min-width: 52px; padding: 4px; border-radius: 6px; }
.zv:hover { background: #f2f1ee; }
.avatars { display: flex; align-items: center; }
.avatars img { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--hot); object-fit: cover; }
.avatars i { font: normal 500 10px var(--sans); width: 26px; height: 26px; border-radius: 50%; background: var(--acc); color: #fff; display: grid; place-items: center; margin-left: -6px; border: 2px solid #fff; }
.btn-pri, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; border: 1px solid transparent; }
.btn-pri { background: var(--acc); color: #fff; }
.btn-pri:hover { background: var(--acc-ink); }
.btn-ghost { background: #fff; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-pri.wide { width: 100%; margin-top: 6px; }

.layers { position: fixed; top: var(--top); left: 0; bottom: 0; width: var(--lay); z-index: 15; background: var(--panel); border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.lay-h { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px 8px; }
.lay-sec { font-size: 12px; font-weight: 600; padding: 10px 8px 4px; }
.layers button { text-align: left; border: 0; background: transparent; border-radius: 6px; padding: 6px 8px 6px 18px; font-size: 13px; display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.layers button i { font-style: normal; color: var(--ink-3); font-size: 11px; }
.layers button:hover { background: #f4f3f0; }
.layers button.on { background: var(--acc-bg); color: var(--acc-ink); }
.layers button.on i { color: var(--acc); }
.lay-foot { margin-top: auto; font-size: 11px; color: var(--ink-3); padding: 12px 8px 4px; line-height: 1.7; }
kbd { font: 10px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fafaf8; }

.insp { position: fixed; top: var(--top); right: 0; bottom: 0; width: var(--insp); z-index: 15; background: var(--panel); border-left: 1px solid var(--line); padding: 14px 14px; overflow-y: auto; font-size: 13px; }
.insp-h { font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.insp-xy { display: grid; grid-template-columns: 14px 1fr 14px 1fr; gap: 6px 6px; margin: 0 0 14px; font-size: 12px; }
.insp-xy dt { color: var(--ink-3); }
.insp-xy dd { margin: 0; background: #f4f3f0; border-radius: 4px; padding: 2px 6px; }
.insp-s { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.insp p { margin: 0; color: var(--ink-2); line-height: 1.55; }
.insp p.mono { font-size: 12px; }

/* ---------- canvas ---------- */
.cv { position: fixed; top: var(--top); left: var(--lay); right: var(--insp); bottom: 0; overflow: hidden; background-color: var(--canvas); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 24px 24px; cursor: default; touch-action: none; outline: none; }
.cv.hand, .cv.hand * { cursor: grab !important; }
.cv.drag, .cv.drag * { cursor: grabbing !important; user-select: none; }
.world { position: absolute; left: 0; top: 0; width: 2740px; height: 1060px; transform-origin: 0 0; will-change: transform; }
.world.fly { transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.sec { position: absolute; border-radius: 10px; background: rgba(255, 255, 255, .35); border: 1px solid rgba(0, 0, 0, .05); pointer-events: none; }
.sec span { position: absolute; top: 14px; left: 18px; font: 500 12px var(--sans); color: var(--ink-3); }

.fr { position: absolute; background: #fff; border-radius: 4px; box-shadow: 0 0 0 1px #dedcd6, 0 1px 2px rgba(0, 0, 0, .04); }
.fr.sel { box-shadow: 0 0 0 2px var(--acc), 0 8px 30px rgba(60, 40, 160, .10); }
.ft { position: absolute; left: 0; top: -22px; font: 500 12px var(--sans); color: var(--ink-3); white-space: nowrap; }
.fr.sel .ft { color: var(--acc); }
.fr.sel::after { content: ""; position: absolute; right: -5px; bottom: -5px; width: 8px; height: 8px; background: #fff; border: 2px solid var(--acc); border-radius: 2px; }
.pad { padding: 24px; height: 100%; overflow: hidden; }
.pad.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }

.disp { font: 400 40px/1.05 var(--serif); letter-spacing: -.01em; margin: 0 0 14px; }
.disp em { color: var(--acc); }
.disp.sm { font-size: 30px; }
.muted { color: var(--ink-2); margin: 0 0 14px; }
.hero { padding: 30px 32px; }
.hero-ph { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; margin-bottom: 18px; }
.hero-k { font-size: 11px; color: #138a55; margin: 0 0 10px; }
.hero-k::before { content: "● "; }
.hero-p { color: var(--ink-2); font-size: 15px; margin: 0 0 22px; max-width: 46ch; }
.hero-b { display: flex; gap: 8px; flex-wrap: wrap; }

.work { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; text-decoration: none; padding: 8px; margin: 0 -8px 4px; border-radius: 8px; }
.work:hover { background: #f6f5f2; }
.work img { width: 96px; height: 62px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); }
.work span { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.work b { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.more { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 500; color: var(--acc-ink); text-decoration: none; }
.more:hover { text-decoration: underline; }
.svc { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.svc li { font-size: 13px; color: var(--ink-2); padding-left: 14px; border-left: 2px solid var(--acc-bg); }
.svc b { display: block; color: var(--ink); font-weight: 600; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.steps li { counter-increment: s; font-size: 13px; color: var(--ink-2); }
.steps li::before { content: "0" counter(s); display: block; font: 500 11px var(--mono); color: var(--acc); margin-bottom: 6px; }
.steps b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

.mail { border: 1px dashed var(--ink-3); background: #fafaf8; border-radius: 8px; padding: 8px 12px; font-size: 12px; display: block; margin-bottom: 6px; }
.quick { display: flex; flex-direction: column; gap: 8px; }
.quick label { font-size: 12px; font-weight: 600; }
.quick textarea { resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 13px; background: #fafaf8; }
.quick textarea:focus { outline: 2px solid var(--acc); border-color: transparent; }
.err { color: #c0392b; font-size: 12px; margin: 0; }

/* comments + ghost cursor */
.pin { position: absolute; width: 28px; height: 28px; border-radius: 50% 50% 50% 4px; background: #ffd23f; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); font: 600 12px var(--sans); color: #5a4300; z-index: 3; }
.pin:hover { transform: scale(1.1); }
.no-pins .pin, .no-pins .note { display: none !important; }
.note { position: absolute; z-index: 4; width: 230px; background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .14); padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.note b { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }
.note b img { width: 18px; height: 18px; border-radius: 50%; }
.cursor { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; transition: transform 1.4s cubic-bezier(.45, 0, .2, 1); }
.cursor b { display: inline-block; vertical-align: top; margin: 16px 0 0 4px; background: var(--hot); color: #fff; font: 500 11px var(--sans); padding: 2px 8px; border-radius: 2px 8px 8px 8px; }
.cursor em { display: block; margin: 4px 0 0 22px; background: var(--hot); color: #fff; font: normal 12px var(--sans); padding: 6px 10px; border-radius: 2px 10px 10px 10px; max-width: 220px; }

/* toolbar, tour, toast */
.tools { position: fixed; bottom: 16px; left: calc(var(--lay) + (100vw - var(--lay) - var(--insp)) / 2); transform: translateX(-50%); z-index: 18; display: flex; align-items: center; gap: 2px; background: var(--ink); padding: 5px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.tool { width: 36px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #ddd; font-size: 16px; }
.tool:hover { background: #2a2a30; }
.tool.on { background: var(--acc); color: #fff; }
.tool-sep { width: 1px; height: 20px; background: #3a3a42; margin: 0 4px; }
.tour { position: fixed; bottom: 70px; left: calc(var(--lay) + (100vw - var(--lay) - var(--insp)) / 2); transform: translateX(-50%); z-index: 19; display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); font-size: 12px; }
.tour span { min-width: 160px; text-align: center; }
.toast { position: fixed; top: calc(var(--top) + 12px); left: 50%; transform: translate(-50%, -20px); z-index: 40; background: var(--ink); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 8px; opacity: 0; transition: .25s; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mini apps ---------- */
.app-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.app-h b { font-size: 15px; }
.app-h small { color: var(--ink-3); font-size: 12px; }
.lbl { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.slot { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 0; font: 12px var(--mono); }
.slot:disabled { background: #f4f3f0; color: #b9b7b0; text-decoration: line-through; cursor: not-allowed; }
.slot.on { background: var(--acc); color: #fff; border-color: var(--acc); }
.slot.mine { background: var(--acc-bg); color: var(--acc-ink); text-decoration: none; }
.inp { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: #fafaf8; }
.inp:focus { outline: 2px solid var(--acc); border-color: transparent; }
.app-cta { width: 100%; margin-top: 12px; }
.done { text-align: center; padding-top: 30px; }
.done .big { font: 400 34px/1.1 var(--serif); margin: 10px 0 8px; }
.done p { color: var(--ink-2); font-size: 13px; margin: 0 0 16px; }
.tick { width: 54px; height: 54px; border-radius: 50%; background: #e6f6ee; color: #138a55; display: grid; place-items: center; font-size: 26px; margin: 0 auto; }

.prods { display: grid; gap: 6px; }
.prod { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid #f1f0ec; }
.prod .em { font-size: 22px; text-align: center; }
.prod b { font-size: 13px; font-weight: 500; display: block; }
.prod small { color: var(--ink-3); font-size: 12px; }
.step { display: flex; align-items: center; gap: 6px; }
.step button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: #fff; line-height: 1; }
.step span { font: 12px var(--mono); min-width: 14px; text-align: center; }
.cart { margin-top: 12px; background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.cart button { background: #25d366; color: #073b1e; border: 0; border-radius: 6px; padding: 6px 10px; font-weight: 600; font-size: 12px; }
.cart button:disabled { opacity: .4; cursor: not-allowed; }
.wa { background: #e7ddd3; border-radius: 10px; padding: 12px; min-height: 250px; display: flex; flex-direction: column; gap: 8px; }
.bub { max-width: 85%; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; white-space: pre-line; }
.bub.me { align-self: flex-end; background: #d9fdd3; }
.bub.them { align-self: flex-start; background: #fff; }
.typing { align-self: flex-start; background: #fff; border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--ink-3); }

.crm-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid #f1f0ec; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.crm-row:hover { background: #faf9f6; }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--sans); color: #fff; }
.crm-row b { font-size: 13px; font-weight: 500; display: block; }
.crm-row small { font-size: 12px; color: var(--ink-3); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.call { background: #fff1e0; color: #a35a00; }
.badge.ok { background: #e6f6ee; color: #138a55; }
.badge.new { background: var(--acc-bg); color: var(--acc-ink); }
.crm-list { max-height: 268px; overflow-y: auto; margin-top: 8px; }
.empty { color: var(--ink-3); font-size: 13px; padding: 16px 0; text-align: center; }

.swatches { display: grid; grid-template-columns: repeat(5, 1fr); height: 250px; border-radius: 10px; overflow: hidden; }
.sw { position: relative; border: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 10px 4px; gap: 6px; font: 500 12px var(--mono); }
.sw .lock { font-size: 14px; opacity: 0; transition: .15s; }
.sw:hover .lock, .sw.locked .lock { opacity: 1; }
.sw .hex { background: rgba(255, 255, 255, .85); color: var(--ink); border-radius: 4px; padding: 2px 6px; }
.pal-bar { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.pal-bar small { color: var(--ink-3); font-size: 12px; margin-left: auto; }

.arena { position: relative; height: 270px; border-radius: 10px; background: #f7f5ff; overflow: hidden; border: 1px solid #ebe6ff; }
.px { position: absolute; width: 22px; height: 22px; border-radius: 4px; background: var(--acc); border: 0; padding: 0; transition: transform .1s; }
.px:active { transform: scale(.8); }
.arena-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; font-size: 13px; color: var(--ink-2); }
.arena-msg b { font: 400 30px var(--serif); color: var(--ink); }
.hud { display: flex; justify-content: space-between; font: 12px var(--mono); color: var(--ink-2); margin-top: 10px; }

/* ---------- small desktops: no inspector ---------- */
@media (max-width: 1180px) {
  :root { --insp: 0px; }
  .insp { display: none; }
}

/* ---------- phones and small tablets: swipeable frames ---------- */
@media (max-width: 820px) {
  :root { --lay: 0px; }
  body { overflow: hidden; }
  .file-dim, .avatars, .top-c, #tourBtn { display: none; }
  .layers { top: var(--top); left: 0; right: 0; bottom: auto; width: auto; height: 46px; flex-direction: row; align-items: center; overflow-x: auto; padding: 6px 10px; gap: 6px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .layers::-webkit-scrollbar { display: none; }
  .lay-h, .lay-sec, .lay-foot, .layers button i { display: none; }
  .layers button { flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
  .cv { top: calc(var(--top) + 46px); left: 0; right: 0; touch-action: auto; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; background-size: 20px 20px; }
  .cv::-webkit-scrollbar { display: none; }
  .world { position: static; transform: none !important; width: max-content; height: 100%; display: flex; align-items: flex-start; gap: 14px; padding: 34px 16px 90px; }
  .sec, .pin, .note, .cursor, .tools, .tour, .fr::after { display: none !important; }
  .fr { position: relative; left: auto !important; top: auto !important; flex: none; width: calc(100vw - 44px) !important; height: auto !important; max-height: calc(100% - 10px); overflow-y: auto; scroll-snap-align: center; overscroll-behavior: contain; }
  .fr.sel { box-shadow: 0 0 0 1px #dedcd6; }
  .pad { height: auto; padding: 20px 18px; }
  .pad.two { grid-template-columns: 1fr; gap: 18px; }
  .hero { padding: 22px 20px; }
  .disp { font-size: 34px; }
  .disp.sm { font-size: 28px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .swatches { height: 200px; }
  .arena { height: 240px; }
  .crm-list { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  .world.fly, .cursor, .toast { transition: none; }
  .cursor { display: none; }
}
