/* ============================================================
   Raitis Gorbacevics — portfolio / CV
   Dark, two-column. No framework, no build step.
   ============================================================ */

:root {
  --bg:         #0F131C;
  --bg-raised:  #171D28;
  --text:       #E4E8F0;   /* 15.1:1 on --bg */
  --text-dim:   #8B95A8;   /*  6.2:1 on --bg */
  --accent:     #FF6B5B;   /*  6.6:1 on --bg */
  --rule:       rgba(228, 232, 240, 0.12);

  /* derived from --accent; change all four together */
  --accent-weak:  rgba(255, 107, 91, 0.45);   /* hover borders */
  --accent-faint: rgba(255, 107, 91, 0.12);   /* tinted fills  */
  --on-accent:    #0F131C;                    /* text on an accent background */

  --display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
           "Liberation Mono", monospace;

  --gutter: 10rem;   /* width of the date column */
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: top 0.18s ease;
}
.skip:focus { top: 1rem; }

/* ---------- layout ---------- */

.shell {
  display: grid;
  grid-template-columns: 21rem minmax(0, 1fr);
  gap: 4.5rem;
  max-width: 72rem;
  margin-inline: auto;
  padding: 5rem 2.5rem 7rem;
}

.rail {
  position: sticky;
  top: 3.5rem;
  align-self: start;
}

/* ---------- identity rail ---------- */

.avatar {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
  display: block;
}

.name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 3vw, 2.9rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  margin: 1.6rem 0 0;
}
.name span { display: block; }
.given, .family { color: var(--text); }

.role {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tagline {
  margin: 1.1rem 0 0;
  color: var(--text-dim);
  font-size: 0.93rem;
  line-height: 1.6;
  max-width: 34ch;
}

.meta {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.meta li {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
  line-height: 1.45;
}
.meta .ico {
  width: 0.92rem;
  height: 0.92rem;
  color: var(--accent);
  opacity: 0.85;
  margin-top: 0.22rem;  /* optically centre on the first line */
}
.meta a { text-decoration-color: var(--rule); text-underline-offset: 3px; }
.meta a:hover { color: var(--accent); }

/* ---------- link chips ---------- */

.chips {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.chip:hover {
  color: var(--accent);
  border-color: var(--accent-weak);
}
.chip-cv {
  border-color: var(--accent-weak);
  color: var(--accent);
}
.chip-cv:hover { background: var(--accent-faint); }

.ext { font-size: 0.72em; opacity: 0.75; }

/* ---------- section nav ---------- */

.sectnav { margin-top: 2.5rem; }
.sectnav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.sectnav a {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.3rem 0;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.dash {
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  transition: width 0.22s ease, height 0.22s ease, opacity 0.22s ease;
}
.sectnav a:hover { color: var(--text); }
.sectnav a.is-active { color: var(--accent); }
.sectnav a.is-active .dash { width: 0.45rem; height: 0.45rem; opacity: 1; }

/* ---------- content ---------- */

.content > section { scroll-margin-top: 3rem; }
.content > section + section { margin-top: 4.5rem; }

.sect {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text);
  border-top: 2px solid var(--accent);
  padding-top: 0.85rem;
  margin: 0 0 1.8rem;
}

.prose p { margin: 0 0 1.1rem; max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- entries ---------- */

.entry {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.9rem 0;
  border-bottom: 1px solid var(--rule);
}
.entry:first-of-type { padding-top: 0; }
.entry:last-of-type  { border-bottom: none; padding-bottom: 0; }

.when {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding-top: 0.3rem;
}
.when .range { text-transform: uppercase; line-height: 1.5; }
.when .dur { opacity: 0.72; }

.what h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.org {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
}
.org .kind {
  color: var(--text-dim);
  font-weight: 400;
}
.lede {
  margin: 0.7rem 0 0;
  color: var(--text-dim);
  font-size: 0.93rem;
  max-width: 70ch;
}

.bullets {
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
  max-width: 70ch;
}
.bullets li {
  position: relative;
  padding-left: 1.5rem;   /* an em dash is wide; 1.1rem let it touch the text */
  font-size: 0.93rem;
  line-height: 1.6;
}
.bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: 0.9;
}

.links {
  list-style: none;
  margin: 0.95rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.76rem;
}
.links a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-weak);
}

/* ---------- skills / languages ---------- */

.skills {
  margin: 0;
  display: grid;
  grid-template-columns: calc(var(--gutter) + 2rem) minmax(0, 1fr);
  gap: 0;
}
.skills dt {
  padding-right: 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}
.skills dd {
  margin: 0;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.skills dt:first-of-type, .skills dd:first-of-type { border-top: none; padding-top: 0; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.4;
}
.qual { color: var(--text-dim); font-size: 0.92em; }
.plain { color: var(--text); font-size: 0.93rem; }

/* ---------- footer ---------- */

.foot {
  margin-top: 4.5rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--rule);
  color: var(--text-dim);
  font-size: 0.9rem;
}
.foot p { margin: 0; }
.foot a { color: var(--accent); text-underline-offset: 3px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  :root { --gutter: 7.5rem; }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 3.5rem;
    padding: 3rem 1.5rem 4.5rem;
  }
  .rail { position: static; }
  .sectnav { display: none; }
  .tagline { max-width: 52ch; }
  .content > section + section { margin-top: 3.5rem; }
}

@media (max-width: 620px) {
  .entry, .skills { grid-template-columns: minmax(0, 1fr); }
  .entry { gap: 0.75rem; }
  .skills dt { padding-right: 0; }

  .skills dt { padding-bottom: 0.5rem; border-top: 1px solid var(--rule); }
  .skills dd { padding-top: 0; border-top: none; }
  .skills dd:first-of-type { padding-top: 0; }
  .skills dt:first-of-type { padding-top: 0; }

  .when { padding-top: 0; }
  .when { display: flex; gap: 0.6rem; align-items: baseline; }
  .name { font-size: 2.1rem; }
  .avatar { width: 5.5rem; height: 5.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- print ---------- */

@media print {
  :root {
    --bg: #fff;
    --bg-raised: #fff;
    --text: #000;
    --text-dim: #444;
    --accent: #000;
    --rule: #ccc;
    --gutter: 10rem;   /* wide enough that "JAN 2017 — FEB 2022" stays on one line */
  }

  body { background: #fff; color: #000; font-size: 9.75pt; line-height: 1.4; }

  .skip, .sectnav, .chips, .avatar, .foot { display: none !important; }

  .shell { display: block; max-width: none; padding: 0; }

  /* identity block collapses to a compact letterhead */
  .rail { position: static; margin-bottom: 0.9rem; }
  .name { font-size: 19pt; margin-top: 0; }
  .name span { display: inline; }
  .given::after { content: " "; }
  .role { margin-top: 0.25rem; }
  .tagline { margin-top: 0.45rem; max-width: none; }
  .meta { margin-top: 0.6rem; gap: 0.2rem; max-width: none; }

  .content > section + section { margin-top: 1rem; }
  .sect {
    font-size: 13pt;
    margin-bottom: 0.55rem;
    padding-top: 0;
    padding-bottom: 0.15rem;
    border-top: none;              /* drop the coral slab on paper */
    border-bottom: 1px solid #ccc;
  }

  .prose p { margin-bottom: 0.5rem; max-width: none; }

  .entry { padding: 0.55rem 0; gap: 1rem; }
  .lede    { margin-top: 0.35rem; max-width: none; }
  .bullets { margin-top: 0.4rem; gap: 0.25rem; max-width: none; }
  .links   { margin-top: 0.45rem; gap: 0.15rem 0.8rem; }

  .skills dt, .skills dd { padding: 0.5rem 0; }
  .tag { padding: 0.1rem 0.4rem; border-radius: 3px; }

  /* keep a role, a skill row or a project from straddling a page break */
  .entry, .skills dt, .skills dd { break-inside: avoid; page-break-inside: avoid; }
  .sect { break-after: avoid; page-break-after: avoid; }

  /* spell out destinations that are no longer clickable on paper */
  .links a::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    color: #444;
  }
  .links a { border-bottom: none; }
}
