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

:root {
  --accent: #2563eb;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --page-bg: #ffffff;
  --font: 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 2rem 1rem;
}

.page {
  max-width: 780px;
  margin: 0 auto;
  background: var(--page-bg);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  overflow: hidden;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem 2.5rem 1.5rem;
  background: var(--accent);
  color: #fff;
}

.header-photo {
  flex-shrink: 0;
}

.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.header-info {
  flex: 1;
}

.name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.title {
  font-size: 1rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.contacts {
  list-style: none;
  text-align: right;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contacts a {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}

.contacts a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Download Button */
.header-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  justify-content: space-between;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: fit-content;
  align-self: end;
}

.download-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.download-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Main */
.main {
  padding: 2rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Section */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Summary */
.summary {
  color: #374151;
  font-size: 0.95rem;
}

/* Entry */
.entry {
  margin-bottom: 1.25rem;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.entry-company {
  font-weight: 600;
  font-size: 0.95rem;
}

.entry-period {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.entry-role {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.15rem;
  margin-bottom: 0.5rem;
}

.entry-bullets {
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Skills */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill {
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: default;
  transition: background 0.15s, transform 0.1s;
}

.skill:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

/* Accordion */
.accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-bottom: 1rem;
}

.accordion-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.accordion-btn svg {
  transition: transform 0.3s ease;
  width: 20px;
  height: 20px;
}

.accordion-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.accordion-content.open {
  max-height: 10000px;
  overflow: visible;
  transition: max-height 0.5s ease;
}

/* Projects Table */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.project-card {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.card-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  margin-bottom: 0.3rem;
  transition: opacity 0.2s;
}

.card-link:hover {
  opacity: 0.7;
}

.card-period {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.card-description {
  font-size: 0.8rem;
  color: #374151;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-list {
  list-style: none;
  margin-bottom: 0.75rem;
}

.card-list li {
  font-size: 0.75rem;
  color: #374151;
  margin-bottom: 0.3rem;
  padding-left: 1rem;
  position: relative;
}

.card-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-badge {
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* Print */
@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: none;
    padding: 0;
    margin: 0;
  }

  .page {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  .header {
    padding: 1rem 1.25rem 0.75rem;
    page-break-after: avoid;
    gap: 1.25rem;
  }

  .header-photo {
    width: 80px;
    height: 80px;
  }

  .profile-photo {
    width: 80px;
    height: 80px;
    border-width: 2px;
    box-shadow: none;
  }

  .header-info {
    flex: 1;
  }

  .name {
    font-size: 1.3rem;
    margin-bottom: 0.1rem;
  }

  .title {
    font-size: 0.85rem;
  }

  .contacts {
    font-size: 0.7rem;
    gap: 0.1rem;
    text-align: right;
  }

  .contacts a {
    color: #fff;
    opacity: 1;
  }

  .main {
    padding: 0.75rem 1.25rem 1rem;
    gap: 0.8rem;
  }

  .section {
    page-break-inside: avoid;
    margin-bottom: 0;
  }

  .section-title {
    font-size: 0.6rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    color: #000;
    border-color: #000;
  }

  .summary {
    font-size: 0.8rem;
    color: #000;
    margin: 0;
    line-height: 1.4;
  }

  .entry {
    margin-bottom: 0.6rem;
    page-break-inside: avoid;
  }

  .entry:last-child {
    margin-bottom: 0;
  }

  .entry-header {
    margin-bottom: 0.1rem;
    gap: 0.5rem;
  }

  .entry-company {
    font-size: 0.8rem;
    font-weight: 700;
  }

  .entry-period {
    font-size: 0.7rem;
  }

  .entry-role {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0;
    margin-bottom: 0.3rem;
  }

  .entry-bullets {
    padding-left: 0.9rem;
    font-size: 0.75rem;
    color: #000;
    gap: 0.1rem;
  }

  .entry-bullets li {
    margin-bottom: 0;
  }

  .skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .skill {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    border-radius: 3px;
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
    font-weight: normal;
    line-height: 1.2;
  }

  .skill:hover {
    transform: none;
  }

  .download-btn {
    display: none;
  }
  
  .hidden-print {
    display: none;
  }

  @page {
    margin: 0.4in;
    size: letter;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .header {
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
    text-align: center;
  }

  .header-content {
    align-items: center;
  }

  .contacts {
    text-align: center;
  }

  .download-btn {
    width: 100%;
    justify-content: center;
  }

  .main, .header {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .entry-header {
    flex-direction: column;
    gap: 0.1rem;
  }

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

  .project-card {
    padding: 0.75rem;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .card-list {
    margin-bottom: 0.5rem;
  }

  .card-list li {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
  }

  .card-tech {
    gap: 0.3rem;
  }

  .tech-badge {
    font-size: 0.65rem;
  }
}
