:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(14, 25, 42, 0.88);
  --panel-strong: #111f34;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f8fc;
  --muted: #9dafc5;
  --accent: #42d8ff;
  --accent-2: #8b7cff;
  --header-h: 68px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -10%, rgba(66, 216, 255, 0.16), transparent 34rem),
    radial-gradient(circle at 100% 10%, rgba(139, 124, 255, 0.14), transparent 28rem),
    var(--bg);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: #111;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 31, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
  text-decoration: none;
  font-weight: 720;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(66, 216, 255, 0.2), rgba(139, 124, 255, 0.22));
  color: #fff;
  font-size: 12px;
  font-weight: 820;
}

.brand-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.site-nav a,
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.button:hover,
.button:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  outline: none;
}

.site-nav .primary,
.button.primary {
  border-color: rgba(66, 216, 255, 0.36);
  background: linear-gradient(135deg, rgba(66, 216, 255, 0.18), rgba(139, 124, 255, 0.18));
  color: #fff;
}

.site-nav .primary:hover,
.button.primary:hover {
  transform: translateY(-1px);
}

.document-main {
  padding: 18px clamp(12px, 2vw, 26px) 26px;
}

.reader {
  width: min(1720px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.reader-bar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
}

.reader-title {
  min-width: 0;
}

.reader-title h1 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.reader-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.pdf-frame {
  width: 100%;
  height: calc(100dvh - var(--header-h) - 116px);
  min-height: 560px;
  display: block;
  border: 0;
  background: #202631;
}

.pdf-fallback {
  min-height: 560px;
  display: grid;
  place-items: center;
  padding: 34px 18px;
  text-align: center;
}

.fallback-card {
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.fallback-card img {
  width: 100%;
  height: auto;
  max-height: 310px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.28);
}

.resume-fallback {
  width: min(430px, 100%);
}

.resume-fallback img {
  max-height: 480px;
}

.fallback-card h2 {
  margin: 20px 0 8px;
  font-size: 22px;
}

.fallback-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.fallback-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.standalone .site-nav .project-link {
  display: none;
}

body.rules-theme {
  --bg: #0f0c09;
  --panel: rgba(27, 20, 13, 0.92);
  --panel-strong: #21180f;
  --line: rgba(228, 181, 100, 0.18);
  --muted: #c3ad8e;
  --accent: #e9aa49;
  --accent-2: #865123;
  background:
    radial-gradient(circle at 14% -10%, rgba(233, 170, 73, 0.14), transparent 34rem),
    radial-gradient(circle at 100% 14%, rgba(134, 81, 35, 0.16), transparent 30rem),
    var(--bg);
}

.rules-theme .site-header {
  background: rgba(15, 12, 9, 0.88);
}

.rules-theme .brand-mark {
  border-color: rgba(228, 181, 100, 0.28);
  background: linear-gradient(145deg, rgba(233, 170, 73, 0.18), rgba(134, 81, 35, 0.28));
}

.rules-theme .site-nav .primary,
.rules-theme .button.primary {
  border-color: rgba(233, 170, 73, 0.34);
  background: linear-gradient(135deg, rgba(233, 170, 73, 0.18), rgba(134, 81, 35, 0.2));
}

.error-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.error-card {
  width: min(620px, 100%);
  padding: clamp(28px, 6vw, 56px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  text-align: center;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.error-code {
  margin: 0;
  color: var(--accent);
  font-size: clamp(64px, 15vw, 112px);
  font-weight: 840;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.error-card h1 {
  margin: 22px 0 10px;
  font-size: clamp(24px, 5vw, 34px);
}

.error-card p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 820px) {
  :root {
    --header-h: auto;
  }

  .site-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .site-nav a {
    flex: 0 0 auto;
  }

  .document-main {
    padding-top: 12px;
  }

  .reader {
    border-radius: 16px;
  }

  .reader-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .reader-title h1 {
    white-space: normal;
  }

  .reader-actions {
    width: 100%;
  }

  .reader-actions .button {
    flex: 1 1 0;
  }

  .pdf-frame {
    height: 72dvh;
    min-height: 520px;
  }
}

@media (max-width: 520px) {
  .brand-copy small {
    display: none;
  }

  .site-nav a {
    min-height: 38px;
    padding-inline: 11px;
    font-size: 12px;
  }

  .pdf-frame {
    min-height: 480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.home-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(58px, 9vw, 112px) 0 72px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(36px, 8vw, 108px);
  align-items: end;
  padding-bottom: clamp(48px, 8vw, 84px);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.home-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 7.5vw, 92px);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero-summary {
  padding-left: 24px;
  border-left: 2px solid rgba(66, 216, 255, 0.55);
}

.hero-summary > p {
  margin: 0;
  color: #dce6f3;
  font-size: 18px;
  line-height: 1.75;
}

.hero-summary ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.hero-summary li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  --card-accent: var(--accent);
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(170px, 0.82fr) minmax(0, 1.18fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(21, 36, 59, 0.96), rgba(11, 22, 38, 0.96));
  text-decoration: none;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: color-mix(in srgb, var(--card-accent) 55%, transparent);
  outline: none;
  transform: translateY(-4px);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.32);
}

.project-card figure {
  min-height: 300px;
  margin: 0;
  overflow: hidden;
  background: #111a27;
}

.project-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
  transition: transform 240ms ease;
}

.project-card:hover img {
  transform: scale(1.025);
}

.project-card-copy {
  display: flex;
  flex-direction: column;
  padding: 30px 28px 26px;
}

.project-index {
  margin: 0;
  color: var(--card-accent);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.project-card h2 {
  margin: 24px 0 12px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.025em;
}

.english-title {
  margin: -4px 0 10px !important;
  color: var(--card-accent) !important;
  font-size: 13px !important;
  font-weight: 720;
  letter-spacing: 0.06em;
}

.project-card-copy > p:not(.project-index) {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.project-card-copy > span {
  margin-top: auto;
  padding-top: 28px;
  color: #f6f9fd;
  font-size: 14px;
  font-weight: 720;
}

.project-card-copy b {
  margin-left: 4px;
  color: var(--card-accent);
}

.card-playable { --card-accent: #31d99a; }
.card-rules { --card-accent: #f0ad42; }
.card-resume { --card-accent: #9a8cff; }

.site-footer {
  width: min(1180px, calc(100% - 40px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 24px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.footer-identity,
.filing-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.footer-identity {
  min-width: min(100%, 310px);
}

.filing-links {
  justify-content: flex-end;
}

.site-footer a {
  color: #d9e8f8;
  text-decoration: none;
}

.filing-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted) !important;
  line-height: 1.45;
  transition: color 160ms ease;
}

.filing-link:hover,
.filing-link:focus-visible {
  color: #fff !important;
  outline: none;
}

.filing-police img {
  width: 18px;
  height: 19px;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .hero-summary {
    max-width: 660px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .home-main,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .home-main {
    padding-top: 44px;
  }

  .home-hero h1 {
    font-size: clamp(42px, 14vw, 64px);
  }

  .hero-summary {
    padding-left: 18px;
  }

  .project-card {
    grid-template-columns: 38% 62%;
    min-height: 264px;
  }

  .project-card figure {
    min-height: 264px;
  }

  .project-card-copy {
    padding: 24px 20px 22px;
  }

  .project-card h2 {
    margin-top: 18px;
    font-size: 23px;
  }

  .project-card-copy > p:not(.project-index) {
    font-size: 15px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .filing-links {
    justify-content: flex-start;
  }
}

@media (max-width: 440px) {
  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card figure {
    min-height: 210px;
    max-height: 250px;
  }
}
