html {
  scrollbar-gutter: stable;
}

body {
  background: #fff;
  font-family: "Inter", sans-serif;
  min-width: 640px;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 30px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-tags {
  color: #aaa;
  font-size: 1.2rem;
}

.hero h1,
.container > h1 {
  font-family: "Anonymous Pro", monospace;
  font-size: 3.52rem;
  font-weight: normal;
  line-height: 1.2;
  white-space: nowrap;
  margin-bottom: 32px;
}

#mg-wrap {
  width: 220px;
  height: 276px;
  overflow: hidden;
  flex-shrink: 0;
}

#mg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#mg.mg-gif {
  object-fit: cover;
  object-position: 65% center;
}

.headlines-date {
  font-family: "Space Mono", monospace;
  color: #aaa;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.headlines-bar {
  font-family: "DotGothic16", sans-serif;
  display: flex;
  align-items: stretch;
  border: 1px solid #8b8c5a;
  font-size: 1.4rem;
  box-shadow: 0 2px 1px rgba(0, 0, 0, 0.15);
}

.headlines-label {
  background: #7a7a48;
  color: #e8e8c8;
  padding: 7px 12px 7px 80px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  font-size: 1.28rem;
  box-shadow:
    inset 2px 2px 0px 0 #d8d8b6,
    inset 0 -2px 0px 0 #60603a;
}

.headlines-content {
  background: #c8c87a;
  flex: 1;
  padding: 6px 12px;
  position: relative;
  box-shadow:
    inset 2px 2px 0px 0 #a6a675,
    inset -2px -2px 0px 0 #e5e5d3;
  min-height: 32px;
}

.headline {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  color: #222;
  white-space: nowrap;
}

a.headline {
  text-decoration: underline;
}

a.headline:hover {
}

.headline.visible {
  opacity: 1;
  pointer-events: auto;
}

.site-header {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 20px 10px;
}

.internal-links {
  font-size: 1.4rem;
  color: #aaa;
}

.internal-links a {
  color: #aaa;
  text-decoration: underline;
}

.internal-links .sep {
  color: #222;
}

#site-links {
  margin-top: 36px;
}

.links {
  text-align: center;
  line-height: 1.4;
  border-top: 1px solid #000;
  padding-top: 16px;
}

.link-row {
  margin-bottom: 2px;
}

.links a {
  color: #0000ff;
  text-decoration: underline;
  font-size: 1.4rem;
}

.sep {
  color: #222;
  margin: 0 4px;
}

.sp-only {
  display: none;
}

.hidden-mg {
  text-align: center;
  color: #fff;
  font-size: 1.4rem;
  padding: 8px 0 0;
  user-select: text;
}

.footer {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  color: #aaa;
  font-size: 1.1rem;
  padding: 30px 20px 32px;
}

/* ---- SP (〜639px) ---- */
@media (max-width: 639px) {
  body {
    min-width: unset;
  }

  .container {
    padding: 48px 16px 40px;
  }

  .hero {
    flex-direction: column;
    align-items: end;
    gap: 8px;
  }

  .hero-text {
    width: 100%;
  }

  .hero h1 {
    font-size: 3.52rem;
    margin-bottom: 0;
  }

  #mg-wrap {
    width: 200px;
    height: 240px;
  }

  .headlines-label {
    padding: 4px 10px;
  }

  .headlines-content {
    overflow-x: auto;
    padding: 0px 12px;
  }

  .headline {
    white-space: nowrap;
  }

  .sp-only {
    display: inline;
  }

  .bio-layout {
    flex-direction: column;
    gap: 0;
  }

  /* About SP */
  .profile-layout {
    flex-direction: column-reverse;
    gap: 24px;
  }

  .profile-right {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .gif-viewer {
    width: 100%;
    max-width: 250px;
  }

  .gallery-grid {
    column-count: 2;
  }
}

/* ---- About page ---- */
.section-heading {
  font-size: 1.8rem;
  font-weight: 500;
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
  margin-top: 32px;
  margin-bottom: 16px;
}

.bio-layout {
  display: flex;
  gap: 24px;
  margin-top: 40px;
}

.bio-col {
  flex: 1;
  min-width: 0;
}

.bio-col p {
  font-size: 1.4rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 14px;
}

.bio-col p:last-child {
  margin-bottom: 0;
}

.bio-col a {
  color: #0000ff;
  text-decoration: underline;
}

.sections {
  margin-top: 8px;
  overflow: hidden;
}

.section-block {
  margin-bottom: 20px;
}

.section-block h3 {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 6px;
}

.section-block ul {
  list-style: none;
}

.section-block li {
  font-size: 1.4rem;
  line-height: 1.8;
  color: #333;
  position: relative;
  padding-left: 1.5em;
}

.section-block li::before {
  content: "•";
  position: absolute;
  left: 0;
}

.section-block li > ul {
  padding-left: 1em;
}

.section-block li > ul > li {
  padding-left: 1.3em;
}

.section-block li > ul > li::before {
  content: "◦";
}

.section-block a {
  color: #0000ff;
  text-decoration: underline;
}

.section-sublist {
  margin-top: 4px;
  padding-left: 1.2em;
}

.history-sublist li::before {
  content: "- ";
}

.section-body {
  font-size: 1.4rem;
  line-height: 1.9;
  color: #333;
  margin-bottom: 20px;
}

.section-body a,
.section-body a:visited {
  color: #0000ff;
  text-decoration: underline;
}

/* ---- Gallery page ---- */
.gallery-grid {
  column-count: 3;
  column-gap: 6px;
}

.gallery-item {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

.profile-layout {
  display: flex;
  gap: 24px;
  margin-top: 0;
  align-items: flex-start;
}

.profile-left {
  flex: 13;
  min-width: 0;
}

.profile-right {
  flex: 7;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: left;
}

.profile-table {
  font-size: 1.3rem;
  border-collapse: collapse;
  width: 100%;
}

.profile-table th,
.profile-table td {
  border: 1px solid #333;
  padding: 5px 10px;
  text-align: left;
  font-weight: normal;
  background: #fff;
  color: #333;
}

.profile-table th {
  white-space: nowrap;
  width: 6em;
}

.profile-table td a {
  color: #333;
  text-decoration: underline;
}

.gif-viewer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
}

#gif-main {
  width: 90%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 65% center;
  display: block;
  image-rendering: pixelated;
}

.gif-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
}

.gif-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.35;
  image-rendering: pixelated;
}

.gif-thumb.active {
  opacity: 1;
}

.gif-thumb:hover {
  opacity: 0.75;
}
