:root {
  --primary-color: #1a1a1a;
  --accent-color: #0066cc;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #fff;
  --border-color: #e0e0e0;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@page {
  size: A4;
  margin: 0;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.5;
  max-width: 210mm;
  margin: 0 auto;
  padding: 15mm;
}

.page {
  break-after: page;
  padding-top: 15mm;
}

.page:first-child {
  padding-top: 0;
}

.page:last-child {
  break-after: avoid;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--accent-color);
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.header-info {
  display: flex;
  flex-direction: column;
}

.photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.2;
}

.contact-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.contact-info a {
  color: var(--accent-color);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

section {
  margin-bottom: 28px;
}

#profile {
  margin-bottom: 30px;
}

#education {
  margin-bottom: 30px;
}

#skills {
  margin-bottom: 30px;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

#profile p {
  font-size: 0.95rem;
  color: var(--text-color);
}

.entry {
  margin-bottom: 8px;
}

.entry h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-color);
}

.entry .degree {
  color: var(--text-color);
}

.entry .period {
  color: var(--text-light);
  font-size: 0.85rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.skill-category h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 4px;
}

.skill-category ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skill-category li {
  font-size: 0.8rem;
  color: var(--text-color);
}

.skill-category li:not(:last-child)::after {
  content: "·";
  margin-left: 4px;
  color: var(--text-light);
}

.project-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.project-name {
  font-weight: 600;
  color: var(--primary-color);
}

.project-desc {
  color: var(--text-light);
  font-size: 0.85rem;
}

.project-item a {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.85rem;
}

.project-item a:hover {
  text-decoration: underline;
}

.project-detail {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
}

.project-detail h2 {
  font-size: 1.3rem;
  text-transform: none;
  border-bottom: none;
  margin-bottom: 15px;
}

.project-full-desc {
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 15px;
}

.project-features {
  margin-bottom: 20px;
  padding-left: 20px;
}

.project-features li {
  font-size: 0.85rem;
  color: var(--text-color);
  margin-bottom: 8px;
}

.project-features strong {
  color: var(--primary-color);
}

.screenshot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 15px;
  overflow: hidden;
}

.screenshot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.project-links {
  display: flex;
  gap: 15px;
}

.project-links a {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.project-links a:hover {
  text-decoration: underline;
}

@media print {
  body {
    font-size: 11pt;
    padding: 15mm;
    margin: 0;
    max-width: 100%;
  }

  .page {
    break-after: page;
  }

  .page:last-child {
    break-after: avoid;
  }

  header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .photo {
    width: 50px;
    height: 50px;
  }

  h1 {
    font-size: 1.3rem;
  }

  section {
    margin-bottom: 10px;
  }

  h2 {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .skills-grid {
    gap: 8px;
  }

  .project-item {
    margin-bottom: 6px;
  }

  .screenshot {
    background: none;
    padding: 0;
  }

  .project-detail {
    height: auto;
  }

  a {
    text-decoration: none;
    color: #000;
  }
}

@media (max-width: 500px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .contact-info {
    align-items: flex-start;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}