/* =========================================================
   SP UI/UX Designer — Model 2 · "Pen Studio"
   ========================================================= */
:root {
  --paper: #f3f1ec;
  --paper-2: #e9e6df;
  --white: #ffffff;
  --ink: #141417;
  --ink-2: #2a2a30;
  --muted: #6c6973;
  --line: rgba(20, 20, 23, 0.12);
  --blue: #2b6cff;
  --accent: #ff5a36;
  --pink: #ff4fa3;
  --green: #18c29c;
  --yellow: #ffd23f;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 5vw, 72px);
  --ruler: 0px;
  --pen-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='white' stroke='%23141417' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 19l7-7 3 3-7 7-3-3z'/%3E%3Cpath d='M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z'/%3E%3Cpath d='M2 2l7.586 7.586'/%3E%3Ccircle cx='11' cy='11' r='2'/%3E%3C/svg%3E") 2 2, crosshair;
}
@media (min-width: 1000px) { :root { --ruler: 18px; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
@media (pointer: fine) { body { cursor: var(--pen-cursor); } }
a, button { color: inherit; text-decoration: none; font: inherit; cursor: pointer; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--white); }
::selection { background: var(--blue); color: #fff; }

main { position: relative; z-index: 1; }
.container { width: min(1200px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { width: min(920px, 100%); }
.section { position: relative; padding: clamp(100px, 14vw, 190px) 0; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.label::before { content: ""; display: inline-block; width: 8px; height: 8px; border: 1.5px solid var(--blue); background: var(--white); margin-right: 10px; vertical-align: 1px; }
.title { font-weight: 800; font-size: clamp(38px, 6.4vw, 92px); line-height: 1; letter-spacing: -.045em; margin-bottom: clamp(40px, 6vw, 80px); }
.title em { letter-spacing: -.02em; color: var(--blue); }

/* ---------- parallax dot grid ---------- */
.dots {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
  background-size: 26px 26px;
}

/* ---------- pen trail ---------- */
.trail-wrap { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.trail { display: block; overflow: visible; }
.trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trail-ghost { stroke: rgba(43, 108, 255, .22); stroke-width: 1.2; stroke-dasharray: 4 7; }
.trail-path { stroke: var(--blue); stroke-width: 2.4; }
.t-anchor { opacity: 0; transition: opacity .35s; }
.t-anchor.on { opacity: 1; }
.t-anchor rect { fill: var(--white); stroke: var(--blue); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .5s var(--ease); }
.t-anchor.on rect { transform: scale(1); }
.t-anchor line { stroke: var(--blue); stroke-width: 1; opacity: .6; }
.t-anchor circle { fill: var(--blue); }
.t-anchor .hl { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .6s var(--ease) .15s; }
.t-anchor.on .hl { stroke-dashoffset: 0; }
.t-anchor circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .4s var(--ease) .45s; }
.t-anchor.on circle { transform: scale(1); }
.trail-pen-icon { fill: var(--white); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.trail-pen-tag rect { fill: var(--ink); }
.trail-pen-tag text { fill: var(--paper); font-family: var(--mono); font-size: 11px; text-anchor: middle; }

/* ---------- rulers & status ---------- */
.ruler { position: fixed; z-index: 40; background-color: var(--paper-2); display: none; }
.ruler-x {
  top: 0; left: 0; right: 0; height: var(--ruler); border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(90deg, var(--tick) 1px, transparent 1px),
    linear-gradient(90deg, var(--tick-2) 1px, transparent 1px);
  background-size: 100px 100%, 10px 5px;
  background-position: var(--ruler) 100%, var(--ruler) 100%;
  background-repeat: repeat-x;
}
.ruler-y {
  top: 0; bottom: 0; left: 0; width: var(--ruler); border-right: 1px solid var(--line);
  background-image:
    linear-gradient(var(--tick) 1px, transparent 1px),
    linear-gradient(var(--tick-2) 1px, transparent 1px);
  background-size: 100% 100px, 5px 10px;
  background-position: 100% var(--ry, 0px), 100% var(--ry, 0px);
  background-repeat: repeat-y;
}
.ruler-x::after, .ruler-mark {
  content: ""; position: absolute; background: var(--blue);
}
.ruler-x::after { top: 0; bottom: 0; width: 1px; left: var(--cx, -10px); }
.ruler-mark { left: 0; right: 0; height: 1px; top: var(--cy, -10px); }
.ruler-corner { position: fixed; top: 0; left: 0; width: var(--ruler); height: var(--ruler); background: var(--paper-2); z-index: 41; border: solid var(--line); border-width: 0 1px 1px 0; display: none; }
@media (min-width: 1000px) { .ruler, .ruler-corner { display: block; } }

.statusbar {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; color: var(--muted);
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 11px;
}
@media (pointer: coarse), (max-width: 999px) { .statusbar { display: none; } }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; z-index: 45; top: var(--ruler); left: var(--ruler); right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px var(--gutter);
  transition: background .4s, padding .4s, box-shadow .4s;
}
.topbar.scrolled { background: var(--glass-paper); backdrop-filter: blur(12px); padding-block: 10px; box-shadow: 0 1px 0 var(--line); }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  position: relative; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; white-space: nowrap;
  border-radius: 12px; background: var(--ink); color: var(--paper); overflow: hidden;
}
.logo-mark b { font-weight: 800; font-size: 16px; letter-spacing: -.03em; position: relative; z-index: 1; transition: opacity .3s; }
.logo-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .8s var(--ease), opacity .2s; }
.logo:hover .logo-mark svg { stroke-dashoffset: 0; opacity: 1; }
.logo:hover .logo-mark b { opacity: 0; }
.logo-text { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.file-name { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(24, 194, 156, .18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(24, 194, 156, 0); } }
.share-btn { background: var(--blue); color: #fff; padding: 10px 20px; border-radius: 10px; font-weight: 700; font-size: 14px; transition: transform .3s var(--ease), box-shadow .3s; }
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(43, 108, 255, .7); }
@media (max-width: 760px) { .file-name { display: none; } }

/* ---------- bottom toolbar ---------- */
.toolbar {
  position: fixed; z-index: 45; left: 50%; bottom: 18px; translate: -50% 0;
  display: flex; align-items: center; gap: 4px; padding: 6px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px -16px var(--shadow);
  animation: toolbar-in 1s var(--ease) 1.1s both;
}
@keyframes toolbar-in { from { opacity: 0; translate: -50% 40px; } }
.tool { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; transition: background .25s, color .25s; }
.tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tool:hover { background: var(--paper); }
.tool.active { background: var(--blue); color: #fff; }
.tool-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; translate: -50% 6px; white-space: nowrap;
  background: var(--ink); color: var(--paper); font-size: 12px; padding: 6px 10px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s, translate .3s var(--ease);
}
.tip kbd { background: transparent; color: inherit; opacity: .6; border-color: currentColor; margin-left: 6px; }
.tool:hover .tip, .tool:focus-visible .tip { opacity: 1; translate: -50% 0; }
@media (max-width: 420px) { .tool { width: 38px; height: 38px; } .tool-sep { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 28px; border-radius: 12px; font-weight: 700; font-size: 15px; transition: transform .4s var(--ease), background .3s, color .3s, box-shadow .4s; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -14px rgba(20, 20, 23, .7); }
.btn-line { border: 1.5px dashed var(--blue); color: var(--blue); background: rgba(43, 108, 255, .05); }
.btn-line:hover { background: var(--blue); color: #fff; border-style: solid; }
.btn-xl { font-size: clamp(18px, 3vw, 30px); padding: 22px 40px; border-radius: 18px; margin: 10px 0 34px; }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(46px); transition: opacity .9s var(--ease) var(--d, 0s), transform 1s var(--ease) var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(30px, 5vw, 80px); align-items: center;
  padding: calc(110px + var(--ruler)) var(--gutter) 120px calc(var(--gutter) + var(--ruler));
  max-width: 1440px; margin: 0 auto; overflow: hidden; overflow: clip;
}
.kicker { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; background: var(--white); border: 1px solid var(--line); padding: 8px 16px; border-radius: 99px; margin-bottom: 26px; }
.hero-title { font-weight: 800; font-size: clamp(42px, 6.6vw, 104px); line-height: .98; letter-spacing: -.055em; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.hero-title .line > span { display: inline-block; transform: translateY(110%); transition: transform 1.2s var(--ease); }
.hero-title .line:nth-child(2) > span { transition-delay: .12s; }
.hero-title .line:nth-child(3) > span { transition-delay: .24s; }
.loaded .hero-title .line > span { transform: none; }
.hero-title em { position: relative; display: inline-block; color: var(--accent); font-size: 1.12em; letter-spacing: -.03em; padding: 0 .08em; }
.circled svg { position: absolute; inset: -14% -8% -10%; width: 116%; height: 124%; overflow: visible; pointer-events: none; }
.circled path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; transition: stroke-dashoffset 1.4s var(--ease) 1s; }
.loaded .circled path { stroke-dashoffset: 0; }
.hero-sub { color: var(--muted); max-width: 520px; margin: 28px 0 34px; font-size: clamp(16px, 1.4vw, 18px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-canvas { position: relative; z-index: 2; }
.canvas-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 40px 80px -40px var(--shadow); overflow: hidden; }
.canvas-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.wdots { display: flex; gap: 6px; }
.wdots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.wdots i:nth-child(2) { background: #febc2e; }
.wdots i:nth-child(3) { background: #28c840; }
.canvas-hint { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--blue); animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
.editor {
  display: block; width: 100%; height: auto; touch-action: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 20px 20px;
}
.editor-curve { fill: none; stroke: url(#g-curve); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease) .6s; }
.loaded .editor-curve { stroke-dashoffset: 0; }
.e-line { stroke: var(--blue); stroke-width: 1.5; }
.e-handle { fill: var(--white); stroke: var(--blue); stroke-width: 2; cursor: grab; }
.e-anchor { fill: var(--blue); stroke: var(--white); stroke-width: 2; cursor: move; }
.e-handle:hover, .e-anchor:hover, .dragging { stroke-width: 3; filter: drop-shadow(0 0 6px rgba(43, 108, 255, .6)); }
#editor-ui { opacity: 0; transition: opacity .6s 2s; }
.loaded #editor-ui { opacity: 1; }
.canvas-foot { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.canvas-foot span:first-child { color: var(--blue); }

/* floating hero pieces */
.fl { position: absolute; z-index: 3; pointer-events: none; }
.fl > * { animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-12px); } }
.fl-cursor { display: flex; align-items: flex-start; gap: 2px; }
.fl-cursor svg { width: 22px; height: 22px; fill: var(--c); stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.fl-cursor span { margin-top: 16px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px 6px 6px 2px; }
.fl-cursor.c1 { --c: var(--pink); top: 22%; left: 47%; }
.fl-cursor.c1 > * { animation: wander1 9s ease-in-out infinite; }
.fl-cursor.c2 { --c: var(--green); bottom: 18%; left: 38%; }
.fl-cursor.c2 > * { animation: wander2 11s ease-in-out infinite; }
@keyframes wander1 { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(60px, 40px); } 60% { transform: translate(-30px, 70px); } }
@keyframes wander2 { 0%, 100% { transform: translate(0, 0); } 40% { transform: translate(-80px, -30px); } 70% { transform: translate(40px, -60px); } }
.fl-comment { top: 18%; right: 5%; }
.fl-comment > * { animation-delay: -2s; }
.fl-comment { display: flex; align-items: flex-start; gap: 8px; }
.fl-comment .avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; background: var(--yellow); font-weight: 800; font-size: 13px; }
.fl-comment p { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13px; box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .4); }
.fl-comment b { display: block; font-size: 12px; }
.fl-chip { bottom: 12%; right: 4%; display: flex; gap: 6px; background: var(--white); padding: 8px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .4); }
.fl-chip i { width: 26px; height: 26px; border-radius: 7px; background: var(--c); animation: none; }
.fl-sticky { bottom: 3%; left: 30%; background: var(--yellow); padding: 14px 16px; font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.1; rotate: -6deg; box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .5); }
.fl-sticky { animation: bob 7s ease-in-out infinite; }

.scroll-hint { position: absolute; left: 50%; bottom: 90px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); z-index: 2; }
.scroll-hint i { width: 22px; height: 34px; border: 1.5px solid var(--muted); border-radius: 12px; position: relative; }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--blue); animation: wheel 1.8s infinite; }
@keyframes wheel { to { transform: translateY(12px); opacity: 0; } }

/* ---------- about ---------- */
.about-text { font-weight: 700; font-size: clamp(26px, 3.6vw, 50px); line-height: 1.22; letter-spacing: -.03em; max-width: 1080px; }
.about-text .sw { color: var(--faint); transition: color .3s, background .3s; border-radius: 4px; }
.about-text .sw.on { color: var(--ink); }
.about-text .sw.picked { background: rgba(43, 108, 255, .16); color: var(--blue); box-shadow: 0 0 0 2px rgba(43, 108, 255, .16); }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: clamp(50px, 8vw, 100px); }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 26px; transition: transform .4s var(--ease), border-color .3s; }
.stat:hover { transform: translateY(-6px); border-color: var(--blue); }
.stat strong { display: block; font-weight: 800; font-size: clamp(38px, 4.4vw, 60px); letter-spacing: -.05em; line-height: 1; }
.stat p { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ---------- skills ---------- */
.skills { overflow: hidden; }
.bg-word { position: absolute; top: 40px; right: -2%; font-family: var(--serif); font-style: italic; font-size: clamp(120px, 22vw, 340px); line-height: 1; color: transparent; -webkit-text-stroke: 1.2px var(--outline); pointer-events: none; white-space: nowrap; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tcard { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 30px; overflow: hidden; transition: transform .5s var(--ease), box-shadow .5s, border-color .3s; }
.tcard::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1.5px solid var(--blue); opacity: 0; transition: opacity .3s; pointer-events: none; }
.tcard:hover { transform: translateY(-8px) rotate(-.5deg); box-shadow: 0 30px 50px -30px var(--shadow); }
.tcard:hover::after { opacity: 1; }
.tcard svg { width: 46px; height: 46px; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 26px; }
.tcard svg * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease) calc(var(--d, 0s) + .3s); }
.tcard.in svg * { stroke-dashoffset: 0; }
.tcard:hover svg { stroke: var(--blue); }
.tcard h3 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 6px; }
.tcard p { color: var(--muted); font-size: 15px; }

/* ---------- work frames ---------- */
.frames { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 56px); }
.frame--down { margin-top: clamp(0px, 12vw, 170px); }
.frame-label { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 10px; font-size: 12px; }
.frame-label span:first-child { color: var(--blue); font-weight: 500; }
.frame-box { position: relative; transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease); transform-style: preserve-3d; }
.frame-inner { position: relative; aspect-ratio: 4 / 4.4; overflow: hidden; border-radius: 4px; box-shadow: 0 40px 70px -40px var(--shadow); }
.shot { position: absolute; inset: -12% 0; display: grid; place-items: center; transition: transform 1.4s var(--ease); transform: scale(1.18); background: linear-gradient(155deg, var(--g1, #ff8a5c), var(--g2, #7b3cff)); }
.shot > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-box.in .shot { transform: scale(1); }
.sel { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sel rect { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s var(--ease) .2s; }
.frame-box.in .sel rect { stroke-dashoffset: 0; }
.hd { position: absolute; width: 11px; height: 11px; background: var(--white); border: 1.5px solid var(--blue); transform: scale(0); transition: transform .5s var(--ease) 1.2s; }
.frame-box.in .hd { transform: scale(1); }
.hd.tl { top: -5px; left: -5px; } .hd.tr { top: -5px; right: -5px; } .hd.bl { bottom: -5px; left: -5px; } .hd.br { bottom: -5px; right: -5px; }
.frame-info { padding-top: 22px; }
.frame-info h3 { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.03em; }
.frame-info p { color: var(--muted); }

.mock-phone { width: 34%; aspect-ratio: 9 / 19; background: #fff; border-radius: 24px; padding: 16px 11px; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 40px 60px -20px rgba(0, 0, 0, .45); position: absolute; left: 22%; top: 24%; rotate: -6deg; transition: rotate .8s var(--ease), translate .8s var(--ease); }
.mock-phone i { display: block; height: 14%; border-radius: 9px; background: #f1edf7; }
.mock-phone i:first-child { height: 26%; background: linear-gradient(135deg, #ff6b3d, #b9a6ff); }
.mock-phone--b { left: 48%; top: 30%; rotate: 8deg; background: #15151d; }
.mock-phone--b i { background: #262634; }
.mock-phone--b i:first-child { background: linear-gradient(135deg, #4fe3c1, #2a7fff); }
.frame:hover .mock-phone { rotate: -2deg; translate: -10px -10px; }
.frame:hover .mock-phone--b { rotate: 3deg; translate: 10px 0; }
.mock-browser { width: 78%; aspect-ratio: 4 / 3; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 40px 60px -20px rgba(0, 0, 0, .45); transition: transform .8s var(--ease); }
.mock-browser span { display: block; height: 22px; background: #eef1f6; }
.mock-browser div { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: 12px; padding: 14px; height: calc(100% - 22px); }
.mock-browser i { border-radius: 9px; background: #e7f6f3; }
.mock-browser i:first-child { grid-row: span 2; background: #0f2a3d; }
.mock-browser i:last-child { background: linear-gradient(90deg, #4fe3c1, #2a7fff); opacity: .7; }
.frame:hover .mock-browser { transform: scale(1.04) rotate(-1deg); }
.mock-grid { width: 76%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; transition: transform .8s var(--ease); }
.mock-grid i { aspect-ratio: 3 / 4; border-radius: 12px; background: rgba(255, 255, 255, .85); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .35); }
.mock-grid i:nth-child(2n) { background: #7a2e1f; transform: translateY(20px); }
.frame:hover .mock-grid { transform: scale(1.05); }
.mock-tokens { width: 70%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mock-tokens i { aspect-ratio: 1; border-radius: 50%; background: #fff; }
.mock-tokens i:nth-child(2) { background: #ff6b3d; }
.mock-tokens i:nth-child(3) { background: #4fe3c1; }
.mock-tokens b { grid-column: span 3; height: 44px; border-radius: 99px; background: rgba(255, 255, 255, .9); }
.mock-tokens b:last-child { background: transparent; border: 2px solid rgba(255, 255, 255, .8); }

/* ---------- process flow ---------- */
.flow { position: relative; display: grid; grid-template-columns: 1fr 1fr; column-gap: 18%; row-gap: 24px; grid-auto-rows: minmax(80px, auto); }
.flow-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.flow-lines path.noodle { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; }
.flow-lines marker path { fill: var(--blue); }
.flow-lines circle { fill: var(--white); stroke: var(--blue); stroke-width: 2; transition: transform .4s var(--ease); transform-box: fill-box; transform-origin: center; }
.node { position: relative; z-index: 1; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; transition: border-color .3s, box-shadow .4s; }
.node:hover { border-color: var(--blue); box-shadow: 0 24px 40px -28px rgba(43, 108, 255, .6); }
.node span { color: var(--blue); }
.node h3 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.03em; margin: 6px 0; }
.node p { color: var(--muted); font-size: 15px; }
.node:nth-of-type(odd) { grid-column: 1; }
.node:nth-of-type(even) { grid-column: 2; }
.node { grid-row: var(--row) / span 2; }

/* ---------- playground ---------- */
.play-help { color: var(--muted); max-width: 760px; margin: -40px 0 30px; }
.play-help b { color: var(--ink); }
.play-board { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 40px 80px -50px var(--shadow); }
.play-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.play-btns { display: flex; gap: 8px; }
.play-btns button { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 700; transition: background .2s, color .2s; }
.play-btns button:hover { background: var(--ink); color: var(--paper); }
.play-svg {
  display: block; width: 100%; height: clamp(360px, 52vh, 520px); touch-action: none; cursor: var(--pen-cursor);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 20px 20px;
}
.play-svg .shape { stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; fill: none; }
.play-svg .shape.closed { fill: var(--fill); fill-opacity: .85; }
.play-svg .shape.new { animation: pop .5s var(--ease); transform-box: fill-box; transform-origin: center; }
@keyframes pop { 40% { transform: scale(1.04); } }
#play-preview { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 5 5; }
.p-line { stroke: var(--blue); stroke-width: 1; }
.p-handle { fill: var(--white); stroke: var(--blue); stroke-width: 1.5; }
.p-anchor { fill: var(--white); stroke: var(--blue); stroke-width: 1.6; }
.p-anchor.first { fill: var(--blue); }
.p-anchor.first.hot { stroke-width: 4; }
.play-empty { position: absolute; left: 0; right: 0; top: 55%; text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: clamp(24px, 3vw, 36px); pointer-events: none; transition: opacity .3s; }
.play-empty.hide { opacity: 0; }

/* ---------- contact ---------- */
.contact { text-align: center; padding-bottom: clamp(140px, 16vw, 220px); }
.contact .label::before { display: none; }
.contact-title { font-weight: 800; font-size: clamp(40px, 7vw, 104px); line-height: 1; letter-spacing: -.055em; }
.contact-title em { color: var(--accent); }
.swoosh { display: block; width: min(560px, 80%); height: 50px; margin: 10px auto 34px; overflow: visible; }
.swoosh path { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.socials a { background: var(--white); border: 1px solid var(--line); padding: 10px 20px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: transform .3s var(--ease), border-color .3s, color .3s; }
.socials a:hover { transform: translateY(-3px); border-color: var(--blue); color: var(--blue); }

.footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; padding: 26px var(--gutter) 100px calc(var(--gutter) + var(--ruler)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer .logo { color: var(--ink); }
.footer a.mono:hover { color: var(--blue); }
.footer-credit { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--accent); transition: color .25s; }
.footer-credit:hover { color: var(--accent); }
.footer-credit { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--accent); transition: color .25s; }
.footer-credit:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 120px; padding-bottom: 150px; }
  .hero-canvas { max-width: 620px; }
  .fl-cursor.c1 { top: 9%; left: 58%; }
  .fl-comment { top: auto; bottom: 46%; right: 3%; }
  .fl-sticky, .fl-cursor.c2 { display: none; }
  .scroll-hint { bottom: 96px; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .frames { grid-template-columns: 1fr; }
  .frame--down { margin-top: 0; }
  .tool-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; row-gap: 56px; }
  .node:nth-of-type(n) { grid-column: 1; grid-row: auto; }
  .fl-comment, .fl-chip, .fl-cursor.c1 { display: none; }
  .logo-text { font-size: 14px; }
  .scroll-hint { display: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* =========================================================
   THEMES — light (default) & dark
   ========================================================= */
:root {
  color-scheme: light;
  --dot: rgba(20, 20, 23, .16);
  --tick: rgba(20, 20, 23, .35);
  --tick-2: rgba(20, 20, 23, .2);
  --glass: rgba(255, 255, 255, .8);
  --glass-paper: rgba(243, 241, 236, .82);
  --faint: rgba(20, 20, 23, .25);
  --outline: rgba(20, 20, 23, .1);
  --shadow: rgba(20, 20, 23, .35);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101013;
  --paper-2: #17171c;
  --white: #1c1c23;
  --ink: #f2efe9;
  --ink-2: #d9d6cf;
  --muted: #9b98a5;
  --line: rgba(255, 255, 255, .1);
  --blue: #5b8cff;
  --accent: #ff6b47;
  --dot: rgba(255, 255, 255, .1);
  --tick: rgba(255, 255, 255, .32);
  --tick-2: rgba(255, 255, 255, .16);
  --glass: rgba(28, 28, 35, .8);
  --glass-paper: rgba(16, 16, 19, .8);
  --faint: rgba(242, 239, 233, .2);
  --outline: rgba(255, 255, 255, .08);
  --shadow: rgba(0, 0, 0, .7);
}
:root[data-theme="dark"] .trail-ghost { stroke: rgba(91, 140, 255, .28); }
:root[data-theme="dark"] .about-text .sw.picked { background: rgba(91, 140, 255, .2); }
:root[data-theme="dark"] .hero-title em,
:root[data-theme="dark"] .contact-title em { text-shadow: 0 0 40px rgba(255, 107, 71, .25); }
.fl-sticky, .fl-comment .avatar { color: #141417; }

/* smooth colour change when the browser has no View Transitions */
.theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after {
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), fill .5s, stroke .5s !important;
}
/* circular reveal (View Transitions API) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- theme switch ---------- */
.top-right { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  width: 66px; height: 36px; padding: 0 9px; border-radius: 99px;
  background: var(--white); border: 1px solid var(--line);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .08);
}
.theme-toggle svg {
  position: relative; z-index: 2; width: 17px; height: 17px; fill: none; stroke: var(--muted);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s, transform .6s var(--ease);
}
.theme-toggle .knob {
  position: absolute; z-index: 1; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 4px 10px -3px rgba(255, 90, 54, .7);
  transition: transform .55s var(--ease), background .4s, box-shadow .4s;
}
.theme-toggle .i-sun { stroke: #fff; }
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(30px); background: var(--blue); box-shadow: 0 4px 12px -3px rgba(91, 140, 255, .8); }
:root[data-theme="dark"] .theme-toggle .i-sun { stroke: var(--muted); transform: rotate(-90deg) scale(.85); }
:root[data-theme="dark"] .theme-toggle .i-moon { stroke: #fff; transform: rotate(-20deg); }
.theme-toggle:hover .knob { box-shadow: 0 0 0 5px rgba(43, 108, 255, .15); }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 420px) {
  .logo-text { font-size: 13px; }
  .logo-mark { min-width: 38px; height: 38px; padding: 0 10px; }
  .logo-mark b { font-size: 14px; }
  .share-btn { padding: 9px 13px; font-size: 13px; }
  .top-right { gap: 8px; }
}

/* =========================================================
   Laravel additions — links, contact form, case study page
   ========================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.frame-link { display: block; }
.frame-link:focus-visible { outline: 3px solid var(--blue); outline-offset: 6px; border-radius: 6px; }
.frame-info h3 a { background: linear-gradient(var(--blue), var(--blue)) 0 100% / 0 2px no-repeat; transition: background-size .5s var(--ease), color .3s; }
.frame:hover .frame-info h3 a, .frame-info h3 a:focus-visible { background-size: 100% 2px; color: var(--blue); }
.frame-more { display: inline-flex; gap: 6px; margin-top: 10px; font-weight: 700; font-size: 14px; color: var(--blue); }
.frame-more span { transition: transform .4s var(--ease); }
.frame:hover .frame-more span { transform: translateX(5px); }

/* enquiry button */
.btn-enquiry { gap: 14px; }
.btn-enquiry .arrow { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8em; transition: transform .5s var(--ease); }
.btn-enquiry:hover .arrow { transform: translateX(4px); }

/* contact form */
.contact-form { text-align: left; max-width: 640px; margin: 0 auto 40px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 4vw, 34px); box-shadow: 0 40px 80px -50px var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px;
  transition: border-color .25s, box-shadow .25s; width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(43, 108, 255, .15); }
.field .error { color: var(--accent); font-size: 13px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--accent); }
.contact-form .btn { width: 100%; }
.alert { max-width: 640px; margin: 0 auto 24px; padding: 14px 18px; border-radius: 12px; font-weight: 600; text-align: left; }
.alert-success { background: rgba(24, 194, 156, .14); color: var(--green); border: 1px solid rgba(24, 194, 156, .35); }
.alert-error { background: rgba(255, 92, 53, .1); color: var(--accent); border: 1px solid rgba(255, 92, 53, .35); }
.alert[hidden] { display: none; }
.contact-form .btn:disabled { opacity: .6; cursor: progress; transform: none; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; gap: 0; } }

/* case study page */
.cs-hero { padding: calc(130px + var(--ruler)) 0 clamp(60px, 8vw, 100px); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 26px; }
.crumbs a:hover { color: var(--blue); }
.crumbs li { list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.cs-title { font-weight: 800; font-size: clamp(48px, 9vw, 140px); line-height: .92; letter-spacing: -.06em; }
.cs-title em { color: var(--accent); }
.cs-summary { font-size: clamp(19px, 2vw, 26px); line-height: 1.4; max-width: 760px; margin: 26px 0 40px; color: var(--muted); }
.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: clamp(50px, 7vw, 90px); }
.cs-meta div { background: var(--white); padding: 18px 22px; }
.cs-meta dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.cs-meta dd { font-weight: 700; margin-top: 4px; }
.cs-frame .frame-inner { aspect-ratio: 16 / 9; }
.cs-body { padding-top: 0; }
.cs-body .container { max-width: 860px; }
.cs-body p { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.75; margin-bottom: 1.3em; }
.cs-body p:first-of-type::first-letter { font-family: var(--serif); font-style: italic; float: left; font-size: 4.2em; line-height: .8; margin: .08em .12em 0 0; color: var(--accent); }
.next-project { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(30px, 5vw, 50px); border: 1px solid var(--line); border-radius: 24px; background: var(--white); transition: border-color .3s, transform .5s var(--ease); }
.next-project:hover { border-color: var(--blue); transform: translateY(-4px); }
.next-project small { font-family: var(--mono); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.next-project strong { display: block; font-size: clamp(32px, 5vw, 64px); letter-spacing: -.05em; line-height: 1; margin-top: 6px; }
.next-project .arrow { font-size: clamp(32px, 5vw, 60px); transition: transform .5s var(--ease); }
.next-project:hover .arrow { transform: translateX(10px); color: var(--blue); }
@media (max-width: 760px) { .cs-meta { grid-template-columns: 1fr 1fr; } }
h2.label { font-weight: 500; }

/* 404 page */
.notfound { min-height: 78vh; display: flex; align-items: center; }
.notfound-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 34px; }
.notfound-actions .btn-xl { margin: 0; }
