/* =========================================================
   SIGNATURE: draft -> live browser
   The live site sits on top, clipped by --cut (0% = fully live,
   100% = fully draft). A glowing seam marks the edit line.
   ========================================================= */
.stage { position: relative; }
.js .stage { --cut: 100%; --seam: 0; }
.layer { position: relative; }
.layer.live {
  position: absolute; inset: 0; z-index: 2;
  clip-path: inset(0 0 0 var(--cut, 0%));
  background: #120b14;
}
.seam {
  position: absolute; top: 0; bottom: 0; z-index: 3; left: var(--cut, 0%); width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, #fff 20%, #ffb3f2 50%, #fff 80%, transparent);
  box-shadow: 0 0 18px 3px rgba(255, 43, 214, .75), 0 0 60px 10px rgba(138, 43, 255, .45);
  pointer-events: none;
  opacity: var(--seam, 1);
  transition: opacity .3s ease;
}
.seam-handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #1a0b2b;
  display: grid; place-items: center; box-shadow: 0 6px 24px rgba(255, 43, 214, .6);
}
.seam-handle svg { width: 16px; height: 16px; }

/* draft layer: wireframe of the same layout */
.layer.draft { background: #0d0a14; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 18px 18px; }
.wf { position: relative; border: 1.5px dashed rgba(186, 160, 230, .35); border-radius: 8px; color: rgba(200, 185, 235, .7); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .03em; }
.wf-label { position: absolute; top: -9px; left: 10px; padding: 0 6px; background: #0d0a14; color: #c9a8ff; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; line-height: 1.4; }
.wf-bar { height: 10px; border-radius: 4px; background: rgba(200, 185, 235, .16); }
.wf-title { padding: 18px 14px 14px; display: grid; gap: 10px; }
.wf-title .wf-bar:first-child { height: 26px; width: 92%; }
.wf-title .wf-bar:nth-child(2) { height: 26px; width: 64%; }
.wf-text { padding: 16px 14px 12px; display: grid; gap: 8px; }
.wf-text .wf-bar:nth-child(2) { width: 86%; } .wf-text .wf-bar:nth-child(3) { width: 58%; }
.wf-row { display: flex; gap: 10px; padding: 16px 12px 12px; }
.wf-btn { height: 36px; border-radius: 999px; border: 1.5px dashed rgba(186,160,230,.4); display: grid; place-items: center; padding: 0 16px; color: rgba(200,185,235,.75); }
.wf-img { display: grid; place-items: center; min-height: 220px; height: calc(100% - 36px); margin: 18px; overflow: hidden; }
.wf-img::before, .wf-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(186,160,230,.25) 50%, transparent calc(50% + 1px)); }
.wf-img::after { transform: scaleX(-1); }
.wf-img span { position: relative; z-index: 1; padding: 4px 10px; background: #0d0a14; border-radius: 6px; }
.wf-nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; margin-bottom: 18px; }
.wf-nav .wf-bar { width: 90px; height: 14px; }
.wf-links { display: flex; gap: 10px; } .wf-links i { width: 34px; height: 8px; border-radius: 4px; background: rgba(200,185,235,.16); }
.wf-note {
  position: absolute; z-index: 1; font-family: var(--font-mono); font-size: .68rem; color: #ffb3f2;
  padding: 5px 9px; border-radius: 6px; background: rgba(255, 43, 214, .1); border: 1px solid rgba(255, 43, 214, .35);
  white-space: nowrap; pointer-events: none;
}
.wf-note.n1 { top: 22px; right: 20px; }
.wf-note.n2 { bottom: 26px; left: 30px; }

/* draft / live toggle */
.mode-switch {
  position: relative; flex: none;
  display: inline-flex; padding: 3px; border-radius: 999px; gap: 2px;
  background: rgba(7, 5, 12, .7); border: 1px solid var(--line-2);
}
.mode-switch button { height: 26px !important; padding: 0 12px !important; font-size: .68rem !important; }
.mode-switch .thumb { top: 3px !important; bottom: 3px !important; }
.mode-switch button {
  position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted);
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  height: 32px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  transition: color .2s ease, transform .12s var(--ease-out);
}
.mode-switch button:active { transform: scale(.97); }
.mode-switch button[aria-pressed="true"] { color: #fff; }
.mode-switch .thumb {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: var(--grad);
  box-shadow: 0 4px 16px -4px rgba(255,43,214,.7);
  transition: transform .35s var(--ease-out), width .35s var(--ease-out);
}
.mode-switch .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.mode-switch button[data-mode="live"][aria-pressed="true"] .led { background: #4cff9a; opacity: 1; box-shadow: 0 0 8px #4cff9a; }

.stage { cursor: ew-resize; touch-action: pan-y; }
.url .state { font-family: var(--font-mono); font-size: .68rem; padding: 2px 7px; border-radius: 5px; background: rgba(76, 255, 154, .12); color: #4cff9a; transition: background-color .25s ease, color .25s ease; }
.url .state.is-draft { background: rgba(201, 168, 255, .14); color: #c9a8ff; }

/* hover gating for touch devices */
@media (hover: none) {
  .card:hover, .work-card:hover { transform: none; }
  .card:hover .icon-tile { transform: none; }
}

/* ---------------- small polish ---------------- */
.hero h1 .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .04em; }
h2 em, .section-head h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.light .section-head h2 em, .light h2 em { font-style: normal; background: linear-gradient(120deg, #6a1fe0, #d01fb5); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* services bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.bento > .s-web { grid-column: span 4; }
.bento > .s-maps { grid-column: span 2; }
.bento > .s-seo, .bento > .s-ads, .bento > .s-photo { grid-column: span 2; }
.s-web { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: center; }
.s-web .icon-tile { margin-bottom: 18px; }

/* mini map visual */
.mapviz { position: relative; height: 190px; border-radius: 14px; overflow: hidden; margin-bottom: 22px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255,255,255,.08) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 57%, rgba(255,255,255,.08) 57% 63%, transparent 63%),
    linear-gradient(35deg, transparent 28%, rgba(255,255,255,.05) 28% 31%, transparent 31%),
    radial-gradient(circle at 18% 22%, rgba(76, 255, 154, .10), transparent 22%),
    radial-gradient(circle at 85% 30%, rgba(80, 160, 255, .10), transparent 20%),
    #100c19;
  border: 1px solid var(--line);
}
.pin { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -100%); color: #ff2bd6; filter: drop-shadow(0 6px 10px rgba(255,43,214,.5)); animation: pinDrop 3.2s var(--ease-out) infinite; }
.pin svg { width: 34px; height: 34px; display: block; }
.pin-pulse { position: absolute; left: 50%; top: 44%; width: 14px; height: 6px; border-radius: 50%; transform: translate(-50%, -50%); background: rgba(255,43,214,.5); animation: pulse 3.2s ease-out infinite; }
.map-chip { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.96); color: #1b1328; font-size: .76rem; line-height: 1.3; }
.map-chip b { display: block; font-size: .82rem; }
.map-chip .open { margin-left: auto; color: #188038; font-weight: 600; white-space: nowrap; }

/* ads mini visual */
.adviz { height: 190px; margin-bottom: 22px; border-radius: 14px; border: 1px solid var(--line); background: #100c19; padding: 16px; display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.adviz .ad-top { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); line-height: 1.3; }
.adviz .ad-top b { color: var(--ink); font-family: var(--font-head); font-size: 1.3rem; display: block; margin-top: 2px; }
.adviz .ad-top .up { color: #4cff9a; font-family: var(--font-mono); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 100%; }
.bars i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #ff2bd6, #8a2bff); transform-origin: bottom; animation: grow 3.6s var(--ease-out) infinite; opacity: .9; }
.bars i:nth-child(1) { height: 30%; animation-delay: 0s; } .bars i:nth-child(2) { height: 42%; animation-delay: .06s; }
.bars i:nth-child(3) { height: 38%; animation-delay: .12s; } .bars i:nth-child(4) { height: 58%; animation-delay: .18s; }
.bars i:nth-child(5) { height: 66%; animation-delay: .24s; } .bars i:nth-child(6) { height: 80%; animation-delay: .3s; }
.bars i:nth-child(7) { height: 96%; animation-delay: .36s; }

/* photo mini visual */
.photoviz { position: relative; height: 190px; margin-bottom: 22px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.photoviz img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.card:hover .photoviz img { transform: scale(1.03); }
.photoviz .frame { position: absolute; inset: 14px; pointer-events: none; }
.photoviz .frame i { position: absolute; width: 18px; height: 18px; border-color: rgba(255,255,255,.85); border-style: solid; border-width: 0; }
.photoviz .frame i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.photoviz .frame i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.photoviz .frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.photoviz .frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.photoviz .rec { position: absolute; top: 12px; right: 14px; font-family: var(--font-mono); font-size: .68rem; color: #fff; display: flex; align-items: center; gap: 6px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.photoviz .rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff3b3b; animation: blink 1.2s steps(1) infinite; }
.photoviz .flash { position: absolute; inset: 0; background: #fff; opacity: 0; animation: flash 4s ease-out infinite; pointer-events: none; }

@keyframes pinDrop { 0% { transform: translate(-50%, -260%); opacity: 0; } 18% { transform: translate(-50%, -100%); opacity: 1; } 24% { transform: translate(-50%, -112%); } 30%, 100% { transform: translate(-50%, -100%); } }
@keyframes pulse { 0%, 20% { transform: translate(-50%, -50%) scale(1); opacity: .8; } 70%, 100% { transform: translate(-50%, -50%) scale(6); opacity: 0; } }
@keyframes grow { 0% { transform: scaleY(.15); } 35%, 100% { transform: scaleY(1); } }
@keyframes flash { 0%, 70% { opacity: 0; } 72% { opacity: .7; } 80%, 100% { opacity: 0; } }

/* ---------------- design pass fixes ---------------- */
h1, h2, h3 { text-wrap: balance; }
.lead, .card p { text-wrap: pretty; }
.ticks { align-content: start; }
.nav.scrolled { background: rgba(7, 5, 12, .86); }
.photoviz .rec { top: 22px; right: 42px; }

/* SEO ranking visual */
.rankviz { height: 190px; margin-bottom: 22px; border-radius: 14px; border: 1px solid var(--line); background: #100c19; padding: 14px; display: grid; gap: 8px; align-content: center; }
.rank { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.035); border: 1px solid var(--line); font-size: .8rem; }
.rank .kw { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .pos { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); display: inline-grid; overflow: hidden; height: 1.3em; }
.rank .pos span { grid-area: 1 / 1; line-height: 1.3em; animation: posSwap 4s var(--ease-out) infinite; }
.rank .pos span + span { color: #4cff9a; animation-name: posSwapIn; }
.rank .delta { font-family: var(--font-mono); font-size: .7rem; color: #4cff9a; }
.rank:nth-child(2) .pos span { animation-delay: .15s; }
.rank:nth-child(3) .pos span { animation-delay: .3s; }
@keyframes posSwap { 0%, 30% { transform: none; opacity: 1; } 45%, 90% { transform: translateY(-100%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes posSwapIn { 0%, 30% { transform: translateY(100%); opacity: 0; } 45%, 90% { transform: none; opacity: 1; } 100% { transform: translateY(100%); opacity: 0; } }

@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento > .s-web { grid-column: span 2; }
  .bento > .s-maps, .bento > .s-seo, .bento > .s-ads, .bento > .s-photo { grid-column: span 1; }
}
@media (max-width: 860px) {
  .s-web { grid-template-columns: 1fr; }
  .wf-note { display: none; }
  /* keep the draft wireframe in the same order as the live layout */
  .layer.draft .wf-img { order: -1; min-height: 0; height: 202px; margin: 18px 18px 0; }
}
@media (max-width: 560px) {
  .browser-bar { gap: 8px; padding: 0 10px; }
  .browser-bar .dots, .url .state { display: none; }
  .url { min-width: 0; max-width: none; margin: 0; justify-content: flex-start; padding: 0 10px; overflow: hidden; white-space: nowrap; }
  .mode-switch button { padding: 0 10px !important; }
  .mode-switch .led { display: none; }
  .pill { font-size: .82rem; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento > * { grid-column: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
  .seam { display: none; }
}
