/* global window */

/*
 * TAGS — the canonical taxonomy for every entry/sketch/letter.
 * Each tag is a leather-bound book on the Goat Notes shelf.
 * Order here is the order on the shelf.
 *
 * Colors are quiet leather tones — never pure or saturated.
 */
const TAGS = [
  { id: "adventure",        label: "Adventure",         leather: "#7a3a2a", spine: "saddle"     },
  { id: "the-road",         label: "The Road",          leather: "#4f3a25", spine: "earth"      },
  { id: "the-fire",         label: "The Fire",          leather: "#6e2e1f", spine: "ember"      },
  { id: "the-quiet",        label: "The Quiet",         leather: "#3a3527", spine: "olive"      },
  { id: "field-stories",    label: "The Field Stories", leather: "#5a3823", spine: "burgundy"   },
  { id: "family",           label: "Family",            leather: "#4a3422", spine: "cinnamon"   },
  { id: "fatherhood",       label: "Fatherhood",        leather: "#3e2a1f", spine: "ox-blood"   },
  { id: "friendship",       label: "Friendship",        leather: "#7d5a36", spine: "tobacco"    },
  { id: "the-herd",         label: "The Herd",          leather: "#6b4a2c", spine: "honey"      },
  { id: "weather",          label: "Weather",           leather: "#3d4347", spine: "slate"      },
  { id: "maps",             label: "Maps",              leather: "#3c4a3e", spine: "fern"       },
  { id: "hard-places",      label: "Hard Places",       leather: "#2c2620", spine: "shadow"     },
  { id: "beautiful-places", label: "Beautiful Places",  leather: "#6b4f3c", spine: "rose"       },
  { id: "quiet-mornings",   label: "Quiet Mornings",    leather: "#8a6a3e", spine: "honey"      },
  { id: "late-nights",      label: "Late Nights",       leather: "#23262b", spine: "ink"        },
  { id: "long-days",        label: "Long Days",         leather: "#5a4128", spine: "tan"        },
  { id: "the-west",         label: "The West",          leather: "#7a4a2a", spine: "saddle"     },
  { id: "water",            label: "Water",             leather: "#2f4248", spine: "deep-slate" },
  { id: "mountains",        label: "Mountains",         leather: "#3f4438", spine: "moss"       },
  { id: "desert",           label: "Desert",            leather: "#8a5a3b", spine: "clay"       },
  { id: "trees",            label: "Trees",             leather: "#3a4632", spine: "pine"       },
  { id: "the-coast",        label: "The Coast",         leather: "#4a5560", spine: "fog"        },
  { id: "gear",             label: "Gear",              leather: "#5d4330", spine: "rust"       },
  { id: "cool-stuff",       label: "Cool Stuff",        leather: "#6b3f2a", spine: "russet"     },
  { id: "work",             label: "Work",              leather: "#332a1e", spine: "umber"      },
  { id: "life",             label: "Life",              leather: "#735540", spine: "warm-tan"   },
  { id: "lessons",          label: "Lessons",           leather: "#403322", spine: "dark-earth" },
  { id: "homeward",         label: "Homeward",          leather: "#7d4a30", spine: "amber"      },
  { id: "camp-life",        label: "Camp Life",         leather: "#5a3c28", spine: "campfire"   },
  { id: "work-and-grit",    label: "Work & Grit",       leather: "#2a2a30", spine: "iron"       }
];

/*
 * PROMPTS — daily writing prompts. The desk picks one per day deterministically;
 * the user can refresh to draw a new one any time.
 */
const PROMPTS = [
  "Where were you the last time the signal dropped — and what did you do with the silence?",
  "Name one road you keep meaning to drive. What's stopping you?",
  "Tell me about the third log on a fire you remember.",
  "Who do you call when the truck won't start?",
  "When was the last time the plan fell apart — and what got better because of it?",
  "What's the kettle, the boots, the thing you keep using because it works?",
  "Write about a quiet morning that taught you something the loud ones didn't.",
  "Describe the sky on the day everything changed.",
  "What did your father know how to fix that you don't?",
  "Tell me about a stranger who turned into a story.",
  "Where do you go when you need to remember who you are?",
  "Write down the smell of a place you miss.",
  "What is the longest you have ever sat still on purpose?",
  "Who taught you to drive a back road?",
  "Tell me about a fire you almost let go out — and what happened when you didn't.",
  "What did you learn the year you stopped trying to keep up?",
  "Describe the hour just before sunrise without using the word 'quiet'.",
  "What did the storm leave behind that you needed?",
  "Write about a meal eaten standing up, somewhere you weren't supposed to be.",
  "Who is the friend you'd call from a payphone?",
  "Tell me about a time the radio cut out and the song in your head took over.",
  "What's the most honest conversation you've ever had outside?",
  "Describe a road you've never finished.",
  "Write about a tool that has outlived an opinion you used to hold.",
  "What did your kid notice that you walked right past?",
  "Tell me about the last thing you did that nobody saw.",
  "What is worth driving four hours for, and back the same day?",
  "Describe the feeling of an empty highway at 4:47 AM.",
  "Who is the goat in your life — the lonesome one, the one who walks off?",
  "What have you stopped explaining to people, and why?",
  "Write about a place that is better when no one is talking.",
];

/* dayKey + index → deterministic daily pick */
function dailyPromptIndex(offset = 0) {
  const d = new Date();
  const seed = d.getFullYear() * 372 + d.getMonth() * 31 + d.getDate();
  return (seed + offset) % PROMPTS.length;
}

const NOTES = [
  {
    id: "marfa-storm",
    no: "№ 014",
    title: "The Storm Found Us First",
    date: "October 12, 2025",
    location: "Marfa, TX",
    coords: "30.3094° N, 104.0203° W",
    weather: "Wind 38 mph · Sky black",
    wordCount: 1284,
    category: "Field Log",
    tags: ["weather", "gear", "the-road", "adventure", "hard-places"],
    excerpt: "We were chasing a sunset and got a wall of hail instead. The truck took the worst of it. The story took the best.",
    photoCaption: "the storm rolling in over Pinto Canyon",
    sketchCaption: "wind direction · estimated"
  },
  {
    id: "father-son-big-bend",
    no: "№ 013",
    title: "Three Days, No Signal",
    date: "September 28, 2025",
    location: "Big Bend, TX",
    coords: "29.2498° N, 103.2502° W",
    weather: "Clear · 88°F",
    wordCount: 962,
    category: "Father / Son",
    tags: ["fatherhood", "family", "the-road", "the-fire", "the-quiet", "camp-life"],
    excerpt: "My boy is twelve. He didn't ask once about his phone. By the second night he was reading the stars like the rest of the world had finally quieted down.",
    photoCaption: "boots, biscuits, and the fire at hour two",
    sketchCaption: "Rio Grande oxbow · pencil"
  },
  {
    id: "old-truck",
    no: "№ 012",
    title: "On Coaxing a 1978 Ford",
    date: "September 6, 2025",
    location: "Alpine, TX",
    coords: "30.3585° N, 103.6610° W",
    weather: "Hot · still",
    wordCount: 1124,
    category: "Local Legend",
    tags: ["gear", "hard-places", "field-stories", "friendship", "work-and-grit"],
    excerpt: "Mr. Esquivel has been keeping this truck alive since the Carter administration. He doesn't trust the new ones. He may have a point.",
    photoCaption: "the old F-100 in his shop",
    sketchCaption: "carburetor · field diagram"
  },
  {
    id: "campfire-rules",
    no: "№ 011",
    title: "The Unwritten Rules of a Good Fire",
    date: "August 19, 2025",
    location: "Davis Mountains, TX",
    coords: "30.6049° N, 103.9120° W",
    weather: "Cool · 62°F",
    wordCount: 743,
    category: "Field Notes",
    tags: ["the-fire", "friendship", "field-stories", "late-nights", "camp-life"],
    excerpt: "First rule: never poke a fire someone else built. Second rule: the truth comes out around the third log.",
    photoCaption: "midnight, third log on",
    sketchCaption: "fire ring layout"
  },
  {
    id: "morning-coffee",
    no: "№ 010",
    title: "Coffee Before the Horizon",
    date: "August 2, 2025",
    location: "Terlingua, TX",
    coords: "29.3211° N, 103.6173° W",
    weather: "Cold pre-dawn",
    wordCount: 412,
    category: "Quiet Morning",
    tags: ["quiet-mornings", "the-quiet", "beautiful-places", "the-west"],
    excerpt: "The kettle is older than I am. It hisses the same way every morning. I think that's why I keep using it.",
    photoCaption: "5:48 AM · before the world wakes",
    sketchCaption: "the kettle · contour"
  },
  {
    id: "dirt-road-map",
    no: "№ 009",
    title: "A Map of Roads That Aren't on the Map",
    date: "July 14, 2025",
    location: "Presidio County, TX",
    coords: "29.5630° N, 104.3727° W",
    weather: "Hot · dry · 101°F",
    wordCount: 1572,
    category: "Maps",
    tags: ["maps", "the-road", "adventure", "beautiful-places", "desert"],
    excerpt: "Every county has roads the GPS forgets. They have names if you ask the right people. They go somewhere worth getting to.",
    photoCaption: "Pinto Canyon Rd · mile 11",
    sketchCaption: "back-route sketch · not to scale"
  }
];

const MANIFESTO = [
  { t: "People are more connected than ever, and somehow more lost." },
  { t: "We know exactly where we are." },
  { t: "We have maps in our pockets, satellites above us, calendars full of meetings, messages, alerts, feeds, and noise." },
  { t: "We can see everything." },
  { t: "And somehow, we see almost nothing at all.", em: true },
  { t: "Something has gone missing." },
  { t: "Adventure has been replaced by convenience." },
  { t: "Silence has been replaced by scrolling." },
  { t: "Friendship has been replaced by following." },
  { t: "Stories have been replaced by content." },
  { t: "The open road has been replaced by optimized routes." },
  { t: "We do not need more noise." },
  { t: "We do not need more things pretending to matter." },
  { t: "We need more real life.", em: true },
  { t: "More stillness." },
  { t: "More silence." },
  { t: "More dirt roads." },
  { t: "More long drives with no hurry." },
  { t: "More campfires that make people talk honestly." },
  { t: "More storms rolling over the desert." },
  { t: "More mornings where the only thing on the calendar is coffee and the horizon." },
  { t: "We need more adventure.", em: true },
  { t: "Not the polished kind." },
  { t: "Not the algorithm kind." },
  { t: "The real kind." },
  { t: "The kind where the truck barely starts." },
  { t: "The road washes out." },
  { t: "The sky turns black." },
  { t: "The hail comes sideways." },
  { t: "The plan falls apart." },
  { t: "And somehow, by the end of the day, you have a better story than the one you set out to make." },
  { t: "That is the kind of life we still believe in.", em: true },
  { t: "Lonesome Goat exists for the ones who feel it too." },
  { t: "The ones who are tired of shallow connection and soft living." },
  { t: "The ones who know comfort is not the same thing as peace." },
  { t: "The ones who still believe there is something sacred in open country, honest work, old friends, hard roads, quiet places, and stories earned the long way." },
  { t: "To be lonesome is not to be alone.", em: true },
  { t: "It is to step away from the noise long enough to hear what is true." },
  { t: "It is to remember who you are without the crowd telling you." },
  { t: "It is to choose the road that still asks something of you." },
  { t: "We believe solitude makes a person stronger." },
  { t: "We believe adventure makes a person more alive." },
  { t: "We believe real friendship is built shoulder to shoulder, not screen to screen." },
  { t: "We believe the best stories usually begin when things do not go according to plan." },
  { t: "We believe people need to be more lonesome.", em: true },
  { t: "More still." },
  { t: "More silent." },
  { t: "More bold." },
  { t: "More bonded." },
  { t: "More adventurous." },
  { t: "More connected to the earth and to each other in a real way." },
  { t: "That is why this needs to exist." },
  { t: "Not as another clothing brand." },
  { t: "Not as another lifestyle label." },
  { t: "Not as another thing to buy." },
  { t: "Lonesome Goat is a signal.", em: true },
  { t: "A mark for people who still want to live a life with some grit in it." },
  { t: "A reminder to get outside, take the long way, gather around the fire, tell the truth, and go find the story worth bringing home." },
  { t: "The goods matter because they carry the mark." },
  { t: "The trips matter because they create the story." },
  { t: "The community matters because the road is better with the right people." },
  { t: "This is for the long haul.", em: true },
  { t: "For West Texas evenings and first stars." },
  { t: "For trucks covered in dust." },
  { t: "For coffee before sunrise." },
  { t: "For whiskey after the storm." },
  { t: "For old roads, new friends, and the quiet confidence that comes from doing hard things together." },
  { t: "The world does not need more noise." },
  { t: "It needs more people willing to leave it behind for a while.", em: true },
  { t: "Stay Lonesome.", em: true, big: true }
];

Object.assign(window, { NOTES, MANIFESTO, TAGS, PROMPTS, dailyPromptIndex });
