/* ==========================================================================
   components.css  -  buttons, figures, photo slots, timeline, lists, tables
   ========================================================================== */

/* ----- Buttons and links ----- */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.4rem 0 0; }
.btn {
  display: inline-block; padding: 0.6rem 1.15rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: var(--step--1);
  text-decoration: none; color: #fff; border: 1px solid var(--line);
  background: var(--panel); transition: border-color .15s, box-shadow .15s, color .15s;
}
.btn:hover { color: #fff; border-color: var(--accent); box-shadow: 0 0 18px -4px var(--accent); }
.btn--solid { background: var(--accent); color: #000; border-color: var(--accent); }
.btn--solid:hover { color: #000; box-shadow: 0 0 24px -2px var(--accent); }

/* ----- Tags ----- */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.4rem; }
.tags li { margin: 0; }
.tag {
  display: inline-block; padding: 0.2rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 500;
}
.tag--muted { border-color: var(--line); color: var(--muted); }

/* ----- Figures (paper figures sit on white, so they get a lit frame) ----- */
.fig { margin: 0 0 1.5rem; }
.fig__frame {
  background: #fff; border-radius: 8px; padding: 10px;
  box-shadow: 0 0 0 1px var(--accent), 0 0 34px -8px var(--accent);
  cursor: zoom-in;
}
.fig__frame img { margin-inline: auto; }
.fig figcaption { color: var(--muted); font-size: var(--step--1); line-height: 1.5; margin-top: 0.7rem; max-width: 70ch; }
.fig figcaption strong { color: var(--text); }

/* ----- Empty slot, shown when an image file is missing ----- */
.slot {
  display: grid; place-content: center; text-align: center; gap: 0.35rem;
  min-height: 190px; padding: 1.25rem; border-radius: 8px;
  border: 1.5px dashed var(--accent); color: var(--muted);
  font-family: var(--font-display); font-size: var(--step--1);
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.025) 14px 28px);
}
.slot code { color: var(--accent); word-break: break-all; }
.slot strong { color: #fff; font-size: var(--step-0); }

.photo-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 1.5rem; }
.photo { margin: 0; }
.photo img { border-radius: 8px; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #000; box-shadow: 0 0 0 1px var(--line), 0 0 30px -10px var(--accent); }
.photo--light img { background: #fff; }
.photo .slot { aspect-ratio: 4 / 3; min-height: 0; }
.photo figcaption { color: var(--muted); font-size: var(--step--1); margin-top: 0.5rem; }

/* ----- Panels (used sparingly; sizes differ on purpose) ----- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem;
}
.panel--glow { border-color: var(--accent); box-shadow: 0 0 40px -14px var(--accent); }

/* Project panels on the home page: each has its own color */
.projects { display: grid; gap: 1.25rem; grid-template-columns: 1.3fr 1fr 1fr; }
@media (max-width: 900px) { .projects { grid-template-columns: 1fr; } }
.project {
  display: flex; flex-direction: column; padding: 1.6rem; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--c, var(--line));
  text-decoration: none; color: var(--text);
  box-shadow: 0 0 36px -16px var(--c);
  transition: box-shadow .2s, transform .2s;
}
.project:hover { color: var(--text); box-shadow: 0 0 46px -8px var(--c); transform: translateY(-2px); }
.project h3 { color: var(--c); }
.project p { color: var(--muted); flex: 1; }
.project__status { font-family: var(--font-display); font-size: var(--step--1); color: var(--text); margin: 0; }
.project--cardiac { --c: var(--orange); }
.project--dorsal  { --c: var(--violet); }
.project--v4      { --c: var(--cyan); }

/* ----- Timeline (education is a real sequence) ----- */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.4rem 1.4rem; margin: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 0.5em; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.timeline__when { font-family: var(--font-display); font-size: var(--step--1); color: var(--muted); display: block; }
.timeline__what { display: block; font-family: var(--font-display); font-weight: 600; color: #fff; }

/* ----- Experience entries ----- */
.entry { margin-bottom: 2rem; }
.entry h3 { margin-bottom: 0.15em; }
.entry__meta { color: var(--muted); font-size: var(--step--1); margin: 0 0 0.6rem; font-family: var(--font-display); }
.entry ul { margin-bottom: 0; }

/* ----- Publication list ----- */
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: 0.9rem 0; margin: 0; border-bottom: 1px solid var(--line); }
.pubs li:first-child { padding-top: 0; }
.pubs__title { color: #fff; }
.pubs__note { color: var(--muted); font-size: var(--step--1); display: block; }

/* ----- Skill and fact lists ----- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.5rem; margin: 0 0 1.5rem; }
.facts dt { font-family: var(--font-display); font-weight: 600; color: #fff; }
.facts dd { margin: 0; color: var(--muted); }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; gap: 0.1rem; } .facts dd { margin-bottom: 0.8rem; } }

.plain-list { list-style: none; padding: 0; }
.plain-list li { padding-left: 1rem; border-left: 2px solid var(--accent); margin-bottom: 0.7rem; }

/* ----- Steps (a true sequence, so numbers are fine) ----- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.1rem 3rem; margin: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05em;
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: #000; background: var(--accent);
  box-shadow: 0 0 14px -2px var(--accent);
}
.steps strong { display: block; font-family: var(--font-display); }

/* ----- Table ----- */
.table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.map { width: 100%; border-collapse: collapse; min-width: 680px; font-size: var(--step--1); line-height: 1.5; }
.map th, .map td { text-align: left; vertical-align: top; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.map th { font-family: var(--font-display); color: #fff; background: var(--panel-strong); }
.map tr:last-child td { border-bottom: 0; }
.map td:first-child { font-family: var(--font-display); font-weight: 600; color: #fff; white-space: nowrap; }
.map td:nth-child(3) { color: var(--accent-2); }

/* ----- Callout ----- */
.callout { border-left: 3px solid var(--accent); padding: 0.2rem 0 0.2rem 1.1rem; margin: 1.5rem 0; color: var(--muted); max-width: 66ch; }
.callout strong { color: var(--text); }

/* ----- Code block ----- */
.code {
  position: relative; background: #0b0d12; border: 1px solid var(--line); border-radius: 8px;
  padding: 0.9rem 4.5rem 0.9rem 1rem; margin: 0 0 1rem; overflow-x: auto; color: #d7dcea;
}
.code pre { margin: 0; white-space: pre; }
.code button {
  position: absolute; top: 0.5rem; right: 0.5rem; background: var(--panel-strong); color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.15rem 0.55rem; font: 500 0.78rem var(--font-display);
  cursor: pointer;
}
.code button:hover { color: #fff; border-color: var(--accent); }

/* ----- Citation ----- */
.cite { font-size: var(--step--1); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; max-width: 70ch; }

/* ----- Lightbox ----- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center;
  background: rgba(0, 0, 0, 0.92); padding: 1.5rem; cursor: zoom-out;
}
.lightbox.is-open { display: grid; }
.lightbox img { max-height: 92vh; max-width: 94vw; background: #fff; border-radius: 6px; }

/* ----- Live simulations (cardiac page) ----- */
.sims { margin-top: 3rem; display: grid; gap: 1.6rem; }
.sims .block__head { margin-bottom: 0; }
.sim-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem 1.2rem; }
.sim-card h4 { margin: 0 0 0.4rem; font-size: var(--step-0); font-weight: 600; color: #fff; }
.sim-card__how { color: var(--muted); font-size: var(--step--1); max-width: 78ch; margin: 0 0 1rem; }
.sim-card__how strong { color: var(--text); }
.sim-card__frame { display: block; width: 100%; height: 580px; border: 0; background: transparent; }
.sim-note { border: 1px dashed var(--accent); border-radius: 8px; padding: 1rem 1.2rem; color: var(--muted); font-size: var(--step--1); }
.sim-note code { color: var(--accent); }
.sublist { margin: 0.5rem 0 0.25rem; font-size: var(--step--1); color: var(--muted); }
.sublist li { margin-bottom: 0.4rem; }
