/* ==========================================================================
   Luca Bordino — Research Portfolio
   Plain CSS, no build step. Change --accent to retheme the whole site.
   ========================================================================== */

:root {
  --accent: #00f5d4;
  --info: #38bdf8;

  --bg: #0a0a0c;
  --surface: #0f131b;
  --line: #1f2430;
  --line-soft: #151a24;
  --line-hover: #334155;

  --text: #f4f4f5;
  --muted: #94a3b8;
  --dim: #7c8799;

  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --cond: "Barlow Condensed", sans-serif;

  --max: 1200px;
  --gutter: 24px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--bg); padding: 8px 14px; border-radius: 6px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--bg); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section { border-top: 1px solid var(--line); scroll-margin-top: 64px; }
.section > .container { padding-block: 64px; display: flex; flex-direction: column; gap: 24px; }

.section-title {
  margin: 0; font-size: 26px; letter-spacing: -0.02em; font-weight: 600;
}
.section-title .num {
  font-family: var(--mono); color: var(--dim); font-size: 14px; font-weight: 500; margin-right: 12px;
}

/* Animations ------------------------------------------------------------ */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
.caret {
  display: inline-block; width: 7px; height: 12px; background: var(--text);
  vertical-align: -2px; animation: blink 1s step-end infinite;
}

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); font-size: 14px; color: var(--text);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--line-hover); background: var(--surface); color: var(--text); }
.btn--primary {
  padding: 0 18px; background: var(--accent); border-color: var(--accent);
  color: var(--bg); font-weight: 600;
}
.btn--primary:hover { background: var(--accent); color: var(--bg); filter: brightness(1.1); }
.btn--soon,
.btn--soon:hover {
  background: transparent; color: var(--accent); border-style: dashed;
  filter: none; cursor: default;
}

/* Key/value lists ------------------------------------------------------- */
.kv {
  margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 20px;
  font-family: var(--mono); font-size: 13px;
}
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }
.kv--boxed { gap: 10px 20px; border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.kv--ruled { border-top: 1px solid var(--line); padding-top: 16px; }

/* ==========================================================================
   Nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 12, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding-block: 16px;
}
.nav__brand {
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.nav__links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px;
  font-family: var(--mono); font-size: 13px;
}
.nav__links a { color: var(--muted); }
.nav__links a:hover,
.nav__links a[aria-current="true"] { color: var(--accent); }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-block: 88px 64px;
  display: flex; flex-wrap: wrap; gap: 48px; align-items: center; justify-content: space-between;
  scroll-margin-top: 64px;
}
.hero__text { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero__eyebrow { font-family: var(--mono); font-size: 13px; color: var(--info); }
.hero h1 {
  margin: 0; font-size: clamp(38px, 6vw, 64px); line-height: 1.04;
  letter-spacing: -0.035em; font-weight: 600;
}
.hero__lead { margin: 0; max-width: 640px; color: var(--muted); font-size: 17px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.hero__side { flex: 0 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.hero__photo {
  margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  aspect-ratio: 1 / 1; background: var(--surface);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 50%; }

/* ==========================================================================
   Projects
   ========================================================================== */
#projects > .container { gap: 72px; }
.section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px;
}
.section-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 480px; }

.project { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.project--reverse { flex-wrap: wrap-reverse; }
.project__text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.project__tag { font-family: var(--mono); font-size: 12px; color: var(--info); }
.project h3 { margin: 0; font-size: 28px; letter-spacing: -0.02em; font-weight: 600; }
.project p { margin: 0; color: var(--muted); font-size: 16px; }

/* Phone mockup ---------------------------------------------------------- */
.phone-wrap { margin: 0; flex: 0 0 auto; display: flex; justify-content: center; width: 300px; max-width: 100%; }
.phone {
  position: relative; width: 300px; height: 640px; border-radius: 48px;
  background: #16181d; padding: 11px; border: 1px solid #2a2f3a;
  box-shadow: 0 0 0 2px #0b0c0f, 0 30px 80px rgba(0, 0, 0, .6);
}
.phone__screen {
  position: relative; width: 100%; height: 100%; border-radius: 38px; overflow: hidden;
  display: flex; flex-direction: column; color: var(--text);
}
.phone__island {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 26px; border-radius: 20px; background: #000; z-index: 3;
}
.phone__glare {
  position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: linear-gradient(125deg, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, 0) 30%);
}
.phone__scroll {
  flex: 1; overflow-y: auto; padding: 48px 14px 14px;
  scrollbar-width: none;
}
.phone__scroll::-webkit-scrollbar { display: none; }

/* --- A · Endurance Lab app (Lexend + Barlow Condensed) --- */
.el { background: #0f1116; font-family: Lexend, var(--sans); }
.el .c { font-family: var(--cond); font-weight: 700; }
.el__sub { color: #b8bcc8; }
.el__stack { display: flex; flex-direction: column; gap: 12px; }
.el__date { font-size: 12px; letter-spacing: .06em; color: #b8bcc8; }
.el__greet { font-weight: 600; font-size: 21px; letter-spacing: -0.01em; line-height: 1.2; }
.el__steps { display: flex; gap: 10px; font-size: 10.5px; color: #b8bcc8; }
.el__steps .c { font-size: 13px; color: var(--text); }
.el__week { border-radius: 18px; background: #4a3d7e; padding: 12px 12px 8px; }
.el__row { display: flex; justify-content: space-between; align-items: baseline; }
.el__row--center { align-items: center; }
.el__lav { color: #e4defc; }
.el__chip { font-size: 9.5px; background: #231d40; border-radius: 999px; padding: 3px 8px; color: #e4defc; }
.el__week svg { display: block; width: 100%; height: auto; }
.el__h { font-size: 16px; letter-spacing: .04em; }
.el__card { border: 1px solid #262a33; border-radius: 14px; background: #171a21; }
.el__grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.el__grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.el__spark { padding: 10px 0 0; overflow: hidden; }
.el__spark > div { padding: 0 10px; }
.el__spark svg { display: block; width: 100%; height: 30px; }
.el__sleep { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.el__legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 9px; color: #b8bcc8; }
.el__perf { border-radius: 12px; padding: 8px; }
.el__perf .label { font-size: 11px; color: #c4b5fd; }
.el__perf .value { font-size: 19px; }

.el__search {
  display: flex; align-items: center; gap: 8px; border: 1px solid #262a33; border-radius: 999px;
  padding: 7px 12px; color: #b8bcc8; font-size: 11px;
}
.el__latest { position: relative; overflow: hidden; border-radius: 18px; background: #4a3d7e; padding: 14px; }
.el__latest > * { position: relative; }
.el__latest .bg-icon { position: absolute; right: 8px; top: 8px; width: 70px; height: 70px; }
.el__list { padding: 0 10px; }
.el__item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #232733; }
.el__item:last-child { border-bottom: 0; }
.el__item-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; background: #4a3d7e;
  display: flex; align-items: center; justify-content: center;
}
.el__item-name { font-weight: 600; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.el__tabbar {
  display: flex; justify-content: space-around; padding: 8px 6px 16px;
  background: #15181e; border-top: 1px solid #1f232b;
}
.el__tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 64px; min-height: 44px; border: 0; background: transparent; padding: 0;
  color: #b8bcc8; font-family: Lexend, var(--sans); font-size: 10px; font-weight: 500;
}
.el__tab .pill {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 24px; border-radius: 12px; transition: background-color .15s ease;
}
.el__tab[aria-selected="true"] { color: var(--text); }
.el__tab[aria-selected="true"] .pill { background: #4f4a1e; color: #f0d75a; }

/* --- C · Wellbeing app (Figtree) --- */
.wb { background: #111418; font-family: Figtree, var(--sans); }
.wb .phone__scroll { display: flex; flex-direction: column; gap: 12px; }
.wb__sub { color: #a7adb8; }
.wb__greet { font-weight: 700; font-size: 21px; letter-spacing: -0.01em; line-height: 1.2; }
.wb__coach { border-radius: 18px; background: #134236; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.wb__coach-badge {
  width: 24px; height: 24px; border-radius: 50%; background: #5fd3b4;
  display: flex; align-items: center; justify-content: center;
}
.wb__moods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.wb__mood {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0;
  min-height: 44px; border-radius: 10px; border: 1px solid #0f2e26; background: #0f2e26;
  color: #e6f7f1; font-family: Figtree, var(--sans); font-size: 8.5px; font-weight: 600;
  transition: background-color .15s ease, color .15s ease;
}
.wb__mood[aria-pressed="true"] { background: #5fd3b4; border-color: #5fd3b4; color: #0d2b23; }
.wb__plan { border: 1px solid #262b33; border-radius: 14px; background: #171b21; padding: 0 10px; }
.wb__task {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border: 0; border-bottom: 1px solid #262b33; background: transparent;
  color: var(--text); font-family: Figtree, var(--sans); text-align: left;
}
.wb__check {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  border: 1.6px solid #a7adb8; display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.wb__check svg { stroke: transparent; }
.wb__task[aria-pressed="true"] .wb__check { background: #5fd3b4; border-color: #5fd3b4; }
.wb__task[aria-pressed="true"] .wb__check svg { stroke: #0d2b23; }
.wb__task[aria-pressed="true"] .wb__task-title { text-decoration: line-through; }
.wb__task-title { display: block; font-weight: 600; font-size: 11.5px; }
.wb__task-sub { display: block; font-size: 9.5px; color: #a7adb8; }
.wb__task-icon {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.wb__fab {
  position: absolute; right: 14px; bottom: 72px; z-index: 2; width: 42px; height: 42px;
  border-radius: 50%; background: #5fd3b4; display: flex; align-items: center; justify-content: center;
}
.wb__tabbar {
  display: flex; justify-content: space-around; padding: 8px 4px 16px;
  background: #171b21; border-top: 1px solid #22262d;
  font-size: 9.5px; font-weight: 600; color: #a7adb8;
}
.wb__tabbar > span { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wb__tabbar .ic { height: 22px; display: flex; align-items: center; }
.wb__tabbar .ic--on { width: 44px; justify-content: center; border-radius: 11px; background: #1d4a40; }

/* Laptop mockup (B · modeling toolchain) -------------------------------- */
.laptop { margin: 0; flex: 1 1 600px; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.laptop__lid {
  width: 100%; background: #16181d; border: 1px solid #2a2f3a;
  border-radius: 16px 16px 4px 4px; padding: 12px 12px 18px;
}
.laptop__base {
  width: 112%; max-width: calc(100% + 80px); height: 14px; position: relative;
  background: linear-gradient(#2a2f3a, #16181d); border-radius: 0 0 14px 14px;
}
.laptop__base::after {
  content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 90px; height: 5px; border-radius: 0 0 6px 6px; background: #0e1015;
}
.desk {
  aspect-ratio: 16 / 10; background: #0b0d12; border-radius: 4px; overflow: hidden;
  display: flex; flex-direction: column; font-family: var(--mono); font-size: 11px;
}
.desk__bar {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px;
  background: #07080b; border-bottom: 1px solid #1a1f2a; color: var(--muted); font-size: 10.5px;
}
.desk__bar .right { margin-left: auto; }
.desk__ws { display: flex; gap: 4px; }
.desk__ws button {
  min-width: 22px; height: 18px; padding: 0 5px; border-radius: 4px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-family: var(--mono); font-size: 10px;
}
.desk__ws button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.desk__tiles { flex: 1; display: flex; gap: 6px; padding: 6px; min-height: 0; }
.win {
  min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: #0a0c10;
  display: flex; flex-direction: column; overflow: hidden;
}
.win--focus { border-color: var(--accent); }
.win__title {
  display: flex; justify-content: space-between; padding: 4px 8px;
  border-bottom: 1px solid #1a1f2a; color: var(--dim); font-size: 10px;
}
.term { flex: 1 1 52%; }
.term__body { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.term__body > div { white-space: pre-wrap; word-break: break-word; }
.term__foot {
  padding: 6px 8px; border-top: 1px solid #1a1f2a;
  display: flex; justify-content: space-between; align-items: center;
}
.term__run {
  height: 24px; padding: 0 10px; border-radius: 5px; border: 1px solid #2a3140;
  background: var(--surface); color: var(--text); font-family: var(--mono); font-size: 10.5px;
  transition: border-color .15s ease;
}
.term__run:hover { border-color: var(--accent); }
.plot { flex: 1 1 48%; }
.plot__body { flex: 1; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.plot__body svg { display: block; width: 100%; }
.plot__hr { flex: 1; min-height: 0; }
.editor { flex: 1; display: flex; flex-direction: column; min-height: 0; margin: 6px; }
.editor__tabs { display: flex; border-bottom: 1px solid #1a1f2a; font-size: 10px; }
.editor__tabs span { padding: 4px 10px; color: var(--dim); }
.editor__tabs span.on { background: #111520; color: var(--text); }
.editor__code { flex: 1; padding: 8px 0; overflow: hidden; }
.editor__code > div { display: flex; gap: 12px; white-space: pre; }
.editor__code .ln { width: 26px; text-align: right; color: #4b5563; flex: 0 0 auto; }
.editor__status {
  display: flex; justify-content: space-between; padding: 3px 10px;
  background: var(--accent); color: var(--bg); font-size: 10px; font-weight: 600;
}
[hidden] { display: none !important; }

/* ==========================================================================
   Research / Publications / Stack / Contact
   ========================================================================== */
#research > .container { gap: 32px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.card {
  border: 1px solid var(--line); border-radius: 12px; padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s ease, background-color .2s ease;
}
.card:hover { border-color: var(--line-hover); background: var(--surface); }
.card__tag { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

.pubs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.pub { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.pub__year { font-family: var(--mono); font-size: 13px; color: var(--dim); width: 60px; }
.pub__body { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pub__title { font-weight: 500; }
.pub__meta { font-size: 14px; color: var(--muted); }
.pub__meta .me { color: var(--text); }
.pub__links { display: flex; gap: 8px; font-family: var(--mono); font-size: 12px; }
.pub__links a { color: var(--info); }

.pubs-soon {
  margin: 0; display: flex; flex-direction: column; gap: 8px;
  border: 1px dashed var(--line); border-radius: 12px; padding: 24px;
  font-family: var(--mono); font-size: 14px; color: var(--muted);
}
.pubs-soon .caret { margin-left: 6px; }

.stack {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  font-family: var(--mono); font-size: 13px;
}
.stack > div { background: var(--bg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stack .path { color: var(--dim); font-size: 11px; }

.footer > .container {
  padding-block: 64px 48px;
  flex-direction: row; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-end;
}
.footer__main { display: flex; flex-direction: column; gap: 12px; }
.footer__prompt { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.footer__email { font-size: clamp(22px, 3.4vw, 34px); font-weight: 600; letter-spacing: -0.02em; word-break: break-word; }
.footer__main p { margin: 0; color: var(--muted); font-size: 14px; }
.footer__meta {
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  display: flex; flex-direction: column; gap: 4px; text-align: right;
}

/* Small screens --------------------------------------------------------- */
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .hero { padding-block: 56px 48px; }
  .section > .container { padding-block: 48px; }
  .site-header { position: static; }
  .status-pill { display: none; }
  .footer__meta { text-align: left; }
  /* the laptop demo is dense — let it scroll sideways rather than squash */
  .laptop { overflow-x: auto; align-items: flex-start; }
  .laptop__lid { min-width: 560px; }
  .laptop__base { display: none; }
}
