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

:root {
  --bg: #F7F5F2;
  --ink: #1A1916;
  --muted: #8A877F;
  --accent: #C8A96E;
  --line: #E2DED8;
}

[data-theme="dark"] {
  --bg: #1A1916;
  --ink: #F7F5F2;
  --muted: #A8A49A;
  --accent: #D4B57F;
  --line: #2F2D28;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ── Layout ── */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}

/* ── Header ── */
header {
  margin-bottom: 80px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
  text-align: center;
}

.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 32px;
  display: block;
  border: 3px solid var(--line);
  box-shadow: 0 4px 12px rgba(26, 25, 22, 0.08);
}

.name {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 16px;
}

.name em {
  font-style: italic;
  color: var(--accent);
}

.tagline {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tagline-line {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin: 0 10px 2px 0;
}

.contact-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

.contact-btn {
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 10px 20px;
  font-size: 12px;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  border-radius: 2px;
  font-family: 'DM Mono', monospace;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contact-btn svg {
  width: 16px;
  height: 16px;
}

/* LinkedIn and GitHub use fill */
.contact-btn:nth-child(2) svg,
.contact-btn:nth-child(3) svg {
  fill: currentColor;
}

/* Email and CV use stroke */
.contact-btn:nth-child(1) svg,
.contact-btn:nth-child(4) svg {
  fill: none;
  stroke: currentColor;
}

.contact-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

/* ── Sections ── */
section {
  margin-bottom: 64px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }
section:nth-child(6) { animation-delay: 0.5s; }

.section-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.skill-group {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.skill-group:nth-child(odd) {
  padding-right: 32px;
  border-right: 1px solid var(--line);
}

.skill-group:nth-child(even) {
  padding-left: 32px;
}

.skill-group:last-child,
.skill-group:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}

.skill-category {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 500;
}

.skill-list {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.9;
}

/* ── Experience ── */
.job {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.job:last-child { border-bottom: none; }

.job-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.3;
}

.job-company {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.job-desc {
  font-size: 13px;
  color: var(--ink);
  opacity: 0.75;
  line-height: 1.75;
}

.job-date {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-align: right;
  padding-top: 3px;
}

.job-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 2px;
  margin-top: 6px;
}

/* ── Footer ── */
footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  display: flex;
  justify-content: space-between;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.4s forwards;
}

/* ── Theme Toggle ── */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1000;
}

/* ── Language Toggle ── */
.lang-toggle {
  position: fixed;
  top: 24px;
  right: 80px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1000;
}

.lang-toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.lang-text {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink);
  transition: color 0.3s;
}

.lang-toggle:hover .lang-text {
  color: white;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: fill 0.3s, stroke 0.3s;
}

.theme-toggle .sun {
  stroke: var(--ink);
  fill: none;
}

.theme-toggle .moon {
  fill: var(--ink);
  stroke: none;
}

.theme-toggle:hover .sun {
  stroke: white;
}

.theme-toggle:hover .moon {
  fill: white;
}

.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }

[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ── Animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .skills-grid { grid-template-columns: 1fr; }
  .skill-group:nth-child(odd) { border-right: none; padding-right: 0; }
  .skill-group:nth-child(even) { padding-left: 0; }
  .skill-group:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .job { grid-template-columns: 1fr; }
  .job-date { text-align: left; }

  .contact-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}
