// /about · /papers · /404

const STACK = ['VHDL', 'Verilog', 'Vivado', 'Libero', 'OrCAD', 'C', 'Python', 'PyTorch', 'TF', 'Modelsim', 'STA'];

// ─── /about ─────────────────────────────────────────────
function AboutPage() {
  return (
    <div className="page wide" data-page="about">
      <h1 className="page-title">About</h1>
      {UPDATED['/about/'] && <p className="meta-line">Updated <time dateTime={UPDATED['/about/']}>{UPDATED['/about/']}</time></p>}

      <div className="about-grid">
        <div className="prose">
          <p>
            My first blog, in 2013, was science experiments you could try at home, like invisible ink and a car that runs on a balloon. A few years later I started one on the history of flight. It got from Daedalus to the Wright brothers, promised modern aircraft “from my next post”, and stopped there xD
          </p>
          <p>
            Flight stuck with me, though, and took me to IIST, the Indian Institute of Space Science and Technology, on a Department of Space scholarship. Somewhere along the way I fell for machine learning too. In 2020 I spent a <a href="/experience/polaris/">Google Summer of Code</a> with Libre Space Foundation building anomaly detection for cubesat telemetry, and kept helping out the year after. In 2021 a Mitacs Globalink internship with Polytechnique Montréal had me <a href="/experience/iprune/">pruning binary neural networks</a> until each neuron fit in an FPGA lookup table, and I kept working with Jean-Pierre David for my <a href="/experience/bnn-explain/">B.Tech thesis</a>, on the explainability and pruning of binary networks.
          </p>
          <p>
            After graduating I joined ISRO’s U R Rao Satellite Centre and spent three years on flight hardware. The piece I’m proudest of is the <a href="/experience/spadex-counter/">SPADEX motor drive</a>. I inherited an FPGA design that needed more than 140% of its chip, got it under 95% while adding what it was missing, and then watched SPADEX dock in January 2025 :D Much of the rest was lab time, debugging around thirty engineering and flight model boards across five missions, usually with a hand on my forehead wondering why something that was supposed to work didn’t.
          </p>
          <p>
            Since November 2025 I’ve been at <a href="/experience/kaleideo/">KaleidEO</a>, designing the FPGA side of an Earth-observation payload, from how the sensor data comes in to how it gets compressed and stored.
          </p>
          <p>
            The binary networks never quite let go of me, so I’ve picked that work up again <a href="/experience/independent/">on my own</a>. This time the question is how small a network can get on an FPGA before radiation upsets cost more than the logic it saves.
          </p>
          <p>
            I want to write here a lot more often, mostly about things that broke in interesting ways and how we worked out why. This time I’ll try to get to the next post :)
          </p>
        </div>

        <aside>
          <div className="side-block">
            <h2 className="side-title">Contact</h2>
            <ul className="side-list">
              <li><a className="link-accent" href={`mailto:${CONTACT.email}`}>{CONTACT.email}</a></li>
              <li><a className="link-accent" href={`https://github.com/${CONTACT.github}`} target="_blank" rel="noopener">GitHub</a></li>
              <li><a className="link-accent" href={`https://gitlab.com/${CONTACT.gitlab}`} target="_blank" rel="noopener">GitLab</a></li>
              <li><a className="link-accent" href={`https://linkedin.com/in/${CONTACT.linkedin}`} target="_blank" rel="noopener">LinkedIn</a></li>
            </ul>
          </div>

          <div className="side-block">
            <h2 className="side-title">Documents</h2>
            <ul className="side-list">
              <li><a className="link-accent" href="/Adithya-Venkateswaran-CV.pdf">CV (PDF)</a></li>
              <li><a className="link-accent" href="/papers/">Publications</a></li>
            </ul>
          </div>

          <div className="side-block">
            <h2 className="side-title">Tools</h2>
            <p className="side-text">{STACK.join(', ')}</p>
          </div>

          <div className="side-block">
            <h2 className="side-title">Location</h2>
            <p className="side-text">{CONTACT.location}</p>
          </div>

          <div className="dev-only dev-box">
            <span className="kicker">[dev] you found this — well done</span>
            <p>There are three eggs in total. You found <code>sudo</code>. Two left.</p>
          </div>
        </aside>
      </div>
    </div>
  );
}

// ─── /papers ────────────────────────────────────────────
function PapersPage() {
  return (
    <div className="page" data-page="papers">
      <h1 className="page-title">Papers</h1>
      <ul className="dated" style={{ marginTop: 32 }}>
        {PAPERS.map((p, i) => (
          <li key={i}>
            <span className="date">{p.year}</span>
            <span>
              {p.title}
              {p.summary && <span className="paper-summary">{p.summary}</span>}
              <span className="sub">
                {p.venue}
                {p.href && <> · <a className="link-accent" href={p.href} target="_blank" rel="noopener">{p.linkLabel} ↗</a></>}
              </span>
            </span>
          </li>
        ))}
      </ul>
    </div>
  );
}

// ─── /404 with countdown ────────────────────────────────
function NotFoundPage({ route }) {
  const [n, setN] = React.useState(10);
  React.useEffect(() => {
    const id = setInterval(() => setN((x) => x - 1), 1000);
    return () => clearInterval(id);
  }, []);
  React.useEffect(() => {
    if (n <= 0) go('/');
  }, [n]);

  return (
    <div className="page notfound" data-page="404">
      <h1 className="page-title">Signal lost.</h1>
      <p className="lede">
        You asked for <code>{route.path}</code> but I&rsquo;m not transmitting on that channel.
        Returning home in <strong style={{ color: 'var(--sk-accent)' }}>{n}</strong>…
      </p>

      <pre>{
`        .
        |
       /|\\
      / | \\
     /__|__\\
    |   |   |
    |   |   |
    '---+---'
        |
        |       ~ signal ~
        |             ~       ~
        |        ~`
}</pre>

      <p style={{ marginTop: 24 }}>
        <a className="link-accent" href="/">Go home now</a>
      </p>
    </div>
  );
}

Object.assign(window, { AboutPage, PapersPage, NotFoundPage });
