/* Self-hosted webfonts (no external CDN — works in mainland China). */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('./fonts/space-grotesk.woff2') format('woff2-variations'),
       url('./fonts/space-grotesk.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo Black';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/archivo-black-400.woff2') format('woff2');
}

:root {
  --bg: #fff5d6;
  --fg: #000000;
  --muted: #2a2a2a;
  --card: #ffffff;
  --shadow: #000000;
  --c1: #ff5a5f;
  --c2: #ffd166;
  --c3: #4ecdc4;
  --c4: #5d8bf4;
  --c5: #c77dff;
  /* CJK fallback chain: latin handled by webfont; Chinese/Japanese fall
     through to whatever the OS ships (PingFang on Apple, Yu Gothic / Yahei
     on Windows, Noto Sans CJK on Linux/Android). */
  --sans: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
          'PingFang SC', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN',
          'Yu Gothic', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans CJK JP',
          sans-serif;
  --display: 'Archivo Black', 'Space Grotesk', 'Inter',
             'PingFang SC', 'Hiragino Sans', 'Yu Gothic', 'Microsoft YaHei',
             'Noto Sans CJK SC', 'Noto Sans CJK JP',
             sans-serif;
}

/* Dark mode. Auto-switches via system appearance unless pinned via
   `color_scheme: light|dark` in config.yml.
   Brutalism on dark needs visible shadows: the trademark black drop-shadow
   disappears against a dark page, so on dark the shadow becomes a bright
   neon (cyan) and the body color is a richer charcoal so the cards still
   pop. The signature primary palette keeps its identity. */
@media (prefers-color-scheme: dark) {
  :root:not(.scheme-light) {
    --bg: #14141a;
    --fg: #f5f5f5;
    --muted: #b8b8b8;
    --card: #1f1f24;
    --shadow: #4ecdc4;
  }
  :root:not(.scheme-light) .link-button.link-latest { color: #14141a; }
  :root:not(.scheme-light) .link-latest-badge {
    background: #14141a;
    color: var(--c2);
    border-color: #14141a;
  }
}
:root.scheme-dark {
  --bg: #14141a;
  --fg: #f5f5f5;
  --muted: #b8b8b8;
  --card: #1f1f24;
  --shadow: #4ecdc4;
}
:root.scheme-dark .link-button.link-latest { color: #14141a; }
:root.scheme-dark .link-latest-badge {
  background: #14141a;
  color: var(--c2);
  border-color: #14141a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--shadow) 1px, transparent 1px),
    linear-gradient(90deg, var(--shadow) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  background-attachment: fixed;
  background-color: var(--bg);
  background-blend-mode: soft-light;
}

a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: 480px; }

.profile { text-align: center; margin-bottom: 36px; }

.profile-pic-wrap {
  display: inline-block;
  background: var(--c2);
  padding: 8px;
  border: 3px solid var(--shadow);
  box-shadow: 6px 6px 0 var(--shadow);
  margin-bottom: 20px;
  transform: rotate(-2deg);
}

.profile-pic {
  width: 110px;
  height: 110px;
  object-fit: cover;
  display: block;
  border: 3px solid var(--shadow);
}

.name {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.description {
  display: inline-block;
  background: var(--card);
  color: var(--fg);
  border: 3px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 500;
  text-wrap: pretty;
  max-width: 36ch;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.link-button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  color: var(--fg);
  border: 3px solid var(--shadow);
  box-shadow: 6px 6px 0 var(--shadow);
  font-size: 17px;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.link-button:nth-child(5n+1) { background: var(--c1); }
.link-button:nth-child(5n+2) { background: var(--c2); }
.link-button:nth-child(5n+3) { background: var(--c3); }
.link-button:nth-child(5n+4) { background: var(--c4); color: #fff; }
.link-button:nth-child(5n+5) { background: var(--c5); color: #fff; }

.link-button:hover,
.link-button:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--shadow);
  outline: none;
}

.link-button:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--shadow);
}

.link-icon i { font-size: 18px; }
.link-button-text { font-size: 13px; font-weight: 600; opacity: 0.85; margin-left: 6px; }

.button-container { display: flex; justify-content: center; }

.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.icon-button {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  color: var(--fg);
  border: 3px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.icon-button i { font-size: 18px; }

.icon-button:hover,
.icon-button:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow);
  outline: none;
}

.icon-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow);
}

.footer {
  margin-top: 40px;
  padding: 16px;
  background: var(--card);
  border: 3px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}

.footer a {
  font-weight: 700;
  border-bottom: 2px solid var(--shadow);
}

.copyright { margin-top: 8px; font-size: 12px; opacity: 0.8; }

@media (max-width: 480px) {
  .name { font-size: 28px; }
  .link-button { box-shadow: 4px 4px 0 var(--shadow); }
  .link-button:hover { box-shadow: 6px 6px 0 var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* "Latest" link variant — chunky stamp + clamp long titles */
.link-button.link-latest {
  align-items: flex-start;
  background: var(--c2);
}
.link-latest-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  margin-right: 8px;
  background: var(--fg);
  color: var(--c2);
  border: 2px solid var(--fg);
  transform: rotate(-2deg);
  vertical-align: 1px;
}
.link-latest .link-text {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
          line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

/* ── BGM (Bangumi log) ─────────────────────────────────────────────── */
.bgm { margin-top: 36px; }
.bgm-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 16px;
  display: inline-block;
  padding: 4px 10px;
  background: var(--c2);
  color: var(--fg);
  border: 3px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
  transform: rotate(-1deg);
}
.bgm-title a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.bgm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bgm-item { margin: 0; }
.bgm-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--card);
  color: var(--fg);
  border: 3px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.bgm-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow);
}
.bgm-link:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow);
}
.bgm-cover {
  flex: 0 0 auto;
  width: 44px;
  height: 60px;
  object-fit: cover;
  display: block;
  background: var(--bg);
  border: 2px solid var(--shadow);
}
.bgm-cover-empty { display: inline-block; }
.bgm-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bgm-name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
          line-clamp: 2;
}
.bgm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bgm-tag {
  padding: 1px 6px;
  background: var(--bg);
  border: 2px solid var(--shadow);
  color: var(--fg);
}
.bgm-tag-in-progress { background: var(--c3); color: var(--fg); }
.bgm-tag-completed   { background: var(--c2); color: var(--fg); }
.bgm-tag-planned     { background: var(--card); color: var(--fg); }
.bgm-tag-on-hold     { background: var(--c4); color: #fff; }
.bgm-tag-dropped     { background: var(--c1); color: #fff; }
.bgm-date {
  margin-left: auto;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* ── FR24 (Flight log) ─────────────────────────────────────────────── */
.fr24 { margin-top: 36px; }
.fr24-banners {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.fr24-card { margin: 0; }
.fr24-caption {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  display: inline-block;
  padding: 2px 8px;
  background: var(--fg);
  color: var(--bg);
}
.fr24-card a {
  display: inline-block;
  line-height: 0;
  border: 3px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
  background: var(--card);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.fr24-card a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow);
}
.fr24-card a:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow);
}
.fr24-card img {
  display: block;
  width: 320px;
  height: 70px;
  max-width: 100%;
}

@media (min-width: 740px) {
  .fr24-banners {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-left: -90px;
    margin-right: -90px;
  }
}

/* ── Interests chips (profile) ─────────────────────────────────────── */
.interests {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.interest-tag {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--card);
  border: 2px solid var(--shadow);
  letter-spacing: 0.02em;
}
.interest-tag:nth-child(5n+1) { background: var(--c1); color: var(--fg); }
.interest-tag:nth-child(5n+2) { background: var(--c2); color: var(--fg); }
.interest-tag:nth-child(5n+3) { background: var(--c3); color: var(--fg); }
.interest-tag:nth-child(5n+4) { background: var(--c4); color: #fff; }
.interest-tag:nth-child(5n+5) { background: var(--c5); color: #fff; }

/* ── Memories (collapsible photo collection) ───────────────────────── */
.memories { margin-top: 36px; }
.memories-box {
  background: var(--card);
  border: 3px solid var(--shadow);
  box-shadow: 4px 4px 0 var(--shadow);
}
.memories-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  user-select: none;
  background: var(--c3);
  color: var(--fg);
  border-bottom: 3px solid var(--shadow);
}
.memories-summary::-webkit-details-marker { display: none; }
.memories-summary::marker { content: ""; }
.memories-title { flex: 1 1 auto; min-width: 0; }
.memories-count {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  background: var(--fg);
  color: var(--bg);
  border: 2px solid var(--fg);
}
.memories-chev {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid var(--fg);
  transition: transform 0.15s ease;
}
.memories-box[open] .memories-chev { transform: rotate(180deg); }
.memories-box:not([open]) .memories-summary { border-bottom: none; }

.memories-list {
  list-style: none;
  margin: 0;
  padding: 12px;
  column-count: 2;
  column-gap: 10px;
}
@media (max-width: 380px) {
  .memories-list { column-count: 1; }
}
.memories-card {
  margin: 0 0 10px;
  padding: 8px;
  background: var(--bg);
  border: 3px solid var(--shadow);
  box-shadow: 3px 3px 0 var(--shadow);
  break-inside: avoid;
  /* `display: inline-block` is the classic CSS-columns hack: without it,
     some browsers (older Firefox) split flex containers across columns
     even with break-inside: avoid. */
  display: inline-block;
  width: 100%;
}
.memories-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.memories-cap-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.memories-cap-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}
.memories-cap-date { white-space: nowrap; }
.memories-cap-sep { opacity: 0.6; }
.memories-cap-event {
  font-weight: 800;
  letter-spacing: 0.04em;
}
.memories-cap-loc {
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.memories-cap-text {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

.memories-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.memories-shot { margin: 0; }
.memories-shot-link {
  display: block;
  line-height: 0;
  border: 2px solid var(--shadow);
  background: var(--card);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.memories-shot-link:hover,
.memories-shot-link:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--shadow);
  outline: none;
}
.memories-photo {
  display: block;
  width: 100%;
  height: auto;
  background: var(--card);
}

/* ── Steam-specific extra meta (genres + description + year) ───────── */
.bgm-desc {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
          line-clamp: 2;
  overflow: hidden;
}

