/* links.routerlabs.ai
   Brand tokens, mark and fonts are the real Router Labs ones (~/dev/CLAUDE.md).
   Deliberately NOT taken from the institutional grammar: 2px radii, 9.5px mono row
   labels, hairline lists, flat ground. This page is opened from a phone, from a bio,
   by someone deciding in two seconds whether to tap. */

/* Light is the default ground, matching routerlabs.ai. Dark follows the system, and
   the toggle overrides both — so every token is declared three times and nowhere else. */
:root{
  --bg:#ffffff; --raised:#f5f4f2; --raised-2:#eeece8; --sunk:#faf9f7;
  --strong:#0d0c0a; --ink:#1f1d1a; --muted:#4a4842; --faint:#63605a; --subtle:#6b645a;
  --accent:#0d0c0a; --accent-hi:#26231f; --on-accent:#ffffff;
  --rule:rgba(0,0,0,.12); --rule-strong:rgba(0,0,0,.22); --rule-faint:rgba(0,0,0,.07);
  --glow-a:rgba(13,12,10,.07); --glow-b:rgba(13,12,10,.05);
  --field-line:rgba(0,0,0,.13); --field-spark:#0d0c0a;
  --mark:url(/icons/mark-black.png);
  --grain:.026;
  --shadow:0 14px 38px -16px rgba(0,0,0,.28);
  --serif:'Instrument Serif','Times New Roman',serif;
  --sans:'DM Sans',system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:'JetBrains Mono',ui-monospace,monospace;
  /* One spring, used everywhere, so every movement on the page feels related. */
  --spring:cubic-bezier(.22,1.15,.36,1);
  --ease:cubic-bezier(.16,1,.3,1);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0a0908; --raised:#141312; --raised-2:#1b1a18; --sunk:#050403;
  --strong:#f4ede0; --ink:#e8e0d4; --muted:#b5ac9f; --faint:#8a8378; --subtle:#6b645a;
  --accent:#F5E6D3; --accent-hi:#fff5e8; --on-accent:#0a0908;
  --rule:rgba(245,230,211,.13); --rule-strong:rgba(245,230,211,.26);
  --rule-faint:rgba(245,230,211,.07);
  --glow-a:rgba(245,230,211,.22); --glow-b:rgba(245,230,211,.13);
  --field-line:rgba(245,230,211,.20); --field-spark:#F5E6D3;
  --mark:url(/icons/mark-white.png);
  --grain:.032;
  --shadow:0 14px 38px -16px rgba(0,0,0,.7);
}}
:root[data-theme="dark"]{
  --bg:#0a0908; --raised:#141312; --raised-2:#1b1a18; --sunk:#050403;
  --strong:#f4ede0; --ink:#e8e0d4; --muted:#b5ac9f; --faint:#8a8378; --subtle:#6b645a;
  --accent:#F5E6D3; --accent-hi:#fff5e8; --on-accent:#0a0908;
  --rule:rgba(245,230,211,.13); --rule-strong:rgba(245,230,211,.26);
  --rule-faint:rgba(245,230,211,.07);
  --glow-a:rgba(245,230,211,.22); --glow-b:rgba(245,230,211,.13);
  --field-line:rgba(245,230,211,.20); --field-spark:#F5E6D3;
  --mark:url(/icons/mark-white.png);
  --grain:.032;
  --shadow:0 14px 38px -16px rgba(0,0,0,.7);
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--sans);font-weight:300;
     -webkit-font-smoothing:antialiased;min-height:100vh;min-height:100dvh;
     display:flex;flex-direction:column;overflow-x:hidden;position:relative;
     transition:background .45s var(--ease),color .45s var(--ease)}

/* ── ambient ─────────────────────────────────────────────────────────────
   Three layers: two drifting washes for depth, the animated wave field (the mark,
   in motion — see field.js), and grain on top so the blurred gradients never band. */
.ambient{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.glow{position:absolute;border-radius:50%;filter:blur(90px);opacity:.85}
.g1{width:min(78vw,680px);aspect-ratio:1;left:50%;top:-24%;translate:-50% 0;
    background:radial-gradient(circle,var(--glow-a),transparent 68%);
    animation:drift1 22s var(--ease) infinite alternate}
.g2{width:min(66vw,540px);aspect-ratio:1;right:-16%;bottom:-14%;
    background:radial-gradient(circle,var(--glow-b),transparent 70%);
    animation:drift2 27s var(--ease) infinite alternate}
@keyframes drift1{to{translate:-50% 7%;opacity:.55}}
@keyframes drift2{to{translate:-9% -6%;opacity:1}}

#field{position:absolute;inset:0;width:100%;height:100%;display:block;
       mask-image:radial-gradient(120% 78% at 50% 46%,#000 34%,transparent 84%);
       -webkit-mask-image:radial-gradient(120% 78% at 50% 46%,#000 34%,transparent 84%);
       opacity:0;transition:opacity 1.4s var(--ease) .25s}
.field-on #field{opacity:1}

.grain{position:absolute;inset:-50%;opacity:var(--grain);pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E")}

/* ── shell ───────────────────────────────────────────────────────────── */
.wrap{position:relative;z-index:1;width:100%;max-width:520px;margin:0 auto;
      padding:96px 20px 24px;flex:1 1 auto;min-height:0;
      display:flex;flex-direction:column;justify-content:center;gap:34px}
@media(min-width:900px){.wrap{max-width:560px;padding:120px 20px 30px}}

.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}

/* ── masthead ────────────────────────────────────────────────────────── */
.bar{position:fixed;inset:0 0 auto;z-index:3;display:flex;align-items:center;
     justify-content:space-between;gap:16px;padding:16px}
@media(min-width:900px){.bar{padding:22px 26px}}

.lockup{display:inline-flex;align-items:center;gap:10px;text-decoration:none;
        padding:6px 12px 6px 8px;border-radius:14px;
        border:1px solid transparent;transition:border-color .25s,background .25s}
.lockup:hover{border-color:var(--rule);background:color-mix(in srgb,var(--raised) 72%,transparent);
              backdrop-filter:blur(14px)}
.lockup:focus-visible{outline:none;box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--rule-strong)}
.lockup .mark{width:26px;height:26px;flex:0 0 auto;
              background:var(--mark) center/contain no-repeat;
              transition:transform .5s var(--spring)}
.lockup:hover .mark{transform:translateY(-2px) scale(1.06)}
.lockup .word{font-family:var(--serif);font-size:20px;line-height:1;color:var(--strong);
              letter-spacing:-.01em;white-space:nowrap}
@media(min-width:900px){.lockup .word{font-size:22px}.lockup .mark{width:28px;height:28px}}

.tools{display:flex;gap:8px}
.icb{position:relative;flex:0 0 auto;width:42px;height:42px;display:grid;place-items:center;
     border-radius:14px;cursor:pointer;color:var(--muted);
     background:color-mix(in srgb,var(--raised) 68%,transparent);backdrop-filter:blur(14px);
     border:1px solid var(--rule);
     transition:color .2s,border-color .2s,transform .4s var(--spring),background .2s}
.icb:hover{color:var(--strong);border-color:var(--rule-strong);transform:translateY(-2px)}
.icb:active{transform:scale(.93)}
.icb:focus-visible{outline:none;box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--rule-strong)}
.icb svg{width:17px;height:17px;position:absolute;
         transition:opacity .28s,transform .45s var(--spring)}

/* Sun and moon cross-fade with a rotate, so the toggle reads as one control
   changing state rather than two icons swapping. */
.ic-moon{opacity:0;transform:rotate(-70deg) scale(.5)}
:root[data-theme="dark"] .ic-sun,
:root:not([data-theme="light"]) .ic-sun{opacity:0;transform:rotate(70deg) scale(.5)}
:root[data-theme="dark"] .ic-moon,
:root:not([data-theme="light"]) .ic-moon{opacity:1;transform:none}
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]) .ic-sun{opacity:1;transform:none}
  :root:not([data-theme="dark"]) .ic-moon{opacity:0;transform:rotate(-70deg) scale(.5)}
}
:root[data-theme="light"] .ic-sun{opacity:1;transform:none}
:root[data-theme="light"] .ic-moon{opacity:0;transform:rotate(-70deg) scale(.5)}

/* Keyed on the id as well as the class: these two icons are stacked on top of each
   other, so if the selector ever stops matching they BOTH paint and the button shows
   a checkmark over the link. That is exactly what happened when .share was renamed. */
.share .ic-check,#share .ic-check{opacity:0;transform:scale(.5) rotate(-25deg)}
.share.done,#share.done{color:var(--accent);border-color:var(--rule-strong)}
.share.done .ic-link,#share.done .ic-link{opacity:0;transform:scale(.5) rotate(25deg)}
.share.done .ic-check,#share.done .ic-check{opacity:1;transform:none}

/* ── socials ─────────────────────────────────────────────────────────────
   --px/--py are set from the pointer in app.js for the magnetic pull. */
.socials{display:flex;justify-content:center;gap:11px;margin:0}
.socials a{width:46px;height:46px;display:grid;place-items:center;border-radius:15px;
  color:var(--muted);background:var(--raised);border:1px solid var(--rule-faint);
  text-decoration:none;position:relative;
  translate:var(--px,0px) var(--py,0px);
  transition:color .22s,border-color .22s,background .22s,translate .45s var(--spring),
             transform .45s var(--spring),box-shadow .3s}
.socials a svg{width:18px;height:18px;transition:transform .45s var(--spring)}
.socials a:hover,.socials a:focus-visible{color:var(--on-accent);background:var(--accent);
  border-color:var(--accent);transform:translateY(-4px);box-shadow:var(--shadow)}
.socials a:hover svg{transform:scale(1.12)}
.socials a:active{transform:translateY(-1px) scale(.95)}
.socials a:focus-visible{outline:none;box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--rule-strong)}

/* ── cards ───────────────────────────────────────────────────────────── */
.cards{display:flex;flex-direction:column;gap:11px;flex:0 0 auto}

.card{position:relative;display:flex;align-items:center;gap:14px;
      padding:19px 18px;border-radius:18px;text-decoration:none;overflow:hidden;
      background:var(--raised);border:1px solid var(--rule-faint);
      transition:transform .45s var(--spring),border-color .3s,background .3s,box-shadow .35s}
/* Filling with the accent IS the hover. Nothing is filled at rest, so the page has
   one resting texture and the pointer is what creates emphasis. */
.card:hover,.card:focus-visible{transform:translateY(-3px);background:var(--accent);
  border-color:var(--accent);box-shadow:var(--shadow);outline:none}
.card:hover .t,.card:focus-visible .t{color:var(--on-accent)}
.card:hover .n,.card:focus-visible .n{color:color-mix(in srgb,var(--on-accent) 62%,transparent)}
.card:hover .arw,.card:focus-visible .arw{color:var(--on-accent)}
.card:active{transform:translateY(-1px) scale(.992)}
.card:focus-visible{outline:none;box-shadow:var(--shadow),0 0 0 2px var(--bg),0 0 0 4px var(--rule-strong)}

/* Sheen follows the pointer via --mx/--my, set in app.js. Never switched on for
   touch or reduced motion. */
.card::before{content:"";position:absolute;inset:0;opacity:0;pointer-events:none;
  background:radial-gradient(300px circle at var(--mx,50%) var(--my,50%),
             color-mix(in srgb,var(--on-accent) 13%,transparent),transparent 60%);
  transition:opacity .35s}
.card:hover::before{opacity:1}

.card .body{flex:1 1 auto;min-width:0}
.card .t{display:block;font-size:17.5px;font-weight:400;color:var(--strong);
         letter-spacing:-.012em;line-height:1.25}
.card .n{display:block;font-size:13px;color:var(--faint);margin-top:4px;line-height:1.45}
.card .arw{flex:0 0 auto;width:16px;height:16px;color:var(--subtle);
           transition:transform .45s var(--spring),color .25s}
/* Colour is set by the hover block above; this rule only moves it. Setting colour
   here too would override that block, which is exactly how the arrow went
   near-black-on-near-black in light mode. */
.card:hover .arw{transform:translate(3px,-3px)}

/* The lead card is not filled — it just rests on a firmer border and slightly heavier
   title, so it reads first without shouting. Hierarchy is built from the accent alone;
   there is no second colour in this system. */
.card.primary{border-color:var(--rule)}
.card.primary .t{font-weight:500}

/* A single light sweep on hover — one pass, no loop, so it reads as a response to the
   pointer rather than an idle animation. */
.card::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(105deg,transparent 38%,
             color-mix(in srgb,var(--on-accent) 18%,transparent) 50%,transparent 62%);
  translate:-120% 0;transition:translate .85s var(--ease)}
.card:hover::after{translate:120% 0}

/* ── footer ──────────────────────────────────────────────────────────── */
.foot{position:relative;z-index:1;flex:0 0 auto;padding:0 20px 30px;text-align:center}
.fnav{display:flex;justify-content:center;gap:20px;flex-wrap:wrap}
.fnav a{font-family:var(--mono);font-size:9.5px;font-weight:500;letter-spacing:.2em;
        text-transform:uppercase;color:var(--subtle);text-decoration:none;
        transition:color .2s}
.fnav a:hover{color:var(--ink)}

/* ── entrance ────────────────────────────────────────────────────────────
   .r starts hidden ONLY once app.js adds .anim to <html>, so a failed script or a
   blocked module leaves every link plainly visible. A links page that hides its
   links because an animation did not fire is broken. */
.r{transition:opacity .6s var(--ease),transform .7s var(--spring);transition-delay:var(--d,0ms)}
.anim .r{opacity:0;transform:translateY(14px)}
.anim .r.in{opacity:1;transform:none}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
  .anim .r{opacity:1;transform:none}
  #field{opacity:1}
}
