@font-face {
  font-family: 'Tobias';
  src: url('../fonts/Tobias-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'GT-Flexa-Mono';
  src: url('../fonts/GT-Flexa-Mono-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'LogoFont';
  src: url('../fonts/logo-font.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

/* Webkit browsers (Chrome, Safari, newer versions of Edge) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #000000;
  /* Black background */
}

::-webkit-scrollbar-thumb {
  background: #333333;
  /* Dark gray scrollbar */
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444444;
  /* Slightly lighter on hover */
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #333333 #000000;
  box-sizing: border-box
}

/* Remove focus outline from specific elements */
a[data-fancybox]:focus {
  outline: none;
}

#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.logo-spinner {
  width: 32px;
  height: 32px;
  opacity: 0;
  will-change: transform, opacity;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes spin180 {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(180deg);
  }
}

.fade-in,
.fade-out {
  animation:
    fadeIn 0.3s ease-in forwards,
    spin180 0.6s ease-in-out infinite;
}

.fade-out {
  animation-name: fadeOut, spin180;
}

.bg-fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

html,
body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  /* Remove default margin */
  padding: 8px;
  /* Use padding instead */
  background-color: black;
  color: white;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  /* This can remain */
  overflow-x: hidden;
  /* Prevent horizontal scrolling */
}

a {
  color: white;
}

h1,
h2,
h3,
p,
span {
  color: white;
}

h1 {
  font-family: 'Tobias', Arial, sans-serif;
  font-size: clamp(16px, calc(0.5rem + 6.2vw), 150px);
  line-height: 80%;
  text-transform: uppercase;
  text-align: justify;
  text-align-last: justify;
  font-weight: 100;
  margin: 0;
  letter-spacing: -8px;
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  white-space: normal;
  box-sizing: border-box;
  padding-right: 12px;
  font-feature-settings: "kern" on, "liga" on, "calt" on, "titl" on, "ss08" on, "ss10" on;
  display: inline;
}

h1 .bracket-span {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-transform: lowercase;
  text-align: inherit;
  text-align-last: inherit;
  font-weight: inherit;
  margin: inherit;
  letter-spacing: inherit;
  width: inherit;
  max-width: inherit;
  overflow-wrap: inherit;
  white-space: inherit;
  box-sizing: inherit;
  padding-right: inherit;
  font-feature-settings: inherit;
  display: inherit;
}

.lowercase {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-transform: lowercase;
  text-align: inherit;
  text-align-last: inherit;
  font-weight: inherit;
  margin: inherit;
  letter-spacing: inherit;
  width: inherit;
  max-width: inherit;
  overflow-wrap: inherit;
  white-space: inherit;
  box-sizing: inherit;
  padding-right: inherit;
  font-feature-settings: inherit;
  display: inherit;
}

#logo-char {
  font-family: 'LogoFont', sans-serif;
  vertical-align: 1.35em;
  display: inline;
  font-size: clamp(16px, calc(0.1rem + 1.4vw), 36px);
  animation: blink 3s infinite;
  color: #FF0000;
  padding: 0 1em;
}

h2,
h3,
p,
span,
a {
  font-family: 'GT-Flexa-Mono', sans-serif;
  text-transform: uppercase;
  font-size: 14px;
  line-height: 100%;
  padding: 0;
  margin: 0 0 0 0;
  font-weight: 300;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

header p {
  margin-top: 4px;
  width: 25%;
}

.logo {
  height: clamp(18px, calc(0.2 * (0.5rem + 6.2vw)), 32px);
  margin: 0 auto;
}

#electronic-materials-office {
  margin-top: 48px;
}

.electronic-materials-office-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  background-color: #1C1C1C;
}

.electronic-materials-office-container video {
  flex: 9;
  max-width: 75%;
  height: auto;
}

.emo-info {
  flex: 3;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-wrap: nowrap;
  align-self: stretch;
  /* Smooth transition for color changes */
}

.emo-info a {
  transition: color 0.2s ease;

}

.emo-info a:hover {
  color: #444444;
  /* Darker grey on hover */
}

.emo-info a:active {
  color: #666666;
  /* Even darker grey when clicked */
}

.emo-heading-info {
  width: 100%;
}

.emo-meta-info {
  align-self: flex-end;
  width: 100%;
}

.emo-meta-info p,
.emo-meta-info a,
.grid-item p {
  color: #737373;
}

.press-links,
.award-links {
  padding-bottom: 32px;
}

#previous-work {
  margin-top: 146px;
  margin-bottom: 84px;
}

#previous-work h2 {
  margin-bottom: 146px;
  text-align: center;
}

.grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
}

.grid-item {
  flex: 1;
  box-sizing: border-box;
}

.grid-item a {
  display: block;
  transition: transform 0.3s ease;
}

.grid-item a:hover {
  transform: scale(0.99);
}

.grid-item a:active {
  transform: scale(1.02);
}

.grid-item img,
.grid-item video {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 8px;
  padding: 0;
  box-sizing: border-box;
}

.grid-item h3:nth-of-type(2) {
  margin-top: 12px;
}

.tag {
  background-color: #1C1C1C;
  color: #737373;
  padding: 2px 8px;
  border-radius: 5px;
  display: inline-block;
  margin-top: 4px;
  margin-bottom: 4px;
}

.grid p {
  margin-bottom: 8px;
}

footer {
  border-top: 1px solid #737373;
  padding-top: 16px;
  padding-bottom: 16px;
  font-variant-numeric: slashed-zero;
  /* Enables slashed zero */

}

.footer-content {
  width: 25%;
}


.fancybox-video {
  width: auto !important;
}

.fancybox-slide--video .fancybox-content {
  width: auto !important;
}

/* Mobile styles */

@media (max-width: 768px) {

  body {
    padding: 4px;
  }

  .logo-spinner {
    width: 24px;
    height: 24px;
  }

  #logo-char {
    vertical-align: 0.75em;
  }

  h1 {
    font-size: 45px;
    text-align: left;
    text-align-last: left;
    margin: 0;
    letter-spacing: -4px;
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
    padding-right: 12px;
  }

  header p {
    width: 100%;
  }

  h2,
  h3,
  p,
  span,
  a {
    font-size: 12px;
  }

  #electronic-materials-office {
    margin-top: 32px;
  }

  .electronic-materials-office-container {
    flex-wrap: wrap;
  }

  .electronic-materials-office-container video {
    max-width: 100%;
  }

  .emo-info {
    padding: 8px 4px;
  }

  .emo-heading-info,
  .press-links,
  .award-links {
    padding-bottom: 16px;
  }

  #previous-work {
    margin-top: 32px;
    margin-bottom: 32px;
  }

  #previous-work h2 {
    margin-bottom: 32px;
  }

  .grid {
    display: inline-block;
    column-count: 2;
    gap: 4px;
    display: block;
  }

  .grid-item img,
  .grid-item video {
    margin-bottom: 4px;
    height: auto
  }

  .grid-item {
    margin-bottom: 12px;
    break-inside: avoid;
  }

  .footer-content {
    width: 100%;
  }

}