:root {
  --color-bg: #ffffff;
  --color-text: #3B3B3B;
  --color-text-muted: #707070;
  --color-focus: #3B7EA1;

  --color-rubrik: #139cdb;
  --color-rubrik-hover: #acd0e0;
  --color-amazon: #FF9900;
  --color-amazon-hover: #ffe0b3;
  --color-cal: #3B7EA1;
  --color-cal-hover: #e5f0f6;
  --color-cs61b: #2F86EB;
  --color-cs61b-hover: #e9f2fd;
  --color-citadel: #1A4D8F;
  --color-citadel-hover: #c9d2e0;
  --color-tea: #83C868;
  --color-tea-hover: #e9f5e4;
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Open Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: var(--color-text);
}

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

h1 {
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  display: inline-block;
}

h1::after {
  content: '';
  display: block;
  width: 100%;
  height: 4px;
  background-color: var(--color-text);
  margin-top: 0.3em;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  animation: drawLine 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.5s forwards;
}

p {
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.6;
}

.about-padding {
  padding: 4% 10% 4% 10%;
}

.align {
  max-width: 640px;
}

.align p {
  margin: 0.4em 0;
}

.align p:last-child {
  margin-top: 1.2em;
}

.align .previously-label {
  margin-bottom: 0;
}

.align .teaching-label {
  margin-bottom: 0;
  margin-top: 1.5em;
}

.previously {
  list-style: none;
  padding-left: 2.4em;
  margin: 0.2em 0 0.4em;
}

.previously li {
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.6;
  position: relative;
  padding-left: 0.2em;
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.align .previously:first-of-type li:nth-child(1) {
  animation-delay: 0.35s;
}

.align .previously:first-of-type li:nth-child(2) {
  animation-delay: 0.5s;
}

.align .previously:last-of-type li:nth-child(1) {
  animation-delay: 0.7s;
}

.align .previously:last-of-type li:nth-child(2) {
  animation-delay: 0.85s;
}

.previously li::before {
  content: '▸';
  position: absolute;
  left: -1.2em;
  color: var(--color-text-muted);
}

@keyframes drawLine {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Staggered fade-in animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in.delay-1 {
  animation-delay: 0.2s;
}

.fade-in.delay-2 {
  animation-delay: 0.4s;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .social-icons a,
  .previously li,
  .footer,
  h1::after {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Link hover effects */
.about-a {
  position: relative;
  display: inline-block;
  transition: color 0.2s ease;
}

.about-a::after,
.about-a::before {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 10px;
  bottom: 10px;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right;
}

.about-a:hover::after,
.about-a:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.about-a::before {
  transition: transform 0.4s cubic-bezier(0.51, 0.18, 0, 0.88) 0.1s;
}

.about-a::after {
  transition: transform 0.2s cubic-bezier(0.29, 0.18, 0.26, 0.83);
}

.link-rubrik {
  color: var(--color-rubrik);
}

.link-rubrik::before {
  background: var(--color-rubrik-hover);
}

.link-amazon {
  color: var(--color-amazon);
}

.link-amazon::before {
  background: var(--color-amazon-hover);
}

.link-cal {
  color: var(--color-cal);
}

.link-cal::before {
  background: var(--color-cal-hover);
}

.link-cs61b {
  color: var(--color-cs61b);
}

.link-cs61b::before {
  background: var(--color-cs61b-hover);
}

.link-citadel {
  color: var(--color-citadel);
}

.link-citadel::before {
  background: var(--color-citadel-hover);
}

.link-tea {
  color: var(--color-tea);
}

.link-tea::before {
  background: var(--color-tea-hover);
}

/* Tea icon */
.tea-icon {
  vertical-align: middle;
  margin-left: 0.1em;
  position: relative;
  top: -2px;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.link-tea:hover + .tea-icon,
.link-tea:hover ~ .tea-icon {
  transform: rotate(-12deg) scale(1.1);
}

/* Social icons */

.social-icons {
  display: flex;
  gap: 0.1rem;
  margin-top: 1.5rem;
  margin-left: -6px;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  transition: transform 0.2s ease;
  opacity: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.social-icons a:nth-child(1) {
  animation-delay: 0.5s;
}

.social-icons a:nth-child(2) {
  animation-delay: 0.65s;
}

.social-icons a:nth-child(3) {
  animation-delay: 0.8s;
}

.social-icons a:hover {
  transform: scale(1.15);
}

.social-icons img {
  width: 32px;
  height: 32px;
}

.social-icons .icon-github {
  width: 36px;
  height: 36px;
}

/* Footer */
.footer {
  padding: 2rem 10%;
  text-align: left;
  opacity: 0;
  animation: fadeIn 0.6s cubic-bezier(0.25, 1, 0.5, 1) 1s forwards;
}

.footer small {
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .about-padding {
    padding: 2rem 1.5rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  p {
    font-size: 1.15rem;
  }

  .previously {
    padding-left: 1.8em;
  }

  .previously li {
    font-size: 1.15rem;
  }

  .footer {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .about-padding {
    padding: 1.5rem 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  p {
    font-size: 0.95rem;
  }

  .previously {
    padding-left: 1.4em;
  }

  .previously li {
    font-size: 0.95rem;
  }

  .social-icons img {
    width: 26px;
    height: 26px;
  }

  .social-icons .icon-github {
    width: 30px;
    height: 30px;
  }

  .social-icons a {
    width: 38px;
    height: 38px;
  }

  .footer {
    padding: 2rem 1rem;
  }
}
