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

:root {
  --font-base: "Lato", sans-serif;
  --color-text: #6a665e;
  --color-footer-text: #00000033;
  --color-logo: #333;
  --color-body-bg: rgb(159 196 226);
  --logo-transition-duration: 2.1s;
  --logo-transition-ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --logo-fade-duration: 1.15s;
  --logo-collapse-delay: 0.7s;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: rgb(159 196 226);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: backgroundCycle 60s linear infinite;
}

@keyframes backgroundCycle {
  0%   { background-color: rgb(245, 226, 226); }
  12%  { background-color: rgb(245, 232, 226); }
  24%  { background-color: rgb(243, 239, 224); }
  36%  { background-color: rgb(230, 241, 223); }
  48%  { background-color: rgb(219, 239, 231); }
  60%  { background-color: rgb(217, 234, 243); }
  72%  { background-color: rgb(226, 225, 243); }
  84%  { background-color: rgb(239, 225, 241); }
  100% { background-color: rgb(245, 226, 226); }
}

.csl-entry{
  margin: 1rem 0 1rem 0rem;
}

ul {
  margin: 0 0 1rem 1rem;
  list-style-position: inside;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
}

.container.full-width {
  max-width: none;
}

/* landing state */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    min-height 1.9s var(--logo-transition-ease),
    padding 1.9s var(--logo-transition-ease),
    transform 1.9s var(--logo-transition-ease);
}

/* content-open state */
body.panel-opening .hero,
body.panel-open .hero {
  min-height: 0;
  padding-top: 1.5rem;
}

/* optional polish */
.ifai-logo,
.logo,
.nav-links {
  transition:
    transform var(--logo-transition-duration) var(--logo-transition-ease),
    margin var(--logo-transition-duration) var(--logo-transition-ease),
    opacity var(--logo-transition-duration) var(--logo-transition-ease);
}

.ifai-logo-shell {
  width: 200px;
  max-height: 110px;
  margin-bottom: 0.35rem;
  overflow: hidden;
  transition:
    max-height var(--logo-transition-duration) var(--logo-transition-ease) var(--logo-collapse-delay),
    margin-bottom var(--logo-transition-duration) var(--logo-transition-ease) var(--logo-collapse-delay);
}

.ifai-logo {
  display: block;
  width: 100%;
  height: auto;
  animation: fadeBreath 60s ease-in-out infinite;
  transition:
    opacity var(--logo-fade-duration) ease,
    transform var(--logo-transition-duration) var(--logo-transition-ease);
}

/* logo heading */
h1.logo {
  font-family: "Baskervville", serif;
  font-weight: 400;
  font-size: 3rem;
  line-height: 1.1;
  text-align: center;
  color: var(--color-logo);
  margin-top: 0.35rem;
  margin-bottom: 1.75rem;
  animation:
    fadeBreath 60s ease-in-out infinite,
    logoColourCycle 60s linear infinite;
    /* text-shadow: 0 0 0.1rem black; */
}

@keyframes logoColourCycle {
  0%   { color: rgb(140, 82, 78); }
  12%  { color: rgb(142, 92, 80); }
  24%  { color: rgb(138, 132, 84); }
  36%  { color: rgb(92, 126, 84); }
  48%  { color: rgb(78, 126, 108); }
  60%  { color: rgb(78, 110, 138); }
  72%  { color: rgb(96, 92, 142); }
  84%  { color: rgb(132, 88, 134); }
  100% { color: rgb(140, 82, 78); }
}

h1.logo a {
  text-decoration: none;
  color: inherit;
}

/* navigation */
.nav-links {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.nav-links .icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.nav-links .icon a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
}

.nav-links .icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  filter: grayscale(100%) saturate(35%);
  transition:
    filter 0.45s ease,
    transform 0.3s ease,
    opacity 0.3s ease;
}

.nav-links .icon span {
  margin-top: 0.65rem;
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  transition:
    color 0.3s ease,
    opacity 0.3s ease;
}

.nav-links .icon:hover img {
  opacity: 0.85;
  filter: grayscale(0%) saturate(110%);
  transform: translateY(-3px);
}

.nav-links .icon:hover span,
.nav-links .icon.active span,
.nav-links .icon a.active span {
  color: var(--color-logo);
}

.nav-links .icon.active img,
.nav-links .icon a.active img {
  opacity: 1;
  filter: grayscale(0%) saturate(110%);
  transform: translateY(-3px);
}

.nav-links .icon[data-enabled="false"] {
  pointer-events: none;
  cursor: default;
}

.nav-links .icon[data-enabled="false"] img {
  filter: grayscale(100%) saturate(15%);
  opacity: 0.4;
  transform: none;
}

.nav-links .icon[data-enabled="false"] span {
  opacity: 0.5;
}

hr {
  margin: 1rem 0;
}

body.panel-opening .nav-links,
body.panel-open .nav-links {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

body.panel-open .ifai-logo-shell {
  max-height: 0;
  margin-bottom: 0;
}

body.logo-fading .ifai-logo,
body.panel-open .ifai-logo {
  opacity: 0;
  transform: translateY(-0.18rem) scale(0.996);
  animation: none;
}

.ifai-logo-shell.logo-hidden {
  display: none;
}

.panel {
  display: none;
  width: 100%;
  min-width: 0;
  margin: 0 auto 2rem auto;
  opacity: 0;
  transform: translateY(1.25rem);
}

.panel.active {
  display: block;
  animation: panelSlideIn 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel-content {
  display: none;
  min-width: 0;
}

.panel-content.active {
  display: block;
  animation: panelContentSlideIn 1.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel-content.active p {
  padding: 0 0 1.15rem 0;
  line-height: 1.65;
}

body.panel-open .hero {
  padding: 0 1rem 0.5rem;
}

.panel-inner {
  background: white;
  border-radius: 0.7rem;
  padding: 2rem;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.4);
  min-width: 0;
}

.panel h2 {
  margin-bottom: 1rem;
  font-size: 1.65rem;
  line-height: 1.2;
  color: inherit;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.panel .document-entry p {
  margin: 0 0 1.15rem 0;
  padding: 0;
  line-height: 1.65;
}

.panel p:last-child {
  padding: 0;
}

/* info accordion */
.info-accordion {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.info-item {
  border-top: 1px solid rgba(0, 0, 0, 0.14);
  padding: 1.5rem 0;
}

.info-item:first-child {
  border-top: none;
  padding-top: 0;
}

.info-item:last-child {
  padding-bottom: 0;
}

.info-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.info-header-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  color: var(--color-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-chevron {
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.28s ease;
  flex: 0 0 auto;
  margin-top: 0.35rem;
}

.info-item.open .info-chevron {
  transform: rotate(180deg);
}

.info-body {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  margin-top: 0;
  transition:
    height 0.42s ease,
    opacity 0.28s ease,
    transform 0.28s ease,
    margin-top 0.28s ease;
  min-width: 0;
}

.info-item.open .info-body {
  opacity: 1;
  transform: translateY(0);
  margin-top: 1rem;
}

.info-body p {
  padding: 0 0 1.15rem 0;
  line-height: 1.65;
}

.info-body p:last-child {
  padding-bottom: 0;
}

.info-body ul {
  margin: 0 0 1rem 1rem;
  list-style-position: inside;
}

.info-body li + li {
  margin-top: 0.35rem;
}

.info-body h3 {
  margin: 0 0 0.65rem 0;
}

.info-body h3:not(:first-child) {
  margin-top: 1.25rem;
}

/* research viewer */
#research-viewer {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-12px);
  margin-top: 0;
  transition:
    height 0.45s ease,
    opacity 0.35s ease,
    transform 0.35s ease,
    margin-top 0.35s ease;
}

#research-viewer.active {
  opacity: 1;
  transform: translateY(0);
  margin-top: 2rem;
}

.article-controls {
  margin: 0 0 1rem 0;
}

.article-controls a {
  text-decoration: underline;
  cursor: pointer;
  color: inherit;
}

#research-viewer .article-fragment a,
#research-viewer .article-fragment a:visited {
  color: var(--color-logo);
  text-decoration: none;
  border-bottom: 1px solid rgb(51 51 51 / 0.25);
  padding-bottom: 0.08rem;
  transition:
    border-color 0.25s ease,
    opacity 0.25s ease;
}

#research-viewer .article-fragment a:hover,
#research-viewer .article-fragment a:focus {
  opacity: 1;
  border-bottom-color: rgba(0, 0, 0, 1);
}

#research-viewer .article-fragment {
  max-width: 100%;
  overflow-x: auto;
}

#research-viewer .article-fragment img {
  max-width: 100%;
  height: auto;
}

#research-viewer .article-fragment figure {
  margin: 2rem 0;
}

#research-viewer .article-fragment figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

#research-viewer .article-fragment h1 {
  font-size: 1.5rem;
  line-height: 1.15;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#research-viewer .article-fragment h2 {
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 1.5rem 0 1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#research-viewer .article-fragment p {
  font-size: larger;
  margin: 0 0 1rem;
  padding: 0;
  line-height: 1.65;
}

/* documents */
.document-list {
  margin-top: 1rem;
  line-height: 1.6;
}

.document-entry {
  margin-top: 0.5rem;
  overflow: hidden;
  transition:
    opacity 0.35s ease,
    max-height 0.45s ease,
    margin 0.35s ease,
    padding 0.35s ease,
    transform 0.35s ease;
}

.document-entry.active-entry {
  opacity: 1;
  transform: translateY(0);
}

.document-entry.inactive-entry {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.document-meta {
  background-color: #868686;
  font-size: 1rem;
  color: rgba(255, 255, 255, 1);
  border-radius: 0.4rem;
  padding: 0.5rem 0.6rem !important;
  margin-bottom: 0.65rem;
  box-shadow: 0.2rem 0.2rem 0.2rem rgba(0, 0, 0, 0.1);
}

.document-title {
  /* font-family: "Baskervville", serif; */
  font-size: 1.4rem;
  line-height: 1.15;
  font-weight: 500;
  color: var(--color-logo);
  margin-bottom: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.document-link a {
  color: var(--color-logo);
  text-decoration: none;
  border-bottom: 1px solid rgb(51 51 51 / 0.25);
  padding-bottom: 0.08rem;
  transition:
    border-color 0.25s ease,
    opacity 0.25s ease;
}

.document-link a:hover {
  opacity: 0.75;
  border-bottom-color: rgb(51 51 51 / 0.65);
}

/* footer */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-footer-text);
  padding: 1rem 0;
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelContentSlideIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeBreath {
  0% {
    opacity: 0.6;
  }

  25% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.5;
  }

  75% {
    opacity: 0.3;
  }

  100% {
    opacity: 0.7;
  }
}
