/* === Fonts === */
@font-face {
  font-family: 'BankGothic';
  src: url('fonts/BankGothic Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Frutiger';
  src: url('fonts/helvetica-neue-light.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'NDS';
  src: url('fonts/NINTENDO-DS-BIOS.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
}

html,
body {
  height: 100%;
}

body {
  --bg: #ffffff;
  --text: #000000;
  --text-secondary: #a8a8a8;
  --accent: #ff0088;
  --bg-pattern: url('../img/bg/bg_tile_light.gif');
  font-family: 'Frutiger', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

body.dark {
  --bg: #000000;
  --text: #f0f0f0;
  --text-secondary: #575757;
  --bg-pattern: url('../img/bg/bg_tile.png');
  --accent: #ff0088;
}

.background-pattern {
  position: fixed;
  top: -25px;
  left: -25px;
  width: calc(100% + 30px);
  height: calc(100% + 30px);
  background-image: var(--bg-pattern);
  background-repeat: repeat;
  background-size: auto;
  z-index: -1;
  pointer-events: none;
}

.container {
  display: flex;
  flex-direction: row;
  flex: 1;
  flex-wrap: wrap;
  padding: 1.5rem;
  max-width: 1200px;
  margin: auto;
  gap: 2rem;
}

body h1,
body h2,
body h3,
nav ul {
  font-family: 'BankGothic', sans-serif;
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--text);
  text-transform: uppercase;
}

nav ul:hover {
  color: var(--accent);
}

/* Notched Corners */
.sidebar,
.carousel-container,
.blog article {
  border: 2px solid var(--accent);
}

/* css has defeated me (╥﹏╥)  
  position: relative;
  clip-path: polygon(15px 0%, 100% 0%, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0% 100%, 0% 15px);
  background: var(--bg);
  z-index: 0;
}

.sidebar::before,
.carousel-container::before,
.blog article::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  clip-path: polygon(15px 0%, 100% 0%, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0% 100%, 0% 15px);
}

.sidebar::after,
.carousel-container::after,
.blog article::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--bg);
  clip-path: polygon(15px 0%, 100% 0%, 100% calc(100% - 16px), calc(100% - 15px) 100%, 0% 100%, 0% 15px);
  z-index: -1;
}*/


/* === Header & Nav === */
.site-header {
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.75);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 4px #0003;
  backdrop-filter: blur(6px);
  z-index: 1000;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-img {
  height: 40px;
}

.site-toggles {
  display: flex;
  gap: 0.5rem;
}

.site-toggles button,
.toggle-controls button,
.secondary-nav button {
  background-color: var(--bg);
  border: 1px solid var(--accent);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.site-toggles button,
.toggle-controls button {
  padding: 0.3rem 0.6rem;
  font-size: 1rem;
}

.toggle-controls button {
  margin: 0 5px 5px 0;
  padding: 0.4rem 0.8rem;
  box-shadow: 0 0 3px var(--accent);
}

.site-toggles button:hover,
.toggle-controls button:hover {
  background-color: var(--accent);
  color: #fff;
}

.site-toggles button:hover {
  color: white;
}

.header-clock {
  font-family: 'NDS', monospace;
  font-size: 200%;
  image-rendering: pixelated;
  color: var(--accent);
  font-smooth: never;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

.header-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.primary-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.primary-nav a {
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
}

.primary-nav a:hover {
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent);
}

.secondary-nav {
  display: flex;
  gap: 0.5rem;
}

.secondary-nav button {
  padding: 0.25rem;
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.secondary-nav img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

.micro-buttons button {
  font-size: 1.2rem;
  background: transparent;
  border: 2px inset var(--accent);
  color: var(--text);
  margin-right: 8px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  box-shadow: inset 0 0 2px #fff, 0 0 2px var(--accent);
}

/* === Sidebar === */
.sidebar {
  flex: 1 1 250px;
  max-width: 300px;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 1rem;
  box-shadow: 0 0 10px #0003;
}

.dark .sidebar {
  background-color: rgba(0, 0, 0, 0.8);
}

.side-nav a {
  font-family: 'BankGothic', sans-serif;
  font-weight: bold;
  font-size: 1.2rem;
  text-transform: uppercase;
  display: block;
  padding: 0.5rem 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.side-nav a:hover {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
}

.side-nav a:hover::before {
  content: " ● ";
  font-size: .8rem;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 88px);
  column-width: 88px;
  gap: 0.5rem;
  justify-content: center;
}

.icon-grid a,
.icon-grid img,
.site-button {
  width: 88px;
  height: 31px;
  image-rendering: pixelated;
}

.embed-code {
  grid-column: 2 / 4;
  margin: 0;
  padding: 0;
  height: 31px;
  width: 100%;
  resize: none;
  scrollbar-width: none;
  word-break: break-all;
  font-family: 'MS Gothic', monospace;
  font-size: 0.75rem;
  background-color: #f0f0f0;
  border: 1px solid var(--accent);
  box-sizing: border-box;
}

/* === Main Content === */
main {
  flex: 3 1 600px;
}

main h2,
main h3,
aside h2,
aside h3 {
  font-size: 1.4rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.25rem;
  margin-top: 1rem;
}

main h3,
aside h3 {
  font-size: 1.2rem;
}

/* Carousel */
.carousel-container {
  position: relative;
  width: 600px;
  height: 400px;
  margin: 40px auto;
  overflow: hidden;
  background-color: var(--accent);
  filter: contrast(1.2) brightness(0.95);
    clip-path: polygon(
    45px 0%, 100% 0%, 100% calc(100% - 45px),
    calc(100% - 45px) 100%, 0% 100%, 0% 45px
  );
}

.carousel-clip {
  width: 100%;
  height: 100%;
    clip-path: polygon(
    50px 0%, 100% 0%, 100% calc(100% - 50px),
    calc(100% - 50px) 100%, 0% 100%, 0% 50px
  );
}


/* CRT scanlines overlay */
.crt::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(18, 16, 16, 0.1);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  animation: flicker 0.15s infinite;
}
.crt::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

/* Scanline flicker animation */
@keyframes flicker {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 0.65;
  }
}

.carousel-slide,
.tv-static {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.2);
}

.tv-static {
  background-repeat: repeat;
}

.carousel-slide.active,
.tv-static.active {
  display: block;
}

.slide-text {
  position: absolute;
  top: 0;
  right: 0;
  color: black;
  padding: 2px;
  margin: 0;
  font-family: 'MS Gothic', monospace;
  font-size: 10px;
  image-rendering: pixelated;
  font-smooth: never;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

/* Glossy screen overlay */
.glossy-overlay {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.05) 60%);
  mix-blend-mode: screen;
  z-index: 20;
}

/* Marquee / News Ticker */
.marquee {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #575757cc;
  color: #fff;
  font-family: 'MS PGothic', sans-serif;
  font-style: italic;
  font-size: 14px;
  margin: 10px 0;
  padding: 5px 0;
  overflow: hidden;
  z-index: 10;
}

.marquee__inner {
  display: flex;
  width: max-content;
  animation: scroll-left 40s linear infinite;
}

.marquee__inner:hover {
  animation-play-state: paused;
}

.marquee ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}


.marquee-list li, .marquee-list li span, .marquee-list li a {
  line-height: 1.5;
  vertical-align: middle;
  padding: 0;
  white-space: nowrap;
}

.marquee li::after {
  content: " ▪ ";
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* === Projects === */
.gamecard-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.nds-cart {
  padding: 1rem;
  margin: auto;
  margin-bottom: 1rem;
  height: 200px;
  width: 150px;
}

/* === Blog === */
.blog article {
  background: rgba(255, 255, 255, 0.9);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 10px #0003;
  position: relative;
}

.blog article:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 15px #0005;
}

.blog article .date {
  position: absolute;
  top: 0rem;
  right: 1rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #8a8a8a;
}

.blog h3 {
  margin-top: 0;
}

.blog .button-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.5em;
  margin-right: 1em;
}

.view-more-link,
.rss-link {
  font-family: 'BankGothic', sans-serif;
  font-weight: bold;
  font-size: 1.2rem;
  text-transform: uppercase;
  text-decoration: none;
  color: white;
  background-color: var(--accent);
  border: 2px solid var(--accent);
  padding: 0.5em 1em;
  cursor: pointer;
  display: inline-block;
  transform: skew(-30deg); /* Skews the outer container */
  overflow: hidden; /* Optional: prevent overflow from counter-skewed text */
}

.view-more-link span,
.rss-link span {
  display: inline-block;
  transform: skew(30deg); /* Counteracts the parent skew */
}

.view-more-link:hover,
.rss-link:hover {
  background-color: var(--bg);
  color: var(--accent);
  text-shadow: 0 0 5px var(--accent);
}

/* === Footer === */
footer {
  background-color: rgba(255, 255, 255, 0.8);
  font-size: 0.75em;
  padding: 5px 20px 10px 20px;
  border-top: 2px solid var(--accent);
}

footer h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.footer-column {
  width: 25%;
  margin: 5px 10px;
  display: inline-block;
  vertical-align: top;
}

.footer-column a {
  color: var(--accent);
  text-decoration: none;
}

.footer-column a:hover {
  text-decoration: underline;
}

/* === Utilities === */
a {
  color: var(--text);
}

a:hover {
  color: var(--accent);
}

/* === Dark Mode === */
body.dark .site-header {
  background-color: rgba(0, 0, 0, 0.75);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 4px #fff3;
}

body.dark .blog article {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid var(--accent);
}

body.dark .blog article:hover {
  background: rgba(20, 20, 20, 0.98);
}

body.dark footer {
  background-color: rgba(0, 0, 0, 0.85);
  border-top: 2px solid var(--accent);
}

body.dark .footer-column a {
  color: var(--accent);
}

/* === Profile.html === */
.profile-content {
  background: rgba(255, 255, 255, 0.9);
  padding: 1.5rem;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px #0003;
}

.dark .profile-content {
  background-color: rgba(0, 0, 0, 0.9);
}

.profile-content ul {
  list-style-type: square;
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.profile-content a {
  color: var(--accent);
  text-decoration: none;
}

.profile-content a:hover {
  text-decoration: underline;
}

.profile-content .fav::marker {
  content: ' ❤ ';
}

.project-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-entry {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 0rem;
}

.project-details {
  flex: 1;
}

.project-details h3 {
  margin-top: 0;
  font-size: 1.4rem;
  color: var(--text);
}

.project-details .meta {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.project-details .description {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.tags span {
  display: inline-block;
  background-color: var(--accent);
  color: #fff;
  padding: 0.2rem 0.5rem;
  margin: 0 0.25rem 0.25rem 0;
  border-radius: 4px;
  font-size: 0.8rem;
}

.project-link {
  display: inline-block;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.5rem;
}

.project-link:hover {
  text-shadow: 0 0 5px var(--accent);
}

/* === Updates Pages === */
.updates h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-preview {
  border-left: 4px solid var(--accent);
  padding: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px #0002;
  border-radius: 4px;
}

body.dark .post-preview {
  background: rgba(30, 30, 30, 0.9);
  box-shadow: 0 2px 10px #fff1;
}

.post-preview h3 {
  margin-top: 0;
}

.post-preview .meta {
  font-size: 0.85rem;
  color: #999;
  margin: 0.2rem 0 0.5rem;
}

.post-preview .excerpt {
  margin: 0;
}

.pagination {
  margin-top: 2rem;
  text-align: center;
}

.page-link,
.page-number {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0 0.2rem;
  border-radius: 4px;
  text-decoration: none;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--accent);
}

.page-number.current {
  font-weight: bold;
  background: var(--accent);
  color: #fff;
}

.blog-post {
  background: rgba(255, 255, 255, 0.98);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 12px #0002;
}

body.dark .blog-post {
  background: rgba(25, 25, 25, 0.95);
  box-shadow: 0 0 12px #fff1;
}

.blog-post h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.blog-post .meta {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 1.5rem;
}

.post-content h2 {
  margin-top: 1.5rem;
  font-size: 1.4rem;
}

.post-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.post-nav {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.links-section {
  padding: 2rem 0;
}

.links-section h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.link-card {
  background: rgba(255, 255, 255, 0.95);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px #0001;
}

body.dark .link-card {
  background: rgba(32, 32, 32, 0.95);
  box-shadow: 0 2px 8px #fff1;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.link-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.link-title {
  font-size: 1.2rem;
  margin: 0;
}

.link-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* === Gallery Page === */
.gallery {
  margin-top: 1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--accent);
  box-shadow: 0 0 6px #0003;
  padding: 0.5rem;
  clip-path: polygon(8px 0%, 100% 0%, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0% 100%, 0% 8px);
  transition: transform 0.2s ease-in-out;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px var(--accent);
}

.gallery-item img {
  width: 100%;
  height: auto;
  image-rendering: auto;
  border: 1px solid var(--accent);
}

gallery-item figcaption {
  font-size: 0.8rem;
  text-align: center;
  color: var(--text);
  margin-top: 0.5rem;
}

/* === Sound Test Page === */
.sound-test {
  margin-top: 1rem;
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.sound-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--accent);
  box-shadow: 0 0 6px #0003;
  padding: 1rem;
  clip-path: polygon(8px 0%, 100% 0%, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0% 100%, 0% 8px);
  transition: box-shadow 0.2s ease-in-out;
}

.sound-card:hover {
  box-shadow: 0 0 10px var(--accent);
}

.sound-card h3 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--text);
}

.sound-card audio {
  width: 100%;
  outline: none;
  filter: drop-shadow(0px 0px 2px #888);
}

/* Lightbox background tweak */
.lb-data .lb-caption {
  color: var(--text);
  font-family: var(--font);
}

.lightboxOverlay {
  background: rgba(240, 248, 255, 0.95);
  /* near-white translucent blue */
  backdrop-filter: blur(6px);
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
  background-color: rgba(255, 255, 255, 0.2);
}

/* === Profile === */
.profile-columns {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.profile-col {
  flex: 1 1 0;
  min-width: 220px;
}

@media (max-width: 800px) {
  .profile-columns {
    flex-direction: column;
    gap: 1rem;
  }
}