// Per-project content: role/year/materials/tools, specs table,
// "What it taught me" + "The project" prose, and the "for nerds" dropdown.
// Merged onto PROJECTS at runtime by app.jsx.

const PROJECT_DETAILS = {
  // ---------- HELLDIVER (sponsor-classified, qualitative only) ----------
  helldiver: {
    classified: true,
    classifiedNote: 'Developed under a U.S. government sponsor. Specific values are withheld; qualitative phrasing is used in their place.',
    role: 'Lead designer + project coordinator',
    materials: 'Pressure housing + structural composites; planar deployable anode element',
    tools: 'SolidWorks, FEA, hand calcs, electrochemistry literature review',
    hideDrawing: false,
    specs: [
      { k: 'Mission',         v: ',', n: 'Extended-duration benthic deployment' },
      { k: 'Deployment',      v: ',', n: 'Standard underwater-vehicle launch tube' },
      { k: 'Power',           v: ',', n: 'Self-generated from sediment chemistry' },
      { k: 'Recovery',        v: ',', n: 'Passive, no mission power available' },
      { k: 'Failure mode',    v: ',', n: 'Sustained-load creep, not static yield' },
      { k: 'Sponsor',         v: ',', n: 'U.S. government, disclosure intentionally limited' },
    ],
    taught: [
      'Senior design put me inside a highly structured engineering process for the first time, formal requirements, a Preliminary Design Review, trade studies, decision matrices, a Critical Design Review, and a fabrication and test phase to follow. That cadence forced a different kind of discipline than ad-hoc project work: justifying decisions on paper before committing to them, and making the analysis the deliverable, not just the design.',
      'Working closely inside a four-person team for the duration of a real project taught me how engineering teams actually function, dividing subsystems, holding each other accountable to milestones, and pushing back on premature convergence so the team evaluates options instead of justifying a favored one.',
      'Working with a sponsor was its own lesson. Acknowledging their existing work, communicating progress on their cadence, and making sure decisions trace back to their requirements rather than ours, those are skills you only develop when there is an actual external stakeholder.',
      'On the technical side, the value was breadth rather than depth. I came in with engineering experience; what I gained was working knowledge of a domain that was new to me, benthic microbial fuel cells, the supporting electrochemistry literature, and the deep-sea environment they operate in. Reading and synthesizing primary research to inform a design decision is a skill I now use comfortably.',
    ],
    project: [
      'Helldiver is a deep-sea lander that sits on the seafloor for an extended-duration mission, generates its own power from sediment chemistry, and resurfaces on its own for recovery. It is designed to deploy from a standard underwater vehicle launch tube.',
      'My team is developing it as a successor to the sponsor\u2019s existing benthic microbial fuel cell platform \u2014 keeping the proven chemistry, redesigning the structure and deployment architecture around it.',
    ],
    nerds: {
      label: 'Information for nerds',
      paragraphs: [
        'The sponsor\u2019s existing platform is documented in \u201cPicoLander 1000 \u2014 Deep Sea Microbial Fuel Cell Lander: a Yardstick to Determine Power Potential\u201d (NIWC / SSC Pacific). It works, but the housing has had reliability issues over long missions, and the form factor is not tube-compatible. We kept the chemistry and iterated the rest.',
        'Lead designer and project coordinator. My areas: pressure vessel and structural analysis, the seafloor sealing mechanism (a rigid contact-cup impact seal replacing the original flexible-mat concept), buoyancy and recovery, and overall system integration.',
      ],
      bullets: [
        'Sustained-load creep \u2014 not static yield \u2014 is the binding failure mode for the housing, which selected the analysis approach and ruled out otherwise-attractive thermoplastics.',
        'Buoyancy and structural integrity are not independent: every component in the recovery load path is gated by density relative to seawater, which disqualifies materials that would otherwise be excellent structural choices.',
        'The deployment envelope drove anode geometry. Higher-output anode shapes do not pack into a launch tube, so the architecture forced a planar deployable element and constrained the seal mechanism around it.',
        'Recovery has to be passive \u2014 no mission power available \u2014 and has to survive a full mission of biofouling and corrosion before it actuates.',
      ],
    },
  },

  // ---------- ATLAS-C ----------
  'atlas-c': {
    role: 'Design / Build',
    materials: 'Carbon fiber spars, PLA, ultralight PLA',
    tools: 'SolidWorks, Bambu Slicer, Cura',
    specs: [
      { k: 'Wingspan',                  v: '1450 mm', n: 'Swept planform' },
      { k: 'MTOW',                      v: '5.20 kg', n: '' },
      { k: 'Cruise speed',              v: '22 m/s',  n: '@ 60% throttle' },
      { k: 'Build time',                v: '42 hr',   n: 'Printer + layup combined' },
      { k: 'Total cost',                v: '$67',     n: '' },
      { k: 'Control surface deflection',v: '±25°',    n: 'Compliant mechanism range' },
    ],
    taught: [
      'This project developed a working methodology for part-count reduction through compliant mechanism design, translating a multi-component control surface assembly into a single printable part.',
      'It built practical knowledge of 3D printing process variables (wall count, material selection, print orientation) and their structural consequences. In the aerospace context specifically, it introduced formal test procedures for failure characterization: defining maximum stress conditions, establishing cyclic load protocols, and identifying failure modes under repeated operational loading.',
    ],
    project: [
      'Atlas-C is a flying wing UAV designed around the constraint that the entire airframe should be manufacturable with desktop tools. The flying wing configuration concentrates structural load evenly across the span through carbon fiber spars, eliminating the complexity of a separate fuselage and tail assembly.',
      'Control surfaces are each a single printed part, a coiled compliant mechanism at the trailing edge that distributes bending forces across the spring geometry rather than concentrating them at a hinge point. Multi-material printing enabled a PLA outer shell over an ultralight PLA core, tuning stiffness and ductility within the same component for the specific demands of each wing section.',
    ],
    nerds: {
      label: 'Technical stuff for nerds',
      bullets: [
        'Compliant mechanism wall configuration: tested at 3-layer and 4-layer counts; 3-layer onset of cracking at ~29,000 cycles (~8 hr); 4-layer passed full 43,000-cycle protocol without failure.',
        'Cyclic test protocol: ±25° deflection at operational cadence, 12-hour continuous run.',
        'FEA scope: spring mechanism only; remainder of airframe below threshold loading conditions.',
        'Peak ESTRN (FEA): ~0.0148 at coil root, within ductile failure envelope of ultralight PLA.',
        'Ultralight PLA: significantly higher ductility and strain capacity than standard PLA; requires custom G-code and controlled print conditions due to expansion behavior during extrusion.',
        'Planned follow-on: advanced FEA cross-referencing with SDSU faculty; CFD study comparing aerodynamic efficiency of exposed compliant surface vs. covered surface.',
      ],
    },
  },

  // ---------- GUSTAV ----------
  gustav: {
    role: 'Design / Build',
    materials: 'PVC, plywood, resin-printed pulleys, V-slot aluminum rail, elastic bands',
    tools: 'SolidWorks, hand calculations (load/force)',
    specs: [
      { k: 'Launch speed',       v: '15–30 m/s', n: 'Configurable' },
      { k: 'Max elastic tension',v: '~250 lb',   n: 'At full draw' },
      { k: 'System weight',      v: '~35 lb',    n: '' },
      { k: 'Elastic bands',      v: '2–4',       n: 'Modular configuration' },
      { k: 'Transport sections', v: '2',         n: 'Field breakdown' },
      { k: 'Drawing scale',      v: '1:50',      n: 'Sheet 1 of 1' },
    ],
    taught: [
      'The project required designing a mechanical system around fixed operational constraints, no runway, no crew, no powered assist. Achieving consistent launch performance across variable band configurations demanded rigorous load analysis and deliberate simplicity in the carriage and release mechanism.',
      'It reinforced that mechanical reliability in field conditions is a design requirement, not a post-build concern.',
    ],
    project: [
      'Gustav was designed to solve a specific operational gap in Project ROSE: reliable aircraft launch without runway access. The system uses two to four elastic bands anchored at the rear of the rail and looped around a resin-printed pulley at the front. Drawing the carriage back to full tension and releasing accelerates the aircraft along V-slot aluminum rails to takeoff speed over a short distance.',
      'Band count is adjustable to match different aircraft weights and required launch velocities. The system breaks into two sections for transport and uses removable legs for level setup on uneven terrain. A rear compartment stores spare rollers and rail components for field maintenance.',
    ],
    nerds: {
      label: 'Technical stuff for nerds',
      bullets: [
        'Rail system: V-slot aluminum extrusion; carriage uses matching V-slot mounts on a plywood block.',
        'Pulleys: resin-printed; selected for dimensional precision and wear resistance over repeated cycles.',
        'Band configuration: 2–4 elastic bands in parallel; tension and launch velocity scale with band count.',
        'Max rated tension: ~250 lb at full draw.',
        'Release mechanism: passive, carriage arrested by aircraft lift-off, no active trigger required.',
        'System weight: ~35 lb; designed for single-operator transport and setup.',
        'DWG NO. 1 · Material: PVC · Scale 1:50 · Sheet 1 of 1.',
        'Planned upgrade: motorized winch for automated tensioning to eliminate manual loading from the bungee zone.',
      ],
    },
  },

  // ---------- LIFT KIT 3 ----------
  'lift-kit-3': {
    role: 'Design / Build',
    materials: 'Aluminum extrusions, PVC, force sensor, airspeed sensor, 3D-printed mounts',
    tools: 'SolidWorks, MATLAB',
    specs: [
      { k: 'Test speed range',  v: '0–15 m/s',  n: 'Vehicle-driven' },
      { k: 'Sensors',           v: '2',         n: 'Force + airspeed' },
      { k: 'Reference airfoil', v: 'CLARK Y',   n: 'Validation baseline' },
      { k: 'AOA',               v: 'Adjustable',n: 'Set manually between runs' },
      { k: 'Data sync method',  v: 'Custom MATLAB', n: 'Resampling for mismatched polling rates' },
      { k: 'Drawing scale',     v: '1:25',      n: 'Sheet 1 of 1' },
    ],
    taught: [
      'Developing the measurement system and the data pipeline without automated tooling required building every part of the information chain deliberately, sensor selection, mount design, synchronization logic, and coefficient extraction all had to be reasoned through from first principles.',
      'It developed a clear understanding of data integrity requirements: how sensor polling mismatches corrupt results, how mechanical noise propagates into lift readings, and how to validate outputs against known reference data before trusting the system.',
    ],
    project: [
      'Lift Kit 3 was built to generate lift coefficient data for the non-standard airfoil used in Project ROSE, without access to a wind tunnel. A balanced lever arm mounts the airfoil so that, at rest, the force sensor reads zero. As the vehicle moves and airflow generates lift, the lever rises and the sensor captures the load. An airspeed sensor co-located below the airfoil records velocity simultaneously.',
      'Angle of attack is fixed manually before each run and can be adjusted between passes to map behavior across multiple conditions. The full data pipeline, sensor synchronization, noise filtering, Cl computation, and validation against CLARK Y reference data, was written in MATLAB without automated assistance, requiring explicit handling of each processing step.',
    ],
    nerds: {
      label: 'Technical stuff for nerds',
      bullets: [
        'Lever geometry: balanced at zero airspeed; lift force measured as moment-arm deflection at force sensor.',
        'Force sensor placement: underside of airfoil lever end; measures net lift load at that attachment point.',
        'Airspeed sensor: mounted below airfoil, reads freestream velocity at test section.',
        'Sensor polling rates: mismatched between force and airspeed channels; MATLAB resampling script aligns time series before computation.',
        'Cl computation inputs: chord area, local air density, measured airspeed, set angle of attack.',
        'Validation method: computed Cl cross-referenced against published CLARK Y data at matching AOA and Reynolds-number range.',
        'Applicable to non-uniform or cambered airfoils where analytic Cl estimation is unreliable.',
      ],
    },
  },

  // ---------- MAXWELL ----------
  maxwell: {
    role: 'Design / Build',
    materials: 'MDF (laser-cut), PVC economy cone (intake), acrylic (viewing chamber), 3D-printed airfoil',
    tools: 'SolidWorks, laser cutter',
    specs: [
      { k: 'Target airspeed',     v: '15 m/s',          n: 'Viewing chamber' },
      { k: 'Intake cross-section',v: '439 mm',          n: 'Entry area' },
      { k: 'Viewing chamber',     v: '170 mm',          n: 'Test section' },
      { k: 'Exit cross-section',  v: '243 mm',          n: 'Diffuser' },
      { k: 'Total weight',        v: '~25 lb (11.3 kg)',n: '' },
      { k: 'Drawing scale',       v: '1:20',            n: 'Sheet 1 of 1' },
    ],
    taught: [
      'The project demonstrated how much engineering is required to communicate a concept clearly to a non-technical audience. Designing an educational tool imposes a different kind of constraint, the physics has to be immediately visible and intuitive, not just technically correct.',
      'Despite being one of the more logistically straightforward builds, it was completed under significant time pressure, which made the flow geometry decisions and fabrication sequencing far more demanding than the scope suggested.',
    ],
    project: [
      'Maxwell is a low-speed wind tunnel built specifically for classroom demonstration of lift. The intake uses a PVC economy cone to establish a smooth, controlled entry flow, feeding into a laser-cut MDF outer structure. A PVC tube honeycomb at the inlet removes swirl and large-scale turbulence before the air reaches the acrylic test section.',
      'The cubic inlet curve transitions velocity gradually from the wide intake to the narrow viewing chamber without sudden pressure drops. A smoke generator upstream of the test section produces visible streamlines around the interchangeable 3D-printed airfoil. The full system was designed and fabricated in approximately three days.',
    ],
    nerds: {
      label: 'Technical stuff for nerds',
      bullets: [
        'Inlet geometry: PVC economy cone; cubic curve profile selected to minimize velocity discontinuity at cross-section transition.',
        'Flow straightener: PVC tube honeycomb, reduces swirl and dissipates large-scale eddies entering test section.',
        'Cross-section sequence (mm): 439 → 170 → 243 (intake → test section → diffuser exit).',
        'Test section: acrylic construction for unobstructed 360° visual access.',
        'Target flow regime at test section: laminar, required for coherent smoke visualization.',
        'Airfoil: 3D printed, interchangeable; multiple profiles compatible with the test section mount.',
        'Fan: industrial, sized to achieve 15 m/s at the test section given the duct area ratios.',
        'Build duration: ~3 days concept through completed assembly.',
      ],
    },
  },

  // ---------- DRONE (NMPC, simulation only) ----------
  drone: {
    role: 'Researcher / developer',
    materials: 'N/A (simulation / software)',
    tools: 'Python, ROS, Gazebo, RotorS, CasADi, IPOPT',
    hideDrawing: true,
    specs: [
      { k: 'Control loop rate',    v: '100 Hz',          n: 'NMPC solver + GP node via ROS' },
      { k: 'Simulation fidelity',  v: '6-DOF',           n: 'Full rigid body + aero drag + rotor wake' },
      { k: 'GP training source',   v: 'Flight residuals',n: 'Offline pre-training, online updates' },
      { k: 'Velocity trigger',     v: 'vmin threshold',  n: 'GP tightening inactive below threshold' },
      { k: 'Solver stack',         v: 'CasADi + IPOPT',  n: 'NLP at every step' },
      { k: 'Affiliation',          v: 'SDSU ME Dept.',   n: 'Active research project' },
    ],
    taught: [
      "The gap between a physics model and a real system isn't a failure of the model, it's information. This project is built on that idea: instead of ignoring the gap or padding every constraint by worst-case assumption, you learn the shape of the error and use it directly.",
      'That shift in framing, from "error is noise" to "error is signal", changed how I think about modeling in general.',
    ],
    project: [
      "At high velocity, a quadrotor's aerodynamic behavior diverges from the first-principles rigid-body model that most flight controllers rely on. Drag, rotor wash, and induced airflow effects grow non-linearly, causing the vehicle to end up somewhere different from where the controller expected.",
      "This project addresses that by running a Gaussian Process model in a background thread, continuously updating its estimate of where the nominal model is wrong and by how much. That uncertainty estimate feeds directly into the NMPC solver's constraint set: when the GP says errors are likely to be large, the safety boundaries tighten; when flight is predictable, they relax. A velocity trigger gates the whole system so the overhead only activates when the drone is actually moving fast enough for aerodynamic effects to matter.",
    ],
    nerds: {
      label: 'Technical stuff for nerds',
      bullets: [
        'Framework: GP-augmented NMPC with adaptive constraint tightening (extends Dincer et al. 2024 from linear to nonlinear systems).',
        'Constraint tightening term: Δ(v), computed from GP posterior variance, velocity-dependent.',
        'Velocity trigger logic: GP update and constraint shrinkage only active above vmin; solver latency minimized at low speed.',
        'ROS pipeline: NMPC solver node + GP residual learner node, communicating over topics at 100 Hz.',
        'Simulation: Gazebo + RotorS multi-rotor plugin, 6-DOF dynamics, aerodynamic drag, rotor wake modeled.',
        'Solver: CasADi + IPOPT.',
        'Evaluation metrics: constraint satisfaction rate + tracking RMSE vs. baseline NMPC (varying aggressiveness levels).',
        'GP training: offline from logged simulation flight residuals, then loaded for closed-loop testing.',
      ],
    },
  },

  // ---------- GAMBIT ----------
  gambit: {
    role: 'Contributor (non-lead), software integration',
    materials: 'UR10 cobot (used / out-of-date unit), aluminum extrusions, custom gripper, vision rig',
    tools: 'Python, chess.com API, ROS, OpenCV',
    specs: [
      { k: 'Arm',           v: 'UR10',                n: 'Sourced used from Dexterity (Northern California)' },
      { k: 'Move input',    v: 'NFC or QR codes',     n: 'Player-facing input method' },
      { k: 'Base material', v: 'Aluminum extrusions', n: 'Frame and board fixturing' },
      { k: 'Software',      v: 'Python',              n: 'Integration glue around UR10 + chess.com' },
      { k: 'Build time',    v: '~5 months',           n: 'Acquisition + reverse-engineering + integration' },
    ],
    taught: [
      "Gambit was the first Engineering Club project where I didn\u2019t take a leadership role. It marked the start of the handoff at the end of my time as club president \u2014 less about driving the project and more about following, listening, and learning.",
      "I didn\u2019t know much software at that point. Being surrounded by people who knew more than I did, on a project I wasn\u2019t running, is where most of the learning happened. The technical content matters less in retrospect than the change in posture.",
      "The single biggest challenge was simply acquiring the arm \u2014 a used UR10 that Dexterity in Northern California was retiring as they moved to a newer series. We had to take it apart, figure out the firmware and the hardware stack it was running, and work out how to drive it from Python. It was a technical nightmare and very much not built for hobbyists or students, which was most of the lesson.",
    ],
    project: [
      "Gambit is a chess-playing robotic arm built around a used UR10 cobot. The system wraps the UR10\u2019s existing controller in a Python integration layer, which in turn talks to a chess.com bot that handles the actual chess engine.",
      "The play loop is image-driven: the system takes a photo of the board, the human player makes their move, the system takes a second photo, diffs the two to identify which piece moved, hands that move to the chess.com algorithm, and receives the next move back as a command sequence that drives the arm to pick up and place the responding piece. Player input is handled either by NFC or by QR codes on the pieces.",
    ],
  },
};

// Expose to other Babel scripts
window.PROJECT_DETAILS = PROJECT_DETAILS;
