:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --max-width: 900px;
  --radius: 0.5rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-2);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

nav .brand { font-weight: 700; letter-spacing: -0.02em; }

nav ul {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

nav a { color: var(--muted); }
nav a:hover { color: var(--text); }

.lang-switch {
  gap: 0.5rem;
  margin-left: 1rem;
}

.lang-switch li + li::before {
  content: "|";
  color: var(--surface-2);
  margin-right: 0.5rem;
}

.lang-switch a.active {
  color: var(--text);
  font-weight: 600;
}

.hero {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--surface-2);
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  margin: 0 0 0.5rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero .tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--accent);
  margin: 0 0 1rem;
  font-weight: 500;
}

.hero .meta {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.hero .actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  transition: background 0.2s, border-color 0.2s;
}

.btn:hover { background: var(--surface-2); border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #7dd3fc; border-color: #7dd3fc; }

section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--surface-2); }

h2 {
  font-size: 1.6rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; color: var(--accent-2); }
p { margin: 0 0 1rem; }

.summary {
  font-size: 1.15rem;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 2rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 { margin-top: 0; font-size: 1rem; }
.card ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.card li { margin-bottom: 0.35rem; }

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

.skill-group h3 { font-size: 1rem; margin: 0 0 0.6rem; color: var(--accent); }
.skill-group ul { list-style: none; padding: 0; margin: 0; }
.skill-group li { display: inline-block; background: var(--surface); border: 1px solid var(--surface-2); padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.85rem; margin: 0 0.35rem 0.45rem 0; color: var(--text); }

.timeline { display: flex; flex-direction: column; gap: 1.5rem; }

.job { display: grid; grid-template-columns: 1fr; gap: 0.25rem; }
@media (min-width: 640px) { .job { grid-template-columns: 160px 1fr; } }

.job .period { color: var(--muted); font-size: 0.9rem; }
.job h3 { margin: 0; font-size: 1.05rem; color: var(--text); }
.job .company { color: var(--accent-2); font-size: 0.95rem; }
.job p { color: var(--muted); margin: 0.4rem 0 0; font-size: 0.95rem; }
.job .tags { margin-top: 0.5rem; }
.job .tags .btn { margin: 0 0.4rem 0.4rem 0; font-size: 0.8rem; padding: 0.25rem 0.5rem; }

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

.project .links { margin-top: 0.75rem; font-size: 0.9rem; }
.project .links a { margin-right: 0.75rem; }

.case-list { list-style: none; padding: 0; margin: 0.75rem 0 0; }
.case-list li { position: relative; padding-left: 1rem; color: var(--muted); font-size: 0.92rem; margin-bottom: 0.4rem; }
.case-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

.education { display: flex; flex-direction: column; gap: 1rem; }
.edu-item h3 { margin: 0; font-size: 1rem; color: var(--text); }
.edu-item .institution { color: var(--accent-2); font-size: 0.95rem; }
.edu-item .date { color: var(--muted); font-size: 0.85rem; }

.contact { text-align: center; padding: 4rem 0; }
.contact h2 { border: none; }
.contact .lead { color: var(--muted); max-width: 600px; margin: 0 auto 1.5rem; }
.contact .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

footer { text-align: center; padding: 2rem 0; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--surface-2); }

@media print {
  header, footer, .contact { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: none; }
  .card, .skill-group li { background: #fff; border-color: #ccc; color: #000; }
  .btn { background: transparent; border-color: #999; color: #000; }
  .project .links a { text-decoration: underline; }
  section { padding: 1.5rem 0; }
  h2 { color: #000; border-bottom-color: #000; }
  h3 { color: #000; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

nav .brand a { color: var(--text); }
nav .brand a:hover { text-decoration: none; }

#blog { padding: 3.5rem 0; }
#blog h2 { border-bottom: 2px solid var(--accent); }

.posts { display: flex; flex-direction: column; gap: 1.25rem; }

.post-summary h2, .post-summary h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.post-summary h2 a, .post-summary h3 a { color: var(--text); }
.post-summary h2 a:hover, .post-summary h3 a:hover { color: var(--accent); text-decoration: none; }
.post-summary .date { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.5rem; }

.post { padding: 4rem 0; }
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 0.5rem; line-height: 1.2; }
.post-header .date { color: var(--muted); margin: 0 0 1rem; }
.post-header .lead { color: var(--muted); font-size: 1.1rem; border-left: 3px solid var(--accent); padding-left: 1rem; }

.post-content { max-width: 720px; }
.post-content h2 { font-size: 1.35rem; border-bottom: 2px solid var(--accent); margin-top: 2rem; }
.post-content h3 { font-size: 1.1rem; color: var(--accent-2); margin-top: 1.5rem; }
.post-content p, .post-content ul, .post-content ol { margin-bottom: 1rem; color: var(--muted); }
.post-content ul, .post-content ol { padding-left: 1.25rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content strong { color: var(--text); }
.post-content a { text-decoration: underline; }

.post-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--surface-2); }
