/* ============================================================
   Andrea Feliz — CV  (light theme, black cards, blue accent)
   ============================================================ */
:root {
  /* Palette: warm ivory paper, graphite cards, muted cobalt */
  --bg: #f4f1ec;
  --ink: #23242b;          /* page text, dark buttons */
  --muted: #6e6a64;
  --line: #e2ddd5;
  --card: #26272e;
  --card-2: #30313a;       /* logo tiles */
  --card-text: #f4f1ec;
  --card-muted: #a8a7ad;
  --card-line: #3b3c45;
  --accent: #4a5fc9;       /* buttons, toggles (white text = 5.6:1) */
  --accent-light: #8c9cf0; /* accents on graphite cards */
  --paper: #fbf9f6;        /* software icon tiles */
  --shadow: 35, 36, 43;
  --radius: 26px;
  --radius-sm: 10px;
  --sidebar: 280px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Self-hosted Manrope (variable 400–800), no requests to Google */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(assets/fonts/manrope-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(assets/fonts/manrope-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;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 "Manrope", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* Masked monochrome icons (take the current text colour) */
.ico {
  display: inline-block;
  width: 1em; height: 1em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
          mask: var(--src) center / contain no-repeat;
}

/* ============ LAYOUT ============ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 72px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;  /* no bottom padding here, or the sticky sidebar gets pushed up at the end */
}

/* ---------- Left column (fixed / sticky) ---------- */
.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column; justify-content: safe center;
  padding: 40px 0 20vh;  /* sits above centre: more room below than above */
}
.profile { animation: rise .9s var(--ease) both; }

.profile__photo {
  width: 184px;
  aspect-ratio: 1 / 1;
  margin: 0 0 22px 18px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-light), #c9bfb2, var(--accent));
  animation: spinIn 1.2s var(--ease) both;
}
.profile__photo img {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 4px solid var(--bg);
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.profile__photo:hover img { transform: scale(1.04) rotate(-2deg); }

/* EN | DE switch */
.lang-switch {
  position: fixed; top: 20px; right: 24px; z-index: 50;
  display: flex; gap: 2px; padding: 3px;
  background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 99px;
  box-shadow: 0 6px 20px -12px rgba(var(--shadow), .35);
}
.lang-switch button {
  border: 0; background: none; cursor: pointer;
  padding: 6px 11px; border-radius: 99px;
  font: 700 12.5px/1 "Manrope", sans-serif; letter-spacing: .04em;
  color: var(--muted);
  transition: background .25s, color .25s;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.profile__name { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }

/* Typewriter role */
.profile__role {
  margin: 4px 0 20px;
  min-height: var(--role-h, 1.6em);  /* set by script to the tallest title */
  font-size: 17px; font-style: italic; color: var(--muted);
}
.typed { color: var(--accent); font-weight: 600; }
.caret { margin-left: 1px; color: var(--accent); font-style: normal; animation: blink 1s steps(1) infinite; }

.profile__meta { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 8px; }
.profile__meta li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; color: var(--muted); }
.profile__meta .ico { font-size: 15px; margin-top: .17em; color: #857f76; }
.profile__meta .sep { display: inline-block; margin: 0 3px; font-size: 1.15em; line-height: 1; color: #857f76; }
.profile__meta a { text-decoration: none; }
.profile__meta a:hover { color: var(--accent); }

.cta { display: grid; grid-template-columns: 1fr; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s, box-shadow .25s;
}
.btn svg, .btn .ico { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(var(--shadow), .45); }
.btn:active { transform: none; }
.btn--accent { background: var(--accent); }
.btn--accent:hover { box-shadow: 0 10px 24px -10px var(--accent); }
.btn--wide { width: 100%; padding: 15px; font-size: 15px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Right column ---------- */
.content { min-width: 0; padding: 72px 0 32px; }
.section { padding: 0 0 80px; }
.section__title {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 24px;
  font-size: 24px; font-weight: 600; letter-spacing: -.01em;
}
.ico--title { font-size: .95em; color: var(--accent); }

/* Mini icon animations: play once when the title scrolls in, replay on hover (script.js) */
.section__title.is-in .ico--title { animation-duration: .9s; animation-timing-function: var(--ease); animation-delay: .35s; animation-fill-mode: both; }
#experience .section__title.is-in .ico--title { animation-name: icoLift;   transform-origin: 50% 100%; }
#education  .section__title.is-in .ico--title { animation-name: icoToss;   transform-origin: 50% 70%; }
#software   .section__title.is-in .ico--title { animation-name: icoBoot; }
#fun-facts  .section__title.is-in .ico--title { animation-name: icoParty;  transform-origin: 15% 85%; }
#contact    .section__title.is-in .ico--title { animation-name: icoFly; animation-duration: 1.1s; }
.section__title { cursor: default; }

@keyframes icoLift  { 0%, 100% { transform: none; } 30% { transform: translateY(-5px) scaleY(1.04); } 55% { transform: translateY(0) scaleY(.92); } 75% { transform: translateY(-1px); } }
@keyframes icoToss  { 0%, 100% { transform: none; } 30% { transform: translateY(-6px) rotate(-14deg); } 60% { transform: translateY(-2px) rotate(6deg); } 80% { transform: rotate(-2deg); } }
@keyframes icoBoot  { 0%, 100% { opacity: 1; } 15% { opacity: .2; } 30% { opacity: 1; } 42% { opacity: .35; } 55%, 90% { opacity: 1; transform: scale(1.08); } }
@keyframes icoParty { 0%, 100% { transform: none; } 15% { transform: rotate(-16deg) scale(1.1); } 30% { transform: rotate(12deg) scale(1.1); } 45% { transform: rotate(-9deg); } 60% { transform: rotate(5deg); } 75% { transform: rotate(-2deg); } }
@keyframes icoFly   { 0% { transform: none; opacity: 1; } 40% { transform: translate(22px, -16px) scale(.6); opacity: 0; } 41% { transform: translate(-22px, 12px) scale(.6); opacity: 0; } 75% { transform: translate(2px, -1px); opacity: 1; } 100% { transform: none; opacity: 1; } }
.section__title .wave { width: 1.25em; height: 1.25em; }
.wave { transform-origin: 70% 75%; animation: wave 2.6s ease-in-out 1s infinite; }

.content > .section > p { font-size: 17px; line-height: 1.7; margin: 0 0 16px; color: #3a3a40; }
.content strong { font-weight: 700; }
.content > .section > p a { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.content > .section > p a:hover { text-decoration-thickness: 2.5px; }

/* ---------- Stats (plain, as in the reference) ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 20px 56px; margin-top: 34px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat__num { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat__label { margin-top: 6px; font-size: 14px; color: var(--muted); }

/* ---------- Black cards ---------- */
.item, .tool, .fact, .form {
  background: var(--card);
  color: var(--card-text);
  border-radius: var(--radius);
}

/* ---------- Accordion (experience / education) ---------- */
.accordion { display: grid; gap: 16px; }
.item { overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s; }
.item:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -24px rgba(var(--shadow), .55); }

.item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 18px;
  padding: 24px 26px 24px 34px;
  cursor: pointer;
  list-style: none;
}
.item.has-logo summary { grid-template-columns: 108px minmax(0, 1fr) auto 24px; padding-left: 26px; }
.item summary::-webkit-details-marker { display: none; }

.item__logo {
  width: 108px; height: 54px;
  border-radius: 8px;
  background: var(--card-2);
  display: grid; place-items: center;
  overflow: hidden;
}
.item__logo img { width: 80%; height: 70%; object-fit: contain; }
/* Custom Freelance mark: viewfinder + pulsing record dot + sparkle */
.item__logo--freelance svg { width: 88%; height: auto; overflow: visible; }
.fl-frame { stroke: var(--card-text); }
.fl-dot { fill: var(--card-text); }
.fl-ring { fill: none; stroke: var(--card-text); stroke-width: 1.5; transform-origin: 20px 20px; animation: flRing 2.4s ease-out infinite; }
.fl-spark { fill: var(--card-text); transform-origin: 37px 3px; animation: flSpark 3.2s ease-in-out infinite; }
.fl-text { fill: var(--card-text); font: 500 13.5px "Manrope", sans-serif; letter-spacing: -.01em; }
.fl-bold { font-weight: 800; }
.item:hover .fl-frame { animation: flFrame .6s var(--ease); }
@keyframes flRing { 0% { transform: scale(1); opacity: .8; } 70%, 100% { transform: scale(2.3); opacity: 0; } }
@keyframes flSpark { 0%, 100% { transform: scale(.6) rotate(0deg); opacity: .5; } 50% { transform: scale(1.1) rotate(90deg); opacity: 1; } }
@keyframes flFrame { 0%, 100% { transform: scale(1); } 40% { transform: scale(.86); } }
.fl-frame { transform-origin: 20px 20px; }

/* Education logos keep their corporate colours */
.item__logo--udc { background: #d70d8b; }
.item__logo--thepower { background: linear-gradient(135deg, #1f3741 0%, #6394a5 50%, #1f3741 100%); }
.item__logo--thepower svg { height: 78%; width: auto; }
.item__logo--aero { background: #fff; }
.item__logo--aero img { width: 86%; height: 80%; }

/* Experience logos sit straight on the card, no tile behind them */
#experience .item__logo { background: none; }


.item__head { display: flex; flex-direction: column; min-width: 0; }
.item__role { font-size: 18px; font-weight: 700; line-height: 1.3; }
.item__org { font-size: 14px; color: var(--card-muted); }
.item__date { font-size: 14px; color: var(--card-muted); white-space: nowrap; }

/* chevron toggle (angle-small-down.svg) */
.item__chev { font-size: 22px; color: var(--card-muted); transition: transform .4s var(--ease), color .3s; }
.item:hover .item__chev { color: var(--card-text); }
.item.is-open .item__chev { transform: rotate(180deg); color: var(--accent-light); }

/* Smooth open/close: script toggles .is-open; grid row animates 0fr -> 1fr */
.item__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.item.is-open .item__body { grid-template-rows: 1fr; }
.item__body > div { overflow: hidden; padding: 0 34px; }
.item.is-open .item__body > div { padding-bottom: 28px; }
.item.has-logo .item__body > div { padding-left: 152px; }

/* Blue dots joined by a line */
.timeline { list-style: none; margin: 0; padding: 0; color: #dedcd8; font-size: 15px; }
.timeline li { position: relative; padding: 0 0 16px 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 0 4px rgba(140, 156, 240, .18);
}
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: 6px; top: calc(.35em + 13px); bottom: -.35em;
  width: 1.5px; background: rgba(140, 156, 240, .55);
}
.timeline strong { color: var(--card-text); }

/* Timeline entrance (MonoCV-style): when a card opens, each dot pops in,
   then its line draws down to the next one, item after item.
   --i is the item index, set by script.js. Closing is instant (no delays). */
.timeline li::before { transform: scale(0); transition: transform .2s ease, box-shadow .2s ease; }
.timeline li::after  { transform: scaleY(0); transform-origin: top; transition: transform .2s ease; }
.timeline li { opacity: 0; translate: -8px 0; transition: opacity .2s ease, translate .2s ease; }

.item.is-open .timeline li {
  opacity: 1; translate: 0 0;
  transition: opacity .45s ease calc(var(--i, 0) * .16s + .12s),
              translate .55s var(--ease) calc(var(--i, 0) * .16s + .12s);
}
.item.is-open .timeline li::before {
  transform: scale(1);
  box-shadow: 0 0 0 4px rgba(140, 156, 240, .18);
  transition: transform .5s cubic-bezier(.34, 1.7, .64, 1) calc(var(--i, 0) * .16s + .1s),
              box-shadow .6s ease calc(var(--i, 0) * .16s + .3s);
  animation: dotPing .9s ease-out calc(var(--i, 0) * .16s + .2s) 1 both;
}
.item.is-open .timeline li::after {
  transform: scaleY(1);
  transition: transform .45s var(--ease) calc(var(--i, 0) * .16s + .3s);
}
@keyframes dotPing {
  0%   { box-shadow: 0 0 0 0 rgba(140, 156, 240, .55); }
  60%  { box-shadow: 0 0 0 9px rgba(140, 156, 240, 0); }
  100% { box-shadow: 0 0 0 4px rgba(140, 156, 240, .18); }
}

/* ---------- Software & fun facts (2-column black cards) ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.tool {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 20px;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.tool:hover, .fact:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(var(--shadow), .55); }
.tool strong, .fact strong { display: block; font-size: 17px; font-weight: 700; line-height: 1.3; }
.tool small, .fact small { display: block; font-size: 13.5px; color: var(--card-muted); margin-top: 2px; }

.tool__icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 9px;
  background: var(--paper);
  display: grid; place-items: center;
}
.tool__icon:has(.adobe) { background: none; }
.tool__icon .adobe {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--bg); color: var(--c);
  border: 1.5px solid var(--c);
  font-weight: 800; font-size: 15px; letter-spacing: -.02em;
}
.tool__icon .brand {
  width: 22px; height: 22px;
  background: var(--c);
  -webkit-mask: var(--src) center / contain no-repeat;
          mask: var(--src) center / contain no-repeat;
}

.fact { padding: 22px 26px; transition: transform .3s var(--ease), box-shadow .3s; }
.fact small { margin-top: 6px; line-height: 1.5; }

/* ---------- Contact form (big black card) ---------- */
.form { padding: 32px; display: grid; gap: 18px; }
.form__intro { margin: 0; color: var(--card-muted); }
.form__topics { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.form__topics legend { font-size: 14px; font-weight: 600; margin-bottom: 10px; padding: 0; }
.form__topics input { position: absolute; opacity: 0; pointer-events: none; }
.form__topics span {
  display: inline-block; padding: 8px 14px;
  border: 1px solid var(--card-line); border-radius: 99px;
  font-size: 14px; color: var(--card-muted); cursor: pointer;
  transition: all .25s;
}
.form__topics span:hover { color: var(--card-text); border-color: #5a5b66; }
.form__topics input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.form__topics input:focus-visible + span { outline: 2px solid var(--accent-light); outline-offset: 2px; }

.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  background: #1f2026;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  color: var(--card-text);
  font: inherit; font-size: 15px;
  resize: vertical;
  transition: border-color .25s, box-shadow .25s;
}
.field input::placeholder, .field textarea::placeholder { color: #939299; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(140, 156, 240, .3); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #ff5d6c; }
.form__note { margin: 0; font-size: 14px; min-height: 1.4em; color: var(--card-muted); }
.form__note.ok { color: #6ee7a0; }
.form__note.err { color: #ff7b87; }

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 24px 0 8px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ============ ANIMATION ============ */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }
.item.reveal.is-in:hover, .tool.reveal.is-in:hover, .fact.reveal.is-in:hover { transform: translateY(-3px); transition-delay: 0s; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes spinIn { from { opacity: 0; transform: scale(.85) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  :root { --sidebar: 250px; }
  .profile__meta li { font-size: 13px; gap: 8px; }
  .layout { gap: 48px; }
  .item.has-logo summary { grid-template-columns: 84px minmax(0, 1fr) auto 24px; }
  .item__logo { width: 84px; }
  .item.has-logo .item__body > div { padding-left: 128px; }
}

/* Tablet & phone: stack columns, sidebar scrolls normally */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 32px 16px 16px; gap: 48px; }
  .sidebar { position: static; height: auto; display: block; padding: 0; }
  .content { padding-top: 0; padding-bottom: 0; }
  .profile { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; align-items: start; }
  .profile__photo { grid-row: span 5; width: 150px; margin: 0; }
  .cta { max-width: 320px; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .profile { display: block; }
  .profile__photo { width: 140px; margin: 0 0 18px; }
  .profile__name { font-size: 26px; }
  .cta { max-width: none; }
  .stats { justify-content: space-between; gap: 12px; }
  .stat__num { font-size: 32px; }
  .stat__label { font-size: 12.5px; text-align: center; }
  .section { padding-bottom: 64px; }
  .section__title { font-size: 21px; }
  .content > .section > p { font-size: 16px; }

  .item summary, .item.has-logo summary {
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 6px 14px;
    padding: 20px;
  }
  .item__logo { grid-column: 1 / -1; width: 96px; height: 46px; margin-bottom: 6px; }
  .item__head { grid-column: 1; grid-row: auto; }
  .item__date { grid-column: 1; }
  .item__chev { grid-column: 2; grid-row: 1; align-self: start; margin-top: 2px; }
  /* cards with a logo: logo and arrow share the first row, centred on each other */
  .item.has-logo .item__logo { grid-column: 1; grid-row: 1; }
  .item.has-logo .item__chev { align-self: center; margin-top: 0; margin-bottom: 6px; }
  .item__role { font-size: 16.5px; }
  .item__body > div, .item.has-logo .item__body > div { padding: 0 20px; }
  .item.is-open .item__body > div { padding-bottom: 22px; }

  .grid2, .form__row { grid-template-columns: 1fr; }
  .tool { padding: 14px 16px; }
  .form { padding: 22px; }
}
