/* External CSS loaded via <link> tags in HTML for parallel loading */

/* Self-hosted fonts - Atkinson Hyperlegible family */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/AtkinsonHyperlegibleNext-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/AtkinsonHyperlegibleNext-RegularItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/AtkinsonHyperlegibleNext-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/AtkinsonHyperlegibleNext-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Atkinson Hyperlegible Mono (replaces Ubuntu Mono) */
@font-face {
  font-family: 'Atkinson Mono';
  src: url('fonts/AtkinsonHyperlegibleMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Mono';
  src: url('fonts/AtkinsonHyperlegibleMono-RegularItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Mono';
  src: url('fonts/AtkinsonHyperlegibleMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Mono';
  src: url('fonts/AtkinsonHyperlegibleMono-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Custom cursors - only on devices with hover (desktops) */
@media (hover: hover) and (pointer: fine) {
  * { 
    cursor: url('img/cabbage.png'), auto !important; 
  }

  a, button, [role="button"], input[type="button"], input[type="submit"], .navbar-item, label[for],
  a *, button *, .navbar-item *, label[for] *, .card-footer-item, .card-footer-item * {
    cursor: url('img/coins.png'), pointer !important;
  }
}

html { 
  scroll-behavior: smooth; 
  font-size: 115%;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  .type {
    animation: none;
    max-width: none;
    border-right: none;
  }
  
  .masonry-item {
    transition: none;
  }
}

html, body, .title, .subtitle, .navbar-item {
  font-family: "Atkinson Hyperlegible", sans-serif;
}

#name1, #name2 {
  font-family: "Atkinson Mono", monospace;
}

/* Fix for random scrolling in card elements */
#card-title {
  overflow: hidden;
}

p > a:hover { text-decoration: underline; }

p a:hover { text-decoration: underline; }

.card-footer-item:hover { text-shadow: 0px 0px 1px; }

.hero-body { position: relative; }

.main-hero {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  opacity: 0.3;
}

.main-hero > picture > img {
  position: absolute;
  min-height: 100vh;
  width: 100%;
  height: 100vh;
  object-fit: cover;
}

.hero {
  scroll-margin-top: 3.25rem; /* Set this value to your navbar height */
}

.hero .navbar {
  backdrop-filter: blur(10px);
  background: rgba(0,0,0,0.25);
}

.navbar-item {
  border-radius: 5px;
}

@media screen and (max-width: 1023px) {
  /* make navbar-menu open on top of content */
  
  .hero {
    scroll-margin-top: 6.25rem; /* Set this value to your navbar height */
  }
  
  .hero .navbar {
    backdrop-filter: none;
    background: rgba(0,0,0,0.0);
  }
  
  /* Chrome bullshit: https://www.reddit.com/r/Frontend/comments/xm2ft0/cant_get_backdropfilter_blur16px_to_work_in/?rdt=48128 */
  .visual-layer {
    position: absolute; /* Position it absolutely within the parent */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(10px); /* Apply the blur effect */
    -webkit-backdrop-filter: blur(10px); /* WebKit compatibility */
    background: rgba(0, 0, 0, 0.25); /* Semi-transparent background color */
    z-index: 0; /* Make sure it is behind the content */
  }
  
  .navbar-menu { 
    left:0; 
    right:0; 
    top:100%; 
    position: absolute; 
    justify-content: center;
    overflow-x: hidden;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background: rgba(0,0,0,0.0);
  }
  
  /* Navbar items styling */
  .navbar-menu .navbar-item {
    display: inline-block; /* Display items inline */
    padding: 0.25em;
    margin: 0;
    border-radius: 5px;
  }
  
  /* show mavbar-menu on screen less than 1024px */
  #menu-toggle:checked ~ .navbar-menu { 
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* make navbar-burger become cross on screen less than 1024px */
  #menu-toggle:checked ~ .navbar-brand > label > span:nth-child(1) { transform: translateY(0px) rotate(45deg); }
  #menu-toggle:checked ~ .navbar-brand > label > span:nth-child(2) { transform: translateY(0px) rotate(-45deg); }
  #menu-toggle:checked ~ .navbar-brand > label > span:nth-child(3) { opacity: 0; }
  #menu-toggle:checked ~ .navbar-brand > label > span:nth-child(4) { opacity: 0; }
  
  /* White hamburger menu */
  .navbar-burger span {
    background-color: white;
  }
}

/* Cool typing effect: https://dev.to/stokry/typing-effect-without-javascript-54ol*/
:root {
  --characters: 14;
}

.subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
}
.type {
  max-width: calc(var(--characters) * 1ch);
  animation: typing 1.75s steps(var(--characters)), blink .5s step-end infinite alternate;
  white-space: nowrap;
  overflow: hidden;
  border-right: 1px solid;
  will-change: max-width;
}

@keyframes typing {
  from {
    max-width: 0;
  }
}    
@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* Base styling for the icon container */
.icon-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Default: 2 columns */
  gap: 0.5rem; /* Space between icons */
  align-items: center;
  justify-items: center;
}

/* 3 columns on large screens */
@media screen and (min-width: 1024px) {
  .icon-container {
    grid-template-columns: repeat(3, 1fr); /* 3 columns for large screens */
  }
}

/* Additional styling */
.icon-container .image {
  margin-bottom: 0;
  max-width: 48px; /* Adjust as needed */
}

.icon-container img {
  width: 100%;
}

/* Align the icon with the text */
.footer i.fa-copyright {
  vertical-align: middle; /* Aligns the icon to the middle of the text */
  font-size: 1em; /* Adjust size to match text size */
  line-height: 1; /* Ensure the icon's line height is consistent with the text */
  margin-right: 0.2em; /* Adds a little space after the icon */
}

.masonry {
  column-count: 1; 
  column-gap: 1rem;
}

.masonry-item {
  display: inline-block;
  width: 100%;
  margin-bottom: 1rem;
  break-inside: avoid;
  will-change: transform;
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth effect */
}

.masonry-item:hover {
  transform: scale(1.05); /* Slight zoom */
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2); /* Soft shadow */
}

/* Ensure the effect works on touchscreens */
@media (hover: none) {
  .masonry-item:active {
    transform: scale(1.05);
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  }
}

/* Responsive column count */
@media screen and (min-width: 768px) {
  .masonry {
    column-count: 2;
  }
}
