/*
  Example build input for IRON/OS. Copy this file to the user's folder as
  build-input.js, replace every value with the real programme, then run:

    node <skill folder>/scripts/build.js build-input.js

  A small three day full body programme for "Sam": home gym with dumbbells and a
  pull up bar, sore left knee, currently maintaining.
*/

/* ---------- App config ---------- */
const APP = {
  name: 'IRON/OS',
  brandSplit: ['IRON', 'OS'],
  defaultMode: 'maintenance',        // 'deficit' | 'maintenance' | 'surplus'
  phaseStart: '2026-08-24',          // '' when they do not run phases
  watchLabel: 'Knee watch',
  watchPrompt: 'How is the knee today? The next-day response is the signal that matters.',
  showWatchBanner: true,             // false when the intake found no injuries
  excluded: ['jump-squat', 'pistol-squat', 'skater-hop'],
  nutrition: null,                   // or { kcal, protein, plan:'sam-meal-plan.html', note }
  cloudSync: false,                  // leave false unless they asked for it
  configVersion: 1                   // increase by one on every rebuild
};

/* ---------- Exercise library ----------
   Keys are the ids used in PROGRAM. Use the exercise-index slug as the id so the
   artwork is found automatically; use "art" to point a custom id at a slug.
   muscle: one of the index headings (Chest, Back, Lats, Upper Back, Rear Delts,
   Shoulders, Biceps, Triceps, Forearms, Quads, Hamstrings, Glutes, Calves,
   Adductors, Hips, Legs, Posterior Chain, Lower Back, Core, Mobility).
   sec: the "Also works" column from the index. Required.
   log: 'weight_reps' (default) | 'reps' | 'time' | 'assisted'. The script fills
   it from the index when the id is an index slug. */
const LIB = {
  'goblet-squat': {
    name: 'Goblet Squat', equip: 'Dumbbell', muscle: 'Quads', sec: ['Glutes', 'Core'],
    anchor: true, watch: true,
    sets: { deficit: 2, maintenance: 3, surplus: 4 }, reps: '6-8', rpe: 'RPE 8', rest: 150,
    start: 16, step: 2,
    tech: ['Hold the bell against your chest, elbows under it.',
      'Sit between your heels, knees tracking over the toes.',
      'Stop the depth where the knee stays quiet.',
      'Drive the whole foot into the floor to stand.']
  },
  'push-up': {
    name: 'Push-up', equip: 'Bodyweight', muscle: 'Chest', sec: ['Triceps', 'Core'],
    sets: { deficit: 2, maintenance: 3, surplus: 4 }, reps: '10-15', rpe: '2 RIR', rest: 90,
    start: 0, step: 0,
    tech: ['Hands just outside the shoulders.', 'Body in one line, glutes tight.', 'Chest to the floor, elbows about 45 degrees.']
  },
  'one-arm-dumbbell-row': {
    name: 'One Arm Dumbbell Row', equip: 'Dumbbell', muscle: 'Back', sec: ['Biceps', 'Rear Delts'],
    anchor: true,
    sets: { deficit: 2, maintenance: 3, surplus: 4 }, reps: '8-12', rpe: '2 RIR', rest: 90,
    start: 20, step: 2,
    tech: ['Flat back, free hand on the bench.', 'Pull the elbow to the hip.', 'Full stretch at the bottom, no twisting.']
  },
  'plank': {
    name: 'Plank', equip: 'Bodyweight', muscle: 'Core', sec: ['Shoulders', 'Glutes'],
    sets: { deficit: 2, maintenance: 3, surplus: 3 }, reps: '45 s', rpe: '', rest: 60,
    start: 0, step: 0,
    tech: ['Elbows under the shoulders.', 'Squeeze glutes, tuck the ribs.', 'Stop when the hips sag.']
  },
  'dumbbell-bench-press': {
    name: 'Dumbbell Bench Press', equip: 'Dumbbell', muscle: 'Chest', sec: ['Triceps', 'Shoulders'],
    anchor: true,
    sets: { deficit: 2, maintenance: 3, surplus: 4 }, reps: '6-8', rpe: 'RPE 8', rest: 150,
    start: 18, step: 2,
    tech: ['Shoulder blades pinned to the bench.', 'Lower to the outer chest.', 'Press up and slightly in.']
  },
  'glute-bridge': {
    name: 'Glute Bridge', equip: 'Bodyweight', muscle: 'Glutes', sec: ['Hamstrings', 'Core'],
    sets: { deficit: 2, maintenance: 3, surplus: 3 }, reps: '12-15', rpe: '2 RIR', rest: 60,
    start: 0, step: 0,
    tech: ['Heels close to the hips.', 'Drive through the heels, squeeze at the top.', 'Ribs down, no arching.']
  },
  'inverted-row': {
    name: 'Inverted Row', equip: 'Bodyweight', muscle: 'Back', sec: ['Biceps', 'Rear Delts', 'Core'],
    sets: { deficit: 2, maintenance: 3, surplus: 4 }, reps: '8-12', rpe: '2 RIR', rest: 90,
    start: 0, step: 0,
    tech: ['Body straight from heels to head.', 'Pull the chest to the bar.', 'Lower slowly, arms fully long.']
  },
  'bicycle-crunch': {
    name: 'Bicycle Crunch', equip: 'Bodyweight', muscle: 'Core', sec: [],
    sets: { deficit: 2, maintenance: 2, surplus: 3 }, reps: '20', rpe: '', rest: 60,
    start: 0, step: 0,
    tech: ['Lower back pressed into the floor.', 'Rotate from the ribs, not the neck.']
  },
  'bulgarian-split-squat': {
    name: 'Bulgarian Split Squat', equip: 'Dumbbell', muscle: 'Quads', sec: ['Glutes', 'Hamstrings'],
    watch: true,
    sets: { deficit: 2, maintenance: 3, surplus: 3 }, reps: '8-10', rpe: '2 RIR', rest: 90,
    start: 10, step: 2,
    tech: ['Rear foot laces down on the bench.', 'Front shin stays close to vertical.', 'Only as deep as the knee allows.']
  },
  'standing-dumbbell-press': {
    name: 'Standing Dumbbell Press', equip: 'Dumbbell', muscle: 'Shoulders', sec: ['Triceps', 'Core'],
    anchor: true,
    sets: { deficit: 2, maintenance: 3, surplus: 4 }, reps: '6-8', rpe: 'RPE 8', rest: 150,
    start: 12, step: 2,
    tech: ['Glutes tight, ribs down.', 'Press to lockout over the ears.', 'Lower to chin height under control.']
  },
  'dumbbell-bent-over-row': {
    name: 'Dumbbell Bent Over Row', equip: 'Dumbbell', muscle: 'Back', sec: ['Biceps', 'Rear Delts'],
    sets: { deficit: 2, maintenance: 3, surplus: 3 }, reps: '8-12', rpe: '2 RIR', rest: 90,
    start: 18, step: 2,
    tech: ['Hinge to about 45 degrees, back flat.', 'Row to the hips, elbows close.', 'No swing.']
  },
  'bicep-curl': {
    name: 'Bicep Curl', equip: 'Dumbbell', muscle: 'Biceps', sec: ['Forearms'],
    sets: { deficit: 1, maintenance: 2, surplus: 3 }, reps: '10-12', rpe: '2 RIR', rest: 60,
    start: 8, step: 1,
    tech: ['Elbows pinned to the sides.', 'Full range, no swing.', 'Two seconds down.']
  }
};

/* ---------- Programme ----------
   One entry per training day, ids 1..n in order. Slots run in session order:
   anchor first, then the second compound, then accessories. */
const PROGRAM = [
  { id: 1, name: 'Full Body A', focus: 'Squat + push', slots: ['goblet-squat', 'push-up', 'one-arm-dumbbell-row', 'plank'] },
  { id: 2, name: 'Full Body B', focus: 'Press + hinge', slots: ['dumbbell-bench-press', 'glute-bridge', 'inverted-row', 'bicycle-crunch'] },
  { id: 3, name: 'Full Body C', focus: 'Single leg + pull', slots: ['bulgarian-split-squat', 'standing-dumbbell-press', 'dumbbell-bent-over-row', 'bicep-curl'] }
];

module.exports = {
  APP: APP,
  LIB: LIB,
  PROGRAM: PROGRAM,
  accent: 'brass',                   // 'brass' | 'red' | 'ice' | 'green' | { accent:'#..', hi:'#..', on:'#..' }
  out: 'sam-iron-os.html'            // written next to this file
};
