/* cutauto.app, shared by every page: tokens, the moving light, typing, the build (guides → outline → inside),
 * the top bar, the mockup slots, the timeline mark between words, the download sheet. Each page keeps its own
 * motion in its own <style> (owner 2026-11-09: each page its own motion, so they never fight). */
@font-face{font-family:"Apple Thai";font-weight:400;src:local("Sukhumvit Set Text"),local("SukhumvitSet-Text");unicode-range:U+0E00-0E7F}
@font-face{font-family:"Apple Thai";font-weight:500;src:local("Sukhumvit Set Medium"),local("SukhumvitSet-Medium");unicode-range:U+0E00-0E7F}
@font-face{font-family:"Apple Thai";font-weight:600;src:local("Sukhumvit Set Semi Bold"),local("SukhumvitSet-SemiBold");unicode-range:U+0E00-0E7F}
@font-face{font-family:"Apple Thai";font-weight:700;src:local("Sukhumvit Set Bold"),local("SukhumvitSet-Bold");unicode-range:U+0E00-0E7F}
:root{color-scheme:dark;--bg:#000;--panel:#08080a;--card:#151517;--fill:#232326;--ink:#f5f5f7;--ink-2:#a1a1a6;--ink-3:#6e6e73;
 --line:rgba(255,255,255,.1);--guide:rgba(255,255,255,.2);--edge:rgba(255,255,255,.5);--accent:#2997ff;--gut:#f5f5f7;
 --font:"Apple Thai",-apple-system,BlinkMacSystemFont,"SF Pro Display","Sukhumvit Set","Thonburi",system-ui,sans-serif;
 --ease:cubic-bezier(.32,.72,0,1);--w:1120px}
*{box-sizing:border-box;margin:0}
html{scroll-behavior:smooth;scroll-padding-top:70px}
html,body{overflow-x:clip}
body{font-family:var(--font);background:var(--bg);color:var(--ink);-webkit-font-smoothing:antialiased;line-height:1.5}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
img,video{display:block;max-width:100%}
.wrap{width:min(var(--w),calc(100% - 32px));margin:0 auto}
h1,h2{font-weight:700;line-height:1.12;letter-spacing:-.015em;text-wrap:balance}
h2{font-size:clamp(32px,5vw,60px)}
.btn{display:inline-flex;align-items:center;gap:8px;height:50px;padding:0 24px;border-radius:999px;font-size:16px;font-weight:600;
 background:var(--accent);color:#fff;transition:transform .2s var(--ease),background .25s var(--ease)}
.btn:hover{background:#4aa6ff}.btn:active{transform:scale(.97)}
.btn svg{width:18px;height:18px;fill:currentColor}
.note{font-size:13px;color:var(--ink-3)}

/* light that never stops moving */
.amb{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none}
.amb i{position:absolute;width:70vmax;height:70vmax;border-radius:50%;opacity:.55}
.amb i:nth-child(1){left:-30vmax;top:-30vmax;background:radial-gradient(closest-side,rgba(32,70,160,.55),transparent);animation:d1 28s ease-in-out infinite alternate}
.amb i:nth-child(2){right:-35vmax;top:10vh;background:radial-gradient(closest-side,rgba(52,40,120,.5),transparent);animation:d2 34s ease-in-out infinite alternate}
.amb i:nth-child(3){left:10vw;bottom:-45vmax;background:radial-gradient(closest-side,rgba(18,80,130,.45),transparent);animation:d3 31s ease-in-out infinite alternate}
@keyframes d1{to{transform:translate(22vw,26vh)}}@keyframes d2{to{transform:translate(-26vw,18vh)}}@keyframes d3{to{transform:translate(18vw,-22vh)}}

/* typing: each letter comes in under a passing light */
.ty .ch{animation:ch .9s var(--ease) both}
@keyframes ch{0%{opacity:0;color:#9fd0ff;text-shadow:0 0 14px rgba(41,151,255,.7)}45%{opacity:1}100%{text-shadow:0 0 0 transparent}}
.caret{display:inline-block;width:.07em;height:.85em;margin-left:.08em;background:currentColor;vertical-align:-.06em;animation:blink 1s steps(1) infinite}
@keyframes blink{50%{opacity:0}}
.js .ty:empty::before{content:"\200b"}

/* build: guide lines run out from the edges, the outline draws round, then the inside comes up, then the guides go */
.build{position:relative}
.gd{position:absolute;background:var(--guide);pointer-events:none;z-index:2;transition:transform .8s var(--ease),opacity 1.4s var(--ease)}
.gd.t,.gd.b{height:1px;left:-100vw;right:-100vw;transform:scaleX(0)}
.gd.l,.gd.r{width:1px;top:-100vh;bottom:-100vh;transform:scaleY(0)}
.build>.gd.t{top:0}.build>.gd.b{bottom:0}.build>.gd.l{left:0}.build>.gd.r{right:0}
.gd.out{z-index:0}                     /* drawn outside a box that clips (feature panel, editor window): set by site.js */
.gd.on{transform:none}
.gd.done{opacity:.55}   /* owner: the white guide lines stay (faint) once the box is built — they lead the eye on */
.build>svg.bd{position:absolute;left:0;top:0;overflow:visible;pointer-events:none;z-index:2}
.bd rect{fill:none;stroke:var(--edge);stroke-width:1;stroke-dasharray:1 1;stroke-dashoffset:1;transition:stroke-dashoffset 1.1s var(--ease) .3s}
.build.on .bd rect{stroke-dashoffset:0}
.build.done .bd rect{stroke:var(--line);transition:stroke 1.2s var(--ease)}
.js .build [data-b]{opacity:0;transform:translateY(16px);transition:opacity .9s var(--ease),transform .9s var(--ease)}
.js .build.on [data-b]{opacity:1;transform:none}
.build .fill{opacity:0;transition:opacity .9s var(--ease) .9s}.build.on .fill{opacity:1}

/* nav */
.nav{position:fixed;top:0;left:0;right:0;z-index:40;height:60px;background:linear-gradient(#000,rgba(0,0,0,0))}
.nav .wrap{height:100%;display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:9px;font-weight:700;font-size:17px}
.brand svg{width:22px;height:22px}
.nav .btn{height:36px;padding:0 16px;font-size:14px}
/* the sections, up top (owner: "หมวดฟีเจอร์ในแถบด้านบน"); a soft pill slides under the one you are looking at */
.links{position:absolute;left:50%;transform:translateX(-50%);display:flex;gap:2px;padding:4px;border-radius:999px;
 background:rgba(22,22,24,.72);box-shadow:inset 0 0 0 1px var(--line);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
.links a{position:relative;z-index:1;padding:7px 15px;border-radius:999px;font-size:14px;font-weight:500;color:var(--ink-2);white-space:nowrap;transition:color .3s var(--ease)}
.links a:hover,.links a.on{color:#fff}
.links .pip{position:absolute;top:4px;bottom:4px;left:0;width:0;border-radius:999px;background:rgba(255,255,255,.13);opacity:0;
 transition:transform .55s var(--ease),width .55s var(--ease),opacity .3s var(--ease)}
@media (max-width:860px){.nav{height:auto;background:linear-gradient(#000 70%,rgba(0,0,0,0))}.nav .wrap{flex-wrap:wrap;row-gap:8px;padding:10px 0 12px}
 .links{position:relative;left:auto;transform:none;order:3;width:100%;justify-content:space-between;overflow-x:auto;scrollbar-width:none}
 .links::-webkit-scrollbar{display:none}.links a{padding:7px 11px;font-size:13.5px}}

/* between the words: a tiny edit timeline (owner: "ทำเป็นเส้นไทม์ไลน์แทนลูกศร") — clips with their sound under them on
 * a lane; the playhead runs over them, two get cut out, the rest close in to the middle, the timeline ends shorter. On a loop. */
.arw{display:inline-block;width:1.3em;height:.62em;margin:0 .3em;vertical-align:.01em}
.arw svg{width:100%;height:100%;overflow:visible}
.arw .ln{fill:rgba(255,255,255,.07);transform-box:fill-box;transform-origin:center;opacity:0}   /* nothing shows before it plays */
.arw .cl{transform-box:fill-box;transform-origin:center}
.arw svg{opacity:0;transition:opacity .5s var(--ease)}.arw.on svg{opacity:1}.arw.on .ln{opacity:1}
.arw .cl .v{fill:var(--accent)}.arw .cl .a{fill:var(--accent);opacity:.4}
.arw .ph{opacity:0}.arw .ph line{stroke:#fff;stroke-width:2.6;stroke-linecap:round}.arw .ph rect{fill:#fff}
.arw.on .c1{animation:keep1 4.4s var(--ease) infinite}
.arw.on .c3{animation:keep3 4.4s var(--ease) infinite}
.arw.on .c5{animation:keep5 4.4s var(--ease) infinite}
.arw.on .x2{animation:cut2 4.4s var(--ease) infinite}
.arw.on .x4{animation:cut4 4.4s var(--ease) infinite}
.arw.on .ln{animation:lane 4.4s var(--ease) infinite}
.arw.on .ph{animation:head 4.4s linear infinite}
@keyframes keep1{0%,50%{transform:none}62%,86%{transform:translateX(15px)}100%{transform:none}}
@keyframes keep3{0%,50%{transform:none}62%,86%{transform:translateX(-2px)}100%{transform:none}}
@keyframes keep5{0%,50%{transform:none}62%,86%{transform:translateX(-17px)}100%{transform:none}}
@keyframes cut2{0%,21%{opacity:1;transform:none}24%{opacity:.25;transform:none}32%,86%{opacity:0;transform:scale(.2,.2)}100%{opacity:1;transform:none}}
@keyframes cut4{0%,35%{opacity:1;transform:none}38%{opacity:.25;transform:none}46%,86%{opacity:0;transform:scale(.2,.2)}100%{opacity:1;transform:none}}
@keyframes lane{0%,50%{transform:none}62%,86%{transform:scaleX(.74)}100%{transform:none}}   /* then it winds back: never an empty lane */
@keyframes head{0%,8%{opacity:0;transform:translateX(0)}10%{opacity:1;transform:translateX(0)}46%{opacity:1;transform:translateX(118px)}50%,100%{opacity:0;transform:translateX(118px)}}
@media (prefers-reduced-motion:reduce){.arw svg,.arw .ln{opacity:1}.arw .x2,.arw .x4{opacity:.25}}
/* one rhythm for the whole page: the same breath between sections, one heading size, one corner, one line */
.sec{padding:clamp(96px,12vw,150px) 0;overflow:clip}   /* a scene's guide lines end at its own edges */
.sec h2{text-align:center;margin-bottom:clamp(36px,5vw,56px)}

/* slots (mockups until the owner picks real clips) */
.slot{width:100%;height:100%;border-radius:inherit;display:grid;place-content:center;justify-items:center;gap:6px;padding:12px;text-align:center;
 background:#1c1c1e center/cover;color:#8e8e93;font-size:12px;line-height:1.35;outline:1px dashed rgba(255,255,255,.2);outline-offset:-8px}
.slot svg{width:26px;height:26px;margin-bottom:4px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.slot b{white-space:nowrap;color:#e5e5ea;font-size:14px;font-weight:600}
.slot.has{outline:0;padding:0}.slot video{width:100%;height:100%;object-fit:cover;border-radius:inherit}
footer{padding:28px 0 40px;font-size:13px;color:var(--ink-3)}

/* phone screens inside demos: the motion plays over an empty screen until real clips go in */
.dph .slot,.ephone .slot{position:absolute;inset:0;outline:0;background-color:transparent}
.dph .slot>*,.ephone .slot>*{display:none}   /* the demos play over an empty screen until real clips go in */

/* the next page, at the bottom of each one */
.next{display:grid;justify-items:center;gap:26px;text-align:center}
.next a.go{display:inline-grid;justify-items:center;gap:6px;color:var(--ink-3);font-size:14px;transition:color .3s var(--ease)}
.next a.go b{font-size:clamp(30px,4.4vw,52px);color:var(--ink);font-weight:700;transition:transform .5s var(--ease)}
.next a.go:hover b{transform:translateX(8px)}
/* pages change without a white flash: the bar stays, the page fades through */
@view-transition{navigation:auto}
.nav{view-transition-name:nav}
::view-transition-old(root){animation:vt-out .32s var(--ease) both}
::view-transition-new(root){animation:vt-in .6s var(--ease) both}
@keyframes vt-out{to{opacity:0;filter:blur(6px);transform:scale(.985)}}
@keyframes vt-in{from{opacity:0;filter:blur(8px);transform:translateY(14px)}}
/* download sheet */
.sheet{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:16px;background:rgba(0,0,0,.55);opacity:0;pointer-events:none;transition:opacity .3s var(--ease)}
.sheet.on{opacity:1;pointer-events:auto}
.sheet .box{width:min(460px,100%);background:var(--card);border-radius:26px;padding:28px;transform:translateY(16px) scale(.98);transition:transform .45s var(--ease);box-shadow:0 0 0 1px var(--line),0 30px 80px rgba(0,0,0,.5)}
.sheet.on .box{transform:none}
.sheet h3{font-size:22px}.sheet ol{margin:18px 0 0;padding:0;list-style:none;display:grid;gap:12px;counter-reset:s}
.sheet li{display:grid;grid-template-columns:28px 1fr;gap:10px;font-size:15px;color:var(--ink-2)}
.sheet li::before{counter-increment:s;content:counter(s);width:28px;height:28px;border-radius:50%;background:var(--fill);color:var(--ink);display:grid;place-items:center;font-weight:600;font-size:13px}
.sheet li b{color:var(--ink);font-weight:600}
.sheet .row{display:flex;justify-content:space-between;align-items:center;margin-top:22px;gap:10px}
.sheet .alt{font-size:13.5px;color:var(--accent)}
.sheet .btn{height:42px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
