/* kasingfung.com — dukope-inspired minimal layout */

:root {
  --bg: #e6e4df;
  --fg: #1a1a1a;
  --rule: rgba(0, 0, 0, 0.12);
  --max: 42rem;
}

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

html {
  scroll-behavior: smooth;
  /* 避免有/無垂直捲軸時視窗寬度變動，置中內容左右「跳一下」 */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", Times, serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 避免瀏覽器把已點擊連結改成預設紫色 */
a:visited {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  z-index: 100;
}

.page {
  width: min(var(--max), 100% - 2.5rem);
  margin-inline: auto;
  padding: 2.5rem 0 4rem;
}

/* masthead — “GAMES BY …” style */
.masthead {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.masthead-title {
  margin: 0;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  text-transform: uppercase;
  font-family: inherit;
}

.masthead-nav {
  margin-top: 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.masthead-nav a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.masthead-nav a:hover {
  color: #000;
}

.masthead-nav [aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
}

.profile-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.profile-pic {
  width: min(160px, 40vw);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.works {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: center;
}

.work {
  margin: 0;
  max-width: 100%;
}

.work img {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
  border: 1px solid var(--rule);
}

.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.8rem;
  color: #444;
}

.site-footer p {
  margin: 0.35rem 0;
}

.site-footer-copy {
  margin-bottom: 0.75rem !important;
}

.site-footer-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0;
}

.site-footer-sep {
  color: #888;
  user-select: none;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-footer-contact a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-skip-ink: none;
}

.site-footer a:hover {
  color: var(--fg);
}

/* Devlog */
.devlog-intro {
  margin: 0 0 2.5rem;
  font-size: 0.9rem;
  color: #444;
}

.devlog-intro code {
  font-size: 0.85em;
}

.devlog-entry {
  margin-bottom: 3.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}

.devlog-entry:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.devlog-entry-header {
  margin-bottom: 1rem;
}

.devlog-time {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.devlog-entry-title {
  margin: 0.5rem 0 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.devlog-body {
  font-size: 0.95rem;
}

.devlog-body p {
  margin: 0 0 1rem;
}

.devlog-body p:last-child {
  margin-bottom: 0;
}

/* 圖 + 圖說整塊在文章欄內水平置中 */
.devlog-media {
  display: block;
  margin: 1.25rem auto;
  width: min(28rem, 100%);
  max-width: 100%;
  box-sizing: border-box;
}

/* 單張：直接放在 figure 下 */
.devlog-media > img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

/* 兩張並排：用 .devlog-media--pair + .devlog-media-row */
.devlog-media--pair {
  width: min(40rem, 100%);
}

.devlog-media-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-start;
  width: 100%;
}

.devlog-media-row img {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  object-fit: contain;
}

@media (max-width: 28rem) {
  .devlog-media-row {
    flex-direction: column;
  }

  .devlog-media-row img {
    flex: 1 1 auto;
    max-width: 100%;
  }
}

.devlog-media figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #555;
  text-align: center;
}

.video-embed {
  position: relative;
  width: 100%;
  max-width: 40rem;
  margin: 1.25rem 0;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Devlog index — dukope-style list */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.devlog-index {
  padding-top: 0.5rem;
}

.devlog-page-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.devlog-page-sub {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: #444;
}

.devlog-page-sub a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-skip-ink: none;
}

.devlog-filter {
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.devlog-filter a {
  color: var(--fg);
  text-decoration: none;
}

.devlog-filter a:hover {
  text-decoration: underline;
}

.devlog-filter a.is-active {
  font-weight: 600;
  text-decoration: underline;
}

.devlog-hint {
  margin: 0 0 2rem;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.5;
}

.devlog-hint code {
  font-size: 0.78em;
}

.devlog-section {
  margin-bottom: 2.5rem;
}

.devlog-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

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

.devlog-list li {
  margin-bottom: 0.65rem;
}

.devlog-list-item {
  display: block;
  color: var(--fg);
  text-decoration: none;
  line-height: 1.35;
}

.devlog-list-item:hover .devlog-list-label {
  text-decoration: underline;
}

.devlog-list-item time {
  display: block;
  font-size: 0.8rem;
  color: #555;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.devlog-list-label {
  display: block;
  margin-top: 0.15rem;
}

.devlog-back {
  margin: 0 0 1.75rem;
  font-size: 0.9rem;
}

.devlog-back a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.devlog-entry--single .devlog-entry-title {
  font-size: 1.35rem;
}
