/* shenhavs · "from napkin to product". The board is a fixed design space
   (1000x656, or 420x640 on phones) scaled by --k from napkin.js. Every cell
   holds a sketch layer and a real layer; --ink wipes the real one in from the
   right, like a pen going over the drawing. */

.nk__stage { background: #120d09; overflow: clip; --lap: 0; --panel: 0; }
.nk__table img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transform: scale(calc(1.04 - var(--lap) * 0.04)); }
.nk__shade { position: absolute; inset: 0; pointer-events: none; background: rgb(8 8 10 / calc(0.25 + var(--lap) * 0.6)); }

.nk__device {
  position: absolute; left: 38%; top: 50%; width: 1000px; height: 656px; margin: -328px 0 0 -500px; z-index: 2;
  transform: translate3d(calc(var(--lap) * -7vw), calc(var(--lap) * 4vh), 0) scale(calc(var(--k, 0.6) * (1 - var(--lap) * 0.2)));
  will-change: transform;
}
.nk__device::before { /* the laptop bezel arrives around the board */
  content: ""; position: absolute; inset: -18px; border-radius: 22px; background: #111216; z-index: -1;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 60px 120px -30px rgb(0 0 0 / 0.75); opacity: var(--lap);
}
.nk__lapbase { position: absolute; left: -9%; right: -9%; top: calc(100% + 18px); height: 26px; border-radius: 0 0 26px 26px; background: linear-gradient(#45474e, #1b1c20 70%); box-shadow: 0 30px 50px -10px rgb(0 0 0 / 0.7); opacity: var(--lap); }
.nk__board { position: absolute; inset: 0; border-radius: 10px; }
.nk__napkin img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; filter: drop-shadow(0 18px 24px rgb(0 0 0 / 0.45)); opacity: calc(1 - var(--panel)); }
.nk__panel { position: absolute; inset: 0; border-radius: 10px; background: #f6f4ef; opacity: var(--panel); }

.nk__app {
  position: absolute; inset: 56px 64px 60px; display: grid; gap: 12px; direction: rtl;
  grid-template-columns: 170px 1fr 230px; grid-template-rows: 58px 92px 1fr 1fr;
  grid-template-areas: "head head head" "nav kpi kpi" "nav chart pay" "nav table table";
}
.nk-cell { position: relative; min-width: 0; min-height: 0; }
.nk-cell[data-cell="head"] { grid-area: head; } .nk-cell[data-cell="nav"] { grid-area: nav; }
.nk-cell[data-cell="kpi"] { grid-area: kpi; } .nk-cell[data-cell="chart"] { grid-area: chart; }
.nk-cell[data-cell="pay"] { grid-area: pay; } .nk-cell[data-cell="table"] { grid-area: table; }

/* the pen: ballpoint blue, wobbling slightly like a hand */
.nk-sk { position: absolute; inset: 0; color: #22345a; font: 700 27px/1 "Amatic SC", var(--sc-font-text); opacity: var(--sk, 1); transition: opacity 200ms; }
.nk-sk svg { overflow: visible; }
.nk-sk svg :is(rect, path, circle) { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: url(#nk-rough); stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 0)); }
.nk-box { position: absolute; inset: 0; width: 100%; height: 100%; }
.nk-h { position: absolute; right: 18px; top: 50%; translate: 0 -50%; font-size: 38px; opacity: var(--draw, 0); }
.nk-h--big { right: 50%; translate: 50% -64%; font-size: 64px; }
.nk-note { position: absolute; left: 70px; top: 50%; translate: 0 -50%; font-size: 24px; opacity: var(--draw, 0); white-space: nowrap; }
[data-cell="pay"] .nk-note { left: 50%; top: auto; bottom: 18px; translate: -50% 0; }
.nk-note--chart { left: 16px; top: 22px; translate: none; }
.nk-note--table { right: 18px; left: auto; top: 18px; translate: none; }
.nk-dot { position: absolute; left: 16px; top: 50%; width: 40px; height: 40px; margin-top: -20px; }
.nk-list { list-style: none; margin: 0; padding: 22px 18px; display: grid; gap: 18px; opacity: var(--draw, 0); }
.nk-list li::before { content: "– "; }
.nk-sk--kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.nk-sk--kpi > span { position: relative; display: grid; place-items: center; font-size: 26px; }
.nk-zig { position: absolute; left: 6%; right: 6%; top: 28%; width: 88%; height: 60%; }
.nk-rows { position: absolute; left: 4%; top: 32%; width: 92%; height: 56%; }

/* the real product: light, calm, built */
.nk-real {
  position: absolute; inset: 0; border-radius: 10px; background: #fff; border: 1px solid #e6e1d8; color: #1b1d22;
  font: 500 14px/1.3 var(--sc-font-text); overflow: hidden;
  clip-path: inset(0 0 0 calc((1 - var(--ink, 0)) * 100%)); box-shadow: 0 6px 18px -8px rgb(40 30 20 / 0.25);
}
.nk-cell::after { /* the pen tip at the inking edge */
  content: ""; position: absolute; top: -6px; bottom: -6px; width: 3px; border-radius: 3px; left: calc((1 - var(--ink, 0)) * 100%);
  background: var(--sc-accent); box-shadow: 0 0 14px 3px rgb(255 107 44 / 0.7);
  opacity: calc(min(var(--ink, 0), 1 - var(--ink, 0)) * 4); pointer-events: none;
}
.nk-real--head { display: flex; align-items: center; gap: 18px; padding: 0 16px; }
.nk-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; direction: ltr; }
.nk-logo i, .nk-plogo i { width: 14px; height: 14px; border-radius: 4px; background: var(--sc-accent); transform: rotate(45deg); }
.nk-search { flex: 1; padding: 9px 14px; border-radius: 8px; background: #f4f2ee; color: #8a857c; }
.nk-user { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.nk-user i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #1b1d22; color: #fff; font-style: normal; font-size: 12px; }
.nk-user em { font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: #e8f7ee; color: #12804a; }
.nk-real--nav ul { list-style: none; margin: 0; padding: 14px 10px; display: grid; gap: 4px; }
.nk-real--nav li { padding: 10px 12px; border-radius: 8px; color: #5b574f; }
.nk-real--nav li.on { background: #fff1ea; color: #c2410c; font-weight: 600; }
.nk-real--kpi { display: grid; grid-template-columns: repeat(3, 1fr); background: transparent; border: 0; box-shadow: none; gap: 12px; overflow: visible; }
.nk-real--kpi > div { display: grid; align-content: center; gap: 4px; padding: 0 16px; border-radius: 10px; background: #fff; border: 1px solid #e6e1d8; box-shadow: 0 6px 18px -8px rgb(40 30 20 / 0.25); }
.nk-real--kpi span { color: #7a756c; font-size: 13px; }
.nk-real--kpi b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.nk-real--chart { padding: 14px 16px; display: flex; flex-direction: column; }
.nk-real--chart p { margin: 0 0 6px; font-weight: 600; display: flex; justify-content: space-between; }
.nk-real--chart p span { color: #a39e95; font-weight: 500; font-size: 12px; }
.nk-real--chart svg { flex: 1; width: 100%; }
.nk-real--chart .l { fill: none; stroke: var(--sc-accent); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--ink, 0)); }
.nk-real--pay { padding: 14px; display: grid; align-content: start; gap: 8px; }
.nk-real--pay p { margin: 0; font-weight: 600; }
.nk-plan { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 8px; border: 1px solid #e6e1d8; }
.nk-plan.on { border-color: var(--sc-accent); background: #fff6f1; }
.nk-plan b { font-variant-numeric: tabular-nums; }
.nk-paid { font-size: 12px; color: #12804a; font-weight: 600 !important; }
.nk-paid::before { content: "✓ "; }
.nk-real--table { padding: 10px 16px; display: grid; align-content: start; }
.nk-real--table p { margin: 0; display: grid; grid-template-columns: 1.4fr 1fr 1fr; padding: 9px 0; border-bottom: 1px solid #efebe4; }
.nk-real--table p:last-child { border: 0; }
.nk-real--table b { color: #8a857c; font-weight: 600; font-size: 12px; }
.nk-real--table .ok { color: #12804a; font-weight: 600; }
.nk-real--table .try { color: #b45309; font-weight: 600; }

.nk__arrows { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: var(--arw, 0); }
.nk__arrows path { fill: none; stroke: #22345a; stroke-width: 2.4; stroke-linecap: round; filter: url(#nk-rough); stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 0)); }
.nk__arrows.is-live path { stroke: var(--sc-accent); filter: drop-shadow(0 0 6px rgb(255 107 44 / 0.8)); stroke-dasharray: 0.02 0.03; animation: nkflow 1.2s linear infinite; }
@keyframes nkflow { to { stroke-dashoffset: -0.1; } }

.nk__phone {
  position: absolute; z-index: 3; left: 46%; top: 52%; width: 13rem; aspect-ratio: 9 / 19; border-radius: 34px; padding: 9px;
  background: #0d0d0f; box-shadow: inset 0 0 0 2px #2c2d33, 0 50px 80px -20px rgb(0 0 0 / 0.8);
  transform: translate3d(0, calc(-30% + (1 - var(--lap)) * 70vh), 0) rotate(calc(4deg - var(--lap) * 8deg)); opacity: var(--lap);
}
.nk__pscreen { height: 100%; border-radius: 26px; background: #f6f4ef; padding: 40px 16px 16px; display: grid; align-content: start; gap: 6px; color: #1b1d22; overflow: hidden; }
.nk__pscreen p { margin: 0; }
.nk-plogo { display: flex; align-items: center; gap: 8px; font-weight: 700; direction: ltr; justify-content: flex-end; margin-bottom: 14px !important; }
.nk-pk { font-size: 12px; color: #7a756c; }
.nk-pv { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.nk__pscreen svg { width: 100%; height: 70px; margin: 8px 0; }
.nk-prow { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: #fff; font-size: 13px; border: 1px solid #e6e1d8; }

.nk__toasts { list-style: none; margin: 0; padding: 0; position: absolute; z-index: 4; left: var(--sc-gutter); top: 4.5vh; grid-auto-flow: column; justify-content: start; display: grid; gap: 0.6rem; }
.nk__toasts li {
  display: inline-flex; align-items: center; gap: 0.6rem; justify-self: start; padding: 0.7rem 1rem; border-radius: 12px;
  background: rgb(18 19 23 / 0.94); border: 1px solid rgb(255 255 255 / 0.12); color: var(--sc-ink); font-size: var(--sc-t-sm); box-shadow: var(--sc-e3);
  opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity 300ms var(--sc-ease-out), transform 300ms var(--sc-ease-out);
}
.nk__toasts li.is-on { opacity: 1; transform: none; }
.nk__toasts i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgb(74 222 128 / 0.18); }

.nk__copy { position: absolute; z-index: 5; right: var(--sc-gutter); top: 50%; translate: 0 -50%; width: min(26rem, 28vw); display: grid; }
.nk__cap { grid-area: 1 / 1; align-self: center; display: grid; gap: 0.8rem; }
.nk__cap p { margin: 0; font-size: var(--sc-t-lg); line-height: 1.5; color: #e8e1d4; text-wrap: pretty; }
.nk__k { font-family: var(--sc-font-display); font-weight: 700; font-size: clamp(3rem, 4.6vw, 4.8rem) !important; line-height: 0.9 !important; color: var(--sc-ink) !important; }
.nk__title { margin: 0; font-family: var(--sc-font-display); font-weight: 700; font-size: clamp(3.4rem, 5.6vw, 6rem); line-height: 0.88; }
.nk__title span { color: var(--sc-accent); }
.nk__copy::before { content: ""; position: absolute; inset: -40% -30% -40% -20%; z-index: -1; background: radial-gradient(closest-side, rgb(10 8 6 / 0.85), rgb(10 8 6 / 0.5) 60%, transparent); pointer-events: none; }

@media (max-width: 860px) {
  .nk__device { left: 50%; top: 40%; width: 420px; height: 640px; margin: -320px 0 0 -210px;
    transform: translate3d(0, calc(var(--lap) * 7vh), 0) scale(calc(var(--k, 0.6) * (1 - var(--lap) * 0.16))); }
  .nk__app { inset: 34px 30px 36px; gap: 9px; grid-template-columns: 1fr 120px; grid-template-rows: 50px 74px 1fr 92px 46px;
    grid-template-areas: "head head" "kpi kpi" "chart chart" "table pay" "nav nav"; }
  .nk-real--head { gap: 10px; padding: 0 10px; } .nk-search { display: none; } .nk-logo { font-size: 17px; margin-inline-end: auto; }
  .nk-real--nav ul { grid-auto-flow: column; padding: 6px; gap: 2px; } .nk-real--nav li { padding: 8px 6px; font-size: 12px; text-align: center; } .nk-real--nav li:nth-child(n+5) { display: none; }
  .nk-real--kpi { gap: 8px; } .nk-real--kpi > div { padding: 0 10px; } .nk-real--kpi b { font-size: 19px; } .nk-real--kpi span { font-size: 11px; }
  .nk-real--table { padding: 6px 10px; font-size: 12px; } .nk-real--table p { padding: 5px 0; grid-template-columns: 1.4fr 1fr; } .nk-real--table p > :nth-child(2) { display: none; } .nk-real--table p:nth-child(n+4) { display: none; }
  .nk-real--pay { padding: 8px; gap: 5px; font-size: 12px; } .nk-plan { padding: 5px 8px; } .nk-real--pay > p:first-child, .nk-paid { display: none; }
  .nk-sk { font-size: 22px; } .nk-list { grid-auto-flow: column; padding: 8px 12px; gap: 12px; } .nk-h { font-size: 30px; } .nk-h--big { font-size: 44px; }
  .nk-note { font-size: 19px; left: 50px; } [data-cell="pay"] .nk-note { display: none; }
  .nk__phone { left: auto; right: 6%; top: 34%; width: 7.5rem; border-radius: 22px; padding: 6px; }
  .nk__pscreen { border-radius: 17px; padding: 22px 9px 9px; gap: 3px; }
  .nk__pscreen .nk-pv { font-size: 20px; } .nk__pscreen svg { height: 36px; } .nk-prow { padding: 5px 7px; font-size: 9px; } .nk-plogo { font-size: 11px; }
  .nk__toasts { top: 4.6rem; left: var(--sc-gutter); right: var(--sc-gutter); }
  .nk__toasts li { font-size: 0.78rem; padding: 0.5rem 0.8rem; }
  .nk__toasts li:nth-child(n+3) { display: none; }
  .nk__copy { left: var(--sc-gutter); right: var(--sc-gutter); width: auto; top: auto; bottom: calc(var(--wo-h) + var(--bar) + 1.4rem); translate: none; }
  .nk__cap { align-self: end; gap: 0.5rem; }
  .nk__cap p { font-size: var(--sc-t-base); }
  .nk__k { font-size: 2.4rem !important; }
  .nk__title { font-size: 2.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .nk__arrows.is-live path { animation: none; }
}
