* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #000 !important;
  color: #fff !important;
}

main {
  position: relative;
  flex: 1;
}

/* ========================================
   PAGE LAYOUT
   ======================================== */

.landing-hero {
  position: relative;
  min-height: calc(100vh - 102px);
}

.landing-card-section {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 102px);
  padding-top: 4rem;
  padding-bottom: 3rem;
}

.container {
  color: #fff;
}

/* ========================================
   CONTENT CARDS
   ======================================== */

.content-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 50vh;
  overflow: hidden;
  border: 1px solid #333;
  border-radius: 0.5rem;
  background-color: #111;
  transition:
    background-color 0.2s ease-in-out,
    transform 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
}

.content-card:hover {
  background-color: #1a1a1a;
  transform: scale(1.02);
  box-shadow: 0 0.5rem 1.5rem rgba(255, 255, 255, 0.08);
}

.content-card-image {
  flex: 0 0 40%;
  min-width: 0;
  background-color: #222;
  border-right: none;
  border-bottom: 1px solid #333;
}

.content-card-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

.content-card-text h2 {
  margin-top: 0;
}

.content-card-lg {
  min-height: 60vh;
}

/* ========================================
   60 / 40 ROW CARDS
   ======================================== */

.content-card-row {
  flex-direction: row;
  width: 100%;
}

.content-card-row .content-card-image {
  flex: 0 0 40%;
  width: 40%;
  border-right: 1px solid #333;
  border-bottom: none;
}

.content-card-row .content-card-text {
  flex: 0 0 60%;
  width: 60%;
}

.content-card-row.content-card-reverse {
  flex-direction: row-reverse;
}

.content-card-row.content-card-reverse .content-card-image {
  border-right: none;
  border-left: 1px solid #333;
}

/* ========================================
   HOMEPAGE
   ======================================== */

/* Contact + Portfolio side-by-side cards */

.homepage-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
}

/* Entire lower homepage cards are clickable */

.homepage-link-card {
  min-height: 30vh;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.homepage-link-card:visited,
.homepage-link-card:hover,
.homepage-link-card:focus {
  color: #fff;
  text-decoration: none;
}

.homepage-link-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Homepage call-to-action links */

.homepage-card-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.homepage-card-link:visited {
  color: #fff;
}

.homepage-card-link:hover,
.homepage-card-link:focus {
  color: #ccc;
}

.homepage-card-link .bi {
  margin-left: 0.3rem;
}

/* ========================================
   BOOTSTRAP-STYLE ARROW ICON
   ======================================== */

.bi {
  display: inline-block;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  vertical-align: -0.05em;
}

.bi-arrow-up-right::before {
  content: "↗";
}

/* ========================================
   CONTACT CARD LINKS
   ======================================== */

.content-card-links {
  display: flex;
  flex: 0 0 40%;
  flex-direction: column;
}

.hover-reveal-box {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #222;
  border-bottom: 1px solid #333;
  cursor: default;
}

.hover-reveal-box:last-child {
  border-bottom: none;
}

.hover-reveal-label,
.hover-reveal-content {
  position: absolute;
  transition: opacity 0.2s ease-in-out;
  font-size: 1.1rem;
}

.hover-reveal-label {
  pointer-events: none;
}

.hover-reveal-content {
  opacity: 0;
  color: #fff;
  text-decoration: none;
  z-index: 1;
  pointer-events: none;
}

.hover-reveal-box:hover .hover-reveal-label {
  opacity: 0;
}

.hover-reveal-box:hover .hover-reveal-content {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   GITHUB PORTFOLIO CARD
   ======================================== */

.github-card {
  flex-direction: row;
  width: 100%;
}

/* 30% GitHub logo section */

.github-card-logo {
  display: flex;
  flex: 0 0 30%;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: #fff;
  background-color: #222;
  border-right: 1px solid #333;
  text-decoration: none;
  overflow: hidden;
}

.github-card-logo:visited {
  color: #fff;
}

.github-card-logo:hover {
  color: #fff;
}

/* Large GitHub logo */

.github-card-logo .bi-github {
  width: 45%;
  height: 45%;
  transition:
    transform 0.2s ease-in-out,
    opacity 0.2s ease-in-out;
}

.github-card-logo:hover .bi-github {
  transform: scale(1.08);
  opacity: 0.8;
}

/* 70% GitHub text section */

.github-card-text {
  position: relative;
  flex: 0 0 70%;
  width: 70%;
  padding-bottom: 5.5rem;
}

/* ========================================
   GITHUB HOVER BUTTON
   ======================================== */

.github-reveal-button {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 11rem;
  height: 3.25rem;
  overflow: hidden;
  color: #fff;
  background-color: #222;
  border: 1px solid #444;
  border-radius: 0.35rem;
  text-decoration: none;
  transition:
    background-color 0.2s ease-in-out,
    border-color 0.2s ease-in-out,
    transform 0.2s ease-in-out;
}

.github-reveal-button:visited {
  color: #fff;
}

.github-reveal-button:hover {
  color: #fff;
  background-color: #2a2a2a;
  border-color: #667;
  transform: translateY(-2px);
}

.github-reveal-label,
.github-reveal-content {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: opacity 0.2s ease-in-out;
}

.github-reveal-label {
  opacity: 1;
}

.github-reveal-content {
  opacity: 0;
}

.github-reveal-button:hover .github-reveal-label {
  opacity: 0;
}

.github-reveal-button:hover .github-reveal-content {
  opacity: 1;
}

.github-reveal-button .bi-github {
  width: 1.1em;
  height: 1.1em;
}

/* ========================================
   LOCAL GITHUB ICON
   ======================================== */

.bi-github {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;

  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;

  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar {
  background-color: #000 !important;
  border-bottom: 1px solid #222;
}

.navbar-brand,
.nav-link {
  color: #fff !important;
}

.nav-link:hover {
  color: #ccc !important;
}

/* ========================================
   FOOTER
   ======================================== */

.footer-container {
  flex-shrink: 0;
  padding: 0.75rem 0;
}

.footer-container hr {
  margin: 0.25rem 0;
  border-color: #333;
}

footer,
.footer-container {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
  font-family: Arial, Helvetica, sans-serif;
}

footer hr {
  margin: 0.5rem 0;
  border-color: #333;
}

.footer-brand {
  color: #444;
}

footer a {
  color: #444;
  margin-right: 1rem;
  text-decoration: none;
}

footer a:hover {
  color: #667;
}

/* ========================================
   FONTS
   ======================================== */

@font-face {
  font-family: "Space Mono";
  src:
    url("../fonts/SpaceMono-Regular.woff2") format("woff2"),
    url("../fonts/SpaceMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src:
    url("../fonts/SpaceMono-Bold.woff2") format("woff2"),
    url("../fonts/SpaceMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body,
button,
input,
textarea,
select {
  font-family:
    "Space Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-weight: 400;
}

/* ========================================
   PAGE TITLE
   ======================================== */

.site-title {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max-content !important;
  margin: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

/* ========================================
   GENERAL ICONS
   ======================================== */

.icon-svg {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  margin: 0 0.25em;
}

/* ========================================
   TYPEWRITER CURSOR
   ======================================== */

.typewriter-cursor::after {
  content: "|";
  margin-left: 0.1em;
  animation: blink-cursor 0.8s step-end infinite;
}

@keyframes blink-cursor {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ========================================
   SCROLL INDICATOR
   ======================================== */

/*
  IMPORTANT:

  The scroll indicator is HIDDEN by default.

  JavaScript adds .is-visible only after confirming
  that the browser is actually at the top of the page.

  This prevents the arrow appearing briefly when a
  page is refreshed while scrolled further down.
*/

.scroll-indicator {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;

  color: #fff;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  cursor: pointer;

  transition:
    opacity 0.4s ease-in-out,
    visibility 0.4s ease-in-out,
    color 0.2s ease-in-out;

  animation: bounce-scroll 1.6s ease-in-out infinite;
}

/* Only visible after JavaScript confirms scroll position */

.scroll-indicator.is-visible {
  opacity: 0.85;
  visibility: visible;
  pointer-events: auto;
}

.scroll-indicator.is-visible:hover {
  color: #66b2ff;
  opacity: 1;
}

.scroll-indicator svg {
  width: 2.5rem;
  height: 2.5rem;
}

@keyframes bounce-scroll {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-0.5rem);
  }
}

/* ========================================
   CARD TEXT REVEAL
   ======================================== */

.content-card.card-reveal-ready .content-card-text > * {
  opacity: 0;
  translate: 0 1.15rem;
  filter: blur(6px);

  transition:
    opacity 0.65s ease,
    translate 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.65s ease;

  transition-delay: calc(var(--reveal-order, 0) * 90ms);
}

.content-card.card-reveal-ready.is-revealed .content-card-text > * {
  opacity: 1;
  translate: 0 0;
  filter: blur(0);
}

/* ========================================
   EMAIL OPTIONS MODAL
   ======================================== */

#emailOptionsModal .modal-content {
  color: #fff !important;
  background-color: #111 !important;
  border: 1px solid #333 !important;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(255, 255, 255, 0.08);
}

#emailOptionsModal .modal-header {
  border-bottom: 1px solid #333 !important;
}

#emailOptionsModal .text-secondary {
  color: #777 !important;
}

#emailOptionsModal .btn-outline-light {
  color: #fff;
  background-color: #222;
  border: 1px solid #444;
  border-radius: 0.35rem;

  transition:
    background-color 0.2s ease-in-out,
    border-color 0.2s ease-in-out,
    transform 0.2s ease-in-out;
}

#emailOptionsModal .btn-outline-light:hover,
#emailOptionsModal .btn-outline-light:focus {
  color: #fff;
  background-color: #2a2a2a;
  border-color: #667;
  transform: translateY(-2px);
}

#emailOptionsModal .btn-outline-light:active {
  color: #fff !important;
  background-color: #222 !important;
  border-color: #667 !important;
  transform: translateY(0);
}

#emailOptionsModal .btn-outline-light:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: none;
}

#emailOptionsModal .btn-close {
  opacity: 0.6;

  transition:
    opacity 0.2s ease-in-out,
    transform 0.2s ease-in-out;
}

#emailOptionsModal .btn-close:hover {
  opacity: 1;
  transform: scale(1.08);
}

/* ========================================
   MODAL BACKGROUND BLUR
   ======================================== */

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal-backdrop.show {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .content-card.card-reveal-ready .content-card-text > *,
  .content-card.card-reveal-ready.is-revealed .content-card-text > * {
    opacity: 1;
    translate: none;
    filter: none;
    transition: none;
  }
}

/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 576px) {
  .content-card {
    min-height: 50vh;
  }

  .content-card-text {
    padding: 1.25rem;
  }

  /* 60 / 40 cards become vertical */

  .content-card-row,
  .content-card-row.content-card-reverse {
    flex-direction: column;
  }

  .content-card-row .content-card-image,
  .content-card-row.content-card-reverse .content-card-image {
    flex: 0 0 auto;
    width: 100%;
    min-height: 16rem;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid #333;
  }

  .content-card-row .content-card-text {
    flex: 1;
    width: 100%;
  }

  /* Homepage Contact + Portfolio cards stack */

  .homepage-card-grid {
    grid-template-columns: 1fr;
  }

  .homepage-link-card {
    min-height: 16rem;
  }

  /* Contact card */

  .content-card-links {
    flex: 0 0 auto;
  }

  .hover-reveal-box {
    min-height: 6rem;
  }

  /* GitHub portfolio card */

  .github-card {
    flex-direction: column;
  }

  .github-card-logo {
    flex: 0 0 auto;
    width: 100%;
    min-height: 16rem;
    border-right: none;
    border-bottom: 1px solid #333;
  }

  .github-card-logo .bi-github {
    width: 6rem;
    height: 6rem;
  }

  .github-card-text {
    flex: 1;
    width: 100%;
    padding-bottom: 5.5rem;
  }

  .github-reveal-button {
    right: 1.25rem;
    bottom: 1.25rem;
  }
}
