/* AppiTech lab website. Accent colours come from the lab logo (brand/build-marks.py). */
:root {
  --sky: #38bdf8;
  --blue: #2f80ff;
  --indigo: #4f46e5;
  --violet: #8b5cf6;
  --teal: #14b8a6;
  --deep: #1d4ed8;        /* links and small accent text: passes AA on white */
  --action: #1d6ff2;      /* filled buttons: passes AA with white text */

  --ink: #14161f;
  --ink-soft: #4a5063;
  --line: #e2e5ee;
  --paper: #ffffff;
  --paper-alt: #f5f7fb;
  --night: #0b1020;
  --night-2: #0f1a3a;

  --radius: 14px;
  --max: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #6d28d9; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 16, 32, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand:hover { color: #fff; }
.brand-logo { height: 32px; width: auto; }
.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: rgba(255, 255, 255, 0.78); text-decoration: none; font-size: 0.92rem; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.lang-switch {
  margin-left: 8px; padding: 5px 10px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px;
  color: #fff; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-decoration: none;
}
.lang-switch:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(47, 128, 255, 0.38), transparent 60%),
    radial-gradient(700px 420px at 10% 90%, rgba(139, 92, 246, 0.30), transparent 60%),
    linear-gradient(160deg, var(--night) 0%, var(--night-2) 100%);
  padding: 96px 0 88px;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; pointer-events: none; }
.hero .wrap { position: relative; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--deep);
}
.hero .eyebrow { color: #a9c8ff; border: 1px solid rgba(169, 200, 255, 0.35); border-radius: 999px; padding: 6px 14px; }
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.9rem); line-height: 1.08; margin: 22px 0 18px; letter-spacing: -0.02em; max-width: 16ch; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #bcd5ff, #5b9bff 55%, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: rgba(255, 255, 255, 0.8); max-width: 60ch; margin: 0 0 32px; }
.hero p.lead + p.lead { margin-top: -20px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.hero-facts span { font-size: 0.88rem; padding: 6px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); }
.hero-facts b { color: #a9c8ff; font-weight: 600; margin-right: 6px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--deep); color: #fff; }
.btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* ---------- sections ---------- */
section { padding: 88px 0; }
section.alt { background: var(--paper-alt); }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; margin: 10px 0 14px; letter-spacing: -0.01em; }
.section-head p { color: var(--ink-soft); margin: 0; font-size: 1.05rem; }

.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
.about-grid p { color: var(--ink-soft); font-size: 1.05rem; margin-top: 0; }
.pillars { display: grid; gap: 14px; }
.pillar { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.pillar .dot { flex: none; width: 10px; border-radius: 4px; }
.pillar h3 { margin: 0 0 4px; font-size: 1rem; }
.pillar p { margin: 0; font-size: 0.95rem; }

/* research areas, numbered like a call for papers */
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.area {
  position: relative; padding: 26px 24px 24px; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line);
  border-top: 4px solid var(--c, var(--blue));
}
.area .num { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: color-mix(in srgb, var(--c, var(--blue)) 60%, var(--night)); }
.area h3 { margin: 8px 0 10px; font-size: 1.18rem; line-height: 1.3; }
.area p { margin: 0 0 14px; color: var(--ink-soft); font-size: 0.97rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li { font-size: 0.78rem; padding: 3px 9px; border-radius: 6px; background: var(--paper-alt); color: var(--ink-soft); border: 1px solid var(--line); }

/* projects */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filters button {
  font: inherit; font-size: 0.9rem; cursor: pointer; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft);
}
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.project {
  display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20, 22, 31, 0.08); }
.project[hidden] { display: none; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.badge { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.badge.funder { background: #e8f0ff; color: #1d4ed8; }
.badge.ongoing { background: #e0f7f4; color: #0f766e; }
.badge.done { background: #eef0f4; color: #5b6275; }
.badge.domain { background: #f1ebfe; color: #6d28d9; }
.project h3 { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.3; }
.project h3 a { color: inherit; text-decoration: none; }
.project h3 a:hover { color: var(--deep); }
.project .meta { font-size: 0.86rem; color: var(--ink-soft); margin: 0 0 12px; }
.project p.desc { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.96rem; flex: 1; }
.project .links { display: flex; gap: 16px; font-size: 0.92rem; font-weight: 600; }

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.person { display: flex; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.person img, .person .initials { flex: none; width: 76px; height: 76px; border-radius: 50%; object-fit: cover; }
.person .initials { display: grid; place-items: center; background: var(--night-2); color: #fff; font-weight: 700; font-size: 1.3rem; }
.person h3 { margin: 0; font-size: 1.08rem; }
.person .role { margin: 2px 0 10px; color: var(--deep); font-weight: 600; font-size: 0.9rem; }
.person p { margin: 0 0 10px; font-size: 0.94rem; color: var(--ink-soft); }

.person.head { grid-column: 1 / -1; }
.person.head img { width: 112px; height: 112px; }

/* publications */
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pubs li { padding: 16px 20px; border-left: 4px solid var(--c, var(--blue)); background: var(--paper); border-radius: 0 10px 10px 0; }
.pubs .title { font-weight: 600; }
.pubs .venue { color: var(--ink-soft); font-size: 0.92rem; }

/* partners */
.partners { display: flex; flex-wrap: wrap; gap: 14px; }
.partners span { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 0.95rem; color: var(--ink-soft); }

/* contact + footer */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.contact address { font-style: normal; color: var(--ink-soft); }
.site-footer { background: var(--night); color: rgba(255, 255, 255, 0.65); padding: 40px 0; font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer a { color: rgba(255, 255, 255, 0.85); }
.footer-logo { height: 46px; width: auto; background: #fff; padding: 6px 10px; border-radius: 8px; }

/* ---------- project pages ---------- */
.page-hero {
  color: #fff; padding: 56px 0 48px;
  background:
    radial-gradient(700px 360px at 90% 0%, rgba(47, 128, 255, 0.34), transparent 60%),
    radial-gradient(520px 300px at 0% 100%, rgba(139, 92, 246, 0.26), transparent 60%),
    linear-gradient(160deg, var(--night) 0%, var(--night-2) 100%);
}
.crumbs { font-size: 0.9rem; margin-bottom: 18px; color: rgba(255, 255, 255, 0.6); }
.crumbs a { color: #a9c8ff; text-decoration: none; }
.crumbs a:hover { color: #fff; }
.page-hero h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.1; margin: 12px 0 14px; letter-spacing: -0.02em; max-width: 24ch; }
.page-hero .lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: rgba(255, 255, 255, 0.8); max-width: 62ch; margin: 0; }
.page-hero .badges { margin: 0; }

.project-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.prose h2 { font-size: 1.45rem; margin: 40px 0 12px; letter-spacing: -0.01em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-soft); font-size: 1.03rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 16px 0 8px; padding: 0; list-style: none; }
.features li { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); border-top: 3px solid var(--c, var(--blue)); }
.features h3 { margin: 0 0 4px; font-size: 1rem; color: var(--ink); }
.features p { margin: 0; font-size: 0.95rem; }

.figure { margin: 24px 0; }
.figure img { border-radius: 12px; border: 1px solid var(--line); width: 100%; height: auto; }
.figure figcaption { font-size: 0.88rem; color: var(--ink-soft); margin-top: 8px; }

.facts { position: sticky; top: 84px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-alt); }
.facts h2 { margin: 0 0 12px; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--deep); }
.facts dl { margin: 0; }
.facts dt { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-top: 14px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 2px 0 0; font-size: 0.97rem; }
.facts .btn { margin-top: 18px; width: 100%; justify-content: center; }

.other-projects { display: flex; flex-wrap: wrap; gap: 10px; }
.other-projects a { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.other-projects a:hover { border-color: var(--blue); }

/* colour per research area: classes, since the CSP forbids inline styles */
.c-sky { --c: var(--sky); }
.c-blue { --c: var(--blue); }
.c-indigo { --c: var(--indigo); }
.c-violet { --c: var(--violet); }
.c-teal { --c: var(--teal); }
.pillar .dot { background: var(--c); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .about-grid, .contact { grid-template-columns: 1fr; }
  .nav { display: none; }
  .site-header .wrap { justify-content: space-between; }
  section { padding: 64px 0; }
  .hero { padding: 72px 0 64px; }
  .projects, .people { grid-template-columns: 1fr; }
  .project-page { grid-template-columns: 1fr; gap: 32px; }
  .facts { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project { transition: none; }
  .hero canvas { display: none; }
}
