/* Layout: robotics lab. A steel door the visitor pushes open, then a bright workshop page:
   hero with a live robot arm, skills mapped onto an architecture, filterable projects, contact. */
:root {
  --bg: #eef0f2;          /* workshop grey */
  --surface: #ffffff;
  --ink: #16191d;
  --muted: #5b636d;
  --line: #d5dae0;
  --orange: #ff5a1f;      /* industrial-robot orange, the accent */
  --steel: #1b1e22;       /* door + dark surfaces */
  --hazard: #f5c400;      /* only on the door's leading edge */
  --ok: #17a05d;
  --display: "Chakra Petch", "Barlow", system-ui, sans-serif;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.6 var(--sans); overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
::selection { background: var(--orange); color: #fff; }
.mono { font-family: var(--mono); }
.dim { color: var(--muted); }

/* =========================================================
   GATE — pushed from left to right
   ========================================================= */
#gate { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.gate-panel {
  position: absolute; inset: 0; pointer-events: auto; cursor: grab; touch-action: none; user-select: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 5px),
    linear-gradient(115deg, #2a2e34 0%, #1b1e22 45%, #24282e 100%);
  box-shadow: 30px 0 60px rgba(0,0,0,.35);
  display: grid; place-items: center; color: #e9ecef; will-change: transform;
}
.gate-panel.dragging { cursor: grabbing; }
.gate-panel.release { transition: transform .5s cubic-bezier(.3,1.4,.5,1); }
.gate-panel.open { transition: transform .9s cubic-bezier(.7,0,.2,1); transform: translateX(105%) !important; }
.hazard { position: absolute; top: 0; bottom: 0; right: 0; width: 28px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 16px, var(--steel) 16px 32px); }
.rivet { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8b939c, #3b4148); }
.rivet.tl { top: 22px; left: 22px; } .rivet.tr { top: 22px; right: 50px; } .rivet.bl { bottom: 22px; left: 22px; } .rivet.br { bottom: 22px; right: 50px; }
.gate-inner { width: min(640px, 86vw); padding-right: 28px; }
.gate-id { font-size: 12px; letter-spacing: .14em; color: #8b939c; margin: 0 0 18px; }
.gate-title { font: 700 clamp(60px, 12vw, 132px)/.9 var(--display); margin: 0; letter-spacing: -.01em; text-transform: uppercase; }
.gate-sub { color: #aab2bb; font-size: clamp(16px, 2vw, 20px); margin: 18px 0 36px; }
.gate-status { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #aab2bb; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .08em; }
.gate-status i { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 10px #e5484d; transition: background .2s, box-shadow .2s; }
.gate-status i.go { background: #3ddc97; box-shadow: 0 0 12px #3ddc97; }
.gate-status b { margin-left: auto; color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 72px; border-radius: 36px; background: #121417; border: 1px solid #3b4148; box-shadow: inset 0 2px 8px rgba(0,0,0,.6); overflow: hidden; }
.track-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(255,90,31,.15), rgba(255,90,31,.45)); }
.track-label { position: absolute; inset: 0; display: grid; place-items: center; font: 600 15px var(--display); letter-spacing: .12em; text-transform: uppercase; color: #6f7780; padding-left: 60px; white-space: nowrap;
  background: linear-gradient(90deg, #6f7780 0 40%, #fff 50%, #6f7780 60% 100%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.4s linear infinite; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.knob {
  position: absolute; left: 4px; top: 4px; width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: grab; touch-action: none;
  background: var(--orange); box-shadow: 0 6px 18px rgba(255,90,31,.45), inset 0 -3px 0 rgba(0,0,0,.18); display: grid; place-items: center;
}
.knob svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.knob.nudge { animation: nudge 1.2s ease-in-out; }
@keyframes nudge { 30% { transform: translateX(26px); } 60% { transform: translateX(0); } 75% { transform: translateX(10px); } }
.gate-hint { font-size: 12px; color: #6f7780; margin-top: 14px; text-align: center; }
.gate-skip { position: absolute; right: 84px; bottom: 16px; pointer-events: auto; background: none; border: 0; color: #8b939c; font-size: 12px; cursor: pointer; letter-spacing: .1em; text-transform: uppercase; }
.gate-skip:hover { color: #fff; }
#gate.done .gate-skip { display: none; }

/* page behind the door reacts to the push */
#site, .top { transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .9s; }
body.locked #site, body.locked .top { transform: scale(.96); opacity: .6; }

/* =========================================================
   PAGE
   ========================================================= */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 28px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(20px, 4vw) 14px;
  background: rgba(238,240,242,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; font: 700 18px var(--display); text-decoration: none; }
.logo span:last-child { color: var(--muted); font-weight: 500; }
.logo-mark { width: 14px; height: 14px; background: var(--orange); border-radius: 3px; transform: rotate(45deg); }
.top nav { display: flex; gap: 24px; margin-left: auto; font-weight: 500; }
.top nav a { text-decoration: none; position: relative; }
.top nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--orange); transform: scaleX(0); transition: transform .25s; transform-origin: left; }
.top nav a:hover::after { transform: scaleX(1); }
.status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(23,160,93,.15); }

.kicker { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin: 0 0 14px; }
h2, h3 { margin: 0; text-wrap: balance; }
.btn { display: inline-flex; align-items: center; font: 600 16px var(--sans); text-decoration: none; padding: 13px 22px; border-radius: 8px; border: 2px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; transition: transform .2s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); background: var(--orange); border-color: var(--orange); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { color: #fff; }

/* hero */
.hero { min-height: 100vh; max-width: 1280px; margin: 0 auto; padding: 110px max(20px, 4vw) 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.hero-title { font: 700 clamp(40px, 4.8vw, 66px)/1.02 var(--display); letter-spacing: -.01em; }
.hero-title em { font-style: normal; color: var(--orange); }
.lede { font-size: clamp(18px, 1.6vw, 21px); color: #3b434c; max-width: 54ch; margin: 24px 0 0; }
.lede b { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-stats { display: flex; gap: 36px; margin: 40px 0 0; flex-wrap: wrap; }
.hero-stats div { border-left: 3px solid var(--orange); padding-left: 12px; }
.hero-stats dt { font: 700 30px var(--display); font-variant-numeric: tabular-nums; }
.hero-stats dd { margin: 0; color: var(--muted); font-size: 14px; }
.arm-wrap { margin: 0; position: relative; min-width: 0; }
#arm { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; cursor: crosshair; }
#arm .gridline { stroke: #e9ecef; stroke-width: 1; }
#arm .reach { fill: none; stroke: #e1e5ea; stroke-width: 1.5; stroke-dasharray: 4 6; }
#arm .base { fill: var(--steel); } #arm .base2 { fill: #3b4148; }
#arm .link { stroke: var(--orange); stroke-width: 34; stroke-linecap: round; }
#arm .link.l2 { stroke-width: 24; }
#arm .joint { fill: var(--steel); stroke: #fff; stroke-width: 4; }
#arm .joint.small { stroke-width: 3; }
#arm .joint-dot { fill: var(--orange); }
#arm .finger { fill: none; stroke: var(--steel); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
#arm .tgt { fill: rgba(255,90,31,.12); stroke: var(--orange); stroke-width: 2; }
#arm .tgt-x { stroke: var(--orange); stroke-width: 2; }
.arm-hud { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; padding: 0 4px; }
.arm-hud b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* sections */
.sec { max-width: 1280px; margin: 0 auto; padding: 100px max(20px, 4vw); }
.sec-head { max-width: 720px; margin-bottom: 40px; }
.sec-head h2 { font: 700 clamp(32px, 4.2vw, 54px)/1.05 var(--display); }
.sec-sub { color: var(--muted); margin: 14px 0 0; }

/* skills */
.skills { display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; align-items: center; }
.groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.groups li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; cursor: default; transition: border-color .25s, transform .25s, box-shadow .25s; outline: none; }
.groups li.on { border-color: var(--orange); transform: translateX(6px); box-shadow: -4px 0 0 var(--orange); }
.groups h3 { font: 700 19px var(--display); display: flex; align-items: center; gap: 10px; }
.ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--bg); font: 600 13px var(--mono); color: var(--orange); }
.groups p { margin: 6px 0 0 40px; color: var(--muted); font-size: 15px; }
.arch { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-width: 0; }
#archSvg { width: 100%; height: auto; display: block; }
#archSvg .edges path { fill: none; stroke: var(--line); stroke-width: 3; }
#archSvg .flow path { fill: none; stroke: var(--orange); stroke-width: 3; stroke-dasharray: 6 14; animation: flow 1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
#archSvg .node rect { fill: var(--bg); stroke: var(--line); stroke-width: 2; transition: fill .25s, stroke .25s; }
#archSvg .node text { font: 700 15px var(--display); fill: var(--ink); text-anchor: middle; transition: fill .25s; }
#archSvg .node text.sm { font: 500 11px var(--mono); fill: var(--muted); }
#archSvg .node.on rect { fill: var(--steel); stroke: var(--orange); }
#archSvg .node.on text { fill: #fff; } #archSvg .node.on text.sm { fill: #ffb18f; }
#archSvg .lbl { font: 500 10px var(--mono); fill: var(--muted); text-anchor: middle; }

/* projects */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip { font: 600 14px var(--sans); padding: 8px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.proj { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; transition: transform .3s, box-shadow .3s, opacity .3s, border-color .3s; }
.proj:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -24px rgba(22,25,29,.35); border-color: #c3cad2; }
.proj.hide { display: none; }
.proj-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.pid { color: var(--orange); font-weight: 500; }
.proj h3 { font: 700 24px/1.15 var(--display); }
.proj p { margin: 0; color: #3b434c; font-size: 16px; }
.impact { list-style: none; margin: 4px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--line); display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.impact b { display: block; font: 700 20px var(--display); color: var(--ink); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.tags span { font: 500 12px var(--mono); padding: 4px 9px; border-radius: 5px; background: var(--bg); color: #3b434c; }
.note { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mail-card { background: var(--steel); color: #fff; border-radius: 16px; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.mail-card .dim { color: #8b939c; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.mail { font: 700 clamp(20px, 2.4vw, 30px) var(--display); text-decoration: none; word-break: break-all; }
.mail:hover { color: var(--orange); }
.mail-card .btn { background: var(--orange); border-color: var(--orange); }
.mail-card .btn:hover { background: #fff; color: var(--ink); border-color: #fff; }
.copied { font-size: 12px; color: #3ddc97; min-height: 1.2em; }
.links { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.links li + li { border-top: 1px solid var(--line); }
.links a { display: flex; justify-content: space-between; gap: 12px; padding: 18px 22px; text-decoration: none; font-weight: 600; transition: background .2s, padding .2s; flex-wrap: wrap; }
.links a:hover { background: var(--bg); padding-left: 28px; }
.links .mono { font-size: 13px; font-weight: 400; color: var(--muted); }
.foot { margin-top: 64px; font-size: 12px; color: var(--muted); text-align: center; }

/* reveal */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .6s, transform .6s; }
.rv.in { opacity: 1; transform: none; }

/* responsive */
@media (max-width: 960px) {
  .hero, .skills, .contact-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 96px; }
  .projects { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top { gap: 14px; }
  .top nav { gap: 14px; font-size: 15px; }
  .status { display: none; }
  .sec { padding: 72px 16px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .gate-inner { padding-right: 34px; }
  .track { height: 64px; } .knob { width: 56px; height: 56px; }
  .groups p { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; }
}
