@import url('https://fonts.googleapis.com/css2?family=Doto&display=swap');

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Doto', monospace;
  background-image: url('res/bg.gif');
  background-size: cover;
  background-repeat: repeat;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.marquee {
  position: fixed;
  top: 0;
  width: 100%;
  background: black;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  z-index: 9999;
}
.marquee-text {
  font-weight: 900;
  line-height: 1.6;
  display: inline-block;
  padding-left: 100%;
  animation: scroll-left 30s linear infinite;
}
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.container {
  width: 95vw;
  max-width: 800px;
  background-color: black;
  color: white;
  border: 2px solid white;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 95vh;
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
  margin-top: 50px;
  padding-bottom: 20px;
}
.header, .footer { padding: 20px; text-align: center; }
.footer { margin-top: auto; border-top: 1px solid white; }
.footer .social-separator { margin: 0 10px; }
.logo { font-size: 32px; font-weight: bold; }
.nav { margin-top: 10px; }
.nav a, .footer a { color: white; text-decoration: none; margin: 0 10px; }
.nav a:hover, .footer a:hover { text-decoration: underline; }
.footer a[href], .homepage .header a[href] {
  display: inline-block;
  padding: 8px 2px;
  font-size: 18px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.footer a[href]:hover, .footer a[href]:focus-visible,
.homepage .header a[href]:hover, .homepage .header a[href]:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
.nav a.home-link {
  position: fixed;
  top: 42px;
  left: 12px;
  z-index: 10000;
  display: inline-block;
  border: 1px solid white;
  padding: 5px 10px;
  background: black;
  text-decoration: none;
}
.nav a.home-link:hover, .nav a.home-link:focus-visible {
  color: white;
  background: black;
  outline: 1px solid white;
  outline-offset: 3px;
}
.section { border-top: 1px solid white; padding: 20px; margin: 0 10px; }
.section:first-child { border-top: none; }
.section p a { color: white; text-decoration: underline; text-underline-offset: 4px; }
.section p a:hover { text-decoration-style: solid; }
p { font-weight: 700; line-height: 1.4; }

.gif-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.gif-container img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  display: block;
}
.gif-container.single img { max-width: 100%; max-height: 500px; }
.gif-container.two-col img { max-width: calc(50% - 5px); }
.gif-container.three-col img { max-width: calc(33.333% - 7px); }
.game-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 15px; }
.game-buttons img { width: 300px; height: auto; display: block; }
.game-buttons a { cursor: pointer; }
.game-buttons img:not(.screenshot):hover { filter: brightness(0.8); outline: 1px solid white; outline-offset: 3px; }
.screenshot { cursor: zoom-in; }
.screenshot-viewer { max-width: 100vw; max-height: 100vh; padding: 0; border: 0; background: transparent; }
.screenshot-viewer::backdrop { background: rgba(0,0,0,0.9); }
.screenshot-viewer img { display: block; max-width: 95vw; max-height: 95vh; object-fit: contain; cursor: zoom-out; }
.screenshot-viewer button:not([hidden]) { display: grid; }
.screenshot-viewer button {
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  position: fixed;
  top: 12px;
  right: 16px;
  border: 1px solid white;
  background: black;
  color: white;
  font: 24px/1 Arial, sans-serif;
  cursor: pointer;
}
.screenshot-viewer .screenshot-arrow { top: 50%; transform: translateY(-50%); }
.screenshot-viewer .screenshot-prev { left: 16px; right: auto; }

.download-button {
  background-color: white;
  color: black;
  font-family: 'Doto', monospace;
  font-weight: bold;
  font-size: inherit;
  line-height: normal;
  text-align: center;
  text-decoration: none;
  border: 2px solid white;
  padding: 10px 20px;
  cursor: pointer;
  margin: 10px auto;
  display: inline-block;
}
.download-button:hover, .download-button:focus-visible { outline: 1px solid white; outline-offset: 3px; }
.post.panel, .post.panel:hover { border: 2px solid white; outline-color: white; outline-width: 2px; }
.panel-button {
  display: inline-block;
  background-color: black;
  color: white;
  font-family: 'Doto', monospace;
  font-weight: bold;
  border: 2px solid white;
  padding: 12px 30px;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: none;
}
.panel-button:hover, .panel-button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.iframe-container { position: relative; width: 100%; margin: 0 auto; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.iframe-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.section table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  background-color: rgba(255,255,255,0.05);
}
.section th, .section td {
  border: 1px solid rgba(255,255,255,0.2);
  padding: 12px;
  text-align: left;
}
.section th {
  background-color: rgba(255,255,255,0.1);
  font-weight: 700;
}
.section tr:hover { background-color: rgba(255,255,255,0.08); }
.project-details th { width: 30%; }
.project-details th, .project-details td { padding: 8px 12px; }

.post { border: 1px solid white; padding: 20px; margin-bottom: 20px; }
.post:hover { outline: 1px solid white; outline-offset: 3px; }
.post-date { font-size: 0.85em; opacity: 0.6; margin-bottom: 10px; text-transform: uppercase; }
.post-content { margin-bottom: 10px; white-space: pre-wrap; font-weight: 700; line-height: 1.4; }
.post-image { max-width: 100%; height: auto; margin-top: 15px; margin-bottom: 10px; border: 1px solid white; }
.post-link {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid white;
  background: rgba(255,255,255,0.1);
  color: white !important;
  font-size: 1em;
  font-weight: 700;
  text-decoration: none;
}
.post-link:hover, .post-link:focus-visible { color: white !important; text-decoration: none; outline: 1px solid white; outline-offset: 3px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.post-tag { font-size: 0.8em; padding: 4px 10px; border: 1px solid white; opacity: 0.8; font-family: monospace; }
.latest-post { margin-bottom: 0; }
.posts-button {
  display: inline-block;
  padding: 12px 24px;
  background: black;
  border: 1px solid white;
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
}
.posts-button:hover, .posts-button:focus-visible { text-decoration: none; background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); outline: 1px solid white; outline-offset: 3px; }

/* Homepage project archive and skills. */
.homepage a { color: white; text-decoration: none; }
.homepage a:hover { text-decoration: underline; }
.homepage .header a[href] { text-decoration: underline; }
.homepage .game-section { border-top: 1px solid white; padding: 20px; margin: 0 10px 30px; }
.homepage .game-section:first-child { border-top: none; }
.project-intro { margin: -5px 0 24px; color: #bdbdbd; font-size: 14px; }
.project-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; counter-reset: project; }
.homepage .project-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid white;
  counter-increment: project;
}
.homepage .project-card:hover, .homepage .project-card:focus-visible {
  text-decoration: none;
  background: rgba(255,255,255,0.05);
  outline: 2px solid white;
  outline-offset: 4px;
}
.project-card .project-image { display: block; width: 100%; border: 1px solid rgba(255,255,255,0.3); box-sizing: border-box; }
.project-info { min-width: 0; }
.project-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.project-heading h3 { margin: 0; font-size: 18px; font-weight: 900; overflow-wrap: anywhere; }
.project-number::before { content: counter(project, decimal-leading-zero) ' / '; font-size: 12px; font-weight: 700; color: #bdbdbd; }
.project-status { display: inline-block; border: 1px solid rgba(255,255,255,0.4); padding: 4px 6px; font-size: 11px; font-weight: 700; }
.project-meta { margin-top: 12px; color: #bdbdbd; font-size: 12px; font-weight: 700; line-height: 1.5; }
.project-info p { margin: 10px 0 16px; font-size: 14px; line-height: 1.5; }
.project-action { display: inline-block; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.project-card:hover .project-action, .project-card:focus-visible .project-action { text-decoration: underline; text-underline-offset: 4px; }
.homepage .project-featured { grid-column: 1 / -1; border-width: 2px; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding: 20px; align-items: center; }
.project-featured .project-heading h3 { font-size: 22px; }
.project-featured .project-info p { font-size: 15px; }
.project-featured .project-status { background: white; border-color: white; color: black; }
@media (max-width: 650px) {
  .project-list { grid-template-columns: minmax(0, 1fr); }
  .homepage .project-card, .homepage .project-featured { grid-template-columns: 80px minmax(0, 1fr); gap: 16px; padding: 16px; }
  .project-heading h3 { font-size: 20px; }
}
@media (max-width: 360px) {
  .homepage .project-card, .homepage .project-featured { grid-template-columns: minmax(0, 1fr); }
  .project-card .project-image { width: 100px; }
}
.homepage img { max-width: 100%; height: auto; }
.homepage center img { margin: 4px; }
.homepage .iframe-container { max-width: 646px; padding-bottom: 29.41%; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.skill-category { border: 1px solid white; padding: 20px; }
.skill-category:hover { outline: 1px solid white; outline-offset: 3px; }
.skill-category h3 { margin: 0 0 15px; font-size: 18px; border-bottom: 1px solid white; padding-bottom: 10px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.skill-tag { display: inline-block; padding: 6px 12px; border: 1px solid white; background-color: black; font-size: 12px; cursor: default; font-weight: 700; line-height: 1.4; }
.skill-tag:hover { outline: 1px solid white; outline-offset: 2px; }
.homepage .posts-button { padding: 8px 16px; }
.homepage .posts-button:hover, .homepage .posts-button:focus-visible { text-decoration: none; background: transparent; color: white; border-color: white; }
.homepage .post-link:hover, .homepage .post-link:focus-visible { text-decoration: none; }

@media (max-width: 768px) {
  .post { padding: 15px; }
  .post-content { font-size: 0.95em; }
  .gif-container.two-col img, .gif-container.three-col img { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-text { animation: none; padding-left: 0; }
}
