// Seed data and i18n strings for the portfolio site
// All seeded from the resume (선민정 / WENTING)

const I18N = {
  ko: {
    // Gate
    gate_title: "PORTFOLIO",
    gate_subtitle: "비밀번호를 입력해 주세요",
    gate_placeholder: "PASSWORD",
    gate_enter: "입장하기",
    gate_error: "비밀번호가 일치하지 않습니다",
    gate_hint: "Minjung Sun · Designer & Developer",
    // Hero
    hero_intro: "안녕하세요,",
    hero_name: "선민정 입니다.",
    hero_role: "Designer × Developer",
    hero_tagline_1: "디자인부터 퍼블리싱, AI 기반 구현까지",
    hero_tagline_2: "빠르게 연결하는 올라운드 디자이너.",
    hero_yrs: "년차",
    hero_yrs_label: "Years of experience",
    hero_projects: "프로젝트",
    hero_projects_label: "Selected works",
    hero_tools: "툴 / 스킬",
    hero_tools_label: "Tools & stacks",
    // Header
    nav_works: "Works",
    nav_about: "About",
    nav_contact: "Contact",
    admin_off: "관리자",
    admin_on: "관리자 ON",
    // Filters
    all: "전체",
    category_web: "Web / App",
    category_sns: "SNS / Card News",
    category_graphic: "Graphic",
    category_dev: "Publishing / Dev",
    category_character: "Character / Illust",
    category_product: "Product / Fashion",
    // Grid
    works_title: "Selected Works",
    works_subtitle: "지금까지의 작업물을 모아둔 게시판입니다.",
    works_count: "건의 작업물",
    empty_title: "아직 등록된 작업물이 없어요",
    empty_sub: "관리자 모드에서 새 작업물을 추가해 보세요.",
    // Card
    view_detail: "자세히 보기",
    // Detail
    detail_tools: "사용 툴",
    detail_period: "작업 기간",
    detail_role: "역할",
    detail_link: "사이트 바로가기",
    detail_close: "닫기",
    detail_images: "추가 이미지",
    detail_prev: "이전",
    detail_next: "다음",
    edit: "수정",
    delete: "삭제",
    delete_confirm: "정말 삭제하시겠어요?",
    // Editor
    new_post: "새 작업물 추가",
    edit_post: "작업물 수정",
    field_title: "제목",
    field_category: "카테고리",
    field_thumb: "썸네일 이미지",
    field_thumb_hint: "이미지 파일을 드래그하거나 클릭해서 선택하세요",
    field_focus: "썸네일 보임 위치",
    field_focus_hint: "9개 위치 중 하나를 골라 카드에서 보일 영역을 정하세요",
    field_desc: "설명 / 내용",
    field_tools: "사용 툴 (쉼표로 구분)",
    field_link: "외부 링크 (URL)",
    field_period: "작업 기간",
    field_extras: "추가 이미지 (여러 장)",
    cancel: "취소",
    save: "저장",
    add: "추가",
    // Footer
    footer_made: "Made by Minjung Sun",
    footer_year: "2026",
    contact: "Contact",
    // Misc
    add_btn: "+ 새 작업물",
    // Auth / data
    login_title: "관리자 로그인",
    login_email: "이메일",
    login_password: "비밀번호",
    login_submit: "로그인",
    login_error: "로그인에 실패했습니다",
    loading_posts: "작업물을 불러오는 중...",
    uploading: "이미지 업로드 중...",
    save_error: "저장 중 오류가 발생했습니다",
    delete_error: "삭제 중 오류가 발생했습니다",
    seed_initial: "샘플 작업물 추가",
    seed_confirm: "포트폴리오에 샘플 작업물을 추가할까요? 기존 항목은 그대로 유지됩니다.",
    seed_done: "샘플 작업물이 추가되었습니다.",
    sign_out: "로그아웃",
    signed_in_as: "로그인 중",
  },
  en: {
    gate_title: "PORTFOLIO",
    gate_subtitle: "Please enter the password",
    gate_placeholder: "PASSWORD",
    gate_enter: "Enter",
    gate_error: "Incorrect password",
    gate_hint: "Minjung Sun · Designer & Developer",
    hero_intro: "Hello,",
    hero_name: "I'm Minjung Sun.",
    hero_role: "Designer × Developer",
    hero_tagline_1: "An all-round designer connecting design,",
    hero_tagline_2: "publishing, and AI-driven build — fast.",
    hero_yrs: "yrs",
    hero_yrs_label: "Years of experience",
    hero_projects: "projects",
    hero_projects_label: "Selected works",
    hero_tools: "tools",
    hero_tools_label: "Tools & stacks",
    nav_works: "Works",
    nav_about: "About",
    nav_contact: "Contact",
    admin_off: "Admin",
    admin_on: "Admin ON",
    all: "All",
    category_web: "Web / App",
    category_sns: "SNS / Card News",
    category_graphic: "Graphic",
    category_dev: "Publishing / Dev",
    category_character: "Character / Illust",
    category_product: "Product / Fashion",
    works_title: "Selected Works",
    works_subtitle: "A board collecting everything I've made.",
    works_count: "works",
    empty_title: "No works yet",
    empty_sub: "Switch to admin mode and add your first piece.",
    view_detail: "View detail",
    detail_tools: "Tools",
    detail_period: "Period",
    detail_role: "Role",
    detail_link: "Visit site",
    detail_close: "Close",
    detail_images: "Additional images",
    detail_prev: "Prev",
    detail_next: "Next",
    edit: "Edit",
    delete: "Delete",
    delete_confirm: "Delete this work?",
    new_post: "New work",
    edit_post: "Edit work",
    field_title: "Title",
    field_category: "Category",
    field_thumb: "Thumbnail image",
    field_thumb_hint: "Drag a file in or click to choose",
    field_focus: "Thumbnail focal point",
    field_focus_hint: "Pick one of 9 positions to control the visible crop area",
    field_desc: "Description",
    field_tools: "Tools (comma-separated)",
    field_link: "External link",
    field_period: "Period",
    field_extras: "Additional images",
    cancel: "Cancel",
    save: "Save",
    add: "Add",
    footer_made: "Made by Minjung Sun",
    footer_year: "2026",
    contact: "Contact",
    add_btn: "+ New work",
    login_title: "Admin sign in",
    login_email: "Email",
    login_password: "Password",
    login_submit: "Sign in",
    login_error: "Sign-in failed",
    loading_posts: "Loading works...",
    uploading: "Uploading image...",
    save_error: "Save failed",
    delete_error: "Delete failed",
    seed_initial: "Seed sample works",
    seed_confirm: "Add sample works to the portfolio? Existing items will be preserved.",
    seed_done: "Sample works added.",
    sign_out: "Sign out",
    signed_in_as: "Signed in as",
  },
};

const CATEGORIES = [
  { id: "web", key: "category_web" },
  { id: "sns", key: "category_sns" },
  { id: "graphic", key: "category_graphic" },
  { id: "dev", key: "category_dev" },
  { id: "character", key: "category_character" },
  { id: "product", key: "category_product" },
];

// Generate a soft gradient placeholder for thumbnails when no image is uploaded.
// Returns a CSS background string.
function placeholderBg(seed) {
  const palette = [
    ["#EEF1FF", "#C9D2FF"],
    ["#FFF3EC", "#FFD6BD"],
    ["#F0F7EF", "#C8E6C2"],
    ["#FBEFF7", "#F4CCE4"],
    ["#F4F0EB", "#DDD2C2"],
    ["#EAF6F8", "#BCDDE3"],
    ["#FFF8E1", "#F2D98A"],
    ["#F2F2F2", "#D0D0D0"],
  ];
  const h = Array.from(seed || "x").reduce((a, c) => a + c.charCodeAt(0), 0);
  const [a, b] = palette[h % palette.length];
  return `linear-gradient(135deg, ${a} 0%, ${b} 100%)`;
}

const SEED_POSTS = [
  {
    id: "p_ttree",
    title: { ko: "티트리 — 주 52시간 근무관리 SaaS", en: "T-tree — 52hr work management SaaS" },
    category: "web",
    desc: {
      ko: "주 52시간 근무시간 관리 프로그램의 웹/앱 디자인과 퍼블리싱을 1인 작업으로 진행했습니다. 관리자 대시보드, 출퇴근 기록, 부서 관리, 휴가 신청 등 전 흐름의 UX 설계부터 반응형 퍼블리싱까지 담당.",
      en: "Solo design + publishing for a SaaS that tracks 52-hour workweek limits. Owned the full UX from admin dashboards to check-in flows and responsive front-end.",
    },
    tools: ["Figma", "Photoshop", "HTML5", "CSS3", "JavaScript"],
    period: "2020 — 2024",
    link: "https://www.ttree.co.kr",
    palette: 0,
  },
  {
    id: "p_ttree_forest",
    title: { ko: "티트리 포레스트 — 커뮤니티", en: "T-tree Forest — Community" },
    category: "dev",
    desc: {
      ko: "사내 커뮤니티 사이트를 백엔드까지 포함해 1인 풀스택으로 개발. 인증, 게시판, 포인트, 알림까지 직접 구현했습니다. 디자인-개발 사이의 핸드오프 없이 빠르게 반복할 수 있어 가장 만족스러운 프로젝트.",
      en: "Built the full community site end-to-end, including backend. Auth, board, points, notifications — all me. No handoff lag, fastest iteration loop I've ever had.",
    },
    tools: ["React", "Node", "MySQL", "Figma"],
    period: "2024",
    link: "https://www.ttree.co.kr/ttreeforest/",
    palette: 2,
  },
  {
    id: "p_donnamu",
    title: { ko: "돈나무레이스 — iOS / Android 앱", en: "Donnamu Race — iOS / Android app" },
    category: "web",
    desc: {
      ko: "(주)수애눈 의뢰로 진행한 모바일 앱 디자인 총괄. 앱 UI/UX, 홈페이지, 사용 설명서까지 디자인 전 영역을 1인으로 진행했습니다.",
      en: "Mobile app design lead for Sueun Inc. Owned app UI/UX, marketing site, and user manual as a solo designer.",
    },
    tools: ["Figma", "Illustrator", "Photoshop"],
    period: "2024",
    link: "",
    palette: 1,
  },
  {
    id: "p_moduuhdi",
    title: { ko: "모두어디 — 위치 공유 앱", en: "ModuUhdi — Location-share app" },
    category: "web",
    desc: {
      ko: "모두어디 앱 디자인 총괄. 앱 화면 설계와 함께 홈페이지와 사용 설명서 디자인까지 한 사이클을 책임졌습니다.",
      en: "Lead designer for ModuUhdi. App screens, marketing site, and printed manual — full cycle.",
    },
    tools: ["Figma", "Illustrator"],
    period: "2024",
    link: "",
    palette: 5,
  },
  {
    id: "p_golfscope",
    title: { ko: "골프스코프 — 골프 거리측정 앱", en: "GolfScope — golf rangefinder app" },
    category: "web",
    desc: {
      ko: "골프스코프 앱과 홈페이지, 매뉴얼까지의 디자인 전 영역을 단독으로 진행했습니다. 골프 사용자에게 익숙한 시각 언어를 유지하면서, 거리·각도 정보가 한눈에 들어오는 화면 구성에 집중.",
      en: "Solo design across the GolfScope app, web, and manual. Tuned for golfers — familiar metaphors, glanceable distance and angle readouts.",
    },
    tools: ["Figma", "Illustrator", "Photoshop"],
    period: "2024",
    link: "",
    palette: 4,
  },
  {
    id: "p_sharefriends",
    title: { ko: "쉐어프렌즈 — 쇼핑몰 / 캐릭터", en: "ShareFriends — shop & characters" },
    category: "product",
    desc: {
      ko: "쇼핑몰의 제품 기획부터 디자인, 제작, 상세페이지, SNS, 이모티콘, 캐릭터까지 100% 단독 작업으로 진행한 프로젝트입니다. 브랜드의 시각언어 전반을 책임졌습니다.",
      en: "100% solo run: product planning, design, manufacturing, PDPs, SNS, stickers, and the brand mascots. Owned the visual language end to end.",
    },
    tools: ["Illustrator", "Photoshop", "그누보드"],
    period: "2019 — 재직중",
    link: "https://www.sharefriends.co.kr",
    palette: 3,
  },
  {
    id: "p_cheonma",
    title: { ko: "두원공과대학교 — 캐릭터 '천마'", en: "Doowon Tech U — Mascot 'Cheonma'" },
    category: "character",
    desc: {
      ko: "두원공과대학교 공식 캐릭터 '천마' 디자인. 학교의 상징성과 친근함을 동시에 담아내기 위해 여러 시안과 표정·동작 변형을 함께 제공했습니다.",
      en: "Designed the official mascot 'Cheonma' for Doowon Tech University. Delivered the master art plus expression and motion variants.",
    },
    tools: ["Illustrator", "Photoshop"],
    period: "2021",
    link: "",
    palette: 6,
  },
  {
    id: "p_ktrot",
    title: { ko: "MBN K-트롯차트 — 방송 / SNS 디자인", en: "MBN K-Trot Chart — broadcast & SNS" },
    category: "sns",
    desc: {
      ko: "MBN 예능 'K-트롯차트' 인스타그램 홍보 이미지와 방송 포스터 디자인을 진행했습니다. 매주 업데이트되는 출연자, 순위 정보를 빠르게 시각화하는 템플릿 시스템도 함께 설계.",
      en: "Designed the Instagram promo art and broadcast posters for MBN's variety show K-Trot Chart, including a weekly template system for cast and ranking updates.",
    },
    tools: ["Photoshop", "Illustrator"],
    period: "2025 — 재직중",
    link: "https://www.instagram.com/official_ktrotchart",
    palette: 1,
  },
  {
    id: "p_uiwang",
    title: { ko: "의왕시 SNS 시민기자단 — 카드뉴스", en: "Uiwang City SNS reporter — card news" },
    category: "sns",
    desc: {
      ko: "의왕시청 공식 인스타그램에 업로드되는 카드뉴스를 디자인하고 있습니다. 시 정책과 생활 정보를 시민이 한 장에 이해할 수 있도록 정보 위계를 잡는 일이 핵심.",
      en: "Designing card news that runs on Uiwang City's official Instagram. The job is hierarchy — making policy & life info land in a single swipe.",
    },
    tools: ["Photoshop", "Illustrator"],
    period: "2026.01 — 재직중",
    link: "https://www.instagram.com/uiwangcity/",
    palette: 7,
  },
  {
    id: "p_gwacheon",
    title: { ko: "과천시 SNS 시민기자단 — 블로그", en: "Gwacheon City SNS reporter — blog" },
    category: "sns",
    desc: {
      ko: "과천시 SNS 시민기자단 블로그 기자로 활동하며, 시 현장을 직접 취재하고 글을 써서 과천시 공식 채널에 업로드 하고 있습니다.",
      en: "Field-reporting and writing posts for Gwacheon City's official blog as a citizen reporter.",
    },
    tools: ["Naver Blog", "Photoshop"],
    period: "2025.01 — 재직중",
    link: "",
    palette: 5,
  },
  {
    id: "p_ridi",
    title: { ko: "리디 — 웹툰 현지화", en: "Ridi — webtoon localization" },
    category: "graphic",
    desc: {
      ko: "리디(주)의 국내 웹툰 현지화 프로젝트에 프리랜서 디자이너로 참여, 다수의 웹툰을 포토샵·일러스트레이터로 편집 디자인했습니다. 말풍선 정렬, 사운드 이펙트 리터치, 컷 보정까지.",
      en: "Worked as a freelance localization designer on Ridi's webtoons — bubble re-typesetting, SFX retouch, panel cleanup across many titles.",
    },
    tools: ["Photoshop", "Illustrator"],
    period: "2021.10 — 2024.12",
    link: "",
    palette: 3,
  },
  {
    id: "p_moimoln",
    title: { ko: "모이몰른 — 그래픽 / 나염 디자인", en: "Moimoln — graphic & print design" },
    category: "product",
    desc: {
      ko: "한세드림(주) 모이몰른 디자인실에서 시즌 그래픽 디자인을 담당. 키즈 브랜드의 톤에 맞는 일러스트·캐릭터·패턴을 시즌 단위로 제안했습니다.",
      en: "Seasonal graphic design for Moimoln (Hansaedream Inc.). Pitched illustrations, characters, and patterns tuned to a kids-fashion tone.",
    },
    tools: ["Illustrator", "Photoshop"],
    period: "2018",
    link: "",
    palette: 6,
  },
  {
    id: "p_agabang",
    title: { ko: "아가방 — 시즌 제품 / 그래픽 디자인", en: "Agabang — seasonal product & graphic" },
    category: "product",
    desc: {
      ko: "아가방앤컴퍼니 디자인실에서 시즌별 제품 기획, 그래픽·나염 디자인, QC, 업체 핸들링, 품평회 준비까지 디자이너로서의 전 영역을 경험했습니다.",
      en: "At Agabang & Co's design studio: seasonal product planning, graphics, prints, QC, vendor handling, and prepping the biannual review — the full job.",
    },
    tools: ["Illustrator", "Photoshop"],
    period: "2016 — 2017",
    link: "",
    palette: 4,
  },
  {
    id: "p_uljin",
    title: { ko: "울진 대게 홍보전시관 — 벽화", en: "Uljin Snow Crab pavilion — mural" },
    category: "graphic",
    desc: {
      ko: "울진 대게 홍보 전시관 벽화를 직접 작업했습니다. 디자인 화면 너머에서 손으로 그리는 작업도 즐깁니다.",
      en: "Hand-painted the wall mural at the Uljin Snow Crab pavilion. Off-screen, with-hands work scratches a different itch.",
    },
    tools: ["Mural", "Acrylic"],
    period: "2011",
    link: "",
    palette: 0,
  },
  {
    id: "p_wordpress",
    title: { ko: "기업 사이트 — 워드프레스 구축 / 유지보수", en: "Corporate sites — WordPress build / ops" },
    category: "dev",
    desc: {
      ko: "앤커웨이브, 굿인벤트 기업 홈페이지를 워드프레스로 구축하고, 위버맨시(PHP), 쉐어프렌즈(그누보드) 사이트의 유지보수와 업데이트를 진행하고 있습니다.",
      en: "Built Anchorwave and GoodInvent's corporate sites on WordPress, and maintain Overman (PHP) and ShareFriends (Gnuboard).",
    },
    tools: ["WordPress", "PHP", "그누보드"],
    period: "2019 — 재직중",
    link: "https://www.anchorwave.co.kr",
    palette: 2,
  },
];

window.I18N = I18N;
window.CATEGORIES = CATEGORIES;
window.SEED_POSTS = SEED_POSTS;
window.placeholderBg = placeholderBg;
