:root {
  --primary: #e7000b;
  --text: #111;
  --muted: #555;
  --bg: #ffffff;
  --border: #e0e0e0;
  --chip-bg: #f5f5f5;
}

[data-theme="dark"] {
  --primary: #ff4757;
  --text: #ffffff;
  --muted: #cccccc;
  --bg: #1a1a1a;
  --border: #333333;
  --chip-bg: #2d2d2d;
}

[data-theme="dark"] header {
  background: #2d2d2d;
}

[data-theme="dark"] footer {
  background: var(--bg);
  border-top-color: var(--border);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header {
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  transition: background-color 0.3s ease;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem 0 2rem;
}

.hero-photo {
  flex: 0 0 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-main {
  flex: 1 1 260px;
  min-width: 0;
}

.hero-main h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

.hero-main h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-meta strong {
  font-weight: 600;
  color: var(--text);
}

main {
  padding: 2rem 0 3rem;
}

section {
  margin-bottom: 2rem;
}

section:last-of-type {
  margin-bottom: 0;
}

h3.section-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.summary-box {
  border-left: 3px solid var(--primary);
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
  gap: 2rem;
}

@media (max-width: 768px) {
  .hero {
    padding-top: 1.75rem;
  }
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

.item {
  margin-bottom: 1rem;
}

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

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

.item-title {
  font-weight: 600;
}

.item-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

.item-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

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

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.chip {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 0.8rem;
}

.list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.list-inline span::after {
  content: "•";
  margin-left: 0.4rem;
  color: var(--border);
}

.list-inline span:last-child::after {
  content: "";
  margin: 0;
}

.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.reference-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
}

.reference-card strong {
  display: block;
  margin-bottom: 0.15rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  background: var(--bg);
  transition: all 0.3s ease;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 20px;
  z-index: 1000;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-theme="dark"] .theme-toggle:hover {
  box-shadow: 0 4px 12px rgba(255,255,255,0.2);
}

.download-cv {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.download-cv:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

[data-theme="dark"] .download-cv:hover {
  box-shadow: 0 4px 12px rgba(255,255,255,0.1);
}