// Shared data + helpers for the portfolio.

const ME = {
  name: 'Sovanarung Seng',
  preferred: 'Davin',
  role: 'Software Engineer',
  focus: 'Web & mobile app development',
  location: 'San Diego, CA',
  bio: 'Software engineer in San Diego. Spent five years at Lytx scaling .NET microservices and PostgreSQL pipelines that handle millions of vehicle trips a day.',
  longBio: `Hi — I'm Davin. I'm a software engineer with five years of experience in full-stack web development with a focus on back-end. 

For the last five years, growing from junior to an experienced developer, I developed APIs and scalable event-driven systems using various technologies such as C#/.NET, SQL, Kafka, and AWS.`,
  interests: ['80s new wave', 'indie music', 'hiking', 'videogames', 'building little side projects'],
  email: 'dseng905@gmail.com',
  socials: {
    github: 'dseng905',
    linkedin: 'sovanarung-seng',
    twitter: 'the_hexagon_sun',
    codepen: 'dseng905',
  },
};

const PROJECTS = [
  {
    id: 'twistify',
    name: 'Twistify',
    year: '2020 → 2026',
    tagline: 'A mobile app that tests your speech clarity with tongue twisters.',
    description: 'Cross-platform Flutter app that uses OpenAI Whisper to evaluate pronunciation. Local SQLite tracks performance per phrase and challenge. Scaled to 10k+ downloads via App Store Optimization and targeted social campaigns. Currently being rebuilt with Claude Code.',
    role: 'Solo · design, build, ship',
    stack: ['Flutter', 'Dart', 'SQLite', 'OpenAI Whisper', 'Claude Code'],
    platform: 'Mobile',
    status: 'Live on the App Store and Google Play',
    links: [
      { label: 'Landing page', href: 'https://davinseng.com/twistify/' },
      { label: 'App Store', href: 'https://apps.apple.com/us/app/twistify-tongue-twisters-test/id6764229737' },
      { label: 'Google Play', href: 'https://play.google.com/store/apps/details?id=com.dseng905.twistifyflutter' },
      { label: 'App of the Day interview', href: 'https://appoftheday.downloadastro.com/app/twistify-an-app-with-tongue-twisters/' },
    ],
    accent: 'oklch(0.62 0.14 145)',
    palette: ['oklch(0.62 0.14 145)', 'oklch(0.95 0.02 145)', 'oklch(0.25 0.05 145)'],
  },
  {
    id: 'newstyper',
    name: 'NewsTyper',
    year: '2022',
    tagline: 'Practice your typing by typing the actual news.',
    description: 'A web app that pulls articles from the Guardian and turns them into typing exercises. Read while you type, build accuracy and WPM on real prose, save your stats across sessions.',
    role: 'Full-stack · solo',
    stack: ['TypeScript', 'React', 'Node.js', 'Express', 'PostgreSQL', 'Prisma'],
    platform: 'Web',
    status: 'Public · in progress',
    links: [
      { label: 'Live site', href: 'https://newstyper.netlify.app/' },
      { label: 'GitHub', href: 'https://github.com/dseng905/newstyper-app' },
    ],
    accent: 'oklch(0.62 0.15 250)',
    palette: ['oklch(0.62 0.15 250)', 'oklch(0.95 0.02 250)', 'oklch(0.25 0.05 250)'],
  },
];

const EXPERIENCE = [
  {
    company: 'Lytx',
    role: 'Software Engineer III',
    period: 'Nov 2020 — Jan 2026',
    location: 'San Diego, CA',
    notes: 'Five years at Lytx, growing from Software Engineer I to III. Architected PostgreSQL schemas with table partitioning to process 3M+ daily vehicle trips, built .NET microservices consuming Kafka and GraphQL endpoints over Redshift, and a REST API over MongoDB. Migrated infrastructure from on-prem to AWS (EKS, DynamoDB). Owned production monitoring via New Relic and raised unit-test coverage above 90% using GitHub Copilot. Mentored junior developers along the way.',
  },
];

const EDUCATION = [
  {
    school: 'UC San Diego',
    degree: 'B.S., Electrical Engineering',
    period: 'Sept 2016 — Jun 2019',
    location: 'La Jolla, CA',
    notes: 'EMG videogame controller, autonomous RC car. C++ and Python; first taste of building things people use.',
  },
];

const SKILLS = [
  { group: 'Languages', items: ['C#', 'TypeScript', 'JavaScript', 'Java', 'Dart', 'SQL'] },
  { group: 'Frameworks', items: ['.NET Core', 'Angular', 'React', 'Flutter'] },
  { group: 'Cloud & Infra', items: ['AWS', 'EKS', 'DynamoDB', 'Redshift', 'Kafka', 'Flink', 'New Relic'] },
  { group: 'Databases', items: ['SQL Server', 'PostgreSQL', 'MongoDB', 'SQLite'] },
  { group: 'Tools', items: ['GraphQL', 'Git', 'GitHub Copilot', 'Claude Code'] },
];

const Icon = ({ name, size = 18 }) => {
  const paths = {
    arrow: 'M5 12h14M13 5l7 7-7 7',
    arrowUp: 'M7 17L17 7M7 7h10v10',
    github: 'M9 19c-4 1-4-2-6-2m12 4v-3.5c0-1 .1-1.4-.5-2 2.8-.3 5.5-1.4 5.5-6a4.6 4.6 0 0 0-1.3-3.2 4.3 4.3 0 0 0-.1-3.2s-1-.3-3.4 1.3a11.6 11.6 0 0 0-6 0C7.7 2.8 6.7 3.1 6.7 3.1a4.3 4.3 0 0 0-.1 3.2A4.6 4.6 0 0 0 5.3 9.5c0 4.6 2.7 5.7 5.5 6-.6.6-.6 1.2-.5 2V21',
    linkedin: 'M4 4h4v4H4zM4 10h4v10H4zM10 10h4v2c.5-1 1.5-2 3.5-2 3 0 3.5 2 3.5 5v5h-4v-4c0-1.5 0-3-2-3s-2 1.5-2 3v4h-4z',
    mail: 'M3 7l9 6 9-6M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V7M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2',
    twitter: 'M22 5.8a8.5 8.5 0 0 1-2.4.7 4 4 0 0 0 1.8-2.2 8 8 0 0 1-2.6 1A4 4 0 0 0 12 9.5a11.4 11.4 0 0 1-8.3-4.2 4 4 0 0 0 1.3 5.3 4 4 0 0 1-1.8-.5 4 4 0 0 0 3.2 4 4 4 0 0 1-1.8.1 4 4 0 0 0 3.7 2.8A8 8 0 0 1 2 18.5a11.3 11.3 0 0 0 6.1 1.8c7.3 0 11.3-6 11.3-11.3v-.5A8 8 0 0 0 22 5.8z',
    sun: 'M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6L4.2 4.2M19.8 19.8l-1.4-1.4M5.6 18.4l-1.4 1.4M19.8 4.2l-1.4 1.4',
    moon: 'M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z',
    external: 'M7 17L17 7M9 7h8v8',
    code: 'M16 18l6-6-6-6M8 6l-6 6 6 6',
  };
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"
      style={{ display: 'inline-block', verticalAlign: 'middle', flex: '0 0 auto' }}>
      {name === 'sun' && <circle cx="12" cy="12" r="4" />}
      <path d={paths[name] || ''} />
    </svg>
  );
};

Object.assign(window, { ME, PROJECTS, EXPERIENCE, EDUCATION, SKILLS, Icon });
