/* ============================================================
   hi·cs — Computer Science, University of Hildesheim
   Modern, clean design system.
   ============================================================ */
:root {
  --navy: #363a5e;            /* deep slate-navy — gradient stop, dark surfaces */
  --slate: #535880;           /* logo wordmark colour — headings on light */
  --brand: #4a5079;           /* primary actions (slate, deepened) */
  --brand-600: #5b6299;       /* slate — links, hovers */
  --brand-300: #9aa0c8;
  --teal: #67bea5;            /* logo connector teal */
  --teal-deep: #2f7d68;       /* deepened teal — safe for white text on colour */
  --accent: #67bea5;          /* teal — badges, primary accent */
  --accent-2: #6dc24b;        /* Hi-CS lime green — secondary accent */
  --lime-deep: #4f8f2e;       /* deepened lime — safe for white text on colour */
  --ink: #262a41;
  --body: #3a3f5c;
  --muted: #6d7290;
  --line: #e6e5ef;
  --bg: #ffffff;
  --surface: #f5f6fb;
  --surface-2: #ececf6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(38,42,65,.05), 0 8px 30px rgba(38,42,65,.07);
  --shadow-lg: 0 20px 50px rgba(43,46,82,.18);
  --maxw: 1140px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  /* sticky footer: main grows, so the footer sits at the bottom even on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
main { flex: 1 0 auto; }
.site-header, .site-footer { flex-shrink: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0 0 .4em; font-weight: 800; letter-spacing: -0.01em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1rem; }
img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 700; color: var(--brand-600); margin: 0 0 .8rem; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand picture { display: flex; }
.brand-logo { display: block; height: 40px; width: auto; }
.brand-sub { font-size: .72rem; line-height: 1.2; color: var(--muted); font-weight: 500; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  color: var(--body); font-weight: 500; font-size: .95rem;
  padding: .5rem .8rem; border-radius: 8px; white-space: nowrap;
}
.site-nav a:hover { background: var(--surface-2); color: var(--brand-600); text-decoration: none; }

/* mobile nav */
.navtoggle, .navtoggle-btn { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .96rem; padding: .72rem 1.3rem;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(74,80,121,.32); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand-600); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); }
.btn-lg { padding: .9rem 1.7rem; font-size: 1.05rem; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--surface-2), var(--bg) 78%); }
.hero-inner { position: relative; z-index: 2; padding: 84px 24px 76px; max-width: 900px; }
.hero-title { font-family: var(--display); font-weight: 900; font-size: clamp(2.3rem, 5.2vw, 3.9rem); letter-spacing: -0.02em; }
.hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--body); max-width: 640px; margin-top: .4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }
.hero-glow {
  position: absolute; inset: -30% -10% auto auto; width: 620px; height: 620px; z-index: 1;
  background: radial-gradient(circle at 60% 40%, rgba(103,190,165,.5), transparent 62%);
  filter: blur(10px); pointer-events: none;
}
.hero-glow-warm { background: radial-gradient(circle at 65% 30%, rgba(109,194,75,.45), rgba(103,190,165,.4) 45%, transparent 72%); }
.hero-ss { background: linear-gradient(135deg, var(--navy) 0%, var(--brand) 55%, var(--teal-deep) 100%); }
.hero-ss .eyebrow { color: #c9e9de; }
.hero-note { color: #b9c3e8; font-size: .88rem; margin-top: 1.2rem; }
.hero-ss .hero-title, .hero-ss .hero-sub { color: #fff; }
.hero-ss .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.hero-ss .btn-ghost:hover { background: rgba(255,255,255,.1); }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-family: var(--display); font-weight: 900; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap; }
.link-more { font-weight: 600; }
.page-hero { padding: 64px 0 24px; background: linear-gradient(180deg, var(--surface-2), var(--bg)); border-bottom: 1px solid var(--line); }
.page-title { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 4vw, 3rem); }
.lede { font-size: 1.18rem; color: var(--body); }
.crumbs { font-size: .85rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs span { margin: 0 .35rem; }

/* ---------- Cards / grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card {
  position: relative; display: block; background: var(--bg); color: var(--body);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px 24px;
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; text-decoration: none; }
.card-acc { position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: var(--accent, var(--brand)); }
.group-card .card-acc { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #fff)); }
.card-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; letter-spacing: .02em; color: #fff;
  background: var(--accent, var(--brand)); border-radius: 8px; padding: .3rem .6rem; margin-bottom: 14px;
}
.card-title { font-size: 1.2rem; margin-bottom: .3rem; }
.card-text { color: var(--body); margin-bottom: .6rem; }
.card-meta { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- Feature (summer school highlight) ---------- */
.feature {
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 0;
  border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--navy), var(--teal-deep));
}
.feature-body { padding: 48px 44px; color: #fff; }
.feature-body .eyebrow { color: #c9e9de; }
.feature-title { color: #fff; font-family: var(--display); font-weight: 900; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.feature-sub { color: #e4f4ee; font-size: 1.1rem; }
.feature-facts { display: flex; flex-wrap: wrap; gap: 22px; margin: 1.4rem 0 1.8rem; }
.feature-facts div { font-size: .98rem; color: #fff; }
.feature-facts span { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: #a8e0cd; margin-bottom: 3px; }
.feature-side { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 40% 40%, var(--teal-deep), var(--navy)); }
.feature-emoji { font-size: 6rem; filter: drop-shadow(0 12px 24px rgba(0,0,0,.35)); }

/* ---------- Summer school page ---------- */
.facts-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; }
.fact span { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: var(--brand-600); font-weight: 700; margin-bottom: 4px; }
.fact strong { font-size: 1.05rem; color: var(--ink); }
.cta-band {
  text-align: center; background: linear-gradient(135deg, var(--teal-deep), var(--lime-deep));
  color: #fff; border-radius: 22px; padding: 52px 24px; box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; font-family: var(--display); }
.cta-band p { color: #eafaf0; max-width: 560px; margin: 0 auto 1.6rem; }
.cta-band .btn-primary { background: #fff; color: var(--teal-deep); }
.cta-band .btn-primary:hover { background: #fff; }

/* group detail hero accent */
.group-hero { border-bottom: 3px solid var(--accent); }
.group-badge { display: inline-block; font-weight: 700; color: #fff; background: var(--accent); border-radius: 8px; padding: .35rem .7rem; margin-bottom: .6rem; }
.group-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 1rem; color: var(--muted); }

/* ---------- Publications ---------- */
.pub-year { margin-bottom: 2.4rem; }
.pub-year-title {
  font-family: var(--display); font-weight: 800; font-size: 1.5rem;
  border-bottom: 2px solid var(--line); padding-bottom: .4rem; margin-bottom: .4rem;
}
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: none; }
.pub-title { font-weight: 600; font-size: 1.04rem; color: var(--ink); }
.pub-meta { color: var(--muted); font-size: .93rem; margin: .2rem 0 0; }
.pub-kind {
  display: inline-block; margin-left: .6rem; padding: .08rem .55rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  color: var(--brand-600); background: var(--surface-2); border-radius: 999px;
  vertical-align: 1px;
}

/* ---------- Rich text ---------- */
.rich { font-size: 1.06rem; }
.rich h2 { font-family: var(--display); font-weight: 800; margin-top: 2rem; }
.rich h3 { margin-top: 1.6rem; }
.rich ul, .rich ol { padding-left: 1.3rem; }
.rich li { margin-bottom: .4rem; }
.rich a { text-decoration: underline; }
.rich table {
  width: 100%; border-collapse: collapse; margin: 1.2rem 0 1.6rem; font-size: .96rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.rich th, .rich td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
.rich th { background: var(--surface); color: var(--ink); font-weight: 700; }
.rich tr:last-child td { border-bottom: none; }

/* ---------- Downloads ---------- */
.download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 1.4rem 0; }
.download-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px;
  color: var(--body); transition: border-color .2s ease, transform .16s ease;
}
.download-card:hover { border-color: var(--teal); transform: translateY(-2px); text-decoration: none; }
.download-icon {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; background: var(--teal-deep); color: #fff;
  font-size: .7rem; font-weight: 800; letter-spacing: .02em;
}
.download-title { font-weight: 700; color: var(--ink); display: block; }
.download-meta { color: var(--muted); font-size: .85rem; margin: 0; }

/* ---------- Funders ---------- */
/* Always a light card, regardless of theme — the funder logos are dark-on-white
   originals and won't read on a dark surface. */
.funders-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px; margin: 1.4rem 0; box-shadow: var(--shadow);
}
.funders-label {
  text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; font-weight: 700;
  color: #6d7290; margin: 0 0 1rem;
}
.funders-row { display: flex; flex-wrap: wrap; align-items: center; gap: 36px; }
.funders-row img { display: block; height: 56px; width: auto; }
/* Compact variant + spacing for the site-wide footer placement */
.footer-funders { margin-top: 8px; }
.funders-card--footer { margin: 0; padding: 18px 22px; }
.funders-card--footer .funders-row img { height: 42px; }

/* ---------- Footer ---------- */
.site-footer { background: #23273f; color: #b4b8d1; margin-top: 40px; padding: 56px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-logo { display: block; height: 42px; width: auto; margin-bottom: .9rem; }
.site-footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .8rem; }
.site-footer a { display: block; color: #b4b8d1; padding: .18rem 0; }
.site-footer a:hover { color: #fff; }
.site-footer .muted { color: #7f83a0; }
.footer-legal { border-top: 1px solid #383c60; margin-top: 32px; padding-top: 20px; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.footer-legal-links { display: flex; gap: 18px; }
.footer-legal-links a { color: #b4b8d1; }
.footer-legal-links a:hover { color: #fff; }
/* offset anchored sections for the sticky header */
.rich h2[id] { scroll-margin-top: 92px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; }
  .feature-side { min-height: 140px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .navtoggle-btn { display: flex; flex-direction: column; gap: 5px; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; }
  .navtoggle-btn span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px 18px;
    gap: 2px; box-shadow: var(--shadow); display: none;
  }
  .navtoggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: .7rem .6rem; }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f5fa; --body: #c3ccda; --muted: #8b95a5;
    --line: #262b42; --bg: #12141f; --surface: #181c2c; --surface-2: #1e2236;
    --brand-600: #a6ade6; --brand-300: #9aa0c8; --teal: #7fd0b8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 30px rgba(0,0,0,.4);
    --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
  }
  .site-header { background: rgba(18,20,31,.82); }
  .site-nav a { color: var(--body); }
  .hero { background: linear-gradient(180deg, #181c2c, #12141f 80%); }
  .card { background: var(--surface); }
  .fact { background: var(--surface); }
  .page-hero { background: linear-gradient(180deg, #181c2c, #12141f); }
}
