/* ===== Global Variables ===== */
:root {
  --bg-color: #181818;
  --font-color: #ffffff;
  --font-family: 'Inter', sans-serif;

  --font-weight: 300;
  --font-size-base: 80px;
  --font-size-mobile: 30px;
  --line-height-base: 1.2;
  --fm-logo-size: 20;

  --gap-size: 10px;
}

/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Body Styling ===== */
body {
  background-color: var(--bg-color);
  font-family: var(--font-family);
  font-weight: var(--font-weight);
  font-size: clamp(var(--font-size-mobile), 2vw, var(--font-size-base));
  color: var(--font-color);
  line-height: var(--line-height-base);
}
.icon {
  width: 1em;
  height: 1em;
  fill: currentColor; /* Enables text-color-based fill */
  color: var(--font-color); /* Sets the color to white */
  vertical-align: middle;
  display: inline-block;
  margin-left: 0.3em;
  transform: translateY(-0.05em);
}
/* ===== Detail Type ===== */
.detail {
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--font-color);
}
.smaller {
  font-family: var(--font-family);
  font-size: 24px;
  color: var(--font-color);
}
/* ===== Links ===== */
a,
a:visited,
a:hover,
a:active,
a:focus {
  color: var(--font-color);
  text-decoration: none;
}

/* ===== Icons (External SVGs) ===== */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  margin-left: 0.3em;
  display: inline-block;
  filter: invert(1); /* Makes black SVGs appear white on dark backgrounds */
}

/* ===== Arrow Glyphs (Optional Fallback) ===== */
.arrow {
  font-family: var(--font-family);
  font-size: inherit;
  color: var(--font-color);
  line-height: 1;
  display: inline-block;
  font-style: normal;
  -webkit-appearance: none; /* Helps on Safari/iOS */
  text-decoration: none;
}

/* ===== Rotating Word Animation ===== */
.title {
  font-family: var(--font-family);
  font-size: clamp(var(--font-size-mobile), 2vw, var(--font-size-base));
  font-weight: var(--font-weight);
  line-height: var(--line-height-base);
  color: var(--font-color);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.word-rotator {
  position: relative;
  height: 1em;
  perspective: 800px;
  overflow: hidden;
}

.word-rotator .word {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transform: rotateX(90deg);
  transform-origin: center bottom;
  animation: rotateWords 12s infinite;
}

.word-rotator .word:nth-child(1) { animation-delay: 0s; }
.word-rotator .word:nth-child(2) { animation-delay: 3s; }
.word-rotator .word:nth-child(3) { animation-delay: 6s; }
.word-rotator .word:nth-child(4) { animation-delay: 9s; }

@keyframes rotateWords {
  0%   { opacity: 0; transform: rotateX(90deg); }
  10%  { opacity: 1; transform: rotateX(0deg); }
  25%  { opacity: 1; transform: rotateX(0deg); }
  35%  { opacity: 0; transform: rotateX(-90deg); }
  100% { opacity: 0; transform: rotateX(-90deg); }
}

/* ===== Layout: Two Column ===== */
.container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-size);
  padding: var(--gap-size);
}

/* ===== Layout: Three Column ===== */
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gap-size);
  padding: var(--gap-size);
}

/* ===== Layout: Four Column ===== */
.four-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--gap-size);
  padding: var(--gap-size);
}

/* ===== Module Styling ===== */
.module {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: calc(var(--gap-size) / 2);
}

.span-2 {
  grid-column: span 2;
}

/* ===== Copy Module ===== */
.copy-module {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(var(--gap-size) / 2);
  font-family: var(--font-family);
  font-size: clamp(var(--font-size-mobile), 2vw, var(--font-size-base));
  color: var(--font-color);
  line-height: var(--line-height-base);
}

/* ===== Media ===== */
.media {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ===== Typography Elements ===== */
.copy {
  font-size: clamp(var(--font-size-mobile), 2vw, var(--font-size-base));
}

h2 {
  font-size: clamp(var(--font-size-mobile), 2vw, var(--font-size-base));
  margin: 0;
}

/* ===== Video Autoplay Enhancements ===== */
.video-autoplay {
  pointer-events: none;
}

/* ===== Responsive Overrides ===== */
@media (max-width: 768px) {
  :root {
    --gap-size: calc(16px / 1.33); /* Reduce gap by one-third on mobile */
  }

  .container,
  .three-col,
  .four-col {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .copy-module {
    min-height: 250px;
  }
}
