:root {
  --bg-page: #FBF8FB;
  --bg-highlight: #dce6e0;
  --border: #EBE8EB;
  --primary: #CDE6EE;
  --secondary: #B2D1Bf;
  --button: #d1e4eb;
  --text: #123456;
  --title: #1B4E80;
  --link: #1B4E80;
  --gradient-ramp-title: linear-gradient( 
    47deg,
    #123456,#123456,#123456,#123456,
    #123456,#123456,#123456,#123456,
    #b2d1cc,#b2c9d1,#b2bcd1,#b5b2d1
  );
  --gradient-size-title: 500% 500%;
  --gradient-duration-title: 5s;
  --gradient-ramp: linear-gradient( 
    47deg,
    #b2d1cc,#b2c9d1,#b2bcd1,#b5b2d1
  );
  --gradient-size: 500% 500%;
  --gradient-duration: 5s; 
}

html {
  overflow: -moz-scrollbars-vertical;
  margin: 0;
  padding: 0;
  height: 100%;
  scroll-behavior: smooth;
}
html::-webkit-scrollbar {
  display: none;
}

body {
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;

  margin: 0;
  padding: 0;
  height: 100%;

  font-family: "Noto Sans SC", Verdana, sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
  font-size: 16px;
  color: var(--text);
}

header#page-header {
  background: var(--bg-page);
  min-width: 100%;
  max-width: 100%;
  padding: 1rem 2rem;
  border-bottom: 2px solid var(--border);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header#page-header #header-content {
  min-width: 75%;
  max-width: 75%;
  display: flex;
  flex-direction: right;
  align-items: center;
}

header#page-header #title {
  color: var(--title);
  text-decoration: none;
  font-size: 3rem;
  font-weight: 500;
}

header#page-header #nav {
  display: flex;
  flex-direction: right;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-item {
  color: var(--title);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem 0.5rem;
  border-radius: 1rem;
  transition: 
    border-radius 0.5s ease,
    background-color 0.2s ease;
}
.nav-item:hover {
  border-radius: 0.2rem;
  background-color: var(--button);
}

@keyframes gradient-animation {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

.gradient-title {
  background-image: var(--gradient-ramp-title);
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  background-size: var(--gradient-size-title);
  animation: gradient-animation var(--gradient-duration-title) ease infinite;
}

.gradient-bg {
  background-image: var(--gradient-ramp);
  background-size: var(--gradient-size);
  animation: gradient-animation var(--gradient-duration) ease infinite;
}

main {
  flex-grow: 1;
  min-width: 70%;
  max-width: 70%;
}

.intro {
  margin: 1rem 0rem 0rem;
  padding: 1rem;
}

section {
  background: var(--bg-page);
  margin: 0.5rem 0rem;
  padding: 0.5rem;
}

article {
  margin: 0.2rem;
  padding: 0.5rem;
  border-radius: 1rem;
  transition: 
    border-radius 0.5s ease,
    background-color 0.2s ease;
}
article:hover {
  border-radius: 0.2rem;
  background-color: var(--bg-highlight);
}

h3 {
  margin: 0.5rem;
  font-size: 1.5rem;
  font-weight: 400;
}

header > h4 {
  margin: 0.5rem 0.5rem 0rem;
  font-size: 1.2rem;
  font-weight: 400;
}

header > time {
  margin: 0rem 0.5rem 0.5rem;
}

details {
  margin: 0rem 0.7rem 0.5rem;
  interpolate-size: allow-keywords;
  list-style: none;
}
details > summary {
  display: none;
}
details::details-content {
  height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  transition: 
    height 0.5s ease, 
    opacity 0.5s ease, 
    content-visibility 0.5s ease allow-discrete;
}
details[open]::details-content {
  height: auto;
  opacity: 1;
}

a {
  text-decoration: none;
  color: var(--link);
  font-weight: 400;
}

p {
  margin: 0.5rem;
}

code {
  background-color: var(--border);
  border-radius: 0.2rem;
  padding: 0 0.2rem;
}

li ~ pre {
  background-color: var(--text);
  padding: 0rem 0.8rem;
  margin: 0.5rem 0;
}

pre > samp {
  background-color: transparent;
  color: var(--primary);
}

/* Quote with translation on hover */
.quote-tl {
  display: grid;
  overflow: hidden;
  text-align: center;
  font-style: italic;
}
.quote-tl > span {
  grid-area: 1 / 1; /* stack both lines in one cell */
  transition: transform 0.5s ease, opacity 0.3s ease;
}
.quote-zh {
  transform: translateY(0);
  opacity: 1;
}
.quote-en {
  transform: translateY(100%);
  opacity: 0;
}
.quote-tl:hover .quote-zh {
  transform: translateY(-100%);
  opacity: 0;
}
.quote-tl:hover .quote-en {
  transform: translateY(0);
  opacity: 1;
}

.border {
  border-radius: 0.5rem;
  border: 2px solid var(--border);
  box-sizing: border-box;
}

.button {
  background-color: var(--button);
}

/* "Recall" element: brings user back to top of page */
#recall {
  position: fixed;
  bottom: -4rem;
  right: calc(8% + 2rem);
  min-height: 3rem;
  min-width: 3rem;
  text-decoration: none;
  border-radius: 1rem;
  border: 2px solid var(--border);
  background-color: var(--bg-page);
  transition: all 0.5s ease;
  animation: recall-rise ease forwards;
  animation-timeline: scroll(root);
  animation-range: 0 8rem;
  box-sizing: border-box;
}
#recall::after {
  content: "";
  position: absolute;
  top: 2.6rem;
  left: 50%;
  width: 0.9rem;
  height: 3rem;
  transform: translateX(-50%) scale(0.2);
  transform-origin: top center;
  background: radial-gradient(
    ellipse 45% 105% at 50% 10%,
    #f4eaff 0%,
    #c9b6ff 12%,
    #7c8dff 34%,
    rgba(220, 92, 255, 0.7) 56%,
    rgba(255, 92, 190, 0.22) 74%,
    /* alternatively, warmer hues
    #fff8d6 0%,
    #ffd166 12%,
    #ff8c42 34%,
    rgba(232, 74, 47, 0.7) 56%,
    rgba(232, 74, 47, 0.22) 74%,
    */
    transparent 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-out, transform 0.5s ease;
}
#recall:hover {
  min-height: 6rem;
  border-radius: 0.2rem;
  border: 2px solid var(--button);;
  background-color: var(--button);
}
#recall:hover::after {
  transform: translateX(-50%) scale(1);
  opacity: 0.8;
}
@keyframes recall-rise {
  to { bottom: 2rem; }
}

footer {
  background: var(--bg-page);
  text-align: center;
  min-width: 100%;
  min-height: fit-content;
  padding: 1rem 0rem;
  flex-grow: 0;
  flex-shrink: 0;
  border-top: 2px solid var(--border);
  box-sizing: border-box;
}

footer > a {
  padding: 0 0.8rem;
}