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

:root {
  --bg: #0d0d0d;
  --panel: #1a1a1a;
  --border: #262626;
  --text: #fff;
  --gold: #997300;
  --heading: #e8b257;
  --code: #66ff66;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.home-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: 'VT323', monospace;
  padding: 24px;
}

.home-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px 0;
}

.logo {
  display: block;
  width: min(300px, 72vw);
  max-height: min(300px, 48svh);
  height: auto;
  object-fit: contain;
  border: 5px solid var(--border);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.site-title {
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: normal;
  letter-spacing: 0;
  line-height: 1.1;
  color: var(--gold);
}

footer {
  width: 100%;
}

footer nav {
  display: flex;
  justify-content: center;
  padding: 0 8px;
}

.footers {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin: 0;
  padding: 0 0 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  list-style: none;
}

.footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--gold);
  text-decoration: none;
  padding: 0 8px;
  line-height: 1;
}

.footer-contact {
  display: flex;
  flex-basis: 100%;
  justify-content: center;
}

.footer a:focus-visible,
.footer a:hover,
.back-button:focus-visible,
.back-button:hover,
.contact-link:focus-visible,
.contact-link:hover {
  color: var(--heading);
}

.article-page {
  font-family: "Courier New", Courier, monospace;
  padding: 20px;
  overflow-wrap: break-word;
}

.article-shell {
  width: min(100%, 900px);
  margin: 0 auto;
}

.article-shell article {
  min-width: 0;
}

.article-page h1,
.article-page h2,
.article-page h3 {
  color: var(--heading);
  line-height: 1.2;
}

.article-page h1 {
  font-size: 2rem;
}

.article-page h2 {
  font-size: 1.5rem;
}

.article-page h3 {
  font-size: 1.25rem;
}

.article-page p,
.article-page li {
  max-width: 76ch;
}

.article-page article a {
  color: var(--heading);
}

.article-page pre {
  max-width: 100%;
  background-color: var(--panel);
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.45;
  white-space: pre;
}

.article-page code {
  color: var(--code);
}

.article-page :not(pre) > code {
  overflow-wrap: anywhere;
}

.article-page table {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

.article-page th,
.article-page td {
  border: 1px solid var(--text);
  padding: 8px;
  text-align: left;
}

.article-page th {
  background-color: var(--border);
}

.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
  color: var(--heading);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
}

.contact-link {
  position: fixed;
  top: 28px;
  right: 20px;
  color: var(--gold);
  text-decoration: none;
  z-index: 2;
}

@media (max-width: 760px) {
  .home-page {
    padding: 16px;
  }

  .home-shell {
    padding: 24px 0 16px;
  }

  .logo {
    width: min(260px, 76vw);
    max-height: 44svh;
  }

  .footers {
    gap: 8px;
    max-width: 360px;
  }

  .footer a {
    min-width: 42px;
    min-height: 42px;
    padding: 0 6px;
  }

  .article-page {
    padding: 56px 16px 24px;
    font-size: 0.95rem;
  }

  .back-button {
    position: absolute;
    top: 12px;
    left: 16px;
  }

  .contact-link {
    position: absolute;
    top: 24px;
    right: 16px;
  }

  .article-page h1 {
    font-size: 1.55rem;
  }

  .article-page h2 {
    font-size: 1.3rem;
  }

  .article-page h3 {
    font-size: 1.1rem;
  }

  .article-page pre {
    margin-right: -16px;
    margin-left: -16px;
    border-radius: 0;
    padding: 12px 16px;
    font-size: 0.82rem;
  }

  .article-page table {
    width: calc(100% + 32px);
    min-width: calc(100% + 32px);
    max-width: calc(100% + 32px);
    margin-right: -16px;
    margin-left: -16px;
    font-size: 0.85rem;
  }

  .article-page th,
  .article-page td {
    padding: 6px 8px;
  }
}

@media (max-width: 380px) {
  .home-page {
    padding: 12px;
  }

  .logo {
    width: min(230px, 78vw);
  }

  .footers {
    max-width: 300px;
  }

  .footer a {
    min-width: 40px;
    min-height: 40px;
  }

  .article-page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .article-page pre,
  .article-page table {
    margin-right: -12px;
    margin-left: -12px;
  }

  .article-page pre {
    padding-right: 12px;
    padding-left: 12px;
  }

  .article-page table {
    width: calc(100% + 24px);
    min-width: calc(100% + 24px);
    max-width: calc(100% + 24px);
  }
}
