/* Prof. Joshua Ellul — academic profile */

:root {
  --ink: #10212b;
  --ink-soft: #3a4f5c;
  --muted: #6b7f8a;
  --paper: #f3f7f9;
  --paper-2: #e8f0f3;
  --white: #ffffff;
  --sea: #0e7c86;
  --sea-bright: #14b8a6;
  --sun: #f0a202;
  --sun-soft: #ffd166;
  --line: rgba(16, 33, 43, 0.1);
  --shadow: 0 18px 50px rgba(16, 33, 43, 0.08);

  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --max: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 1.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.05rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--sea);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--sea-bright);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0.4rem;
}

.skip-link:focus {
  top: 1rem;
}

/* ——— Atmosphere ——— */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 85% -10%, rgba(20, 184, 166, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 45% at -5% 30%, rgba(240, 162, 2, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(14, 124, 134, 0.1), transparent 60%),
    linear-gradient(165deg, #f8fbfd 0%, #eef5f7 45%, #e7f1f4 100%);
}

.code-rain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.09;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--sea);
  white-space: pre;
  user-select: none;
}

.code-rain span {
  display: block;
  position: absolute;
  animation: drift-up linear infinite;
}

@keyframes drift-up {
  from { transform: translateY(110vh); opacity: 0; }
  8% { opacity: 1; }
  85% { opacity: 0.7; }
  to { transform: translateY(-30vh); opacity: 0; }
}

/* ——— Nav ——— */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(243, 247, 249, 0.78);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-nav.scrolled {
  border-bottom-color: var(--line);
  background: rgba(243, 247, 249, 0.92);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-brand span {
  color: var(--sea);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  list-style: none;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--sea);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

/* ——— Layout ——— */

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

.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sea);
  margin-bottom: 0.85rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 3.5vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-lede {
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
  margin-bottom: 2.25rem;
}

/* ——— Hero ——— */

.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex;
  align-items: flex-end;
  padding: 6rem 0 4.5rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: end;
  width: 100%;
}

.hero-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 6.2rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--ink);
  margin-bottom: 1.35rem;
}

.hero-brand em {
  font-style: normal;
  color: var(--sea);
  display: block;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  letter-spacing: -0.02em;
  line-height: 1.3;
  max-width: 22ch;
  margin-bottom: 0.9rem;
}

.hero-support {
  color: var(--ink-soft);
  max-width: 36ch;
  margin-bottom: 1.75rem;
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--sea);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(16, 33, 43, 0.2);
}

.btn-ghost:hover {
  border-color: var(--sea);
  color: var(--sea);
}

.hero-aside {
  position: relative;
  justify-self: end;
  width: min(100%, 400px);
}

.hero-portrait {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 40px rgba(16, 33, 43, 0.18));
}

.hero-meta {
  margin-top: 1.1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.hero-meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* ——— Reveal motion ——— */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ——— Research topics ——— */

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.topic {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  letter-spacing: -0.02em;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, color 0.25s ease;
}

.topic:hover,
.topic:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  transform: translateY(-3px) rotate(-0.5deg);
}

.topic:nth-child(3n):hover {
  background: var(--sea);
  border-color: var(--sea);
  transform: translateY(-3px) rotate(0.8deg);
}

.topic:nth-child(4n):hover {
  background: #c67c00;
  border-color: #c67c00;
}

/* ——— About ——— */

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.about-copy p + p {
  margin-top: 1rem;
}

.about-copy p {
  color: var(--ink-soft);
}

.about-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.aside-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aside-block {
  padding: 1.25rem 1.35rem;
  border-left: 3px solid var(--sea-bright);
  background: rgba(255, 255, 255, 0.55);
}

.aside-block h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.aside-block p,
.aside-block li {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.aside-block ul {
  list-style: none;
}

.aside-block li + li {
  margin-top: 0.35rem;
}

/* ——— Path / timeline ——— */

.path-list {
  list-style: none;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.path-item {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.25rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.path-when {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.path-what strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.path-what p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ——— Funding ——— */

.funding-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem 2rem;
  padding-top: 0.5rem;
}

.fund {
  border-top: 2px solid var(--sea);
  padding-top: 0.85rem;
}

.fund-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.fund h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.fund p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ——— Publications ——— */

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem;
  transition: background 0.2s ease;
}

.pub:first-child {
  border-top: 1px solid var(--line);
}

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 0.2rem;
}

.pub-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
}

.pub-title:hover {
  color: var(--sea);
}

.pub-meta {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ——— People / supervision ——— */

.people-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.people-col h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.person {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.person:first-of-type {
  border-top: 1px solid var(--line);
}

.person strong {
  display: block;
  font-weight: 600;
}

.person span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ——— Talks ——— */

.talk-list {
  list-style: none;
}

.talk {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.talk:first-child {
  border-top: 1px solid var(--line);
}

.talk-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.talk strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
}

.talk span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.talk-list:not(.is-expanded) .talk-more {
  display: none;
}

.talks-toggle {
  margin-top: 1.5rem;
  cursor: pointer;
}

.talks-toggle[hidden] {
  display: none;
}

/* ——— Professional activities ——— */

.activity-list {
  list-style: none;
}

.activity {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.activity:first-child {
  border-top: 1px solid var(--line);
}

.activity strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
}

.activity span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.activity-list:not(.is-expanded) .activity-more {
  display: none;
}

.activities-toggle {
  margin-top: 1.5rem;
  cursor: pointer;
}

.activities-toggle[hidden] {
  display: none;
}

/* ——— Lecturing ——— */

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.course-tags span {
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  color: var(--ink-soft);
}

/* ——— Contact ——— */

.contact {
  background: var(--ink);
  color: var(--white);
  border-radius: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(2.25rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -80px;
  top: -120px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.35), transparent 65%);
  pointer-events: none;
}

.contact::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  left: -60px;
  bottom: -100px;
  background: radial-gradient(circle, rgba(240, 162, 2, 0.22), transparent 65%);
  pointer-events: none;
}

.contact > * {
  position: relative;
  z-index: 1;
}

.contact .section-label {
  color: var(--sea-bright);
}

.contact .section-title {
  color: var(--white);
  max-width: 16ch;
}

.contact p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 36rem;
  margin-bottom: 1.75rem;
}

.contact .btn-primary {
  background: var(--sea-bright);
  color: var(--ink);
}

.contact .btn-primary:hover {
  background: var(--sun-soft);
}

.contact .btn-ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.contact .btn-ghost:hover {
  border-color: var(--white);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.social-row {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.social-row a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.social-row a:hover {
  color: var(--sea-bright);
}

/* ——— Footer ——— */

.site-footer {
  padding: 2.5rem 0 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--sea);
}

/* ——— Responsive ——— */

@media (max-width: 860px) {
  .hero {
    min-height: auto;
    padding: 4.5rem 0 3rem;
    align-items: flex-start;
  }

  .hero-grid,
  .about-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }

  .hero-aside {
    justify-self: start;
    width: min(100%, 340px);
  }

  .hero-brand {
    font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(243, 247, 249, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 1rem var(--gutter) 1.25rem;
    flex-direction: column;
    gap: 0.75rem;
  }

  .nav-links.open {
    display: flex;
  }

  .path-item,
  .talk {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .code-rain span { animation: none; }
  .btn:hover,
  .topic:hover { transform: none; }
}
