@font-face { font-family: Roboto; font-weight: 300; font-display: swap; src: url(fonts/roboto-light.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 400; font-display: swap; src: url(fonts/roboto-regular.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 500; font-display: swap; src: url(fonts/roboto-medium.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 700; font-display: swap; src: url(fonts/roboto-bold.woff2) format("woff2"); }

:root {
  --accent: #dc3522;       /* awesome-red, same as the PDF */
  --accent-dark: #b52a1a;
  --text: #1f2328;
  --muted: #5c6370;
  --line: #e4e6ea;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --radius: 12px;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 1rem/1.6 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent-dark); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.icon { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--bg); padding: .5rem 1rem; }

/* ---------- cover ---------- */
.cover {
  height: clamp(180px, 30vw, 340px);
  background: linear-gradient(to bottom, rgb(0 0 0 / .05), rgb(0 0 0 / .45)), url(cover.webp) center / cover no-repeat;
}

/* ---------- layout: sticky profile card + content ---------- */
.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.profile {
  position: sticky; top: 1.5rem;
  margin-top: -120px;              /* card overlaps the cover */
  padding: 1.5rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .08);
  text-align: center;
}
.avatar {
  display: block;
  width: 160px; height: 160px;
  margin: 0 auto 1rem;
  object-fit: cover; object-position: 50% 22%;   /* portrait photo: keep the face in the circle */
  border-radius: 50%;
  border: 4px solid var(--bg);
  box-shadow: 0 8px 24px rgb(0 0 0 / .18);
  background: var(--bg-soft);
}
h1 {
  font-weight: 300; font-size: 1.85rem; line-height: 1.15; margin: 0 0 .35rem; letter-spacing: -.01em;
}
.position { margin: 0 0 1rem; color: var(--accent); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; line-height: 1.5; }
.position .phrase { display: inline-block; }
.contacts { margin-bottom: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.contact { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; color: var(--muted); font-size: .88rem; text-align: left; }
.contact + .contact { margin-top: .8rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.contact li { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.contact li > :last-child { overflow-wrap: anywhere; }
.contact a { color: inherit; text-decoration: none; }
.contact a:hover { color: var(--accent-dark); text-decoration: underline; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--accent); color: #fff;
  padding: .7rem 1.3rem; border-radius: 999px;
  font-weight: 500; text-decoration: none;
  box-shadow: 0 4px 14px rgb(220 53 34 / .3);
  transition: background .15s, transform .15s;
}
.profile .btn { width: 100%; }
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* ---------- sections ---------- */
main { padding: .5rem 0 3rem; min-width: 0; }
section { margin-top: 3rem; }
h2 {
  font-size: 1.35rem; font-weight: 700; margin: 0 0 1.25rem;
  display: flex; align-items: center; gap: .8rem;
}
h2 .hl { color: var(--accent); } /* first 3 letters red, like Awesome-CV \@sectioncolor */
h2::after { content: ""; flex: 1; height: 2px; background: linear-gradient(to right, var(--line) 70%, var(--accent)); }
.summary { margin: 0; text-align: justify; hyphens: auto; font-size: 1.05rem; color: #333; }

.skills { margin: 0; display: grid; gap: .9rem; }
.summary, .skills { padding-inline: 1.5rem; }   /* indent content under the section heading */
.skill-group { display: grid; grid-template-columns: 210px 1fr; gap: 1rem; align-items: start; }
.skill-group dt { font-weight: 700; padding-top: .25rem; }
.skill-group dd { margin: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .75rem; font-size: .9rem; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 2px solid var(--line); }
.entry { position: relative; padding: 0 0 1.75rem 1rem; }
.entry::before {
  content: ""; position: absolute; left: calc(-1.5rem - 7px); top: .45rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.entry:last-child { padding-bottom: 0; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.entry h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.dates { color: var(--accent-dark); font-weight: 500; font-size: .9rem; white-space: nowrap; }
.subtitle { margin: .15rem 0 0; font-weight: 500; }
.meta { margin: .1rem 0 0; color: var(--muted); font-size: .92rem; font-style: italic; }
.bullets { margin: .6rem 0 0; padding-left: 1.1rem; color: #333; text-align: justify; hyphens: auto; }
.bullets li { margin: .2rem 0; }
.bullets li::marker { color: var(--accent); }

footer { border-top: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); text-align: center; padding: 1.5rem; font-size: .9rem; }
footer p { margin: .2rem 0; }

/* ---------- mobile mini bar (hidden on desktop) ---------- */
.mini-bar { display: none; }

/* ---------- tablet & mobile: single column ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 0; max-width: 720px; }
  .profile { position: static; margin-top: -90px; }
  .contacts { display: grid; justify-content: center; }   /* one shared column: groups stay left-aligned with each other */
  .contact { justify-items: start; }
  .profile .btn { width: auto; }

  .mini-bar {
    display: flex; align-items: center; gap: .65rem;
    position: fixed; inset: 0 0 auto 0; z-index: 3;
    height: 56px; padding: 0 7.5rem 0 1rem;     /* right side leaves room for the language switcher */
    background: rgb(255 255 255 / .92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 16px rgb(0 0 0 / .06);
    transform: translateY(-100%); visibility: hidden;
    transition: transform .3s cubic-bezier(.2, .7, .2, 1), visibility 0s .3s;
  }
  .profile-out .mini-bar { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
  .mini-home { display: flex; align-items: center; gap: .65rem; min-width: 0; color: var(--text); text-decoration: none; }  /* "#top" scrolls to the top */
  .mini-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; flex: none; }
  .mini-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini-dl {
    margin-left: auto; flex: none; display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff;
  }
}

@media (max-width: 640px) {
  .layout { padding: 0 .75rem; }
  .profile { padding: 1rem .9rem; margin-top: -80px; }
  .avatar { width: 120px; height: 120px; margin-bottom: .6rem; }
  h1 { font-size: 1.6rem; }
  .position { margin-bottom: .75rem; }
  .contacts { padding-top: .75rem; margin-bottom: 1rem; }
  .contact { gap: .35rem; }
  .contact + .contact { margin-top: .6rem; padding-top: .6rem; }
  section { margin-top: 2.25rem; }
  .summary, .skills { padding-inline: .75rem; }
  .summary, .bullets { text-align: left; }   /* justify leaves wide gaps on narrow screens */
  .skill-group { grid-template-columns: 1fr; gap: .4rem; }
  .timeline { padding-left: 1rem; }
  .entry::before { left: calc(-1rem - 7px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .mini-bar { transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

@media print {
  .cover, .btn, .skip, .mini-bar { display: none; }
  .layout { display: block; }
  .profile { position: static; margin: 1rem 0; box-shadow: none; }
}

/* ---------- language switcher ---------- */
.lang-switch {
  position: fixed; top: 1rem; right: 1rem; z-index: 4;
  display: flex; padding: 3px; gap: 2px;
  background: rgb(255 255 255 / .85); backdrop-filter: blur(6px);
  border-radius: 999px; box-shadow: 0 2px 10px rgb(0 0 0 / .15);
}
.lang-switch a {
  padding: .3rem .7rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700; letter-spacing: .05em;
  color: var(--muted); text-decoration: none;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] { background: var(--accent); color: #fff; }
.lang-switch a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 960px) { .lang-switch { top: 11px; right: .75rem; } }

@media print {
  .lang-switch { display: none; }
}

