/* Mihai Calancea CV. Mobile first: base styles are the phone, min-width queries add the desktop. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #0c2340;
  --blue: #1d5aa6;
  --sky: #a9cbf7;
  --ink: #2a3a50;
  --muted: #566780;
  --line: #dde4ed;
  --wash: #f3f6fb;
  --white: #ffffff;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); }

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

.wrap { width: min(100% - 2rem, 50rem); margin-inline: auto; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .625rem 1rem;
  background: var(--navy);
  color: var(--white);
}
.skip:focus { top: 1rem; color: var(--white); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .5rem 1rem;
  border: 1px solid var(--navy);
  border-radius: 3px;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn--secondary { background: var(--white); color: var(--navy); }
.btn--secondary:hover { background: var(--wash); color: var(--navy); }
.btn--light { border-color: var(--white); background: var(--white); color: var(--navy); }
.btn--light:hover { border-color: var(--sky); background: var(--sky); color: var(--navy); }
.btn--outline { border-color: rgba(255, 255, 255, .55); background: transparent; color: var(--white); }
.btn--outline:hover { border-color: var(--white); background: rgba(255, 255, 255, .1); color: var(--white); }

/* Banner: photo frame beside the name, then the short introduction and key facts */
.banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: 2.75rem .5rem;
  background: var(--navy);
  color: #dbe6f4;
}
.banner::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: -1;
  background:
    radial-gradient(38% 46% at 74% 34%, rgba(58, 122, 206, .4), transparent 72%),
    radial-gradient(32% 40% at 20% 78%, rgba(29, 90, 166, .34), transparent 72%);
}
.banner :focus-visible { outline-color: var(--white); }

.banner__grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "photo id"
    "intro intro"
    "actions actions"
    "facts facts";
  column-gap: 1.125rem;
  align-items: center;
}

.portrait {
  grid-area: photo;
  position: relative;
  width: 6.5rem;
  aspect-ratio: 1;
  padding: .3125rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
/* The bright arc that travels around the frame */
.portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 58%, rgba(169, 203, 247, .25) 72%, var(--white) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
}
.portrait__frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(150deg, #1c4a84, #12335e);
}
.portrait__frame img { width: 100%; height: 100%; object-fit: cover; }

.banner__id { grid-area: id; }
.banner__name {
  color: var(--white);
  font-size: clamp(2.25rem, 10.5vw, 3rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.03em;
}
.banner__role { margin-top: .5rem; color: var(--sky); font-size: 1rem; font-weight: 500; line-height: 1.35; }
.banner__intro { grid-area: intro; margin-top: 1.5rem; font-size: 1.0625rem; }
.banner__actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; }
.banner__actions .btn { flex: 1 1 auto; }

.facts { grid-area: facts; margin-top: 2rem; border-top: 1px solid rgba(255, 255, 255, .18); }
.facts > div { padding-block: .875rem; }
.facts > div + div { border-top: 1px solid rgba(255, 255, 255, .1); }
.facts dt { color: var(--sky); font-size: .8125rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.facts dd { color: var(--white); font-weight: 500; line-height: 1.4; }

/* Sections */
.section { padding-block: 3.25rem; border-top: 1px solid var(--line); }
.banner + main .section:first-child { border-top: 0; }
.section__title {
  margin-bottom: 2rem;
  color: var(--navy);
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.022em;
}
.section__title::after {
  content: "";
  display: block;
  width: 3rem;
  height: 2px;
  margin-top: .875rem;
  background: var(--blue);
  transform-origin: left;
}

/* Resume entries: the title, place, date and bullets of every experience */
.entry + .entry { margin-top: 2.25rem; padding-top: 2.25rem; border-top: 1px solid var(--line); }

.entry__title {
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.008em;
}
.entry__meta { margin-top: .25rem; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.entry__date {
  margin-top: .25rem;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.entry__points { margin-top: 1rem; padding-left: 1.25rem; list-style: disc; }
.entry__points li { padding-left: .25rem; }
.entry__points li + li { margin-top: .5rem; }
.entry__points li::marker { color: var(--blue); }

/* Skills */
.skills li { padding-block: .8125rem; border-top: 1px solid var(--line); color: var(--navy); font-weight: 500; }

/* Languages */
.languages > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .8125rem;
  border-top: 1px solid var(--line);
}
.languages dt { color: var(--navy); font-weight: 500; }
.languages dd { color: var(--muted); }

/* About */
.prose { max-width: 39rem; }
.prose p + p { margin-top: 1.125rem; }

.subhead {
  margin-top: 2.5rem;
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.008em;
}
.interests { margin-top: .375rem; word-spacing: .08em; }

/* Contact */
.contact__label { color: var(--muted); font-size: 1rem; }
.contact__email {
  display: inline-block;
  padding-block: .375rem;
  color: var(--blue);
  font-size: clamp(1.1875rem, 5.4vw, 1.875rem);
  font-weight: 500;
  letter-spacing: -.012em;
  overflow-wrap: anywhere;
}

/* Footer: logos stay on white so the EU emblem keeps its clear space */
.footer { padding-block: 2.75rem 2rem; border-top: 1px solid var(--line); font-size: .8125rem; line-height: 1.6; color: var(--muted); }

.logos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
  align-items: center;
  margin-bottom: 1.75rem;
}

.footer__line { max-width: 42rem; }
.nowrap { white-space: nowrap; }
.footer__line + .footer__line { margin-top: .75rem; }

.footer__row {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.footer__links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.footer__links a,
.footer__links button {
  display: inline-flex;
  align-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  cursor: pointer;
}
.footer__links a:hover,
.footer__links button:hover { color: var(--navy); }

/* Legal and 404 pages */
.topbar { padding-block: 1rem; border-bottom: 1px solid var(--line); }
.topbar a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--navy);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.008em;
  text-decoration: none;
}
.topbar a:hover { color: var(--blue); }

.legal { padding-block: 3rem 4rem; }
.legal h1 {
  color: var(--navy);
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.022em;
}
.legal h2 { margin-top: 2.25rem; color: var(--navy); font-size: 1.25rem; font-weight: 600; letter-spacing: -.008em; }
.legal p { max-width: 39rem; margin-top: 1rem; }
.legal ul { max-width: 39rem; margin-top: 1rem; padding-left: 1.25rem; list-style: disc; }
.legal li + li { margin-top: .625rem; }
.legal li::marker { color: var(--blue); }
.legal__date { color: var(--muted); font-size: 1rem; }

/* The cookies table becomes labelled rows on a phone */
.legal__table { width: 100%; margin-top: 1.5rem; border-collapse: collapse; font-size: 1rem; }
.legal__table thead { display: none; }
.legal__table tr { display: block; padding-block: .875rem; border-top: 1px solid var(--line); }
.legal__table td { display: block; padding-block: .125rem; }
.legal__table td::before { content: attr(data-label) ": "; color: var(--muted); }
.legal__table code { font-family: inherit; font-weight: 600; color: var(--navy); }

/* Consent banner, only present when analytics is on */
.consent {
  position: fixed;
  left: .75rem;
  right: .75rem;
  bottom: .75rem;
  z-index: 20;
  max-height: calc(100dvh - 1.5rem);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(12, 35, 64, .14);
  font-size: .875rem;
  line-height: 1.5;
}
.consent[hidden] { display: none; }
.consent__title { margin-bottom: .375rem; color: var(--navy); font-size: 1rem; font-weight: 600; }
.consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .75rem; }

@media (min-width: 30rem) {
  .skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
}

@media (min-width: 40rem) {
  .banner { padding-block: 4.5rem 0; }
  .banner__grid {
    grid-template-areas:
      "photo id"
      "photo intro"
      "photo actions"
      "facts facts";
    column-gap: 2.75rem;
  }
  .portrait { width: 11rem; padding: .5rem; }
  .banner__name { font-size: clamp(3rem, 7.4vw, 4.5rem); }
  .banner__role { margin-top: .625rem; font-size: 1.25rem; }
  .banner__intro { margin-top: 1.125rem; }
  .banner__actions { gap: .75rem; margin-top: 1.5rem; }
  .banner__actions .btn { flex: none; padding-inline: 1.375rem; }
  .facts { display: grid; grid-template-columns: repeat(3, auto); margin-top: 3.25rem; }
  .facts > div { padding-block: 1.375rem; }
  .facts > div + div { padding-left: 1.25rem; border-top: 0; border-left: 1px solid rgba(255, 255, 255, .12); }
  .facts dd { font-size: 1rem; }
  .section { padding-block: 4.75rem; }
  .section__title { margin-bottom: 2.5rem; }

  .entry__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 2rem; }
  .entry__title { grid-column: 1; }
  .entry__meta { grid-column: 1; }
  .entry__date { grid-column: 2; grid-row: 1; margin-top: 0; text-align: right; line-height: 1.625; }

  .logos { display: flex; flex-wrap: wrap; gap: 1.5rem 2.75rem; }
  .footer__row { flex-direction: row; justify-content: space-between; align-items: center; gap: 1.5rem; }

  .legal { padding-block: 4.5rem 6rem; }

  .legal__table thead { display: table-header-group; }
  .legal__table tr { display: table-row; padding: 0; border: 0; }
  .legal__table th,
  .legal__table td { display: table-cell; padding: .75rem 1rem .75rem 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
  .legal__table th { color: var(--navy); font-weight: 600; border-top: 0; }
  .legal__table td::before { content: none; }

  .consent { left: auto; right: 1.25rem; bottom: 1.25rem; width: 25rem; padding: 1.25rem; }
}

@media (min-width: 56rem) {
  .portrait { width: 14rem; }
}

/* Motion. Everything below is off for visitors who ask for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .banner::before { animation: drift 24s ease-in-out infinite alternate; will-change: transform; }
  .portrait { animation: pop .9s cubic-bezier(.2, .8, .2, 1) both; }
  .portrait::before { animation: spin 10s linear infinite; }
  .banner__name { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .08s both; }
  .banner__role { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .18s both; }
  .banner__intro { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .28s both; }
  .banner__actions { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .38s both; }
  .facts > div { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .5s both; }
  .facts > div:nth-child(2) { animation-delay: .6s; }
  .facts > div:nth-child(3) { animation-delay: .7s; }

  /* main.js adds these two classes to what is still below the screen */
  .reveal {
    opacity: 0;
    transform: translateY(1.125rem);
    transition: opacity .65s ease var(--delay, 0ms), transform .65s cubic-bezier(.2, .7, .2, 1) var(--delay, 0ms);
  }
  .reveal.is-in { opacity: 1; transform: none; }
  .section__title.reveal::after { transform: scaleX(0); transition: transform .7s cubic-bezier(.2, .7, .2, 1) .25s; }
  .section__title.reveal.is-in::after { transform: scaleX(1); }

  .skills li { transition: color .2s ease, transform .2s ease; }
  .languages > div { transition: padding-inline .2s ease; }

  @media (hover: hover) {
    .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(12, 35, 64, .22); }
    .skills li:hover { color: var(--blue); transform: translateX(.25rem); }
    .languages > div:hover { padding-inline: .25rem; }
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1.125rem); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: scale(.88); }
  to { opacity: 1; transform: none; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes drift {
  from { transform: translate3d(-4%, -3%, 0) scale(1); }
  to { transform: translate3d(5%, 4%, 0) scale(1.08); }
}

@media print {
  body { font-size: 11pt; }
  .skip, .banner__actions, .consent { display: none; }
  .banner { padding-block: 0 1rem; background: none; color: var(--ink); }
  .banner::before, .portrait::before { display: none; }
  .portrait { box-shadow: none; }
  .banner__name, .banner__role, .facts dt, .facts dd { color: var(--navy); }
  .banner *, .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
  .section { padding-block: 1rem; }
  .entry { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
