:root {
  --bg: #050609;
  --bg-2: #0a0c12;
  --ink: #e9ecf2;
  --dim: #7f8696;
  --faint: #444b5c;
  --line: rgba(233, 236, 242, 0.10);
  --cyan: #29d3d3;
  --pink: #ff2db4;
  --accent: var(--cyan);
  --disp: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --pad: clamp(18px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); }
body {
  color: var(--ink);
  font-family: var(--disp);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: default;
}
::selection { background: var(--cyan); color: #03110f; }
a { color: inherit; text-decoration: none; }

/* fixed WebGL stage */
#bg {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block;
  pointer-events: none;
}
.grain { /* subtle vignette for legibility over the canvas */
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 35%, transparent 40%, rgba(5,6,9,0.72) 100%);
}

.loader {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: var(--bg); color: var(--dim);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  transition: opacity .9s ease;
}
.loader b { color: var(--ink); font-weight: 400; }
.loader.hidden { opacity: 0; pointer-events: none; }

/* ---------- chrome / nav ---------- */
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad);
  mix-blend-mode: difference;
}
.topbar .brand { font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; color: #fff; }
.topbar .brand b { color: var(--cyan); font-weight: 400; }

/* logo glitch: PLUG&LEND <-> PLUG&TECH */
.swap { position: relative; display: inline-block; }
.swap.glitching { animation: glSkew .42s steps(2,end) infinite; }
.swap.glitching::before, .swap.glitching::after {
  content: attr(data-text); position: absolute; left: 0; top: 0;
  width: 100%; height: 100%; overflow: hidden; pointer-events: none;
}
.swap.glitching::before { color: var(--cyan); animation: glTop .42s steps(2,end) infinite; }
.swap.glitching::after  { color: var(--pink); animation: glBot .42s steps(2,end) infinite; }
@keyframes glSkew { 0%{transform:skewX(0)} 20%{transform:skewX(7deg)} 40%{transform:skewX(-6deg)} 60%{transform:skewX(3deg)} 80%{transform:skewX(-2deg)} 100%{transform:skewX(0)} }
@keyframes glTop { 0%{clip-path:inset(0 0 68% 0);transform:translate(-2px,-1px)} 50%{clip-path:inset(38% 0 22% 0);transform:translate(2px,1px)} 100%{clip-path:inset(8% 0 60% 0);transform:translate(-1px,0)} }
@keyframes glBot { 0%{clip-path:inset(72% 0 0 0);transform:translate(2px,1px)} 50%{clip-path:inset(52% 0 16% 0);transform:translate(-2px,-1px)} 100%{clip-path:inset(82% 0 4% 0);transform:translate(1px,0)} }

/* magnetic targets */
.magnetic { display: inline-block; will-change: transform; }

/* custom cursor (desktop, fine pointer only) */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; border-radius: 50%; transform: translate(-50%,-50%); display: none; }
.cursor-dot { width: 6px; height: 6px; background: var(--cyan); }
.cursor-ring { width: 32px; height: 32px; border: 1px solid rgba(233,236,242,0.45); transition: width .28s ease, height .28s ease, border-color .28s ease, background .28s ease; }
.cursor-ring.hover { width: 62px; height: 62px; border-color: var(--cyan); background: rgba(41,211,211,0.07); }
body.cursor-on { cursor: none; }
body.cursor-on a, body.cursor-on .magnetic, body.cursor-on .card { cursor: none; }
body.cursor-on .cursor-dot, body.cursor-on .cursor-ring { display: block; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav .links { display: flex; gap: 26px; }
.nav a.mono { color: #fff; opacity: .7; transition: opacity .25s; }
.nav a.mono:hover { opacity: 1; }
.nav .talk {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 999px; padding: 9px 16px;
  transition: background .25s, color .25s;
}
.nav .talk:hover { background: #fff; color: #000; }
@media (max-width: 720px){ .nav .links { display: none; } }

/* flat verification mode: lay everything out as a normal tall document */
html.flat #bg, html.flat .grain, html.flat .scrollcue, html.flat .corner { display: none; }
html.flat .hero, html.flat .foot { min-height: auto; }
html.flat .work .pinwrap { height: auto; display: block; padding: 60px 0; }
html.flat .work .track { flex-direction: column; transform: none !important; }
html.flat .work .intro, html.flat .card { width: 100%; }
html.flat .card { height: auto; min-height: 300px; }

/* corner micro labels */
.corner { position: fixed; z-index: 30; pointer-events: none; }
.corner.bl { left: var(--pad); bottom: 22px; }
.corner.br { right: var(--pad); bottom: 22px; text-align: right; }
.counter b { color: var(--cyan); }
@media (max-width: 720px){ .corner { display: none; } }

/* ---------- layout ---------- */
.content { position: relative; z-index: 10; }
section { position: relative; padding: clamp(90px, 14vh, 180px) var(--pad); }
.wrap { max-width: 1280px; margin: 0 auto; width: 100%; }

/* hero */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 0; }
.hero .tag { margin-bottom: 26px; }
.hero h1 {
  font-weight: 500; font-size: clamp(34px, 6.4vw, 92px); line-height: 0.98;
  letter-spacing: -0.035em; max-width: 16ch;
}
.hero h1 .accent { color: var(--cyan); font-style: italic; font-weight: 300; }
.hero .sub { margin-top: 30px; max-width: 52ch; color: var(--dim); font-size: clamp(14px,1.4vw,17px); line-height: 1.6; font-family: var(--mono); }
.hero .sub b { color: var(--ink); font-weight: 400; }
.scrollcue { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scrollcue .bar { width: 1px; height: 46px; background: linear-gradient(var(--cyan), transparent); animation: drop 1.8s infinite; }
@keyframes drop { 0%{transform:scaleY(0);transform-origin:top} 40%{transform:scaleY(1);transform-origin:top} 60%{transform:scaleY(1);transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }

/* line-mask reveal */
.reveal { overflow: hidden; }
.reveal > * { display: block; will-change: transform; }

/* manifesto */
.manifesto h2 {
  font-weight: 400; font-size: clamp(26px, 4.6vw, 64px); line-height: 1.12; letter-spacing: -0.02em;
  max-width: 20ch;
}
.manifesto h2 .muted { color: var(--faint); }
.manifesto .meta { margin-top: 40px; display:flex; gap: 40px; flex-wrap: wrap; }
.manifesto .meta div b { display:block; font-family: var(--disp); font-size: clamp(28px,3vw,44px); font-weight:500; color: var(--ink); }
.manifesto .meta div span { font-family: var(--mono); font-size: 11px; letter-spacing:.12em; text-transform:uppercase; color: var(--dim); }

/* principles */
.principles .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principles .cell { background: var(--bg); padding: 40px clamp(18px,2vw,34px) 48px; }
.principles .cell .k { font-family: var(--mono); color: var(--cyan); font-size: 11px; letter-spacing:.16em; }
.principles .cell h3 { font-size: clamp(22px,2.4vw,34px); font-weight: 500; margin: 18px 0 14px; letter-spacing:-.02em; }
.principles .cell p { color: var(--dim); font-size: 15px; line-height: 1.6; }
.section-head { display:flex; justify-content: space-between; align-items: baseline; margin-bottom: 46px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-weight: 400; font-size: clamp(13px,1.2vw,15px); font-family: var(--mono); letter-spacing:.2em; text-transform:uppercase; color: var(--dim); }
.section-head .idx { font-family: var(--mono); color: var(--faint); font-size: 12px; }
@media (max-width: 820px){ .principles .grid { grid-template-columns: 1fr; } }

/* work — horizontal carousel */
.work { padding: 0; }
.work .pinwrap { height: 100svh; display: flex; align-items: center; overflow: hidden; }
.work .track { display: flex; gap: clamp(18px,2vw,34px); padding: 0 var(--pad); will-change: transform; }
.work .intro { flex: 0 0 auto; width: min(78vw, 420px); align-self: center; padding-right: 20px; }
.work .intro h2 { font-size: clamp(30px,4vw,58px); font-weight: 500; letter-spacing:-.03em; line-height:1; }
.work .intro p { color: var(--dim); margin-top: 18px; font-family: var(--mono); font-size: 13px; line-height:1.6; }
.card {
  flex: 0 0 auto; width: min(80vw, 380px); height: 64vh; max-height: 540px;
  border: 1px solid var(--line); border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  transition: border-color .3s, transform .3s;
}
.card:hover { border-color: rgba(41,211,211,0.5); }
.card .num { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.card .signal { display:flex; gap:4px; margin-top: 14px; }
.card .signal i { width: 5px; border-radius: 2px; background: var(--cyan); opacity: .85; }
.card h3 { font-size: clamp(24px,2.4vw,32px); font-weight: 500; letter-spacing:-.02em; margin-bottom: 10px; }
.card p { color: var(--dim); font-size: 14.5px; line-height: 1.55; }
.card .tags { display:flex; flex-wrap: wrap; gap: 7px; }
.card .tags span { font-family: var(--mono); font-size: 10.5px; letter-spacing:.05em; color: var(--dim); border:1px solid var(--line); border-radius: 999px; padding: 5px 10px; }

/* ecosystem grid */
.eco .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border:1px solid var(--line); }
.eco .grid span { background: var(--bg); padding: 22px 18px; font-family: var(--mono); font-size: 12.5px; letter-spacing:.06em; color: var(--dim); transition: color .25s, background .25s; }
.eco .grid span:hover { color: var(--ink); background: var(--bg-2); }
@media (max-width: 820px){ .eco .grid { grid-template-columns: repeat(2, 1fr); } }

/* footer CTA */
.foot { min-height: 90svh; display:flex; flex-direction: column; justify-content: center; }
.foot h2 { font-weight: 500; font-size: clamp(38px,8vw,120px); letter-spacing:-.04em; line-height:.92; }
.foot h2 a { display:inline-block; }
.foot h2 a:hover { color: var(--cyan); }
.foot .row { display:flex; justify-content: space-between; align-items: flex-end; margin-top: 60px; gap: 24px; flex-wrap: wrap; }
.foot .links { display:flex; gap: 22px; }

@media (max-width: 720px){
  .work .pinwrap { height: auto; display: block; padding: 80px 0; }
  .work .track { flex-direction: column; transform: none !important; padding: 0 var(--pad); }
  .work .intro, .card { width: 100%; }
  .card { height: auto; min-height: 360px; }
}
